mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-15 06:58:50 +00:00
60 lines
2.2 KiB
Plaintext
60 lines
2.2 KiB
Plaintext
struct %t0 : { [4 x i32] }
|
|
struct %t1 : { i8, struct %t0, i64 }
|
|
|
|
fun i32 @main () {
|
|
init:
|
|
bid: b0
|
|
allocations:
|
|
%l0:const struct %t1:temp
|
|
%l1: struct %t1:temp2
|
|
%l2:i32:sum
|
|
|
|
block b0:
|
|
%b0:i0:*i8 = getelementptr %l0:*const struct %t1 offset 0:i64
|
|
%b0:i1:i8 = typecast 1:i32 to i8
|
|
%b0:i2:unit = store %b0:i1:i8 %b0:i0:*i8
|
|
%b0:i3:* struct %t0 = getelementptr %l0:*const struct %t1 offset 4:i64
|
|
%b0:i4:*[4 x i32] = getelementptr %b0:i3:* struct %t0 offset 0:i64
|
|
%b0:i5:*i32 = getelementptr %b0:i4:*[4 x i32] offset 0:i32
|
|
%b0:i6:i64 = mul 0:i64 4:i64
|
|
%b0:i7:*i32 = getelementptr %b0:i5:*i32 offset %b0:i6:i64
|
|
%b0:i8:unit = store 2:i32 %b0:i7:*i32
|
|
%b0:i9:i64 = mul 1:i64 4:i64
|
|
%b0:i10:*i32 = getelementptr %b0:i5:*i32 offset %b0:i9:i64
|
|
%b0:i11:unit = store 3:i32 %b0:i10:*i32
|
|
%b0:i12:i64 = mul 2:i64 4:i64
|
|
%b0:i13:*i32 = getelementptr %b0:i5:*i32 offset %b0:i12:i64
|
|
%b0:i14:unit = store 4:i32 %b0:i13:*i32
|
|
%b0:i15:i64 = mul 3:i64 4:i64
|
|
%b0:i16:*i32 = getelementptr %b0:i5:*i32 offset %b0:i15:i64
|
|
%b0:i17:unit = store 5:i32 %b0:i16:*i32
|
|
%b0:i18:*i64 = getelementptr %l0:*const struct %t1 offset 24:i64
|
|
%b0:i19:i64 = typecast 6:i32 to i64
|
|
%b0:i20:unit = store %b0:i19:i64 %b0:i18:*i64
|
|
%b0:i21: struct %t1 = load %l0:*const struct %t1
|
|
%b0:i22:unit = store %b0:i21: struct %t1 %l1:* struct %t1
|
|
%b0:i23:*i8 = getelementptr %l1:* struct %t1 offset 0:i64
|
|
%b0:i24:i8 = load %b0:i23:*i8
|
|
%b0:i25:*[4 x i32] = getelementptr %l1:* struct %t1 offset 4:i64
|
|
%b0:i26:*i32 = getelementptr %b0:i25:*[4 x i32] offset 0:i32
|
|
%b0:i27:i64 = typecast 2:i32 to i64
|
|
%b0:i28:i64 = mul %b0:i27:i64 4:i64
|
|
%b0:i29:*i32 = getelementptr %b0:i26:*i32 offset %b0:i28:i64
|
|
%b0:i30:i32 = load %b0:i29:*i32
|
|
%b0:i31:i32 = typecast %b0:i24:i8 to i32
|
|
%b0:i32:i32 = add %b0:i31:i32 %b0:i30:i32
|
|
%b0:i33:*i64 = getelementptr %l1:* struct %t1 offset 24:i64
|
|
%b0:i34:i64 = load %b0:i33:*i64
|
|
%b0:i35:i64 = typecast %b0:i32:i32 to i64
|
|
%b0:i36:i64 = add %b0:i35:i64 %b0:i34:i64
|
|
%b0:i37:i32 = typecast %b0:i36:i64 to i32
|
|
%b0:i38:unit = store %b0:i37:i32 %l2:*i32
|
|
%b0:i39:i32 = load %l2:*i32
|
|
%b0:i40:u1 = cmp eq %b0:i39:i32 11:i32
|
|
%b0:i41:i32 = typecast %b0:i40:u1 to i32
|
|
ret %b0:i41:i32
|
|
|
|
block b1:
|
|
ret 0:i32
|
|
}
|