; LLVM IR from mtsamis/box2d-optimized :: src/dynamics/b2_body.ll (ZN6b2Body7SetTypeE10b2BodyType)

; 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"

%class.b2Body = type { i32, i16, i32, %struct.b2Transform, %struct.b2Transform, %struct.b2Sweep, %struct.b2Vec2, float, %struct.b2Vec2, float, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, float, float, float, float, float, float, float, float, %struct.b2BodyUserData }
%struct.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Rot = type { float, float }
%struct.b2Sweep = type { %struct.b2Vec2, %struct.b2Vec2, %struct.b2Vec2, float, float, float }
%struct.b2Vec2 = type { float, float }
%struct.b2BodyUserData = type { i64 }
%class.b2World = type { %class.b2BlockAllocator, %class.b2StackAllocator, %class.b2ContactManager, ptr, ptr, ptr, ptr, i32, i32, %struct.b2Vec2, i8, ptr, ptr, float, i8, i8, i8, i8, i8, i8, i8, i8, %struct.b2Profile }
%class.b2BlockAllocator = type { ptr, i32, i32, [14 x ptr] }
%class.b2StackAllocator = type <{ [102400 x i8], i32, i32, i32, [4 x i8], [32 x %struct.b2StackEntry], i32, [4 x i8] }>
%struct.b2StackEntry = type { ptr, i32, i8 }
%class.b2ContactManager = type { %class.b2BroadPhase, i32, ptr, ptr, ptr, ptr }
%class.b2BroadPhase = type <{ ptr, ptr, ptr, ptr, %struct.b2TreeNode, ptr, ptr, ptr, i32, i32, %class.b2IntHashTable, i32, i32, i8, [7 x i8] }>
%struct.b2TreeNode = type { ptr, ptr, ptr, ptr, %struct.b2AABB }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%class.b2IntHashTable = type <{ ptr, i32, [4 x i8] }>
%struct.b2Profile = type { float, float, float, float, float }

@.str.1 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__._ZN6b2Body7SetTypeE10b2BodyType = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec27SetZeroEv(ptr noundef nonnull align 4 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6b2Body7SetTypeE10b2BodyType(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %6 = load ptr, ptr %3, align 8
  %7 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %8 = load ptr, ptr %7, align 8, !tbaa !11
  %9 = call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %8)
  %10 = zext i1 %9 to i32
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %12, label %13

12:                                               ; preds = %2
  br label %15

13:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 131, ptr noundef @__PRETTY_FUNCTION__._ZN6b2Body7SetTypeE10b2BodyType) #8
  unreachable

14:                                               ; No predecessors!
  br label %15

15:                                               ; preds = %14, %12
  %16 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %17)
  %19 = zext i1 %18 to i32
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %21, label %22

21:                                               ; preds = %15
  br label %186

22:                                               ; preds = %15
  %23 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 0
  %24 = load i32, ptr %23, align 8, !tbaa !22
  %25 = load i32, ptr %4, align 4, !tbaa !9
  %26 = icmp eq i32 %24, %25
  br i1 %26, label %27, label %28

27:                                               ; preds = %22
  br label %186

28:                                               ; preds = %22
  %29 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 0
  %30 = load i32, ptr %29, align 8, !tbaa !22
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %35, label %32

32:                                               ; preds = %28
  %33 = load i32, ptr %4, align 4, !tbaa !9
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %139

35:                                               ; preds = %32, %28
  %36 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = getelementptr inbounds %class.b2World, ptr %37, i32 0, i32 2
  %39 = getelementptr inbounds %class.b2ContactManager, ptr %38, i32 0, i32 0
  call void @_ZN12b2BroadPhase22InvalidateStaticBodiesEv(ptr noundef nonnull align 8 dereferenceable(137) %39)
  %40 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 11
  %41 = load ptr, ptr %40, align 8, !tbaa !23
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %49

43:                                               ; preds = %35
  %44 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 12
  %45 = load ptr, ptr %44, align 8, !tbaa !24
  %46 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 11
  %47 = load ptr, ptr %46, align 8, !tbaa !23
  %48 = getelementptr inbounds %class.b2Body, ptr %47, i32 0, i32 12
  store ptr %45, ptr %48, align 8, !tbaa !24
  br label %49

49:                                               ; preds = %43, %35
  %50 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 12
  %51 = load ptr, ptr %50, align 8, !tbaa !24
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %59

53:                                               ; preds = %49
  %54 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 11
  %55 = load ptr, ptr %54, align 8, !tbaa !23
  %56 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 12
  %57 = load ptr, ptr %56, align 8, !tbaa !24
  %58 = getelementptr inbounds %class.b2Body, ptr %57, i32 0, i32 11
  store ptr %55, ptr %58, align 8, !tbaa !23
  br label %59

59:                                               ; preds = %53, %49
  %60 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %61 = load ptr, ptr %60, align 8, !tbaa !11
  %62 = getelementptr inbounds %class.b2World, ptr %61, i32 0, i32 3
  %63 = load ptr, ptr %62, align 8, !tbaa !25
  %64 = icmp eq ptr %6, %63
  br i1 %64, label %65, label %71

65:                                               ; preds = %59
  %66 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 12
  %67 = load ptr, ptr %66, align 8, !tbaa !24
  %68 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %69 = load ptr, ptr %68, align 8, !tbaa !11
  %70 = getelementptr inbounds %class.b2World, ptr %69, i32 0, i32 3
  store ptr %67, ptr %70, align 8, !tbaa !25
  br label %71

71:                                               ; preds = %65, %59
  %72 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %73 = load ptr, ptr %72, align 8, !tbaa !11
  %74 = getelementptr inbounds %class.b2World, ptr %73, i32 0, i32 4
  %75 = load ptr, ptr %74, align 8, !tbaa !36
  %76 = icmp eq ptr %6, %75
  br i1 %76, label %77, label %83

77:                                               ; preds = %71
  %78 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 11
  %79 = load ptr, ptr %78, align 8, !tbaa !23
  %80 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %81 = load ptr, ptr %80, align 8, !tbaa !11
  %82 = getelementptr inbounds %class.b2World, ptr %81, i32 0, i32 4
  store ptr %79, ptr %82, align 8, !tbaa !36
  br label %83

83:                                               ; preds = %77, %71
  %84 = load i32, ptr %4, align 4, !tbaa !9
  %85 = icmp eq i32 %84, 0
  br i1 %85, label %86, label %112

86:                                               ; preds = %83
  %87 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %88 = load ptr, ptr %87, align 8, !tbaa !11
  %89 = getelementptr inbounds %class.b2World, ptr %88, i32 0, i32 4
  %90 = load ptr, ptr %89, align 8, !tbaa !36
  %91 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 11
  store ptr %90, ptr %91, align 8, !tbaa !23
  %92 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 12
  store ptr null, ptr %92, align 8, !tbaa !24
  %93 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %94 = load ptr, ptr %93, align 8, !tbaa !11
  %95 = getelementptr inbounds %class.b2World, ptr %94, i32 0, i32 4
  %96 = load ptr, ptr %95, align 8, !tbaa !36
  %97 = icmp ne ptr %96, null
  br i1 %97, label %98, label %104

98:                                               ; preds = %86
  %99 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %100 = load ptr, ptr %99, align 8, !tbaa !11
  %101 = getelementptr inbounds %class.b2World, ptr %100, i32 0, i32 4
  %102 = load ptr, ptr %101, align 8, !tbaa !36
  %103 = getelementptr inbounds %class.b2Body, ptr %102, i32 0, i32 12
  store ptr %6, ptr %103, align 8, !tbaa !24
  br label %108

104:                                              ; preds = %86
  %105 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %106 = load ptr, ptr %105, align 8, !tbaa !11
  %107 = getelementptr inbounds %class.b2World, ptr %106, i32 0, i32 3
  store ptr %6, ptr %107, align 8, !tbaa !25
  br label %108

108:                                              ; preds = %104, %98
  %109 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %110 = load ptr, ptr %109, align 8, !tbaa !11
  %111 = getelementptr inbounds %class.b2World, ptr %110, i32 0, i32 4
  store ptr %6, ptr %111, align 8, !tbaa !36
  br label %138

112:                                              ; preds = %83
  %113 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 11
  store ptr null, ptr %113, align 8, !tbaa !23
  %114 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %115 = load ptr, ptr %114, align 8, !tbaa !11
  %116 = getelementptr inbounds %class.b2World, ptr %115, i32 0, i32 3
  %117 = load ptr, ptr %116, align 8, !tbaa !25
  %118 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 12
  store ptr %117, ptr %118, align 8, !tbaa !24
  %119 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %120 = load ptr, ptr %119, align 8, !tbaa !11
  %121 = getelementptr inbounds %class.b2World, ptr %120, i32 0, i32 3
  %122 = load ptr, ptr %121, align 8, !tbaa !25
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %130

124:                                              ; preds = %112
  %125 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %126 = load ptr, ptr %125, align 8, !tbaa !11
  %127 = getelementptr inbounds %class.b2World, ptr %126, i32 0, i32 3
  %128 = load ptr, ptr %127, align 8, !tbaa !25
  %129 = getelementptr inbounds %class.b2Body, ptr %128, i32 0, i32 11
  store ptr %6, ptr %129, align 8, !tbaa !23
  br label %134

130:                                              ; preds = %112
  %131 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %132 = load ptr, ptr %131, align 8, !tbaa !11
  %133 = getelementptr inbounds %class.b2World, ptr %132, i32 0, i32 4
  store ptr %6, ptr %133, align 8, !tbaa !36
  br label %134

134:                                              ; preds = %130, %124
  %135 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %136 = load ptr, ptr %135, align 8, !tbaa !11
  %137 = getelementptr inbounds %class.b2World, ptr %136, i32 0, i32 3
  store ptr %6, ptr %137, align 8, !tbaa !25
  br label %138

138:                                              ; preds = %134, %108
  br label %139

139:                                              ; preds = %138, %32
  %140 = load i32, ptr %4, align 4, !tbaa !9
  %141 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 0
  store i32 %140, ptr %141, align 8, !tbaa !22
  call void @_ZN6b2Body13ResetMassDataEv(ptr noundef nonnull align 8 dereferenceable(208) %6)
  %142 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 0
  %143 = load i32, ptr %142, align 8, !tbaa !22
  %144 = icmp eq i32 %143, 0
  br i1 %144, label %145, label %162

145:                                              ; preds = %139
  %146 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 6
  call void @_ZN6b2Vec27SetZeroEv(ptr noundef nonnull align 4 dereferenceable(8) %146)
  %147 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 7
  store float 0.000000e+00, ptr %147, align 8, !tbaa !37
  %148 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 5
  %149 = getelementptr inbounds %struct.b2Sweep, ptr %148, i32 0, i32 4
  %150 = load float, ptr %149, align 4, !tbaa !38
  %151 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 5
  %152 = getelementptr inbounds %struct.b2Sweep, ptr %151, i32 0, i32 3
  store float %150, ptr %152, align 4, !tbaa !39
  %153 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 5
  %154 = getelementptr inbounds %struct.b2Sweep, ptr %153, i32 0, i32 2
  %155 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 5
  %156 = getelementptr inbounds %struct.b2Sweep, ptr %155, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %156, ptr align 4 %154, i64 8, i1 false), !tbaa.struct !40
  %157 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 1
  %158 = load i16, ptr %157, align 4, !tbaa !42
  %159 = zext i16 %158 to i32
  %160 = and i32 %159, -3
  %161 = trunc i32 %160 to i16
  store i16 %161, ptr %157, align 4, !tbaa !42
  call void @_ZN6b2Body11UpdateAABBsEv(ptr noundef nonnull align 8 dereferenceable(208) %6)
  br label %162

162:                                              ; preds = %145, %139
  call void @_ZN6b2Body8SetAwakeEb(ptr noundef nonnull align 8 dereferenceable(208) %6, i1 noundef zeroext true)
  %163 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 8
  call void @_ZN6b2Vec27SetZeroEv(ptr noundef nonnull align 4 dereferenceable(8) %163)
  %164 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 9
  store float 0.000000e+00, ptr %164, align 4, !tbaa !43
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  store i32 0, ptr %5, align 4, !tbaa !44
  br label %165

165:                                              ; preds = %181, %162
  %166 = load i32, ptr %5, align 4, !tbaa !44
  %167 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 17
  %168 = load i32, ptr %167, align 8, !tbaa !45
  %169 = icmp slt i32 %166, %168
  br i1 %169, label %171, label %170

170:                                              ; preds = %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  br label %184

171:                                              ; preds = %165
  %172 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 10
  %173 = load ptr, ptr %172, align 8, !tbaa !11
  %174 = getelementptr inbounds %class.b2World, ptr %173, i32 0, i32 2
  %175 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 16
  %176 = load ptr, ptr %175, align 8, !tbaa !46
  %177 = load i32, ptr %5, align 4, !tbaa !44
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds ptr, ptr %176, i64 %178
  %180 = load ptr, ptr %179, align 8, !tbaa !5
  call void @_ZN16b2ContactManager7DestroyEP9b2Contact(ptr noundef nonnull align 8 dereferenceable(184) %174, ptr noundef %180)
  br label %181

181:                                              ; preds = %171
  %182 = load i32, ptr %5, align 4, !tbaa !44
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %5, align 4, !tbaa !44
  br label %165, !llvm.loop !47

184:                                              ; preds = %170
  %185 = getelementptr inbounds %class.b2Body, ptr %6, i32 0, i32 17
  store i32 0, ptr %185, align 8, !tbaa !45
  br label %186

186:                                              ; preds = %184, %27, %21
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN12b2BroadPhase22InvalidateStaticBodiesEv(ptr noundef nonnull align 8 dereferenceable(137)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6b2Body13ResetMassDataEv(ptr noundef nonnull align 8 dereferenceable(208)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6b2Body11UpdateAABBsEv(ptr noundef nonnull align 8 dereferenceable(208)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Body8SetAwakeEb(ptr noundef nonnull align 8 dereferenceable(208), i1 noundef zeroext) #4 align 2

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

declare void @_ZN16b2ContactManager7DestroyEP9b2Contact(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef) #7

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

attributes #0 = { noreturn nounwind "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 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 = { inlinehint mustprogress 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 #5 = { mustprogress uwtable "min-legal-vector-width"="64" "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 #6 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { "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 #8 = { noreturn nounwind }
attributes #9 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_ZTS10b2BodyType", !7, i64 0}
!11 = !{!12, !6, i64 104}
!12 = !{!"_ZTS6b2Body", !10, i64 0, !13, i64 4, !14, i64 8, !15, i64 12, !15, i64 28, !19, i64 44, !16, i64 80, !17, i64 88, !16, i64 92, !17, i64 100, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !14, i64 136, !6, i64 144, !6, i64 152, !14, i64 160, !14, i64 164, !17, i64 168, !17, i64 172, !17, i64 176, !17, i64 180, !17, i64 184, !17, i64 188, !17, i64 192, !17, i64 196, !20, i64 200}
!13 = !{!"short", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTS11b2Transform", !16, i64 0, !18, i64 8}
!16 = !{!"_ZTS6b2Vec2", !17, i64 0, !17, i64 4}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_ZTS5b2Rot", !17, i64 0, !17, i64 4}
!19 = !{!"_ZTS7b2Sweep", !16, i64 0, !16, i64 8, !16, i64 16, !17, i64 24, !17, i64 28, !17, i64 32}
!20 = !{!"_ZTS14b2BodyUserData", !21, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!12, !10, i64 0}
!23 = !{!12, !6, i64 112}
!24 = !{!12, !6, i64 120}
!25 = !{!26, !6, i64 103248}
!26 = !{!"_ZTS7b2World", !27, i64 0, !28, i64 128, !29, i64 103064, !6, i64 103248, !6, i64 103256, !6, i64 103264, !6, i64 103272, !14, i64 103280, !14, i64 103284, !16, i64 103288, !34, i64 103296, !6, i64 103304, !6, i64 103312, !17, i64 103320, !34, i64 103324, !34, i64 103325, !34, i64 103326, !34, i64 103327, !34, i64 103328, !34, i64 103329, !34, i64 103330, !34, i64 103331, !35, i64 103332}
!27 = !{!"_ZTS16b2BlockAllocator", !6, i64 0, !14, i64 8, !14, i64 12, !7, i64 16}
!28 = !{!"_ZTS16b2StackAllocator", !7, i64 0, !14, i64 102400, !14, i64 102404, !14, i64 102408, !7, i64 102416, !14, i64 102928}
!29 = !{!"_ZTS16b2ContactManager", !30, i64 0, !14, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!30 = !{!"_ZTS12b2BroadPhase", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !31, i64 32, !6, i64 80, !6, i64 88, !6, i64 96, !14, i64 104, !14, i64 108, !33, i64 112, !14, i64 128, !14, i64 132, !34, i64 136}
!31 = !{!"_ZTS10b2TreeNode", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !32, i64 32}
!32 = !{!"_ZTS6b2AABB", !16, i64 0, !16, i64 8}
!33 = !{!"_ZTS14b2IntHashTable", !6, i64 0, !14, i64 8}
!34 = !{!"bool", !7, i64 0}
!35 = !{!"_ZTS9b2Profile", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12, !17, i64 16}
!36 = !{!26, !6, i64 103256}
!37 = !{!12, !17, i64 88}
!38 = !{!12, !17, i64 72}
!39 = !{!12, !17, i64 68}
!40 = !{i64 0, i64 4, !41, i64 4, i64 4, !41}
!41 = !{!17, !17, i64 0}
!42 = !{!12, !13, i64 4}
!43 = !{!12, !17, i64 100}
!44 = !{!14, !14, i64 0}
!45 = !{!12, !14, i64 160}
!46 = !{!12, !6, i64 152}
!47 = distinct !{!47, !48}
!48 = !{!"llvm.loop.mustprogress"}


; 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"

@.str.1 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__._ZN6b2Body7SetTypeE10b2BodyType = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Vec27SetZeroEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6b2Body7SetTypeE10b2BodyType(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %1) local_unnamed_addr #2 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 104
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = tail call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %4)
  br i1 %5, label %6, label %7

6:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 131, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6b2Body7SetTypeE10b2BodyType) #6
  unreachable

7:                                                ; preds = %2
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = tail call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %8)
  br i1 %9, label %76, label %10

10:                                               ; preds = %7
  %11 = load i32, ptr %0, align 8, !tbaa !20
  %12 = icmp eq i32 %11, %1
  br i1 %12, label %76, label %13

13:                                               ; preds = %10
  %14 = icmp eq i32 %11, 0
  %15 = icmp eq i32 %1, 0
  %or.cond = or i1 %15, %14
  br i1 %or.cond, label %16, label %45

16:                                               ; preds = %13
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 103064
  tail call void @_ZN12b2BroadPhase22InvalidateStaticBodiesEv(ptr noundef nonnull align 8 dereferenceable(137) %18)
  %19 = getelementptr inbounds i8, ptr %0, i64 112
  %20 = load ptr, ptr %19, align 8, !tbaa !21
  %.not = icmp eq ptr %20, null
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 120
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !22
  br i1 %.not, label %._crit_edge19, label %21

21:                                               ; preds = %16
  %22 = getelementptr inbounds i8, ptr %20, i64 120
  store ptr %.pre, ptr %22, align 8, !tbaa !22
  br label %._crit_edge19

._crit_edge19:                                    ; preds = %16, %21
  %23 = getelementptr inbounds i8, ptr %0, i64 120
  %.not14 = icmp eq ptr %.pre, null
  br i1 %.not14, label %26, label %24

24:                                               ; preds = %._crit_edge19
  %25 = getelementptr inbounds i8, ptr %.pre, i64 112
  store ptr %20, ptr %25, align 8, !tbaa !21
  br label %26

26:                                               ; preds = %24, %._crit_edge19
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 103248
  %29 = load ptr, ptr %28, align 8, !tbaa !23
  %30 = icmp eq ptr %29, %0
  br i1 %30, label %31, label %32

31:                                               ; preds = %26
  store ptr %.pre, ptr %28, align 8, !tbaa !23
  br label %32

32:                                               ; preds = %31, %26
  %33 = phi ptr [ %.pre, %31 ], [ %29, %26 ]
  %34 = getelementptr inbounds i8, ptr %27, i64 103256
  %35 = load ptr, ptr %34, align 8, !tbaa !34
  %36 = icmp eq ptr %35, %0
  br i1 %36, label %37, label %39

37:                                               ; preds = %32
  %38 = load ptr, ptr %19, align 8, !tbaa !21
  store ptr %38, ptr %34, align 8, !tbaa !34
  br label %39

39:                                               ; preds = %37, %32
  %40 = phi ptr [ %38, %37 ], [ %35, %32 ]
  br i1 %15, label %41, label %43

41:                                               ; preds = %39
  store ptr %40, ptr %19, align 8, !tbaa !21
  store ptr null, ptr %23, align 8, !tbaa !22
  %.not16 = icmp eq ptr %40, null
  %42 = getelementptr inbounds i8, ptr %40, i64 120
  %.sink = select i1 %.not16, ptr %28, ptr %42
  br label %.sink.split

43:                                               ; preds = %39
  store ptr null, ptr %19, align 8, !tbaa !21
  store ptr %33, ptr %23, align 8, !tbaa !22
  %.not15 = icmp eq ptr %33, null
  %44 = getelementptr inbounds i8, ptr %33, i64 112
  %.sink20 = select i1 %.not15, ptr %34, ptr %44
  br label %.sink.split

.sink.split:                                      ; preds = %43, %41
  %.sink.sink = phi ptr [ %.sink, %41 ], [ %.sink20, %43 ]
  %.sink21 = phi ptr [ %34, %41 ], [ %28, %43 ]
  store ptr %0, ptr %.sink.sink, align 8, !tbaa !35
  store ptr %0, ptr %.sink21, align 8, !tbaa !35
  br label %45

45:                                               ; preds = %.sink.split, %13
  store i32 %1, ptr %0, align 8, !tbaa !20
  tail call void @_ZN6b2Body13ResetMassDataEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %46 = load i32, ptr %0, align 8, !tbaa !20
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %60

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %0, i64 80
  tail call void @_ZN6b2Vec27SetZeroEv(ptr noundef nonnull align 4 dereferenceable(8) %49)
  %50 = getelementptr inbounds i8, ptr %0, i64 88
  store float 0.000000e+00, ptr %50, align 8, !tbaa !36
  %51 = getelementptr inbounds i8, ptr %0, i64 72
  %52 = load float, ptr %51, align 8, !tbaa !37
  %53 = getelementptr inbounds i8, ptr %0, i64 68
  store float %52, ptr %53, align 4, !tbaa !38
  %54 = getelementptr inbounds i8, ptr %0, i64 60
  %55 = getelementptr inbounds i8, ptr %0, i64 52
  %56 = load i64, ptr %54, align 4
  store i64 %56, ptr %55, align 4
  %57 = getelementptr inbounds i8, ptr %0, i64 4
  %58 = load i16, ptr %57, align 4, !tbaa !39
  %59 = and i16 %58, -3
  store i16 %59, ptr %57, align 4, !tbaa !39
  tail call void @_ZN6b2Body11UpdateAABBsEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  br label %60

60:                                               ; preds = %48, %45
  tail call void @_ZN6b2Body8SetAwakeEb(ptr noundef nonnull align 8 dereferenceable(208) %0, i1 noundef zeroext true)
  %61 = getelementptr inbounds i8, ptr %0, i64 92
  tail call void @_ZN6b2Vec27SetZeroEv(ptr noundef nonnull align 4 dereferenceable(8) %61)
  %62 = getelementptr inbounds i8, ptr %0, i64 100
  store float 0.000000e+00, ptr %62, align 4, !tbaa !40
  %63 = getelementptr inbounds i8, ptr %0, i64 160
  %64 = load i32, ptr %63, align 8, !tbaa !41
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %60
  %66 = getelementptr inbounds i8, ptr %0, i64 152
  br label %67

._crit_edge:                                      ; preds = %67, %60
  store i32 0, ptr %63, align 8, !tbaa !41
  br label %76

67:                                               ; preds = %.lr.ph, %67
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %67 ]
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %68, i64 103064
  %70 = load ptr, ptr %66, align 8, !tbaa !42
  %71 = getelementptr inbounds ptr, ptr %70, i64 %indvars.iv
  %72 = load ptr, ptr %71, align 8, !tbaa !35
  tail call void @_ZN16b2ContactManager7DestroyEP9b2Contact(ptr noundef nonnull align 8 dereferenceable(184) %69, ptr noundef %72)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %73 = load i32, ptr %63, align 8, !tbaa !41
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv.next, %74
  br i1 %75, label %67, label %._crit_edge, !llvm.loop !43

76:                                               ; preds = %10, %7, %._crit_edge
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN12b2BroadPhase22InvalidateStaticBodiesEv(ptr noundef nonnull align 8 dereferenceable(137)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6b2Body13ResetMassDataEv(ptr noundef nonnull align 8 dereferenceable(208)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6b2Body11UpdateAABBsEv(ptr noundef nonnull align 8 dereferenceable(208)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6b2Body8SetAwakeEb(ptr noundef nonnull align 8 dereferenceable(208), i1 noundef zeroext) local_unnamed_addr #3 align 2

declare void @_ZN16b2ContactManager7DestroyEP9b2Contact(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef) local_unnamed_addr #5

attributes #0 = { noreturn nounwind "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 = { mustprogress 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 #2 = { mustprogress 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 = { inlinehint mustprogress 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 = { mustprogress uwtable "min-legal-vector-width"="64" "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 #5 = { "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 #6 = { noreturn 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, !17, i64 104}
!6 = !{!"_ZTS6b2Body", !7, i64 0, !10, i64 4, !11, i64 8, !12, i64 12, !12, i64 28, !16, i64 44, !13, i64 80, !14, i64 88, !13, i64 92, !14, i64 100, !17, i64 104, !17, i64 112, !17, i64 120, !17, i64 128, !11, i64 136, !17, i64 144, !17, i64 152, !11, i64 160, !11, i64 164, !14, i64 168, !14, i64 172, !14, i64 176, !14, i64 180, !14, i64 184, !14, i64 188, !14, i64 192, !14, i64 196, !18, i64 200}
!7 = !{!"_ZTS10b2BodyType", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_ZTS11b2Transform", !13, i64 0, !15, i64 8}
!13 = !{!"_ZTS6b2Vec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !8, i64 0}
!15 = !{!"_ZTS5b2Rot", !14, i64 0, !14, i64 4}
!16 = !{!"_ZTS7b2Sweep", !13, i64 0, !13, i64 8, !13, i64 16, !14, i64 24, !14, i64 28, !14, i64 32}
!17 = !{!"any pointer", !8, i64 0}
!18 = !{!"_ZTS14b2BodyUserData", !19, i64 0}
!19 = !{!"long", !8, i64 0}
!20 = !{!6, !7, i64 0}
!21 = !{!6, !17, i64 112}
!22 = !{!6, !17, i64 120}
!23 = !{!24, !17, i64 103248}
!24 = !{!"_ZTS7b2World", !25, i64 0, !26, i64 128, !27, i64 103064, !17, i64 103248, !17, i64 103256, !17, i64 103264, !17, i64 103272, !11, i64 103280, !11, i64 103284, !13, i64 103288, !32, i64 103296, !17, i64 103304, !17, i64 103312, !14, i64 103320, !32, i64 103324, !32, i64 103325, !32, i64 103326, !32, i64 103327, !32, i64 103328, !32, i64 103329, !32, i64 103330, !32, i64 103331, !33, i64 103332}
!25 = !{!"_ZTS16b2BlockAllocator", !17, i64 0, !11, i64 8, !11, i64 12, !8, i64 16}
!26 = !{!"_ZTS16b2StackAllocator", !8, i64 0, !11, i64 102400, !11, i64 102404, !11, i64 102408, !8, i64 102416, !11, i64 102928}
!27 = !{!"_ZTS16b2ContactManager", !28, i64 0, !11, i64 144, !17, i64 152, !17, i64 160, !17, i64 168, !17, i64 176}
!28 = !{!"_ZTS12b2BroadPhase", !17, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !29, i64 32, !17, i64 80, !17, i64 88, !17, i64 96, !11, i64 104, !11, i64 108, !31, i64 112, !11, i64 128, !11, i64 132, !32, i64 136}
!29 = !{!"_ZTS10b2TreeNode", !17, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !30, i64 32}
!30 = !{!"_ZTS6b2AABB", !13, i64 0, !13, i64 8}
!31 = !{!"_ZTS14b2IntHashTable", !17, i64 0, !11, i64 8}
!32 = !{!"bool", !8, i64 0}
!33 = !{!"_ZTS9b2Profile", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16}
!34 = !{!24, !17, i64 103256}
!35 = !{!17, !17, i64 0}
!36 = !{!6, !14, i64 88}
!37 = !{!6, !14, i64 72}
!38 = !{!6, !14, i64 68}
!39 = !{!6, !10, i64 4}
!40 = !{!6, !14, i64 100}
!41 = !{!6, !11, i64 160}
!42 = !{!6, !17, i64 152}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass