mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-14 22:38:46 +00:00
81 lines
3.2 KiB
Plaintext
81 lines
3.2 KiB
Plaintext
struct Big : { struct Sub, struct Sub, struct Sub }
|
|
struct Sub : { i64, i64, i64, i64 }
|
|
|
|
fun struct Big @foo ( struct Big) {
|
|
init:
|
|
bid: b0
|
|
allocations:
|
|
%l0: struct Big:p1
|
|
%l1: struct Big:r
|
|
|
|
block b0:
|
|
%b0:i0:unit = store %b0:p0: struct Big %l0:* struct Big
|
|
%b0:i1: struct Big = load %l0:* struct Big
|
|
%b0:i2:unit = store %b0:i1: struct Big %l1:* struct Big
|
|
%b0:i3:* struct Sub = getelementptr %l1:* struct Big offset 0:i64
|
|
%b0:i4:*i64 = getelementptr %b0:i3:* struct Sub offset 0:i64
|
|
%b0:i5:i64 = typecast 10:i32 to i64
|
|
%b0:i6:unit = store %b0:i5:i64 %b0:i4:*i64
|
|
%b0:i7: struct Big = load %l1:* struct Big
|
|
ret %b0:i7: struct Big
|
|
}
|
|
|
|
fun i32 @main () {
|
|
init:
|
|
bid: b0
|
|
allocations:
|
|
%l0: struct Big:a
|
|
%l1: struct Big:r
|
|
|
|
block b0:
|
|
%b0:i0:* struct Sub = getelementptr %l0:* struct Big offset 0:i64
|
|
%b0:i1:*i64 = getelementptr %b0:i0:* struct Sub offset 0:i64
|
|
%b0:i2:i64 = typecast 1:i32 to i64
|
|
%b0:i3:unit = store %b0:i2:i64 %b0:i1:*i64
|
|
%b0:i4:*i64 = getelementptr %b0:i0:* struct Sub offset 8:i64
|
|
%b0:i5:i64 = typecast 2:i32 to i64
|
|
%b0:i6:unit = store %b0:i5:i64 %b0:i4:*i64
|
|
%b0:i7:*i64 = getelementptr %b0:i0:* struct Sub offset 16:i64
|
|
%b0:i8:i64 = typecast 3:i32 to i64
|
|
%b0:i9:unit = store %b0:i8:i64 %b0:i7:*i64
|
|
%b0:i10:*i64 = getelementptr %b0:i0:* struct Sub offset 24:i64
|
|
%b0:i11:i64 = typecast 4:i32 to i64
|
|
%b0:i12:unit = store %b0:i11:i64 %b0:i10:*i64
|
|
%b0:i13:* struct Sub = getelementptr %l0:* struct Big offset 32:i64
|
|
%b0:i14:*i64 = getelementptr %b0:i13:* struct Sub offset 0:i64
|
|
%b0:i15:i64 = typecast 2:i32 to i64
|
|
%b0:i16:unit = store %b0:i15:i64 %b0:i14:*i64
|
|
%b0:i17:*i64 = getelementptr %b0:i13:* struct Sub offset 8:i64
|
|
%b0:i18:i64 = typecast 3:i32 to i64
|
|
%b0:i19:unit = store %b0:i18:i64 %b0:i17:*i64
|
|
%b0:i20:*i64 = getelementptr %b0:i13:* struct Sub offset 16:i64
|
|
%b0:i21:i64 = typecast 4:i32 to i64
|
|
%b0:i22:unit = store %b0:i21:i64 %b0:i20:*i64
|
|
%b0:i23:*i64 = getelementptr %b0:i13:* struct Sub offset 24:i64
|
|
%b0:i24:i64 = typecast 5:i32 to i64
|
|
%b0:i25:unit = store %b0:i24:i64 %b0:i23:*i64
|
|
%b0:i26:* struct Sub = getelementptr %l0:* struct Big offset 64:i64
|
|
%b0:i27:*i64 = getelementptr %b0:i26:* struct Sub offset 0:i64
|
|
%b0:i28:i64 = typecast 3:i32 to i64
|
|
%b0:i29:unit = store %b0:i28:i64 %b0:i27:*i64
|
|
%b0:i30:*i64 = getelementptr %b0:i26:* struct Sub offset 8:i64
|
|
%b0:i31:i64 = typecast 4:i32 to i64
|
|
%b0:i32:unit = store %b0:i31:i64 %b0:i30:*i64
|
|
%b0:i33:*i64 = getelementptr %b0:i26:* struct Sub offset 16:i64
|
|
%b0:i34:i64 = typecast 5:i32 to i64
|
|
%b0:i35:unit = store %b0:i34:i64 %b0:i33:*i64
|
|
%b0:i36:*i64 = getelementptr %b0:i26:* struct Sub offset 24:i64
|
|
%b0:i37:i64 = typecast 6:i32 to i64
|
|
%b0:i38:unit = store %b0:i37:i64 %b0:i36:*i64
|
|
%b0:i39: struct Big = load %l0:* struct Big
|
|
%b0:i40: struct Big = call @foo:*[ret: struct Big params:( struct Big)](%b0:i39: struct Big)
|
|
%b0:i41:unit = store %b0:i40: struct Big %l1:* struct Big
|
|
%b0:i42:* struct Sub = getelementptr %l1:* struct Big offset 0:i64
|
|
%b0:i43:*i64 = getelementptr %b0:i42:* struct Sub offset 0:i64
|
|
%b0:i44:i64 = load %b0:i43:*i64
|
|
%b0:i45:i64 = typecast 10:i32 to i64
|
|
%b0:i46:u1 = cmp eq %b0:i44:i64 %b0:i45:i64
|
|
%b0:i47:i32 = typecast %b0:i46:u1 to i32
|
|
ret %b0:i47:i32
|
|
}
|