; LLVM IR from erincatto/box2d :: test (test_world)

; 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.b2BodyId = type { i32, i16, i16 }
%struct.b2WorldDef = type { %struct.b2Vec2, float, float, float, float, float, float, float, float, ptr, ptr, i8, i8, i32, ptr, ptr, ptr, ptr, i32 }
%struct.b2Vec2 = type { float, float }
%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.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.b2WorldId = type { i16, i16 }
%struct.b2Polygon = type { [8 x %struct.b2Vec2], [8 x %struct.b2Vec2], %struct.b2Vec2, float, i32 }
%struct.b2ShapeId = type { i32, i16, i16 }
%struct.b2Counters = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [12 x i32] }

@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [54 x i8], align 1
@__PRETTY_FUNCTION__.DestroyAllBodiesWorld = external hidden unnamed_addr constant [32 x i8], align 1
@b2_nullBodyId = external hidden constant %struct.b2BodyId, align 4
@.str.9 = external hidden unnamed_addr constant [42 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

declare void @b2DefaultWorldDef(ptr dead_on_unwind writable sret(%struct.b2WorldDef) 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) #2

declare i32 @b2CreateWorld(ptr noundef) #1

declare zeroext i1 @b2World_IsValid(i32) #1

declare i32 @printf(ptr noundef, ...) #1

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

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

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

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

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

declare void @b2World_Step(i32, float noundef, i32 noundef) #1

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

declare void @b2DestroyWorld(i32) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @DestroyAllBodiesWorld() #4 {
  %1 = alloca %struct.b2WorldDef, align 8
  %2 = alloca %struct.b2WorldId, align 2
  %3 = alloca i32, align 4
  %4 = alloca i8, align 1
  %5 = alloca [10 x %struct.b2BodyId], align 16
  %6 = alloca %struct.b2BodyDef, align 8
  %7 = alloca %struct.b2Polygon, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.b2BodyId, align 4
  %10 = alloca %struct.b2ShapeDef, align 8
  %11 = alloca %struct.b2ShapeId, align 4
  %12 = alloca %struct.b2Counters, align 4
  call void @llvm.lifetime.start.p0(i64 104, ptr %1) #5
  call void @b2DefaultWorldDef(ptr dead_on_unwind writable sret(%struct.b2WorldDef) align 8 %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %13 = call i32 @b2CreateWorld(ptr noundef %1)
  store i32 %13, ptr %2, align 2
  br label %14

14:                                               ; preds = %0
  %15 = load i32, ptr %2, align 2
  %16 = call zeroext i1 @b2World_IsValid(i32 %15)
  %17 = zext i1 %16 to i32
  %18 = icmp eq i32 %17, 1
  %19 = zext i1 %18 to i32
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %23

21:                                               ; preds = %14
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 127, ptr noundef @__PRETTY_FUNCTION__.DestroyAllBodiesWorld) #6
  unreachable

23:                                               ; preds = %14
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  store i8 1, ptr %4, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 80, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 80, ptr %6) #5
  call void @b2DefaultBodyDef(ptr dead_on_unwind writable sret(%struct.b2BodyDef) align 8 %6)
  %26 = getelementptr inbounds %struct.b2BodyDef, ptr %6, i32 0, i32 0
  store i32 2, ptr %26, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 144, ptr %7) #5
  call void @b2MakeSquare(ptr dead_on_unwind writable sret(%struct.b2Polygon) align 4 %7, float noundef 5.000000e-01)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %70, %25
  %28 = load i32, ptr %8, align 4, !tbaa !5
  %29 = icmp slt i32 %28, 30
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %73

31:                                               ; preds = %27
  %32 = load i8, ptr %4, align 1, !tbaa !9, !range !17, !noundef !18
  %33 = trunc i8 %32 to i1
  br i1 %33, label %34, label %52

34:                                               ; preds = %31
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = icmp slt i32 %35, 10
  br i1 %36, label %37, label %50

37:                                               ; preds = %34
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [10 x %struct.b2BodyId], ptr %5, i64 0, i64 %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %41 = load i32, ptr %2, align 2
  %42 = call i64 @b2CreateBody(i32 %41, ptr noundef %6)
  store i64 %42, ptr %9, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %40, ptr align 4 %9, i64 8, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 80, ptr %10) #5
  call void @b2DefaultShapeDef(ptr dead_on_unwind writable sret(%struct.b2ShapeDef) align 8 %10)
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [10 x %struct.b2BodyId], ptr %5, i64 0, i64 %44
  %46 = load i64, ptr %45, align 8
  %47 = call i64 @b2CreatePolygonShape(i64 %46, ptr noundef %10, ptr noundef %7)
  store i64 %47, ptr %11, align 4
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #5
  br label %51

50:                                               ; preds = %34
  store i8 0, ptr %4, align 1, !tbaa !9
  br label %51

51:                                               ; preds = %50, %37
  br label %68

52:                                               ; preds = %31
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = icmp sgt i32 %53, 0
  br i1 %54, label %55, label %67

55:                                               ; preds = %52
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sub nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [10 x %struct.b2BodyId], ptr %5, i64 0, i64 %58
  %60 = load i64, ptr %59, align 8
  call void @b2DestroyBody(i64 %60)
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = sub nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [10 x %struct.b2BodyId], ptr %5, i64 0, i64 %63
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %64, ptr align 4 @b2_nullBodyId, i64 8, i1 false), !tbaa.struct !19
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = sub nsw i32 %65, 1
  store i32 %66, ptr %3, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %55, %52
  br label %68

68:                                               ; preds = %67, %51
  %69 = load i32, ptr %2, align 2
  call void @b2World_Step(i32 %69, float noundef 0x3F91111120000000, i32 noundef 3)
  br label %70

70:                                               ; preds = %68
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %8, align 4, !tbaa !5
  br label %27, !llvm.loop !22

73:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 88, ptr %12) #5
  %74 = load i32, ptr %2, align 2
  call void @b2World_GetCounters(ptr dead_on_unwind writable sret(%struct.b2Counters) align 4 %12, i32 %74)
  br label %75

75:                                               ; preds = %73
  %76 = getelementptr inbounds %struct.b2Counters, ptr %12, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !24
  %78 = icmp eq i32 %77, 0
  %79 = zext i1 %78 to i32
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %81, label %83

81:                                               ; preds = %75
  %82 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 165, ptr noundef @__PRETTY_FUNCTION__.DestroyAllBodiesWorld) #6
  unreachable

83:                                               ; preds = %75
  br label %84

84:                                               ; preds = %83
  br label %85

85:                                               ; preds = %84
  %86 = load i32, ptr %2, align 2
  call void @b2DestroyWorld(i32 %86)
  br label %87

87:                                               ; preds = %85
  %88 = load i32, ptr %2, align 2
  %89 = call zeroext i1 @b2World_IsValid(i32 %88)
  %90 = zext i1 %89 to i32
  %91 = icmp eq i32 %90, 0
  %92 = zext i1 %91 to i32
  %93 = icmp eq i32 %92, 0
  br i1 %93, label %94, label %96

94:                                               ; preds = %87
  %95 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 169, ptr noundef @__PRETTY_FUNCTION__.DestroyAllBodiesWorld) #6
  unreachable

96:                                               ; preds = %87
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  call void @llvm.lifetime.end.p0(i64 88, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 144, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr %1) #5
  ret i32 0
}

declare void @b2MakeSquare(ptr dead_on_unwind writable sret(%struct.b2Polygon) align 4, float noundef) #1

declare void @b2DestroyBody(i64) #1

declare void @b2World_GetCounters(ptr dead_on_unwind writable sret(%struct.b2Counters) align 4, i32) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 = { nounwind }
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, !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 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"b2BodyDef", !6, i64 0, !13, i64 4, !15, i64 12, !13, i64 20, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !16, i64 48, !16, i64 56, !10, i64 64, !10, i64 65, !10, i64 66, !10, i64 67, !10, i64 68, !10, i64 69, !6, i64 72}
!13 = !{!"b2Vec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !7, i64 0}
!15 = !{!"b2Rot", !14, i64 0, !14, i64 4}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{i64 0, i64 4, !5, i64 4, i64 2, !20, i64 6, i64 2, !20}
!20 = !{!21, !21, i64 0}
!21 = !{!"short", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!25, !6, i64 0}
!25 = !{!"b2Counters", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !7, i64 40}


; 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.b2BodyId = type { i32, i16, i16 }
%struct.b2WorldDef = type { %struct.b2Vec2, float, float, float, float, float, float, float, float, ptr, ptr, i8, i8, i32, ptr, ptr, ptr, ptr, i32 }
%struct.b2Vec2 = type { float, float }
%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.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.b2Polygon = type { [8 x %struct.b2Vec2], [8 x %struct.b2Vec2], %struct.b2Vec2, float, i32 }
%struct.b2Counters = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [12 x i32] }

@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [54 x i8], align 1
@__PRETTY_FUNCTION__.DestroyAllBodiesWorld = external hidden unnamed_addr constant [32 x i8], align 1
@b2_nullBodyId = external hidden local_unnamed_addr constant %struct.b2BodyId, align 4
@.str.9 = external hidden unnamed_addr constant [42 x i8], align 1

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

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

declare i32 @b2CreateWorld(ptr noundef) local_unnamed_addr #1

declare zeroext i1 @b2World_IsValid(i32) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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 void @b2DefaultShapeDef(ptr dead_on_unwind writable sret(%struct.b2ShapeDef) align 8) local_unnamed_addr #1

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

declare void @b2World_Step(i32, float noundef, i32 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) #0

declare void @b2DestroyWorld(i32) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @DestroyAllBodiesWorld() local_unnamed_addr #4 {
  %1 = alloca %struct.b2WorldDef, align 8
  %2 = alloca [10 x %struct.b2BodyId], align 16
  %3 = alloca %struct.b2BodyDef, align 8
  %4 = alloca %struct.b2Polygon, align 4
  %5 = alloca %struct.b2ShapeDef, align 8
  %6 = alloca %struct.b2Counters, align 4
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %1) #5
  call void @b2DefaultWorldDef(ptr dead_on_unwind nonnull writable sret(%struct.b2WorldDef) align 8 %1) #5
  %7 = call i32 @b2CreateWorld(ptr noundef nonnull %1) #5
  %8 = call zeroext i1 @b2World_IsValid(i32 %7) #5
  br i1 %8, label %11, label %9

