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

; 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.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.b2Vec2 = type { float, float }
%struct.b2Profile = type { float, float, float, float, float }
%class.b2Joint = type { ptr, i32, ptr, ptr, %struct.b2JointEdge, %struct.b2JointEdge, ptr, ptr, i32, i8, i8, %struct.b2JointUserData }
%struct.b2JointEdge = type { ptr, ptr, ptr, ptr }
%struct.b2JointUserData = type { i64 }
%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.b2BodyUserData = type { i64 }
%struct.b2JointDef = type <{ i32, [4 x i8], %struct.b2JointUserData, ptr, ptr, i8, [7 x i8] }>

@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [83 x i8], align 1
@__PRETTY_FUNCTION__._ZN7b2World11CreateJointEPK10b2JointDef = external hidden unnamed_addr constant [50 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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6b2Body15GetContactCountEv(ptr noundef nonnull align 8 dereferenceable(208)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6b2Body10GetContactEi(ptr noundef nonnull align 8 dereferenceable(208), i32 noundef) #1 align 2

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

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

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

15:                                               ; preds = %2
  br label %18

16:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 270, ptr noundef @__PRETTY_FUNCTION__._ZN7b2World11CreateJointEPK10b2JointDef) #5
  unreachable

17:                                               ; No predecessors!
  br label %18

18:                                               ; preds = %17, %15
  %19 = call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %11)
  br i1 %19, label %20, label %21

20:                                               ; preds = %18
  store ptr null, ptr %3, align 8
  br label %174

21:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %class.b2World, ptr %11, i32 0, i32 0
  %24 = call noundef ptr @_ZN7b2Joint6CreateEPK10b2JointDefP16b2BlockAllocator(ptr noundef %22, ptr noundef %23)
  store ptr %24, ptr %6, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %class.b2Joint, ptr %25, i32 0, i32 2
  store ptr null, ptr %26, align 8, !tbaa !9
  %27 = getelementptr inbounds %class.b2World, ptr %11, i32 0, i32 5
  %28 = load ptr, ptr %27, align 8, !tbaa !17
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.b2Joint, ptr %29, i32 0, i32 3
  store ptr %28, ptr %30, align 8, !tbaa !29
  %31 = getelementptr inbounds %class.b2World, ptr %11, i32 0, i32 5
  %32 = load ptr, ptr %31, align 8, !tbaa !17
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %39

34:                                               ; preds = %21
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %class.b2World, ptr %11, i32 0, i32 5
  %37 = load ptr, ptr %36, align 8, !tbaa !17
  %38 = getelementptr inbounds %class.b2Joint, ptr %37, i32 0, i32 2
  store ptr %35, ptr %38, align 8, !tbaa !9
  br label %39

39:                                               ; preds = %34, %21
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %class.b2World, ptr %11, i32 0, i32 5
  store ptr %40, ptr %41, align 8, !tbaa !17
  %42 = getelementptr inbounds %class.b2World, ptr %11, i32 0, i32 8
  %43 = load i32, ptr %42, align 4, !tbaa !30
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %42, align 4, !tbaa !30
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %class.b2Joint, ptr %46, i32 0, i32 4
  %48 = getelementptr inbounds %struct.b2JointEdge, ptr %47, i32 0, i32 1
  store ptr %45, ptr %48, align 8, !tbaa !31
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %class.b2Joint, ptr %49, i32 0, i32 7
  %51 = load ptr, ptr %50, align 8, !tbaa !32
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds %class.b2Joint, ptr %52, i32 0, i32 4
  %54 = getelementptr inbounds %struct.b2JointEdge, ptr %53, i32 0, i32 0
  store ptr %51, ptr %54, align 8, !tbaa !33
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %class.b2Joint, ptr %55, i32 0, i32 4
  %57 = getelementptr inbounds %struct.b2JointEdge, ptr %56, i32 0, i32 2
  store ptr null, ptr %57, align 8, !tbaa !34
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %class.b2Joint, ptr %58, i32 0, i32 6
  %60 = load ptr, ptr %59, align 8, !tbaa !35
  %61 = getelementptr inbounds %class.b2Body, ptr %60, i32 0, i32 15
  %62 = load ptr, ptr %61, align 8, !tbaa !36
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = getelementptr inbounds %class.b2Joint, ptr %63, i32 0, i32 4
  %65 = getelementptr inbounds %struct.b2JointEdge, ptr %64, i32 0, i32 3
  store ptr %62, ptr %65, align 8, !tbaa !44
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds %class.b2Joint, ptr %66, i32 0, i32 6
  %68 = load ptr, ptr %67, align 8, !tbaa !35
  %69 = getelementptr inbounds %class.b2Body, ptr %68, i32 0, i32 15
  %70 = load ptr, ptr %69, align 8, !tbaa !36
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %81

72:                                               ; preds = %39
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %class.b2Joint, ptr %73, i32 0, i32 4
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %class.b2Joint, ptr %75, i32 0, i32 6
  %77 = load ptr, ptr %76, align 8, !tbaa !35
  %78 = getelementptr inbounds %class.b2Body, ptr %77, i32 0, i32 15
  %79 = load ptr, ptr %78, align 8, !tbaa !36
  %80 = getelementptr inbounds %struct.b2JointEdge, ptr %79, i32 0, i32 2
  store ptr %74, ptr %80, align 8, !tbaa !45
  br label %81

81:                                               ; preds = %72, %39
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %class.b2Joint, ptr %82, i32 0, i32 4
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds %class.b2Joint, ptr %84, i32 0, i32 6
  %86 = load ptr, ptr %85, align 8, !tbaa !35
  %87 = getelementptr inbounds %class.b2Body, ptr %86, i32 0, i32 15
  store ptr %83, ptr %87, align 8, !tbaa !36
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds %class.b2Joint, ptr %89, i32 0, i32 5
  %91 = getelementptr inbounds %struct.b2JointEdge, ptr %90, i32 0, i32 1
  store ptr %88, ptr %91, align 8, !tbaa !46
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = getelementptr inbounds %class.b2Joint, ptr %92, i32 0, i32 6
  %94 = load ptr, ptr %93, align 8, !tbaa !35
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %class.b2Joint, ptr %95, i32 0, i32 5
  %97 = getelementptr inbounds %struct.b2JointEdge, ptr %96, i32 0, i32 0
  store ptr %94, ptr %97, align 8, !tbaa !47
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = getelementptr inbounds %class.b2Joint, ptr %98, i32 0, i32 5
  %100 = getelementptr inbounds %struct.b2JointEdge, ptr %99, i32 0, i32 2
  store ptr null, ptr %100, align 8, !tbaa !48
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = getelementptr inbounds %class.b2Joint, ptr %101, i32 0, i32 7
  %103 = load ptr, ptr %102, align 8, !tbaa !32
  %104 = getelementptr inbounds %class.b2Body, ptr %103, i32 0, i32 15
  %105 = load ptr, ptr %104, align 8, !tbaa !36
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %class.b2Joint, ptr %106, i32 0, i32 5
  %108 = getelementptr inbounds %struct.b2JointEdge, ptr %107, i32 0, i32 3
  store ptr %105, ptr %108, align 8, !tbaa !49
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = getelementptr inbounds %class.b2Joint, ptr %109, i32 0, i32 7
  %111 = load ptr, ptr %110, align 8, !tbaa !32
  %112 = getelementptr inbounds %class.b2Body, ptr %111, i32 0, i32 15
  %113 = load ptr, ptr %112, align 8, !tbaa !36
  %114 = icmp ne ptr %113, null
  br i1 %114, label %115, label %124

115:                                              ; preds = %81
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = getelementptr inbounds %class.b2Joint, ptr %116, i32 0, i32 5
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = getelementptr inbounds %class.b2Joint, ptr %118, i32 0, i32 7
  %120 = load ptr, ptr %119, align 8, !tbaa !32
  %121 = getelementptr inbounds %class.b2Body, ptr %120, i32 0, i32 15
  %122 = load ptr, ptr %121, align 8, !tbaa !36
  %123 = getelementptr inbounds %struct.b2JointEdge, ptr %122, i32 0, i32 2
  store ptr %117, ptr %123, align 8, !tbaa !45
  br label %124

124:                                              ; preds = %115, %81
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %class.b2Joint, ptr %125, i32 0, i32 5
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = getelementptr inbounds %class.b2Joint, ptr %127, i32 0, i32 7
  %129 = load ptr, ptr %128, align 8, !tbaa !32
  %130 = getelementptr inbounds %class.b2Body, ptr %129, i32 0, i32 15
  store ptr %126, ptr %130, align 8, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.b2JointDef, ptr %131, i32 0, i32 3
  %133 = load ptr, ptr %132, align 8, !tbaa !50
  store ptr %133, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.b2JointDef, ptr %134, i32 0, i32 4
  %136 = load ptr, ptr %135, align 8, !tbaa !52
  store ptr %136, ptr %8, align 8, !tbaa !5
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.b2JointDef, ptr %137, i32 0, i32 5
  %139 = load i8, ptr %138, align 8, !tbaa !53, !range !54, !noundef !55
  %140 = trunc i8 %139 to i1
  %141 = zext i1 %140 to i32
  %142 = icmp eq i32 %141, 0
  br i1 %142, label %143, label %172

143:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !56
  br label %144

144:                                              ; preds = %168, %143
  %145 = load i32, ptr %9, align 4, !tbaa !56
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = call noundef i32 @_ZN6b2Body15GetContactCountEv(ptr noundef nonnull align 8 dereferenceable(208) %146)
  %148 = icmp slt i32 %145, %147
  br i1 %148, label %150, label %149

149:                                              ; preds = %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %171

150:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = load i32, ptr %9, align 4, !tbaa !56
  %153 = call noundef ptr @_ZN6b2Body10GetContactEi(ptr noundef nonnull align 8 dereferenceable(208) %151, i32 noundef %152)
  store ptr %153, ptr %10, align 8, !tbaa !5
  %154 = load ptr, ptr %10, align 8, !tbaa !5
  %155 = call noundef ptr @_ZN9b2Contact11GetFixtureAEv(ptr noundef nonnull align 8 dereferenceable(128) %154)
  %156 = call noundef ptr @_ZN9b2Fixture7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(84) %155)
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = icmp eq ptr %156, %157
  br i1 %158, label %165, label %159

159:                                              ; preds = %150
  %160 = load ptr, ptr %10, align 8, !tbaa !5
  %161 = call noundef ptr @_ZN9b2Contact11GetFixtureBEv(ptr noundef nonnull align 8 dereferenceable(128) %160)
  %162 = call noundef ptr @_ZN9b2Fixture7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(84) %161)
  %163 = load ptr, ptr %7, align 8, !tbaa !5
  %164 = icmp eq ptr %162, %163
  br i1 %164, label %165, label %167

165:                                              ; preds = %159, %150
  %166 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN9b2Contact16FlagForFilteringEv(ptr noundef nonnull align 8 dereferenceable(128) %166)
  br label %167

167:                                              ; preds = %165, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %9, align 4, !tbaa !56
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %9, align 4, !tbaa !56
  br label %144, !llvm.loop !57

171:                                              ; preds = %149
  br label %172

172:                                              ; preds = %171, %124
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %173, ptr %3, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %174

174:                                              ; preds = %172, %20
  %175 = load ptr, ptr %3, align 8
  ret ptr %175
}

declare noundef ptr @_ZN7b2Joint6CreateEPK10b2JointDefP16b2BlockAllocator(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9b2Contact11GetFixtureAEv(ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9b2Fixture7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(84)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9b2Contact11GetFixtureBEv(ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN9b2Contact16FlagForFilteringEv(ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { "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 = { noreturn nounwind }
attributes #6 = { 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, !6, i64 16}
!10 = !{!"_ZTS7b2Joint", !11, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !12, i64 64, !6, i64 96, !6, i64 104, !13, i64 112, !14, i64 116, !14, i64 117, !15, i64 120}
!11 = !{!"_ZTS11b2JointType", !7, i64 0}
!12 = !{!"_ZTS11b2JointEdge", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!13 = !{!"int", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"_ZTS15b2JointUserData", !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!18, !6, i64 103264}
!18 = !{!"_ZTS7b2World", !19, i64 0, !20, i64 128, !21, i64 103064, !6, i64 103248, !6, i64 103256, !6, i64 103264, !6, i64 103272, !13, i64 103280, !13, i64 103284, !25, i64 103288, !14, i64 103296, !6, i64 103304, !6, i64 103312, !26, i64 103320, !14, i64 103324, !14, i64 103325, !14, i64 103326, !14, i64 103327, !14, i64 103328, !14, i64 103329, !14, i64 103330, !14, i64 103331, !28, i64 103332}
!19 = !{!"_ZTS16b2BlockAllocator", !6, i64 0, !13, i64 8, !13, i64 12, !7, i64 16}
!20 = !{!"_ZTS16b2StackAllocator", !7, i64 0, !13, i64 102400, !13, i64 102404, !13, i64 102408, !7, i64 102416, !13, i64 102928}
!21 = !{!"_ZTS16b2ContactManager", !22, i64 0, !13, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!22 = !{!"_ZTS12b2BroadPhase", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !23, i64 32, !6, i64 80, !6, i64 88, !6, i64 96, !13, i64 104, !13, i64 108, !27, i64 112, !13, i64 128, !13, i64 132, !14, i64 136}
!23 = !{!"_ZTS10b2TreeNode", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !24, i64 32}
!24 = !{!"_ZTS6b2AABB", !25, i64 0, !25, i64 8}
!25 = !{!"_ZTS6b2Vec2", !26, i64 0, !26, i64 4}
!26 = !{!"float", !7, i64 0}
!27 = !{!"_ZTS14b2IntHashTable", !6, i64 0, !13, i64 8}
!28 = !{!"_ZTS9b2Profile", !26, i64 0, !26, i64 4, !26, i64 8, !26, i64 12, !26, i64 16}
!29 = !{!10, !6, i64 24}
!30 = !{!18, !13, i64 103284}
!31 = !{!10, !6, i64 40}
!32 = !{!10, !6, i64 104}
!33 = !{!10, !6, i64 32}
!34 = !{!10, !6, i64 48}
!35 = !{!10, !6, i64 96}
!36 = !{!37, !6, i64 144}
!37 = !{!"_ZTS6b2Body", !38, i64 0, !39, i64 4, !13, i64 8, !40, i64 12, !40, i64 28, !42, i64 44, !25, i64 80, !26, i64 88, !25, i64 92, !26, i64 100, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !13, i64 136, !6, i64 144, !6, i64 152, !13, i64 160, !13, i64 164, !26, i64 168, !26, i64 172, !26, i64 176, !26, i64 180, !26, i64 184, !26, i64 188, !26, i64 192, !26, i64 196, !43, i64 200}
!38 = !{!"_ZTS10b2BodyType", !7, i64 0}
!39 = !{!"short", !7, i64 0}
!40 = !{!"_ZTS11b2Transform", !25, i64 0, !41, i64 8}
!41 = !{!"_ZTS5b2Rot", !26, i64 0, !26, i64 4}
!42 = !{!"_ZTS7b2Sweep", !25, i64 0, !25, i64 8, !25, i64 16, !26, i64 24, !26, i64 28, !26, i64 32}
!43 = !{!"_ZTS14b2BodyUserData", !16, i64 0}
!44 = !{!10, !6, i64 56}
!45 = !{!12, !6, i64 16}
!46 = !{!10, !6, i64 72}
!47 = !{!10, !6, i64 64}
!48 = !{!10, !6, i64 80}
!49 = !{!10, !6, i64 88}
!50 = !{!51, !6, i64 16}
!51 = !{!"_ZTS10b2JointDef", !11, i64 0, !15, i64 8, !6, i64 16, !6, i64 24, !14, i64 32}
!52 = !{!51, !6, i64 24}
!53 = !{!51, !14, i64 32}
!54 = !{i8 0, i8 2}
!55 = !{}
!56 = !{!13, !13, i64 0}
!57 = distinct !{!57, !58}
!58 = !{!"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 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [83 x i8], align 1
@__PRETTY_FUNCTION__._ZN7b2World11CreateJointEPK10b2JointDef = external hidden unnamed_addr constant [50 x i8], align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6b2Body15GetContactCountEv(ptr noundef nonnull align 8 dereferenceable(208)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6b2Body10GetContactEi(ptr noundef nonnull align 8 dereferenceable(208), i32 noundef) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN7b2World11CreateJointEPK10b2JointDef(ptr noundef nonnull align 8 dereferenceable(103352) %0, ptr noundef %1) local_unnamed_addr #2 align 2 {
  %3 = tail call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %0)
  br i1 %3, label %4, label %5

4:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 270, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7b2World11CreateJointEPK10b2JointDef) #4
  unreachable

5:                                                ; preds = %2
  %6 = tail call noundef zeroext i1 @_ZNK7b2World8IsLockedEv(ptr noundef nonnull align 8 dereferenceable(103352) %0)
  br i1 %6, label %.loopexit, label %7

7:                                                ; preds = %5
  %8 = tail call noundef ptr @_ZN7b2Joint6CreateEPK10b2JointDefP16b2BlockAllocator(ptr noundef %1, ptr noundef nonnull %0)
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  store ptr null, ptr %9, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 103264
  %11 = load ptr, ptr %10, align 8, !tbaa !16
  %12 = getelementptr inbounds i8, ptr %8, i64 24
  store ptr %11, ptr %12, align 8, !tbaa !28
  %.not = icmp eq ptr %11, null
  br i1 %.not, label %15, label %13

13:                                               ; preds = %7
  %14 = getelementptr inbounds i8, ptr %11, i64 16
  store ptr %8, ptr %14, align 8, !tbaa !5
  br label %15

15:                                               ; preds = %13, %7
  store ptr %8, ptr %10, align 8, !tbaa !16
  %16 = getelementptr inbounds i8, ptr %0, i64 103284
  %17 = load i32, ptr %16, align 4, !tbaa !29
  %18 = add nsw i32 %17, 1
  store i32 %18, ptr %16, align 4, !tbaa !29
  %19 = getelementptr inbounds i8, ptr %8, i64 32
  %20 = getelementptr inbounds i8, ptr %8, i64 40
  store ptr %8, ptr %20, align 8, !tbaa !30
  %21 = getelementptr inbounds i8, ptr %8, i64 104
  %22 = load ptr, ptr %21, align 8, !tbaa !31
  store ptr %22, ptr %19, align 8, !tbaa !32
  %23 = getelementptr inbounds i8, ptr %8, i64 48
  store ptr null, ptr %23, align 8, !tbaa !33
  %24 = getelementptr inbounds i8, ptr %8, i64 96
  %25 = load ptr, ptr %24, align 8, !tbaa !34
  %26 = getelementptr inbounds i8, ptr %25, i64 144
  %27 = load ptr, ptr %26, align 8, !tbaa !35
  %28 = getelementptr inbounds i8, ptr %8, i64 56
  store ptr %27, ptr %28, align 8, !tbaa !43
  %.not49 = icmp eq ptr %27, null
  br i1 %.not49, label %31, label %29

29:                                               ; preds = %15
  %30 = getelementptr inbounds i8, ptr %27, i64 16
  store ptr %19, ptr %30, align 8, !tbaa !44
  br label %31

31:                                               ; preds = %29, %15
  store ptr %19, ptr %26, align 8, !tbaa !35
  %32 = getelementptr inbounds i8, ptr %8, i64 64
  %33 = getelementptr inbounds i8, ptr %8, i64 72
  store ptr %8, ptr %33, align 8, !tbaa !45
  store ptr %25, ptr %32, align 8, !tbaa !46
  %34 = getelementptr inbounds i8, ptr %8, i64 80
  store ptr null, ptr %34, align 8, !tbaa !47
  %35 = getelementptr inbounds i8, ptr %22, i64 144
  %36 = load ptr, ptr %35, align 8, !tbaa !35
  %37 = getelementptr inbounds i8, ptr %8, i64 88
  store ptr %36, ptr %37, align 8, !tbaa !48
  %.not50 = icmp eq ptr %36, null
  br i1 %.not50, label %40, label %38

38:                                               ; preds = %31
  %39 = getelementptr inbounds i8, ptr %36, i64 16
  store ptr %32, ptr %39, align 8, !tbaa !44
  br label %40

40:                                               ; preds = %38, %31
  store ptr %32, ptr %35, align 8, !tbaa !35
  %41 = getelementptr inbounds i8, ptr %1, i64 16
  %42 = load ptr, ptr %41, align 8, !tbaa !49
  %43 = getelementptr inbounds i8, ptr %1, i64 24
  %44 = load ptr, ptr %43, align 8, !tbaa !51
  %45 = getelementptr inbounds i8, ptr %1, i64 32
  %46 = load i8, ptr %45, align 8, !tbaa !52, !range !53, !noundef !54
  %47 = icmp eq i8 %46, 0
  br i1 %47, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %40
  %48 = tail call noundef i32 @_ZN6b2Body15GetContactCountEv(ptr noundef nonnull align 8 dereferenceable(208) %44)
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader, %59
  %.04451 = phi i32 [ %60, %59 ], [ 0, %.preheader ]
  %50 = tail call noundef ptr @_ZN6b2Body10GetContactEi(ptr noundef nonnull align 8 dereferenceable(208) %44, i32 noundef %.04451)
  %51 = tail call noundef ptr @_ZN9b2Contact11GetFixtureAEv(ptr noundef nonnull align 8 dereferenceable(128) %50)
  %52 = tail call noundef ptr @_ZN9b2Fixture7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(84) %51)
  %53 = icmp eq ptr %52, %42
  br i1 %53, label %58, label %54

54:                                               ; preds = %.lr.ph
  %55 = tail call noundef ptr @_ZN9b2Contact11GetFixtureBEv(ptr noundef nonnull align 8 dereferenceable(128) %50)
  %56 = tail call noundef ptr @_ZN9b2Fixture7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(84) %55)
  %57 = icmp eq ptr %56, %42
  br i1 %57, label %58, label %59

58:                                               ; preds = %54, %.lr.ph
  tail call void @_ZN9b2Contact16FlagForFilteringEv(ptr noundef nonnull align 8 dereferenceable(128) %50)
  br label %59

59:                                               ; preds = %58, %54
  %60 = add nuw nsw i32 %.04451, 1
  %61 = tail call noundef i32 @_ZN6b2Body15GetContactCountEv(ptr noundef nonnull align 8 dereferenceable(208) %44)
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %.lr.ph, label %.loopexit, !llvm.loop !55

.loopexit:                                        ; preds = %59, %.preheader, %40, %5
  %.0 = phi ptr [ null, %5 ], [ %8, %40 ], [ %8, %.preheader ], [ %8, %59 ]
  ret ptr %.0
}

declare noundef ptr @_ZN7b2Joint6CreateEPK10b2JointDefP16b2BlockAllocator(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9b2Contact11GetFixtureAEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9b2Fixture7GetBodyEv(ptr noundef nonnull align 8 dereferenceable(84)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN9b2Contact11GetFixtureBEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN9b2Contact16FlagForFilteringEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #0 align 2

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


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