; LLVM IR from BrunoLevy/learn-fpga :: LiteX/software/Doom/mc1-doom/src (p_enemy)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.mobj_s = type { %struct.thinker_s, i32, i32, i32, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, ptr, i32, i32, i32, i32, ptr, i32, i32, ptr, i32, %struct.mapthing_t, ptr }
%struct.thinker_s = type { ptr, ptr, %union.actionf_t }
%union.actionf_t = type { ptr }
%struct.mapthing_t = type { i16, i16, i16, i16, i16 }

@opposite = external dso_local global [9 x i32], align 16
@diags = external dso_local global [4 x i32], align 16
@.str.1 = external hidden unnamed_addr constant [37 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare i32 @P_Random() #1

; Function Attrs: noreturn
declare void @I_Error(ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @P_TryWalk(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @P_NewChaseDir(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [3 x i32], align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.mobj_s, ptr %10, i32 0, i32 28
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = icmp ne ptr %12, null
  br i1 %13, label %15, label %14

14:                                               ; preds = %1
  call void (ptr, ...) @I_Error(ptr noundef @.str.1) #6
  unreachable

15:                                               ; preds = %1
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.mobj_s, ptr %16, i32 0, i32 26
  %18 = load i32, ptr %17, align 8, !tbaa !15
  store i32 %18, ptr %7, align 4, !tbaa !16
  %19 = load i32, ptr %7, align 4, !tbaa !16
  %20 = zext i32 %19 to i64
  %21 = getelementptr inbounds [9 x i32], ptr @opposite, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !16
  store i32 %22, ptr %8, align 4, !tbaa !16
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.mobj_s, ptr %23, i32 0, i32 28
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.mobj_s, ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 8, !tbaa !17
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.mobj_s, ptr %28, i32 0, i32 1
  %30 = load i32, ptr %29, align 8, !tbaa !17
  %31 = sub nsw i32 %27, %30
  store i32 %31, ptr %3, align 4, !tbaa !16
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.mobj_s, ptr %32, i32 0, i32 28
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.mobj_s, ptr %34, i32 0, i32 2
  %36 = load i32, ptr %35, align 4, !tbaa !18
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.mobj_s, ptr %37, i32 0, i32 2
  %39 = load i32, ptr %38, align 4, !tbaa !18
  %40 = sub nsw i32 %36, %39
  store i32 %40, ptr %4, align 4, !tbaa !16
  %41 = load i32, ptr %3, align 4, !tbaa !16
  %42 = icmp sgt i32 %41, 655360
  br i1 %42, label %43, label %45

43:                                               ; preds = %15
  %44 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 1
  store i32 0, ptr %44, align 4, !tbaa !16
  br label %53

45:                                               ; preds = %15
  %46 = load i32, ptr %3, align 4, !tbaa !16
  %47 = icmp slt i32 %46, -655360
  br i1 %47, label %48, label %50

48:                                               ; preds = %45
  %49 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 1
  store i32 4, ptr %49, align 4, !tbaa !16
  br label %52

50:                                               ; preds = %45
  %51 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 1
  store i32 8, ptr %51, align 4, !tbaa !16
  br label %52

52:                                               ; preds = %50, %48
  br label %53

53:                                               ; preds = %52, %43
  %54 = load i32, ptr %4, align 4, !tbaa !16
  %55 = icmp slt i32 %54, -655360
  br i1 %55, label %56, label %58

56:                                               ; preds = %53
  %57 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  store i32 6, ptr %57, align 4, !tbaa !16
  br label %66

58:                                               ; preds = %53
  %59 = load i32, ptr %4, align 4, !tbaa !16
  %60 = icmp sgt i32 %59, 655360
  br i1 %60, label %61, label %63

61:                                               ; preds = %58
  %62 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  store i32 2, ptr %62, align 4, !tbaa !16
  br label %65

63:                                               ; preds = %58
  %64 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  store i32 8, ptr %64, align 4, !tbaa !16
  br label %65

65:                                               ; preds = %63, %61
  br label %66

66:                                               ; preds = %65, %56
  %67 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 1
  %68 = load i32, ptr %67, align 4, !tbaa !16
  %69 = icmp ne i32 %68, 8
  br i1 %69, label %70, label %99

70:                                               ; preds = %66
  %71 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  %72 = load i32, ptr %71, align 4, !tbaa !16
  %73 = icmp ne i32 %72, 8
  br i1 %73, label %74, label %99

74:                                               ; preds = %70
  %75 = load i32, ptr %4, align 4, !tbaa !16
  %76 = icmp slt i32 %75, 0
  %77 = zext i1 %76 to i32
  %78 = shl i32 %77, 1
  %79 = load i32, ptr %3, align 4, !tbaa !16
  %80 = icmp sgt i32 %79, 0
  %81 = zext i1 %80 to i32
  %82 = add nsw i32 %78, %81
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [4 x i32], ptr @diags, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !16
  %86 = load ptr, ptr %2, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.mobj_s, ptr %86, i32 0, i32 26
  store i32 %85, ptr %87, align 8, !tbaa !15
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.mobj_s, ptr %88, i32 0, i32 26
  %90 = load i32, ptr %89, align 8, !tbaa !15
  %91 = load i32, ptr %8, align 4, !tbaa !16
  %92 = icmp ne i32 %90, %91
  br i1 %92, label %93, label %98

93:                                               ; preds = %74
  %94 = load ptr, ptr %2, align 8, !tbaa !5
  %95 = call i32 @P_TryWalk(ptr noundef %94)
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %98

97:                                               ; preds = %93
  store i32 1, ptr %9, align 4
  br label %233

98:                                               ; preds = %93, %74
  br label %99

99:                                               ; preds = %98, %70, %66
  %100 = call i32 @P_Random()
  %101 = icmp sgt i32 %100, 200
  br i1 %101, label %108, label %102

102:                                              ; preds = %99
  %103 = load i32, ptr %4, align 4, !tbaa !16
  %104 = call i32 @llvm.abs.i32(i32 %103, i1 true)
  %105 = load i32, ptr %3, align 4, !tbaa !16
  %106 = call i32 @llvm.abs.i32(i32 %105, i1 true)
  %107 = icmp sgt i32 %104, %106
  br i1 %107, label %108, label %116

108:                                              ; preds = %102, %99
  %109 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 1
  %110 = load i32, ptr %109, align 4, !tbaa !16
  store i32 %110, ptr %6, align 4, !tbaa !16
  %111 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  %112 = load i32, ptr %111, align 4, !tbaa !16
  %113 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 1
  store i32 %112, ptr %113, align 4, !tbaa !16
  %114 = load i32, ptr %6, align 4, !tbaa !16
  %115 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  store i32 %114, ptr %115, align 4, !tbaa !16
  br label %116

116:                                              ; preds = %108, %102
  %117 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 1
  %118 = load i32, ptr %117, align 4, !tbaa !16
  %119 = load i32, ptr %8, align 4, !tbaa !16
  %120 = icmp eq i32 %118, %119
  br i1 %120, label %121, label %123

121:                                              ; preds = %116
  %122 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 1
  store i32 8, ptr %122, align 4, !tbaa !16
  br label %123

123:                                              ; preds = %121, %116
  %124 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  %125 = load i32, ptr %124, align 4, !tbaa !16
  %126 = load i32, ptr %8, align 4, !tbaa !16
  %127 = icmp eq i32 %125, %126
  br i1 %127, label %128, label %130

128:                                              ; preds = %123
  %129 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  store i32 8, ptr %129, align 4, !tbaa !16
  br label %130

130:                                              ; preds = %128, %123
  %131 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 1
  %132 = load i32, ptr %131, align 4, !tbaa !16
  %133 = icmp ne i32 %132, 8
  br i1 %133, label %134, label %144

134:                                              ; preds = %130
  %135 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 1
  %136 = load i32, ptr %135, align 4, !tbaa !16
  %137 = load ptr, ptr %2, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.mobj_s, ptr %137, i32 0, i32 26
  store i32 %136, ptr %138, align 8, !tbaa !15
  %139 = load ptr, ptr %2, align 8, !tbaa !5
  %140 = call i32 @P_TryWalk(ptr noundef %139)
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %143

142:                                              ; preds = %134
  store i32 1, ptr %9, align 4
  br label %233

143:                                              ; preds = %134
  br label %144

144:                                              ; preds = %143, %130
  %145 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  %146 = load i32, ptr %145, align 4, !tbaa !16
  %147 = icmp ne i32 %146, 8
  br i1 %147, label %148, label %158

148:                                              ; preds = %144
  %149 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  %150 = load i32, ptr %149, align 4, !tbaa !16
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.mobj_s, ptr %151, i32 0, i32 26
  store i32 %150, ptr %152, align 8, !tbaa !15
  %153 = load ptr, ptr %2, align 8, !tbaa !5
  %154 = call i32 @P_TryWalk(ptr noundef %153)
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %156, label %157

156:                                              ; preds = %148
  store i32 1, ptr %9, align 4
  br label %233

157:                                              ; preds = %148
  br label %158

158:                                              ; preds = %157, %144
  %159 = load i32, ptr %7, align 4, !tbaa !16
  %160 = icmp ne i32 %159, 8
  br i1 %160, label %161, label %170

161:                                              ; preds = %158
  %162 = load i32, ptr %7, align 4, !tbaa !16
  %163 = load ptr, ptr %2, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.mobj_s, ptr %163, i32 0, i32 26
  store i32 %162, ptr %164, align 8, !tbaa !15
  %165 = load ptr, ptr %2, align 8, !tbaa !5
  %166 = call i32 @P_TryWalk(ptr noundef %165)
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %169

168:                                              ; preds = %161
  store i32 1, ptr %9, align 4
  br label %233

169:                                              ; preds = %161
  br label %170

170:                                              ; preds = %169, %158
  %171 = call i32 @P_Random()
  %172 = and i32 %171, 1
  %173 = icmp ne i32 %172, 0
  br i1 %173, label %174, label %196

174:                                              ; preds = %170
  store i32 0, ptr %6, align 4, !tbaa !16
  br label %175

175:                                              ; preds = %192, %174
  %176 = load i32, ptr %6, align 4, !tbaa !16
  %177 = icmp ule i32 %176, 7
  br i1 %177, label %178, label %195

178:                                              ; preds = %175
  %179 = load i32, ptr %6, align 4, !tbaa !16
  %180 = load i32, ptr %8, align 4, !tbaa !16
  %181 = icmp ne i32 %179, %180
  br i1 %181, label %182, label %191

182:                                              ; preds = %178
  %183 = load i32, ptr %6, align 4, !tbaa !16
  %184 = load ptr, ptr %2, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.mobj_s, ptr %184, i32 0, i32 26
  store i32 %183, ptr %185, align 8, !tbaa !15
  %186 = load ptr, ptr %2, align 8, !tbaa !5
  %187 = call i32 @P_TryWalk(ptr noundef %186)
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %189, label %190

189:                                              ; preds = %182
  store i32 1, ptr %9, align 4
  br label %233

190:                                              ; preds = %182
  br label %191

191:                                              ; preds = %190, %178
  br label %192

192:                                              ; preds = %191
  %193 = load i32, ptr %6, align 4, !tbaa !16
  %194 = add i32 %193, 1
  store i32 %194, ptr %6, align 4, !tbaa !16
  br label %175, !llvm.loop !19

195:                                              ; preds = %175
  br label %218

196:                                              ; preds = %170
  store i32 7, ptr %6, align 4, !tbaa !16
  br label %197

197:                                              ; preds = %214, %196
  %198 = load i32, ptr %6, align 4, !tbaa !16
  %199 = icmp ne i32 %198, -1
  br i1 %199, label %200, label %217

200:                                              ; preds = %197
  %201 = load i32, ptr %6, align 4, !tbaa !16
  %202 = load i32, ptr %8, align 4, !tbaa !16
  %203 = icmp ne i32 %201, %202
  br i1 %203, label %204, label %213

204:                                              ; preds = %200
  %205 = load i32, ptr %6, align 4, !tbaa !16
  %206 = load ptr, ptr %2, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.mobj_s, ptr %206, i32 0, i32 26
  store i32 %205, ptr %207, align 8, !tbaa !15
  %208 = load ptr, ptr %2, align 8, !tbaa !5
  %209 = call i32 @P_TryWalk(ptr noundef %208)
  %210 = icmp ne i32 %209, 0
  br i1 %210, label %211, label %212

211:                                              ; preds = %204
  store i32 1, ptr %9, align 4
  br label %233

212:                                              ; preds = %204
  br label %213

213:                                              ; preds = %212, %200
  br label %214

214:                                              ; preds = %213
  %215 = load i32, ptr %6, align 4, !tbaa !16
  %216 = add i32 %215, -1
  store i32 %216, ptr %6, align 4, !tbaa !16
  br label %197, !llvm.loop !21

217:                                              ; preds = %197
  br label %218

218:                                              ; preds = %217, %195
  %219 = load i32, ptr %8, align 4, !tbaa !16
  %220 = icmp ne i32 %219, 8
  br i1 %220, label %221, label %230

221:                                              ; preds = %218
  %222 = load i32, ptr %8, align 4, !tbaa !16
  %223 = load ptr, ptr %2, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.mobj_s, ptr %223, i32 0, i32 26
  store i32 %222, ptr %224, align 8, !tbaa !15
  %225 = load ptr, ptr %2, align 8, !tbaa !5
  %226 = call i32 @P_TryWalk(ptr noundef %225)
  %227 = icmp ne i32 %226, 0
  br i1 %227, label %228, label %229

228:                                              ; preds = %221
  store i32 1, ptr %9, align 4
  br label %233

229:                                              ; preds = %221
  br label %230

230:                                              ; preds = %229, %218
  %231 = load ptr, ptr %2, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.mobj_s, ptr %231, i32 0, i32 26
  store i32 8, ptr %232, align 8, !tbaa !15
  store i32 0, ptr %9, align 4
  br label %233

233:                                              ; preds = %230, %228, %211, %189, %168, %156, %142, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  %234 = load i32, ptr %9, align 4
  switch i32 %234, label %236 [
    i32 0, label %235
    i32 1, label %235
  ]

235:                                              ; preds = %233, %233
  ret void

236:                                              ; preds = %233
  unreachable
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { noreturn }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 176}
!10 = !{!"mobj_s", !11, i64 0, !12, i64 24, !12, i64 28, !12, i64 32, !6, i64 40, !6, i64 48, !12, i64 56, !12, i64 60, !12, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !6, i64 136, !12, i64 144, !6, i64 152, !12, i64 160, !12, i64 164, !12, i64 168, !12, i64 172, !6, i64 176, !12, i64 184, !12, i64 188, !6, i64 192, !12, i64 200, !13, i64 204, !6, i64 216}
!11 = !{!"thinker_s", !6, i64 0, !6, i64 8, !7, i64 16}
!12 = !{!"int", !7, i64 0}
!13 = !{!"", !14, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!14 = !{!"short", !7, i64 0}
!15 = !{!10, !12, i64 168}
!16 = !{!12, !12, i64 0}
!17 = !{!10, !12, i64 24}
!18 = !{!10, !12, i64 28}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@opposite = external dso_local local_unnamed_addr global [9 x i32], align 16
@diags = external dso_local local_unnamed_addr global [4 x i32], align 16
@.str.1 = external hidden unnamed_addr constant [37 x i8], align 1

declare i32 @P_Random() local_unnamed_addr #0

; Function Attrs: noreturn
declare void @I_Error(ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @P_TryWalk(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @P_NewChaseDir(ptr noundef %0) local_unnamed_addr #2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 176
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %4, label %5

4:                                                ; preds = %1
  tail call void (ptr, ...) @I_Error(ptr noundef nonnull @.str.1) #4
  unreachable

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 168
  %7 = load i32, ptr %6, align 8, !tbaa !14
  %8 = zext i32 %7 to i64
  %9 = getelementptr inbounds [9 x i32], ptr @opposite, i64 0, i64 %8
  %10 = load i32, ptr %9, align 4, !tbaa !15
  %11 = getelementptr inbounds i8, ptr %3, i64 24
  %12 = load i32, ptr %11, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = load i32, ptr %13, align 8, !tbaa !16
  %15 = sub nsw i32 %12, %14
  %16 = getelementptr inbounds i8, ptr %3, i64 28
  %17 = load i32, ptr %16, align 4, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %0, i64 28
  %19 = load i32, ptr %18, align 4, !tbaa !17
  %20 = sub nsw i32 %17, %19
  %21 = icmp sgt i32 %15, 655360
  %22 = icmp slt i32 %15, -655360
  %.79 = select i1 %22, i32 4, i32 8
  %23 = add i32 %15, -655361
  %24 = icmp ult i32 %23, -1310721
  %.sroa.2.0 = select i1 %21, i32 0, i32 %.79
  %25 = icmp slt i32 %20, -655360
  %26 = icmp sgt i32 %20, 655360
  %.81 = select i1 %26, i32 2, i32 8
  %27 = add i32 %20, -655361
  %28 = icmp ult i32 %27, -1310721
  %.sroa.12.0 = select i1 %25, i32 6, i32 %.81
  %or.cond = and i1 %24, %28
  br i1 %or.cond, label %29, label %40

29:                                               ; preds = %5
  %30 = lshr i32 %20, 30
  %31 = and i32 %30, 2
  %32 = icmp sgt i32 %15, 0
  %33 = zext i1 %32 to i32
  %34 = or disjoint i32 %31, %33
  %35 = zext nneg i32 %34 to i64
  %36 = getelementptr inbounds [4 x i32], ptr @diags, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !15
  store i32 %37, ptr %6, align 8, !tbaa !14
  %.not63 = icmp eq i32 %37, %10
  br i1 %.not63, label %40, label %38

38:                                               ; preds = %29
  %39 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not64 = icmp eq i32 %39, 0
  br i1 %.not64, label %40, label %.loopexit83

40:                                               ; preds = %29, %38, %5
  %41 = tail call i32 @P_Random() #5
  %42 = icmp sgt i32 %41, 200
  br i1 %42, label %47, label %43

43:                                               ; preds = %40
  %44 = tail call i32 @llvm.abs.i32(i32 %20, i1 true)
  %45 = tail call i32 @llvm.abs.i32(i32 %15, i1 true)
  %46 = icmp ugt i32 %44, %45
  br i1 %46, label %47, label %48

47:                                               ; preds = %43, %40
  br label %48

48:                                               ; preds = %47, %43
  %.sroa.2.1 = phi i32 [ %.sroa.12.0, %47 ], [ %.sroa.2.0, %43 ]
  %.sroa.12.1 = phi i32 [ %.sroa.2.0, %47 ], [ %.sroa.12.0, %43 ]
  %49 = icmp eq i32 %.sroa.2.1, %10
  %50 = icmp eq i32 %.sroa.12.1, %10
  %.sroa.12.2 = select i1 %50, i32 8, i32 %.sroa.12.1
  %.not6582 = icmp eq i32 %.sroa.2.1, 8
  %.not65 = or i1 %49, %.not6582
  br i1 %.not65, label %53, label %51

51:                                               ; preds = %48
  store i32 %.sroa.2.1, ptr %6, align 8, !tbaa !14
  %52 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not66 = icmp eq i32 %52, 0
  br i1 %.not66, label %53, label %.loopexit83

53:                                               ; preds = %51, %48
  %.not67 = icmp eq i32 %.sroa.12.2, 8
  br i1 %.not67, label %56, label %54

54:                                               ; preds = %53
  store i32 %.sroa.12.2, ptr %6, align 8, !tbaa !14
  %55 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not68 = icmp eq i32 %55, 0
  br i1 %.not68, label %56, label %.loopexit83

56:                                               ; preds = %54, %53
  %.not69 = icmp eq i32 %7, 8
  br i1 %.not69, label %59, label %57

57:                                               ; preds = %56
  store i32 %7, ptr %6, align 8, !tbaa !14
  %58 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not70 = icmp eq i32 %58, 0
  br i1 %.not70, label %59, label %.loopexit83

59:                                               ; preds = %57, %56
  %60 = tail call i32 @P_Random() #5
  %61 = and i32 %60, 1
  %.not71 = icmp eq i32 %61, 0
  br i1 %.not71, label %.preheader.preheader, label %.preheader84.preheader

.preheader84.preheader:                           ; preds = %59
  %.not77 = icmp eq i32 %10, 0
  br i1 %.not77, label %.preheader84.1.thread, label %62

.preheader.preheader:                             ; preds = %59
  %.not73 = icmp eq i32 %10, 7
  br i1 %.not73, label %.preheader.1.thread, label %71

62:                                               ; preds = %.preheader84.preheader
  store i32 0, ptr %6, align 8, !tbaa !14
  %63 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not78 = icmp eq i32 %63, 0
  br i1 %.not78, label %.preheader84.1, label %.loopexit83

.preheader84.1:                                   ; preds = %62
  %.not77.1 = icmp eq i32 %10, 1
  br i1 %.not77.1, label %.preheader84.2.thread, label %.preheader84.1.thread

.preheader84.1.thread:                            ; preds = %.preheader84.preheader, %.preheader84.1
  store i32 1, ptr %6, align 8, !tbaa !14
  %64 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not78.1 = icmp eq i32 %64, 0
  br i1 %.not78.1, label %.preheader84.2, label %.loopexit83

.preheader84.2:                                   ; preds = %.preheader84.1.thread
  %.not77.2 = icmp eq i32 %10, 2
  br i1 %.not77.2, label %.preheader84.3.thread, label %.preheader84.2.thread

.preheader84.2.thread:                            ; preds = %.preheader84.1, %.preheader84.2
  store i32 2, ptr %6, align 8, !tbaa !14
  %65 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not78.2 = icmp eq i32 %65, 0
  br i1 %.not78.2, label %.preheader84.3, label %.loopexit83

.preheader84.3:                                   ; preds = %.preheader84.2.thread
  %.not77.3 = icmp eq i32 %10, 3
  br i1 %.not77.3, label %.preheader84.4.thread, label %.preheader84.3.thread

.preheader84.3.thread:                            ; preds = %.preheader84.2, %.preheader84.3
  store i32 3, ptr %6, align 8, !tbaa !14
  %66 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not78.3 = icmp eq i32 %66, 0
  br i1 %.not78.3, label %.preheader84.4, label %.loopexit83

.preheader84.4:                                   ; preds = %.preheader84.3.thread
  %.not77.4 = icmp eq i32 %10, 4
  br i1 %.not77.4, label %.preheader84.5.thread, label %.preheader84.4.thread

.preheader84.4.thread:                            ; preds = %.preheader84.3, %.preheader84.4
  store i32 4, ptr %6, align 8, !tbaa !14
  %67 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not78.4 = icmp eq i32 %67, 0
  br i1 %.not78.4, label %.preheader84.5, label %.loopexit83

.preheader84.5:                                   ; preds = %.preheader84.4.thread
  %.not77.5 = icmp eq i32 %10, 5
  br i1 %.not77.5, label %.preheader84.6.thread, label %.preheader84.5.thread

.preheader84.5.thread:                            ; preds = %.preheader84.4, %.preheader84.5
  store i32 5, ptr %6, align 8, !tbaa !14
  %68 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not78.5 = icmp eq i32 %68, 0
  br i1 %.not78.5, label %.preheader84.6, label %.loopexit83

.preheader84.6:                                   ; preds = %.preheader84.5.thread
  %.not77.6 = icmp eq i32 %10, 6
  br i1 %.not77.6, label %.preheader84.7.thread, label %.preheader84.6.thread

.preheader84.6.thread:                            ; preds = %.preheader84.5, %.preheader84.6
  store i32 6, ptr %6, align 8, !tbaa !14
  %69 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not78.6 = icmp eq i32 %69, 0
  br i1 %.not78.6, label %.preheader84.7, label %.loopexit83

.preheader84.7:                                   ; preds = %.preheader84.6.thread
  %.not77.7 = icmp eq i32 %10, 7
  br i1 %.not77.7, label %.loopexit.thread, label %.preheader84.7.thread

.preheader84.7.thread:                            ; preds = %.preheader84.6, %.preheader84.7
  store i32 7, ptr %6, align 8, !tbaa !14
  %70 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not78.7 = icmp eq i32 %70, 0
  br i1 %.not78.7, label %.loopexit, label %.loopexit83

71:                                               ; preds = %.preheader.preheader
  store i32 7, ptr %6, align 8, !tbaa !14
  %72 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not74 = icmp eq i32 %72, 0
  br i1 %.not74, label %.preheader.1, label %.loopexit83

.preheader.1:                                     ; preds = %71
  %.not73.1 = icmp eq i32 %10, 6
  br i1 %.not73.1, label %.preheader.2.thread, label %.preheader.1.thread

.preheader.1.thread:                              ; preds = %.preheader.preheader, %.preheader.1
  store i32 6, ptr %6, align 8, !tbaa !14
  %73 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not74.1 = icmp eq i32 %73, 0
  br i1 %.not74.1, label %.preheader.2, label %.loopexit83

.preheader.2:                                     ; preds = %.preheader.1.thread
  %.not73.2 = icmp eq i32 %10, 5
  br i1 %.not73.2, label %.preheader.3.thread, label %.preheader.2.thread

.preheader.2.thread:                              ; preds = %.preheader.1, %.preheader.2
  store i32 5, ptr %6, align 8, !tbaa !14
  %74 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not74.2 = icmp eq i32 %74, 0
  br i1 %.not74.2, label %.preheader.3, label %.loopexit83

.preheader.3:                                     ; preds = %.preheader.2.thread
  %.not73.3 = icmp eq i32 %10, 4
  br i1 %.not73.3, label %.preheader.4.thread, label %.preheader.3.thread

.preheader.3.thread:                              ; preds = %.preheader.2, %.preheader.3
  store i32 4, ptr %6, align 8, !tbaa !14
  %75 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not74.3 = icmp eq i32 %75, 0
  br i1 %.not74.3, label %.preheader.4, label %.loopexit83

.preheader.4:                                     ; preds = %.preheader.3.thread
  %.not73.4 = icmp eq i32 %10, 3
  br i1 %.not73.4, label %.preheader.5.thread, label %.preheader.4.thread

.preheader.4.thread:                              ; preds = %.preheader.3, %.preheader.4
  store i32 3, ptr %6, align 8, !tbaa !14
  %76 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not74.4 = icmp eq i32 %76, 0
  br i1 %.not74.4, label %.preheader.5, label %.loopexit83

.preheader.5:                                     ; preds = %.preheader.4.thread
  %.not73.5 = icmp eq i32 %10, 2
  br i1 %.not73.5, label %.preheader.6.thread, label %.preheader.5.thread

.preheader.5.thread:                              ; preds = %.preheader.4, %.preheader.5
  store i32 2, ptr %6, align 8, !tbaa !14
  %77 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not74.5 = icmp eq i32 %77, 0
  br i1 %.not74.5, label %.preheader.6, label %.loopexit83

.preheader.6:                                     ; preds = %.preheader.5.thread
  %.not73.6 = icmp eq i32 %10, 1
  br i1 %.not73.6, label %.preheader.7.thread, label %.preheader.6.thread

.preheader.6.thread:                              ; preds = %.preheader.5, %.preheader.6
  store i32 1, ptr %6, align 8, !tbaa !14
  %78 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not74.6 = icmp eq i32 %78, 0
  br i1 %.not74.6, label %.preheader.7, label %.loopexit83

.preheader.7:                                     ; preds = %.preheader.6.thread
  %.not73.7 = icmp eq i32 %10, 0
  br i1 %.not73.7, label %.loopexit.thread, label %.preheader.7.thread

.preheader.7.thread:                              ; preds = %.preheader.6, %.preheader.7
  store i32 0, ptr %6, align 8, !tbaa !14
  %79 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not74.7 = icmp eq i32 %79, 0
  br i1 %.not74.7, label %.loopexit, label %.loopexit83

.loopexit:                                        ; preds = %.preheader.7.thread, %.preheader84.7.thread
  %.not75 = icmp eq i32 %10, 8
  br i1 %.not75, label %81, label %.loopexit.thread

.loopexit.thread:                                 ; preds = %.preheader84.7, %.preheader.7, %.loopexit
  store i32 %10, ptr %6, align 8, !tbaa !14
  %80 = tail call i32 @P_TryWalk(ptr noundef nonnull %0)
  %.not76 = icmp eq i32 %80, 0
  br i1 %.not76, label %81, label %.loopexit83

81:                                               ; preds = %.loopexit.thread, %.loopexit
  store i32 8, ptr %6, align 8, !tbaa !14
  br label %.loopexit83

.loopexit83:                                      ; preds = %62, %.preheader84.1.thread, %.preheader84.2.thread, %.preheader84.3.thread, %.preheader84.4.thread, %.preheader84.5.thread, %.preheader84.6.thread, %.preheader84.7.thread, %71, %.preheader.1.thread, %.preheader.2.thread, %.preheader.3.thread, %.preheader.4.thread, %.preheader.5.thread, %.preheader.6.thread, %.preheader.7.thread, %.loopexit.thread, %57, %54, %51, %38, %81
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { noreturn nounwind }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !8, i64 176}
!6 = !{!"mobj_s", !7, i64 0, !11, i64 24, !11, i64 28, !11, i64 32, !8, i64 40, !8, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !8, i64 72, !8, i64 80, !8, i64 88, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !8, i64 136, !11, i64 144, !8, i64 152, !11, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !8, i64 176, !11, i64 184, !11, i64 188, !8, i64 192, !11, i64 200, !12, i64 204, !8, i64 216}
!7 = !{!"thinker_s", !8, i64 0, !8, i64 8, !9, i64 16}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !13, i64 8}
!13 = !{!"short", !9, i64 0}
!14 = !{!6, !11, i64 168}
!15 = !{!11, !11, i64 0}
!16 = !{!6, !11, i64 24}
!17 = !{!6, !11, i64 28}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass,TailCallElimPass