9:                                                ; preds = %0
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 127, ptr noundef nonnull @__PRETTY_FUNCTION__.DestroyAllBodiesWorld) #6
  unreachable

11:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #5
  call void @b2DefaultBodyDef(ptr dead_on_unwind nonnull writable sret(%struct.b2BodyDef) align 8 %3) #5
  store i32 2, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %4) #5
  call void @b2MakeSquare(ptr dead_on_unwind nonnull writable sret(%struct.b2Polygon) align 4 %4, float noundef 5.000000e-01) #5
  %12 = load i64, ptr @b2_nullBodyId, align 4
  br label %15

13:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %6) #5
  call void @b2World_GetCounters(ptr dead_on_unwind nonnull writable sret(%struct.b2Counters) align 4 %6, i32 %7) #5
  %14 = load i32, ptr %6, align 4, !tbaa !15
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %35, label %33

15:                                               ; preds = %11, %31
  %.023 = phi i32 [ 0, %11 ], [ %.1, %31 ]
  %.01822 = phi i1 [ true, %11 ], [ %.119, %31 ]
  %.02021 = phi i32 [ 0, %11 ], [ %32, %31 ]
  br i1 %.01822, label %16, label %24

16:                                               ; preds = %15
  %17 = icmp slt i32 %.023, 10
  br i1 %17, label %18, label %31

18:                                               ; preds = %16
  %19 = sext i32 %.023 to i64
  %20 = getelementptr inbounds [10 x %struct.b2BodyId], ptr %2, i64 0, i64 %19
  %21 = call i64 @b2CreateBody(i32 %7, ptr noundef nonnull %3) #5
  store i64 %21, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %5) #5
  call void @b2DefaultShapeDef(ptr dead_on_unwind nonnull writable sret(%struct.b2ShapeDef) align 8 %5) #5
  %22 = call i64 @b2CreatePolygonShape(i64 %21, ptr noundef nonnull %5, ptr noundef nonnull %4) #5
  %23 = add nsw i32 %.023, 1
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #5
  br label %31

24:                                               ; preds = %15
  %25 = icmp sgt i32 %.023, 0
  br i1 %25, label %26, label %31

26:                                               ; preds = %24
  %27 = add nsw i32 %.023, -1
  %28 = zext nneg i32 %27 to i64
  %29 = getelementptr inbounds [10 x %struct.b2BodyId], ptr %2, i64 0, i64 %28
  %30 = load i64, ptr %29, align 8
  call void @b2DestroyBody(i64 %30) #5
  store i64 %12, ptr %29, align 8
  br label %31

31:                                               ; preds = %16, %24, %26, %18
  %.119 = phi i1 [ true, %18 ], [ false, %26 ], [ false, %24 ], [ false, %16 ]
  %.1 = phi i32 [ %23, %18 ], [ %27, %26 ], [ %.023, %24 ], [ %.023, %16 ]
  call void @b2World_Step(i32 %7, float noundef 0x3F91111120000000, i32 noundef 3) #5
  %32 = add nuw nsw i32 %.02021, 1
  %exitcond.not = icmp eq i32 %32, 30
  br i1 %exitcond.not, label %13, label %15, !llvm.loop !17

33:                                               ; preds = %13
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 165, ptr noundef nonnull @__PRETTY_FUNCTION__.DestroyAllBodiesWorld) #6
  unreachable

35:                                               ; preds = %13
  call void @b2DestroyWorld(i32 %7) #5
  %36 = call zeroext i1 @b2World_IsValid(i32 %7) #5
  br i1 %36, label %37, label %39

37:                                               ; preds = %35
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 169, ptr noundef nonnull @__PRETTY_FUNCTION__.DestroyAllBodiesWorld) #6
  unreachable

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %1) #5
  ret i32 0
}

declare void @b2MakeSquare(ptr dead_on_unwind writable sret(%struct.b2Polygon) align 4, float noundef) local_unnamed_addr #1

declare void @b2DestroyBody(i64) local_unnamed_addr #1

declare void @b2World_GetCounters(ptr dead_on_unwind writable sret(%struct.b2Counters) align 4, i32) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree 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 = { 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 #4 = { 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 = { nounwind }
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, !7, i64 0}
!6 = !{!"b2BodyDef", !7, i64 0, !10, i64 4, !12, i64 12, !10, i64 20, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !13, i64 48, !13, i64 56, !14, i64 64, !14, i64 65, !14, i64 66, !14, i64 67, !14, i64 68, !14, i64 69, !7, i64 72}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"b2Vec2", !11, i64 0, !11, i64 4}
!11 = !{!"float", !8, i64 0}
!12 = !{!"b2Rot", !11, i64 0, !11, i64 4}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"_Bool", !8, i64 0}
!15 = !{!16, !7, i64 0}
!16 = !{!"b2Counters", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !8, i64 40}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass