; LLVM IR from erincatto/box2d :: shared (benchmarks)

; 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.b2Circle = type { %struct.b2Vec2, float }
%struct.b2Vec2 = type { float, float }
%struct.b2WorldId = type { i16, i16 }
%struct.b2ShapeDef = type { ptr, %struct.b2SurfaceMaterial, float, %struct.b2Filter, i8, i8, i8, i8, i8, i8, i8, i32 }
%struct.b2SurfaceMaterial = type { float, float, float, float, i32, i32 }
%struct.b2Filter = type { i64, i64, i32 }
%struct.b2RevoluteJointDef = type { %struct.b2BodyId, %struct.b2BodyId, %struct.b2Vec2, %struct.b2Vec2, float, i8, float, float, i8, float, float, i8, float, float, float, i8, ptr, i32 }
%struct.b2BodyId = type { i32, i16, i16 }
%struct.b2BodyDef = type { i32, %struct.b2Vec2, %struct.b2Rot, %struct.b2Vec2, float, float, float, float, float, ptr, ptr, i8, i8, i8, i8, i8, i8, i32 }
%struct.b2Rot = type { float, float }
%struct.b2ShapeId = type { i32, i16, i16 }
%struct.b2JointId = type { i32, i16, i16 }

@__const.CreateJointGrid.circle = external hidden unnamed_addr constant %struct.b2Circle, align 4

; Function Attrs: nounwind uwtable
define dso_local void @CreateJointGrid(i32 %0) #0 {
  %2 = alloca %struct.b2WorldId, align 2
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %struct.b2ShapeDef, align 8
  %7 = alloca %struct.b2Circle, align 4
  %8 = alloca %struct.b2RevoluteJointDef, align 8
  %9 = alloca %struct.b2BodyDef, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca %struct.b2Vec2, align 4
  %16 = alloca %struct.b2BodyId, align 4
  %17 = alloca %struct.b2ShapeId, align 4
  %18 = alloca %struct.b2Vec2, align 4
  %19 = alloca %struct.b2Vec2, align 4
  %20 = alloca %struct.b2JointId, align 4
  %21 = alloca %struct.b2Vec2, align 4
  %22 = alloca %struct.b2Vec2, align 4
  %23 = alloca %struct.b2JointId, align 4
  store i32 %0, ptr %2, align 2
  %24 = load i32, ptr %2, align 2
  call void @b2World_EnableSleeping(i32 %24, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 10, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = mul nsw i32 %25, %26
  %28 = sext i32 %27 to i64
  %29 = mul i64 %28, 8
  %30 = call noalias ptr @malloc(i64 noundef %29) #7
  store ptr %30, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %6) #6
  call void @b2DefaultShapeDef(ptr dead_on_unwind writable sret(%struct.b2ShapeDef) align 8 %6)
  %31 = getelementptr inbounds %struct.b2ShapeDef, ptr %6, i32 0, i32 2
  store float 1.000000e+00, ptr %31, align 8, !tbaa !11
  %32 = getelementptr inbounds %struct.b2ShapeDef, ptr %6, i32 0, i32 3
  %33 = getelementptr inbounds %struct.b2Filter, ptr %32, i32 0, i32 0
  store i64 2, ptr %33, align 8, !tbaa !18
  %34 = getelementptr inbounds %struct.b2ShapeDef, ptr %6, i32 0, i32 3
  %35 = getelementptr inbounds %struct.b2Filter, ptr %34, i32 0, i32 1
  store i64 4294967293, ptr %35, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 @__const.CreateJointGrid.circle, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 96, ptr %8) #6
  call void @b2DefaultRevoluteJointDef(ptr dead_on_unwind writable sret(%struct.b2RevoluteJointDef) align 8 %8)
  call void @llvm.lifetime.start.p0(i64 80, ptr %9) #6
  call void @b2DefaultBodyDef(ptr dead_on_unwind writable sret(%struct.b2BodyDef) align 8 %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %129, %1
  %37 = load i32, ptr %10, align 4, !tbaa !5
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %132

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %125, %41
  %43 = load i32, ptr %12, align 4, !tbaa !5
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %128

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %48 = load i32, ptr %10, align 4, !tbaa !5
  %49 = sitofp i32 %48 to float
  store float %49, ptr %13, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %50 = load i32, ptr %12, align 4, !tbaa !5
  %51 = sitofp i32 %50 to float
  store float %51, ptr %14, align 4, !tbaa !20
  %52 = load i32, ptr %10, align 4, !tbaa !5
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sdiv i32 %53, 2
  %55 = sub nsw i32 %54, 3
  %56 = icmp sge i32 %52, %55
  br i1 %56, label %57, label %68

57:                                               ; preds = %47
  %58 = load i32, ptr %10, align 4, !tbaa !5
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = sdiv i32 %59, 2
  %61 = add nsw i32 %60, 3
  %62 = icmp sle i32 %58, %61
  br i1 %62, label %63, label %68

63:                                               ; preds = %57
  %64 = load i32, ptr %12, align 4, !tbaa !5
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %66, label %68

66:                                               ; preds = %63
  %67 = getelementptr inbounds %struct.b2BodyDef, ptr %9, i32 0, i32 0
  store i32 0, ptr %67, align 8, !tbaa !21
  br label %70

68:                                               ; preds = %63, %57, %47
  %69 = getelementptr inbounds %struct.b2BodyDef, ptr %9, i32 0, i32 0
  store i32 2, ptr %69, align 8, !tbaa !21
  br label %70

70:                                               ; preds = %68, %66
  %71 = getelementptr inbounds %struct.b2BodyDef, ptr %9, i32 0, i32 1
  %72 = getelementptr inbounds %struct.b2Vec2, ptr %15, i32 0, i32 0
  %73 = load float, ptr %13, align 4, !tbaa !20
  store float %73, ptr %72, align 4, !tbaa !25
  %74 = getelementptr inbounds %struct.b2Vec2, ptr %15, i32 0, i32 1
  %75 = load float, ptr %14, align 4, !tbaa !20
  %76 = fneg float %75
  store float %76, ptr %74, align 4, !tbaa !26
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %71, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %77 = load i32, ptr %2, align 2
  %78 = call i64 @b2CreateBody(i32 %77, ptr noundef %9)
  store i64 %78, ptr %16, align 4
  %79 = load i64, ptr %16, align 4
  %80 = call i64 @b2CreateCircleShape(i64 %79, ptr noundef %6, ptr noundef %7)
  store i64 %80, ptr %17, align 4
  %81 = load i32, ptr %12, align 4, !tbaa !5
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %83, label %99

83:                                               ; preds = %70
  %84 = getelementptr inbounds %struct.b2RevoluteJointDef, ptr %8, i32 0, i32 0
  %85 = load ptr, ptr %4, align 8, !tbaa !9
  %86 = load i32, ptr %5, align 4, !tbaa !5
  %87 = sub nsw i32 %86, 1
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds %struct.b2BodyId, ptr %85, i64 %88
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %84, ptr align 4 %89, i64 8, i1 false), !tbaa.struct !28
  %90 = getelementptr inbounds %struct.b2RevoluteJointDef, ptr %8, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %90, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !28
  %91 = getelementptr inbounds %struct.b2RevoluteJointDef, ptr %8, i32 0, i32 2
  %92 = getelementptr inbounds %struct.b2Vec2, ptr %18, i32 0, i32 0
  store float 0.000000e+00, ptr %92, align 4, !tbaa !25
  %93 = getelementptr inbounds %struct.b2Vec2, ptr %18, i32 0, i32 1
  store float -5.000000e-01, ptr %93, align 4, !tbaa !26
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %91, ptr align 4 %18, i64 8, i1 false), !tbaa.struct !27
  %94 = getelementptr inbounds %struct.b2RevoluteJointDef, ptr %8, i32 0, i32 3
  %95 = getelementptr inbounds %struct.b2Vec2, ptr %19, i32 0, i32 0
  store float 0.000000e+00, ptr %95, align 4, !tbaa !25
  %96 = getelementptr inbounds %struct.b2Vec2, ptr %19, i32 0, i32 1
  store float 5.000000e-01, ptr %96, align 4, !tbaa !26
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %94, ptr align 4 %19, i64 8, i1 false), !tbaa.struct !27
  %97 = load i32, ptr %2, align 2
  %98 = call i64 @b2CreateRevoluteJoint(i32 %97, ptr noundef %8)
  store i64 %98, ptr %20, align 4
  br label %99

99:                                               ; preds = %83, %70
  %100 = load i32, ptr %10, align 4, !tbaa !5
  %101 = icmp sgt i32 %100, 0
  br i1 %101, label %102, label %119

102:                                              ; preds = %99
  %103 = getelementptr inbounds %struct.b2RevoluteJointDef, ptr %8, i32 0, i32 0
  %104 = load ptr, ptr %4, align 8, !tbaa !9
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = sub nsw i32 %105, %106
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds %struct.b2BodyId, ptr %104, i64 %108
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %103, ptr align 4 %109, i64 8, i1 false), !tbaa.struct !28
  %110 = getelementptr inbounds %struct.b2RevoluteJointDef, ptr %8, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %110, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !28
  %111 = getelementptr inbounds %struct.b2RevoluteJointDef, ptr %8, i32 0, i32 2
  %112 = getelementptr inbounds %struct.b2Vec2, ptr %21, i32 0, i32 0
  store float 5.000000e-01, ptr %112, align 4, !tbaa !25
  %113 = getelementptr inbounds %struct.b2Vec2, ptr %21, i32 0, i32 1
  store float 0.000000e+00, ptr %113, align 4, !tbaa !26
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %111, ptr align 4 %21, i64 8, i1 false), !tbaa.struct !27
  %114 = getelementptr inbounds %struct.b2RevoluteJointDef, ptr %8, i32 0, i32 3
  %115 = getelementptr inbounds %struct.b2Vec2, ptr %22, i32 0, i32 0
  store float -5.000000e-01, ptr %115, align 4, !tbaa !25
  %116 = getelementptr inbounds %struct.b2Vec2, ptr %22, i32 0, i32 1
  store float 0.000000e+00, ptr %116, align 4, !tbaa !26
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %114, ptr align 4 %22, i64 8, i1 false), !tbaa.struct !27
  %117 = load i32, ptr %2, align 2
  %118 = call i64 @b2CreateRevoluteJoint(i32 %117, ptr noundef %8)
  store i64 %118, ptr %23, align 4
  br label %119

119:                                              ; preds = %102, %99
  %120 = load ptr, ptr %4, align 8, !tbaa !9
  %121 = load i32, ptr %5, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %5, align 4, !tbaa !5
  %123 = sext i32 %121 to i64
  %124 = getelementptr inbounds %struct.b2BodyId, ptr %120, i64 %123
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %124, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !28
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %125

125:                                              ; preds = %119
  %126 = load i32, ptr %12, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %12, align 4, !tbaa !5
  br label %42, !llvm.loop !31

128:                                              ; preds = %46
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %10, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %10, align 4, !tbaa !5
  br label %36, !llvm.loop !33

132:                                              ; preds = %40
  %133 = load ptr, ptr %4, align 8, !tbaa !9
  call void @free(ptr noundef %133) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret void
}

declare void @b2World_EnableSleeping(i32, i1 noundef zeroext) #1

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

declare void @b2DefaultShapeDef(ptr dead_on_unwind writable sret(%struct.b2ShapeDef) align 8) #1

; 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) #4

declare void @b2DefaultRevoluteJointDef(ptr dead_on_unwind writable sret(%struct.b2RevoluteJointDef) align 8) #1

declare void @b2DefaultBodyDef(ptr dead_on_unwind writable sret(%struct.b2BodyDef) align 8) #1

declare i64 @b2CreateBody(i32, ptr noundef) #1

declare i64 @b2CreateCircleShape(i64, ptr noundef, ptr noundef) #1

declare i64 @b2CreateRevoluteJoint(i32, ptr noundef) #1

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

attributes #0 = { 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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind allocsize(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 nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !14, i64 32}
!12 = !{!"b2ShapeDef", !10, i64 0, !13, i64 8, !14, i64 32, !15, i64 40, !17, i64 64, !17, i64 65, !17, i64 66, !17, i64 67, !17, i64 68, !17, i64 69, !17, i64 70, !6, i64 72}
!13 = !{!"b2SurfaceMaterial", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !6, i64 16, !6, i64 20}
!14 = !{!"float", !7, i64 0}
!15 = !{!"b2Filter", !16, i64 0, !16, i64 8, !6, i64 16}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{!12, !16, i64 40}
!19 = !{!12, !16, i64 48}
!20 = !{!14, !14, i64 0}
!21 = !{!22, !6, i64 0}
!22 = !{!"b2BodyDef", !6, i64 0, !23, i64 4, !24, i64 12, !23, i64 20, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !10, i64 48, !10, i64 56, !17, i64 64, !17, i64 65, !17, i64 66, !17, i64 67, !17, i64 68, !17, i64 69, !6, i64 72}
!23 = !{!"b2Vec2", !14, i64 0, !14, i64 4}
!24 = !{!"b2Rot", !14, i64 0, !14, i64 4}
!25 = !{!23, !14, i64 0}
!26 = !{!23, !14, i64 4}
!27 = !{i64 0, i64 4, !20, i64 4, i64 4, !20}
!28 = !{i64 0, i64 4, !5, i64 4, i64 2, !29, i64 6, i64 2, !29}
!29 = !{!30, !30, i64 0}
!30 = !{!"short", !7, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = distinct !{!33, !32}


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

%struct.b2Circle = type { %struct.b2Vec2, float }
%struct.b2Vec2 = type { float, float }
%struct.b2ShapeDef = type { ptr, %struct.b2SurfaceMaterial, float, %struct.b2Filter, i8, i8, i8, i8, i8, i8, i8, i32 }
%struct.b2SurfaceMaterial = type { float, float, float, float, i32, i32 }
%struct.b2Filter = type { i64, i64, i32 }
%struct.b2RevoluteJointDef = type { %struct.b2BodyId, %struct.b2BodyId, %struct.b2Vec2, %struct.b2Vec2, float, i8, float, float, i8, float, float, i8, float, float, float, i8, ptr, i32 }
%struct.b2BodyId = type { i32, i16, i16 }
%struct.b2BodyDef = type { i32, %struct.b2Vec2, %struct.b2Rot, %struct.b2Vec2, float, float, float, float, float, ptr, ptr, i8, i8, i8, i8, i8, i8, i32 }
%struct.b2Rot = type { float, float }

@__const.CreateJointGrid.circle = external hidden unnamed_addr constant %struct.b2Circle, align 4

; Function Attrs: nounwind uwtable
define dso_local void @CreateJointGrid(i32 %0) local_unnamed_addr #0 {
  %2 = alloca %struct.b2ShapeDef, align 8
  %3 = alloca %struct.b2Circle, align 4
  %4 = alloca %struct.b2RevoluteJointDef, align 8
  %5 = alloca %struct.b2BodyDef, align 8
  tail call void @b2World_EnableSleeping(i32 %0, i1 noundef zeroext false) #6
  %6 = tail call noalias dereferenceable_or_null(800) ptr @malloc(i64 noundef 800) #7
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #6
  call void @b2DefaultShapeDef(ptr dead_on_unwind nonnull writable sret(%struct.b2ShapeDef) align 8 %2) #6
  %7 = getelementptr inbounds i8, ptr %2, i64 32
  store float 1.000000e+00, ptr %7, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %2, i64 40
  store i64 2, ptr %8, align 8, !tbaa !16
  %9 = getelementptr inbounds i8, ptr %2, i64 48
  store i64 4294967293, ptr %9, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) @__const.CreateJointGrid.circle, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %4) #6
  call void @b2DefaultRevoluteJointDef(ptr dead_on_unwind nonnull writable sret(%struct.b2RevoluteJointDef) align 8 %4) #6
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %5) #6
  call void @b2DefaultBodyDef(ptr dead_on_unwind nonnull writable sret(%struct.b2BodyDef) align 8 %5) #6
  %10 = getelementptr inbounds i8, ptr %5, i64 4
  %.sroa.215.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  %invariant.gep = getelementptr i8, ptr %6, i64 -8
  %invariant.gep48 = getelementptr i8, ptr %6, i64 -80
  %11 = getelementptr inbounds i8, ptr %4, i64 8
  %12 = getelementptr inbounds i8, ptr %4, i64 16
  %invariant.gep69 = getelementptr i8, ptr %6, i64 8
  br label %.preheader

.preheader:                                       ; preds = %1, %.split.us
  %.053 = phi i32 [ 0, %1 ], [ %.us-phi.in, %.split.us ]
  %.04552 = phi i32 [ 0, %1 ], [ %133, %.split.us ]
  %13 = uitofp nneg i32 %.04552 to float
  %.not47 = icmp eq i32 %.04552, 0
  br i1 %.not47, label %.preheader.split.us.peel.next, label %.preheader.split.peel.next

.preheader.split.peel.next:                       ; preds = %.preheader
  %14 = and i32 %.04552, 2147483639
  %or.cond55.peel.not = icmp eq i32 %14, 1
  %storemerge.peel = select i1 %or.cond55.peel.not, i32 2, i32 0
  store i32 %storemerge.peel, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -0.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %15 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %16 = call i64 @b2CreateCircleShape(i64 %15, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %17 = sext i32 %.053 to i64
  %gep49.peel = getelementptr %struct.b2BodyId, ptr %invariant.gep48, i64 %17
  %18 = load i64, ptr %gep49.peel, align 4
  store i64 %18, ptr %4, align 8
  store i64 %15, ptr %11, align 8
  store <4 x float> <float 5.000000e-01, float 0.000000e+00, float -5.000000e-01, float 0.000000e+00>, ptr %12, align 8, !tbaa !22
  %19 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %20 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %17
  store i64 %15, ptr %20, align 4
  %indvars.iv.next.peel = add nsw i64 %17, 1
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -1.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %21 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %22 = call i64 @b2CreateCircleShape(i64 %21, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep = getelementptr %struct.b2BodyId, ptr %6, i64 %17
  %23 = load i64, ptr %gep, align 4
  store i64 %23, ptr %4, align 8
  store i64 %21, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %24 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %gep49 = getelementptr %struct.b2BodyId, ptr %invariant.gep48, i64 %indvars.iv.next.peel
  %25 = load i64, ptr %gep49, align 4
  store i64 %25, ptr %4, align 8
  store i64 %21, ptr %11, align 8
  store <4 x float> <float 5.000000e-01, float 0.000000e+00, float -5.000000e-01, float 0.000000e+00>, ptr %12, align 8, !tbaa !22
  %26 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next = add nsw i64 %17, 2
  %27 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next.peel
  store i64 %21, ptr %27, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -2.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %28 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %29 = call i64 @b2CreateCircleShape(i64 %28, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.1 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next
  %30 = load i64, ptr %gep.1, align 4
  store i64 %30, ptr %4, align 8
  store i64 %28, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %31 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %gep49.1 = getelementptr %struct.b2BodyId, ptr %invariant.gep48, i64 %indvars.iv.next
  %32 = load i64, ptr %gep49.1, align 4
  store i64 %32, ptr %4, align 8
  store i64 %28, ptr %11, align 8
  store <4 x float> <float 5.000000e-01, float 0.000000e+00, float -5.000000e-01, float 0.000000e+00>, ptr %12, align 8, !tbaa !22
  %33 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next.1 = add nsw i64 %17, 3
  %34 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next
  store i64 %28, ptr %34, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -3.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %35 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %36 = call i64 @b2CreateCircleShape(i64 %35, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.2 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next.1
  %37 = load i64, ptr %gep.2, align 4
  store i64 %37, ptr %4, align 8
  store i64 %35, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %38 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %gep49.2 = getelementptr %struct.b2BodyId, ptr %invariant.gep48, i64 %indvars.iv.next.1
  %39 = load i64, ptr %gep49.2, align 4
  store i64 %39, ptr %4, align 8
  store i64 %35, ptr %11, align 8
  store <4 x float> <float 5.000000e-01, float 0.000000e+00, float -5.000000e-01, float 0.000000e+00>, ptr %12, align 8, !tbaa !22
  %40 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next.2 = add nsw i64 %17, 4
  %41 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next.1
  store i64 %35, ptr %41, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -4.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %42 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %43 = call i64 @b2CreateCircleShape(i64 %42, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.3 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next.2
  %44 = load i64, ptr %gep.3, align 4
  store i64 %44, ptr %4, align 8
  store i64 %42, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %45 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %gep49.3 = getelementptr %struct.b2BodyId, ptr %invariant.gep48, i64 %indvars.iv.next.2
  %46 = load i64, ptr %gep49.3, align 4
  store i64 %46, ptr %4, align 8
  store i64 %42, ptr %11, align 8
  store <4 x float> <float 5.000000e-01, float 0.000000e+00, float -5.000000e-01, float 0.000000e+00>, ptr %12, align 8, !tbaa !22
  %47 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next.3 = add nsw i64 %17, 5
  %48 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next.2
  store i64 %42, ptr %48, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -5.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %49 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %50 = call i64 @b2CreateCircleShape(i64 %49, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.4 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next.3
  %51 = load i64, ptr %gep.4, align 4
  store i64 %51, ptr %4, align 8
  store i64 %49, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %52 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %gep49.4 = getelementptr %struct.b2BodyId, ptr %invariant.gep48, i64 %indvars.iv.next.3
  %53 = load i64, ptr %gep49.4, align 4
  store i64 %53, ptr %4, align 8
  store i64 %49, ptr %11, align 8
  store <4 x float> <float 5.000000e-01, float 0.000000e+00, float -5.000000e-01, float 0.000000e+00>, ptr %12, align 8, !tbaa !22
  %54 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next.4 = add nsw i64 %17, 6
  %55 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next.3
  store i64 %49, ptr %55, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -6.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %56 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %57 = call i64 @b2CreateCircleShape(i64 %56, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.5 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next.4
  %58 = load i64, ptr %gep.5, align 4
  store i64 %58, ptr %4, align 8
  store i64 %56, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %59 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %gep49.5 = getelementptr %struct.b2BodyId, ptr %invariant.gep48, i64 %indvars.iv.next.4
  %60 = load i64, ptr %gep49.5, align 4
  store i64 %60, ptr %4, align 8
  store i64 %56, ptr %11, align 8
  store <4 x float> <float 5.000000e-01, float 0.000000e+00, float -5.000000e-01, float 0.000000e+00>, ptr %12, align 8, !tbaa !22
  %61 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next.5 = add nsw i64 %17, 7
  %62 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next.4
  store i64 %56, ptr %62, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -7.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %63 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %64 = call i64 @b2CreateCircleShape(i64 %63, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.6 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next.5
  %65 = load i64, ptr %gep.6, align 4
  store i64 %65, ptr %4, align 8
  store i64 %63, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %66 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %gep49.6 = getelementptr %struct.b2BodyId, ptr %invariant.gep48, i64 %indvars.iv.next.5
  %67 = load i64, ptr %gep49.6, align 4
  store i64 %67, ptr %4, align 8
  store i64 %63, ptr %11, align 8
  store <4 x float> <float 5.000000e-01, float 0.000000e+00, float -5.000000e-01, float 0.000000e+00>, ptr %12, align 8, !tbaa !22
  %68 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next.6 = add nsw i64 %17, 8
  %69 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next.5
  store i64 %63, ptr %69, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -8.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %70 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %71 = call i64 @b2CreateCircleShape(i64 %70, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.7 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next.6
  %72 = load i64, ptr %gep.7, align 4
  store i64 %72, ptr %4, align 8
  store i64 %70, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %73 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %gep49.7 = getelementptr %struct.b2BodyId, ptr %invariant.gep48, i64 %indvars.iv.next.6
  %74 = load i64, ptr %gep49.7, align 4
  store i64 %74, ptr %4, align 8
  store i64 %70, ptr %11, align 8
  store <4 x float> <float 5.000000e-01, float 0.000000e+00, float -5.000000e-01, float 0.000000e+00>, ptr %12, align 8, !tbaa !22
  %75 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next.7 = add nsw i64 %17, 9
  %76 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next.6
  store i64 %70, ptr %76, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -9.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %77 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %78 = call i64 @b2CreateCircleShape(i64 %77, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.8 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next.7
  %79 = load i64, ptr %gep.8, align 4
  store i64 %79, ptr %4, align 8
  store i64 %77, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %80 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %gep49.8 = getelementptr %struct.b2BodyId, ptr %invariant.gep48, i64 %indvars.iv.next.7
  %81 = load i64, ptr %gep49.8, align 4
  store i64 %81, ptr %4, align 8
  store i64 %77, ptr %11, align 8
  store <4 x float> <float 5.000000e-01, float 0.000000e+00, float -5.000000e-01, float 0.000000e+00>, ptr %12, align 8, !tbaa !22
  %82 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %83 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next.7
  store i64 %77, ptr %83, align 4
  br label %.split.us

.preheader.split.us.peel.next:                    ; preds = %.preheader
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -0.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %84 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %85 = call i64 @b2CreateCircleShape(i64 %84, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %86 = sext i32 %.053 to i64
  %87 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %86
  store i64 %84, ptr %87, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -1.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %88 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %89 = call i64 @b2CreateCircleShape(i64 %88, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.us = getelementptr %struct.b2BodyId, ptr %6, i64 %86
  %90 = load i64, ptr %gep.us, align 4
  store i64 %90, ptr %4, align 8
  store i64 %88, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %91 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next61 = add nsw i64 %86, 2
  %gep70 = getelementptr %struct.b2BodyId, ptr %invariant.gep69, i64 %86
  store i64 %88, ptr %gep70, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -2.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %92 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %93 = call i64 @b2CreateCircleShape(i64 %92, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.us.1 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next61
  %94 = load i64, ptr %gep.us.1, align 4
  store i64 %94, ptr %4, align 8
  store i64 %92, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %95 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next61.1 = add nsw i64 %86, 3
  %96 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next61
  store i64 %92, ptr %96, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -3.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %97 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %98 = call i64 @b2CreateCircleShape(i64 %97, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.us.2 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next61.1
  %99 = load i64, ptr %gep.us.2, align 4
  store i64 %99, ptr %4, align 8
  store i64 %97, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %100 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next61.2 = add nsw i64 %86, 4
  %101 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next61.1
  store i64 %97, ptr %101, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -4.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %102 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %103 = call i64 @b2CreateCircleShape(i64 %102, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.us.3 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next61.2
  %104 = load i64, ptr %gep.us.3, align 4
  store i64 %104, ptr %4, align 8
  store i64 %102, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %105 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next61.3 = add nsw i64 %86, 5
  %106 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next61.2
  store i64 %102, ptr %106, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -5.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %107 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %108 = call i64 @b2CreateCircleShape(i64 %107, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.us.4 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next61.3
  %109 = load i64, ptr %gep.us.4, align 4
  store i64 %109, ptr %4, align 8
  store i64 %107, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %110 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next61.4 = add nsw i64 %86, 6
  %111 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next61.3
  store i64 %107, ptr %111, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -6.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %112 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %113 = call i64 @b2CreateCircleShape(i64 %112, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.us.5 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next61.4
  %114 = load i64, ptr %gep.us.5, align 4
  store i64 %114, ptr %4, align 8
  store i64 %112, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %115 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next61.5 = add nsw i64 %86, 7
  %116 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next61.4
  store i64 %112, ptr %116, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -7.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %117 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %118 = call i64 @b2CreateCircleShape(i64 %117, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.us.6 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next61.5
  %119 = load i64, ptr %gep.us.6, align 4
  store i64 %119, ptr %4, align 8
  store i64 %117, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %120 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next61.6 = add nsw i64 %86, 8
  %121 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next61.5
  store i64 %117, ptr %121, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -8.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %122 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %123 = call i64 @b2CreateCircleShape(i64 %122, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.us.7 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next61.6
  %124 = load i64, ptr %gep.us.7, align 4
  store i64 %124, ptr %4, align 8
  store i64 %122, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %125 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %indvars.iv.next61.7 = add nsw i64 %86, 9
  %126 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next61.6
  store i64 %122, ptr %126, align 4
  store i32 2, ptr %5, align 8, !tbaa !18
  store float %13, ptr %10, align 4, !tbaa !22
  store float -9.000000e+00, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !22
  %127 = call i64 @b2CreateBody(i32 %0, ptr noundef nonnull %5) #6
  %128 = call i64 @b2CreateCircleShape(i64 %127, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %gep.us.8 = getelementptr %struct.b2BodyId, ptr %invariant.gep, i64 %indvars.iv.next61.7
  %129 = load i64, ptr %gep.us.8, align 4
  store i64 %129, ptr %4, align 8
  store i64 %127, ptr %11, align 8
  store <4 x float> <float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01>, ptr %12, align 8, !tbaa !22
  %130 = call i64 @b2CreateRevoluteJoint(i32 %0, ptr noundef nonnull %4) #6
  %131 = getelementptr inbounds %struct.b2BodyId, ptr %6, i64 %indvars.iv.next61.7
  store i64 %127, ptr %131, align 4
  br label %.split.us

132:                                              ; preds = %.split.us
  call void @free(ptr noundef nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  ret void

.split.us:                                        ; preds = %.preheader.split.peel.next, %.preheader.split.us.peel.next
  %.us-phi.in = add i32 %.053, 10
  %133 = add nuw nsw i32 %.04552, 1
  %exitcond65.not = icmp eq i32 %133, 10
  br i1 %exitcond65.not, label %132, label %.preheader, !llvm.loop !23
}

declare void @b2World_EnableSleeping(i32, i1 noundef zeroext) local_unnamed_addr #1

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3

declare void @b2DefaultShapeDef(ptr dead_on_unwind writable sret(%struct.b2ShapeDef) align 8) local_unnamed_addr #1

; Function Attrs: mustprogress 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) #4

declare void @b2DefaultRevoluteJointDef(ptr dead_on_unwind writable sret(%struct.b2RevoluteJointDef) align 8) local_unnamed_addr #1

declare void @b2DefaultBodyDef(ptr dead_on_unwind writable sret(%struct.b2BodyDef) align 8) local_unnamed_addr #1

declare i64 @b2CreateBody(i32, ptr noundef) local_unnamed_addr #1

declare i64 @b2CreateCircleShape(i64, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i64 @b2CreateRevoluteJoint(i32, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

attributes #0 = { 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 = { "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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, !11, i64 32}
!6 = !{!"b2ShapeDef", !7, i64 0, !10, i64 8, !11, i64 32, !13, i64 40, !15, i64 64, !15, i64 65, !15, i64 66, !15, i64 67, !15, i64 68, !15, i64 69, !15, i64 70, !12, i64 72}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"b2SurfaceMaterial", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !12, i64 16, !12, i64 20}
!11 = !{!"float", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"b2Filter", !14, i64 0, !14, i64 8, !12, i64 16}
!14 = !{!"long", !8, i64 0}
!15 = !{!"_Bool", !8, i64 0}
!16 = !{!6, !14, i64 40}
!17 = !{!6, !14, i64 48}
!18 = !{!19, !12, i64 0}
!19 = !{!"b2BodyDef", !12, i64 0, !20, i64 4, !21, i64 12, !20, i64 20, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !7, i64 48, !7, i64 56, !15, i64 64, !15, i64 65, !15, i64 66, !15, i64 67, !15, i64 68, !15, i64 69, !12, i64 72}
!20 = !{!"b2Vec2", !11, i64 0, !11, i64 4}
!21 = !{!"b2Rot", !11, i64 0, !11, i64 4}
!22 = !{!11, !11, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass