Skip to content

Instantly share code, notes, and snippets.

@chandlerc
Created October 16, 2022 22:58
Show Gist options
  • Save chandlerc/48a4b7c99797a1f55653f63fece3f30e to your computer and use it in GitHub Desktop.
Save chandlerc/48a4b7c99797a1f55653f63fece3f30e to your computer and use it in GitHub Desktop.
; ModuleID = 'reduced.test.ll'
source_filename = "reduced.test.ll"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-macosx12.0.0"
@global = global { [2 x [1024 x [1024 x i8]]], [7 x [32 x i8]] } zeroinitializer
@global.1 = dso_local global { ptr, [24 x i8] } zeroinitializer
@global.2 = global { [2 x [1024 x [1024 x i8]]], [13 x [32 x i8]] } zeroinitializer
define ptr @wobble(ptr %arg) {
bb:
ret ptr %arg
}
define void @main() {
bb:
call void @foo(ptr @global, ptr @global.1, i1 true, i64 1, i8 2, i8 3, i64 4, i1 true, i1 false, i1 true, i64 5, ptr @global.2, ptr null, ptr null, i1 false, i1 false)
ret void
}
define void @foo(ptr %arg, ptr %arg1, i1 %arg2, i64 %arg3, i8 %arg4, i8 %arg5, i64 %arg6, i1 %arg7, i1 %arg8, i1 %arg9, i64 %arg10, ptr %arg11, ptr %arg12, ptr %arg13, i1 %arg14, i1 %arg15) personality ptr null {
bb:
%tmp = load i64, ptr null, align 8
br label %bb16
bb16: ; preds = %bb
br i1 %arg2, label %bb17, label %bb19
bb17: ; preds = %bb16
%tmp18 = alloca i8, i64 0, align 32
br label %bb19
bb19: ; preds = %bb17, %bb16
%tmp20 = phi i64 [ 0, %bb16 ], [ 1, %bb17 ]
%tmp21 = add i64 0, 4304
%tmp22 = inttoptr i64 %arg3 to ptr
%tmp23 = inttoptr i64 %arg10 to ptr
%tmp24 = add i64 %arg3, 5552
%tmp25 = inttoptr i64 %tmp24 to ptr
%tmp26 = add i64 %arg6, 1
%tmp27 = inttoptr i64 %tmp26 to ptr
%tmp28 = add i64 %arg3, 5616
%tmp29 = inttoptr i64 %tmp28 to ptr
%tmp30 = add i64 %arg3, 5632
%tmp31 = inttoptr i64 %tmp30 to ptr
%tmp32 = add i64 1, 1
%tmp33 = add i64 %arg3, 6016
%tmp34 = inttoptr i64 %tmp33 to ptr
%tmp35 = inttoptr i64 6048 to ptr
%tmp36 = add i64 %arg3, 6224
%tmp37 = inttoptr i64 %tmp36 to ptr
%tmp38 = add i64 %tmp20, 6256
%tmp39 = inttoptr i64 %tmp38 to ptr
%tmp40 = add i64 1, 0
br label %bb41
bb41: ; preds = %bb19
store i32 -117901064, ptr %arg1, align 1
%tmp42 = inttoptr i64 0 to ptr
store i8 0, ptr %tmp42, align 1
%tmp43 = call ptr @widget(ptr null)
br label %bb44
bb44: ; preds = %bb41
invoke void @wibble(ptr %arg1, i64 0)
to label %bb45 unwind label %bb48
bb45: ; preds = %bb44
invoke void @bar.5(ptr null, ptr null, ptr null, i64 0)
to label %bb46 unwind label %bb48
bb46: ; preds = %bb45
br label %bb47
bb47: ; preds = %bb46
br label %bb51
bb48: ; preds = %bb45, %bb44
%tmp49 = landingpad { ptr, i32 }
cleanup
br label %bb50
bb50: ; preds = %bb48
br label %bb254
bb51: ; preds = %bb47
br label %bb52
bb52: ; preds = %bb51
%tmp53 = icmp eq ptr %arg1, null
br i1 %tmp53, label %bb54, label %bb60
bb54: ; preds = %bb52
%tmp55 = invoke ptr @bar(i64 0)
to label %bb56 unwind label %bb58
bb56: ; preds = %bb54
br label %bb57
bb57: ; preds = %bb56
store ptr %arg, ptr @global.1, align 8
br label %bb62
bb58: ; preds = %bb54
%tmp59 = landingpad { ptr, i32 }
cleanup
br label %bb248
bb60: ; preds = %bb52
%tmp61 = ptrtoint ptr null to i64
br label %bb62
bb62: ; preds = %bb60, %bb57
%tmp63 = ptrtoint ptr null to i64
%tmp64 = getelementptr inbounds [2 x i64], ptr %tmp35, i64 0, i64 1
%tmp65 = getelementptr inbounds [2 x i64], ptr %arg11, i64 0, i64 1
%tmp66 = getelementptr inbounds [2 x i64], ptr null, i64 0, i64 1
%tmp67 = getelementptr inbounds i8, ptr null, i64 8
%tmp68 = getelementptr inbounds [2 x i64], ptr null, i64 0, i64 1
%tmp69 = getelementptr inbounds i8, ptr null, i64 8
%tmp70 = getelementptr inbounds [2 x i64], ptr null, i64 0, i64 1
%tmp71 = getelementptr inbounds [2 x i64], ptr null, i64 0, i64 1
%tmp72 = getelementptr inbounds i8, ptr null, i64 8
%tmp73 = getelementptr inbounds [2 x i64], ptr %arg12, i64 0, i64 1
%tmp74 = getelementptr inbounds [2 x i64], ptr null, i64 0, i64 1
%tmp75 = getelementptr inbounds [2 x i64], ptr null, i64 0, i64 1
%tmp76 = getelementptr inbounds i8, ptr null, i64 8
%tmp77 = getelementptr inbounds [2 x i64], ptr null, i64 0, i64 1
%tmp78 = getelementptr inbounds [2 x i64], ptr null, i64 0, i64 1
%tmp79 = getelementptr inbounds [2 x i64], ptr %tmp37, i64 0, i64 1
br label %bb80
bb80: ; preds = %bb230, %bb62
%tmp81 = phi i1 [ true, %bb62 ], [ %tmp231, %bb230 ]
br label %bb82
bb82: ; preds = %bb80
%tmp83 = load ptr, ptr %tmp22, align 8
br label %bb84
bb84: ; preds = %bb82
%tmp85 = icmp eq ptr %tmp83, %tmp22
br i1 %tmp85, label %bb233, label %bb86
bb86: ; preds = %bb84
%tmp87 = lshr i64 %tmp21, 1
%tmp88 = add i64 %tmp87, %tmp
%tmp89 = inttoptr i64 %tmp88 to ptr
%tmp90 = load i8, ptr %tmp89, align 1
%tmp91 = icmp ne i8 %tmp90, 0
br i1 %tmp91, label %bb92, label %bb93
bb92: ; preds = %bb86
call void @baz.7(i64 %tmp20)
unreachable
bb93: ; preds = %bb86
br label %bb94
bb94: ; preds = %bb93
%tmp95 = zext i1 %tmp81 to i8
br label %bb96
bb96: ; preds = %bb94
%tmp97 = load ptr, ptr %tmp22, align 8
br label %bb98
bb98: ; preds = %bb96
br label %bb101
bb99: ; preds = %bb246
%tmp100 = landingpad { ptr, i32 }
cleanup
br label %bb248
bb101: ; preds = %bb98
br label %bb102
bb102: ; preds = %bb101
%tmp103 = getelementptr inbounds i8, ptr null, i64 1
%tmp104 = add i64 0, 0
br label %bb105
bb105: ; preds = %bb102
br i1 %arg7, label %bb106, label %bb108
bb106: ; preds = %bb105
%tmp107 = ptrtoint ptr null to i64
br label %bb108
bb108: ; preds = %bb106, %bb105
%tmp109 = call ptr @widget(ptr %tmp27)
br label %bb110
bb110: ; preds = %bb108
store i8 0, ptr %tmp29, align 1
%tmp111 = ptrtoint ptr %tmp103 to i64
%tmp112 = insertvalue [2 x i64] zeroinitializer, i64 %tmp111, 0
%tmp113 = insertvalue [2 x i64] %tmp112, i64 %tmp104, 1
invoke fastcc void @wombat(ptr %tmp31, [2 x i64] %tmp113)
to label %bb114 unwind label %bb117
bb114: ; preds = %bb110
%tmp115 = call ptr @baz(ptr %tmp25, ptr %tmp29)
call void @quux(ptr %tmp31)
br label %bb116
bb116: ; preds = %bb114
br label %bb119
bb117: ; preds = %bb110
%tmp118 = landingpad { ptr, i32 }
cleanup
br label %bb119
bb119: ; preds = %bb117, %bb116
%tmp120 = icmp ne i8 1, 0
br i1 %tmp120, label %bb121, label %bb122
bb121: ; preds = %bb119
call void @baz.7(i64 0)
unreachable
bb122: ; preds = %bb119
br label %bb123
bb123: ; preds = %bb122
%tmp124 = insertvalue [2 x i64] zeroinitializer, i64 %tmp24, 0
%tmp125 = invoke fastcc [2 x i64] @bar.3([2 x i64] %tmp124)
to label %bb126 unwind label %bb144
bb126: ; preds = %bb123
%tmp127 = add i64 %tmp33, %tmp
%tmp128 = inttoptr i64 %tmp127 to ptr
%tmp129 = load i8, ptr %tmp128, align 1
%tmp130 = icmp ne i8 %tmp129, 0
br i1 %tmp130, label %bb131, label %bb132
bb131: ; preds = %bb126
call void @baz.7(i64 %tmp33)
unreachable
bb132: ; preds = %bb126
store i64 0, ptr %tmp34, align 8
br label %bb133
bb133: ; preds = %bb132
store i64 %tmp32, ptr %arg11, align 8
%tmp134 = ptrtoint ptr %tmp64 to i64
%tmp135 = add i64 %tmp134, %tmp
%tmp136 = inttoptr i64 %tmp135 to ptr
%tmp137 = load i8, ptr %tmp136, align 1
%tmp138 = icmp ne i8 %tmp137, 0
br i1 %tmp138, label %bb139, label %bb140
bb139: ; preds = %bb133
call void @baz.7(i64 %tmp134)
unreachable
bb140: ; preds = %bb133
store i64 %tmp63, ptr %tmp64, align 8
br label %bb141
bb141: ; preds = %bb140
br i1 %arg8, label %bb142, label %bb146
bb142: ; preds = %bb141
br label %bb143
bb143: ; preds = %bb142
br label %bb229
bb144: ; preds = %bb123
%tmp145 = landingpad { ptr, i32 }
cleanup
br label %bb146
bb146: ; preds = %bb144, %bb141
br label %bb147
bb147: ; preds = %bb146
%tmp148 = ptrtoint ptr %tmp65 to i64
br i1 %arg8, label %bb149, label %bb150
bb149: ; preds = %bb147
call void @baz.7(i64 %tmp148)
unreachable
bb150: ; preds = %bb147
br label %bb151
bb151: ; preds = %bb150
%tmp152 = icmp eq ptr null, %arg
br i1 %arg15, label %bb153, label %bb189
bb153: ; preds = %bb151
br label %bb154
bb154: ; preds = %bb153
%tmp155 = ptrtoint ptr %tmp75 to i64
br i1 %arg9, label %bb156, label %bb157
bb156: ; preds = %bb154
call void @baz.7(i64 %tmp155)
unreachable
bb157: ; preds = %bb154
br label %bb158
bb158: ; preds = %bb157
%tmp159 = ptrtoint ptr %tmp76 to i64
br i1 %arg14, label %bb160, label %bb161
bb160: ; preds = %bb158
call void @baz.7(i64 %tmp159)
unreachable
bb161: ; preds = %bb158
br label %bb162
bb162: ; preds = %bb161
%tmp163 = ptrtoint ptr %tmp77 to i64
br i1 %arg8, label %bb164, label %bb165
bb164: ; preds = %bb162
call void @baz.7(i64 %tmp163)
unreachable
bb165: ; preds = %bb162
br label %bb166
bb166: ; preds = %bb165
%tmp167 = ptrtoint ptr %tmp78 to i64
br i1 %arg9, label %bb168, label %bb169
bb168: ; preds = %bb166
call void @baz.7(i64 %tmp167)
unreachable
bb169: ; preds = %bb166
br label %bb170
bb170: ; preds = %bb169
%tmp171 = ptrtoint ptr %tmp71 to i64
%tmp172 = icmp ne i8 %arg4, 0
br i1 %tmp172, label %bb173, label %bb174
bb173: ; preds = %bb170
call void @baz.7(i64 %tmp171)
unreachable
bb174: ; preds = %bb170
br label %bb175
bb175: ; preds = %bb174
%tmp176 = ptrtoint ptr %tmp72 to i64
br i1 %arg8, label %bb177, label %bb178
bb177: ; preds = %bb175
call void @baz.7(i64 %tmp176)
unreachable
bb178: ; preds = %bb175
br label %bb179
bb179: ; preds = %bb178
store i64 1, ptr %arg12, align 8
%tmp180 = ptrtoint ptr %tmp73 to i64
%tmp181 = icmp ne i8 %arg5, 0
br i1 %tmp181, label %bb182, label %bb183
bb182: ; preds = %bb179
call void @baz.7(i64 %tmp180)
unreachable
bb183: ; preds = %bb179
br label %bb184
bb184: ; preds = %bb183
store i64 0, ptr %arg1, align 8
%tmp185 = ptrtoint ptr %tmp74 to i64
br i1 %arg8, label %bb186, label %bb187
bb186: ; preds = %bb184
call void @baz.7(i64 %tmp185)
unreachable
bb187: ; preds = %bb184
br label %bb188
bb188: ; preds = %bb187
br label %bb209
bb189: ; preds = %bb151
br label %bb190
bb190: ; preds = %bb189
%tmp191 = ptrtoint ptr %tmp66 to i64
br i1 %arg2, label %bb192, label %bb193
bb192: ; preds = %bb190
call void @baz.7(i64 %tmp191)
unreachable
bb193: ; preds = %bb190
br label %bb194
bb194: ; preds = %bb193
%tmp195 = ptrtoint ptr %tmp67 to i64
br i1 %arg7, label %bb196, label %bb197
bb196: ; preds = %bb194
call void @baz.7(i64 %tmp195)
unreachable
bb197: ; preds = %bb194
br label %bb198
bb198: ; preds = %bb197
%tmp199 = ptrtoint ptr %tmp68 to i64
br i1 %arg8, label %bb200, label %bb201
bb200: ; preds = %bb198
call void @baz.7(i64 %tmp199)
unreachable
bb201: ; preds = %bb198
br label %bb202
bb202: ; preds = %bb201
%tmp203 = ptrtoint ptr %tmp69 to i64
br i1 %arg2, label %bb204, label %bb205
bb204: ; preds = %bb202
call void @baz.7(i64 %tmp203)
unreachable
bb205: ; preds = %bb202
br label %bb206
bb206: ; preds = %bb205
%tmp207 = ptrtoint ptr %tmp70 to i64
br label %bb208
bb208: ; preds = %bb206
call void @baz.7(i64 %tmp207)
unreachable
bb209: ; preds = %bb188
br label %bb210
bb210: ; preds = %bb209
store i64 0, ptr %tmp37, align 8
%tmp211 = ptrtoint ptr %tmp79 to i64
br i1 %arg7, label %bb212, label %bb213
bb212: ; preds = %bb210
call void @baz.7(i64 %tmp211)
unreachable
bb213: ; preds = %bb210
br label %bb214
bb214: ; preds = %bb213
%tmp215 = load i64, ptr %tmp97, align 8
%tmp216 = icmp eq i64 0, %tmp215
br i1 %tmp216, label %bb219, label %bb217
bb217: ; preds = %bb214
%tmp218 = getelementptr inbounds ptr, ptr %arg1, i64 %arg6
br label %bb219
bb219: ; preds = %bb217, %bb214
br label %bb220
bb220: ; preds = %bb219
%tmp221 = invoke i1 @foo.4(ptr null, [2 x i64] zeroinitializer, i32 0, i32 0, ptr %tmp39)
to label %bb222 unwind label %bb223
bb222: ; preds = %bb220
br label %bb226
bb223: ; preds = %bb227, %bb220
%tmp224 = landingpad { ptr, i32 }
cleanup
%tmp225 = call ptr null(ptr null)
br label %bb226
bb226: ; preds = %bb223, %bb222
br label %bb227
bb227: ; preds = %bb226
invoke void @eggs(ptr @global.1, ptr null)
to label %bb228 unwind label %bb223
bb228: ; preds = %bb227
br label %bb229
bb229: ; preds = %bb228, %bb143
br label %bb230
bb230: ; preds = %bb229
%tmp231 = icmp ne i8 %tmp95, 0
%tmp232 = icmp eq i32 0, 1
br i1 %tmp232, label %bb233, label %bb80
bb233: ; preds = %bb230, %bb84
%tmp234 = phi i1 [ %tmp81, %bb230 ], [ false, %bb84 ]
br label %bb235
bb235: ; preds = %bb233
%tmp236 = icmp eq ptr %tmp23, null
br i1 %tmp236, label %bb238, label %bb237
bb237: ; preds = %bb235
br label %bb239
bb238: ; preds = %bb242, %bb235
br label %bb243
bb239: ; preds = %bb242, %bb237
br label %bb240
bb240: ; preds = %bb239
%tmp241 = inttoptr i64 %tmp40 to ptr
store i32 -117901064, ptr %tmp241, align 1
br label %bb242
bb242: ; preds = %bb240
br i1 false, label %bb238, label %bb239
bb243: ; preds = %bb238
br label %bb244
bb244: ; preds = %bb243
%tmp245 = load ptr, ptr @global.1, align 8
br label %bb246
bb246: ; preds = %bb244
invoke fastcc void @pluto(ptr %tmp245, ptr null, ptr null, i64 0)
to label %bb247 unwind label %bb99
bb247: ; preds = %bb246
ret void
bb248: ; preds = %bb99, %bb58
%tmp249 = call ptr @wobble(ptr %arg1)
br label %bb250
bb250: ; preds = %bb248
%tmp251 = call ptr @barney(ptr %tmp23)
br label %bb252
bb252: ; preds = %bb250
%tmp253 = call ptr @wobble.6(ptr %arg)
br label %bb254
bb254: ; preds = %bb252, %bb50
ret void
}
define ptr @bar() {
bb:
ret ptr null
}
define fastcc void @wombat() {
bb:
ret void
}
define fastcc [2 x i64] @bar.3() {
bb:
ret [2 x i64] zeroinitializer
}
define i1 @foo.4() {
bb:
ret i1 false
}
define ptr @barney(ptr %arg) {
bb:
ret ptr %arg
}
define void @wibble() {
bb:
ret void
}
define void @bar.5() {
bb:
ret void
}
define ptr @baz(ptr, ptr %arg) {
bb:
ret ptr %arg
}
define ptr @wobble.6(ptr %arg) {
bb:
ret ptr %arg
}
define void @quux(ptr) {
bb:
ret void
}
define void @eggs() {
bb:
ret void
}
define fastcc void @pluto() {
bb:
ret void
}
define void @baz.7(i64) {
bb:
ret void
}
define ptr @widget(ptr %arg) {
bb:
ret ptr %arg
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment