; LLVM IR from erincatto/box2d :: src (island)

; 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.b2Island = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.b2World = type { %struct.b2ArenaAllocator, %struct.b2BroadPhase, %struct.b2ConstraintGraph, %struct.b2IdPool, %struct.b2BodyArray, %struct.b2IdPool, %struct.b2SolverSetArray, %struct.b2IdPool, %struct.b2JointArray, %struct.b2IdPool, %struct.b2ContactArray, %struct.b2IdPool, %struct.b2IslandArray, %struct.b2IdPool, %struct.b2IdPool, %struct.b2ShapeArray, %struct.b2ChainShapeArray, %struct.b2SensorArray, %struct.b2TaskContextArray, %struct.b2SensorTaskContextArray, %struct.b2BodyMoveEventArray, %struct.b2SensorBeginTouchEventArray, %struct.b2ContactBeginTouchEventArray, [2 x %struct.b2SensorEndTouchEventArray], [2 x %struct.b2ContactEndTouchEventArray], i32, %struct.b2ContactHitEventArray, %struct.b2BitSet, %struct.b2BitSet, %struct.b2BitSet, %struct.b2BitSet, i64, i32, %struct.b2Vec2, float, float, float, float, float, float, float, float, ptr, ptr, i16, %struct.b2Profile, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, float, i32, i32, i16, i8, i8, i8, i8, i8, i8 }
%struct.b2ArenaAllocator = type { ptr, i32, i32, i32, i32, %struct.b2ArenaEntryArray }
%struct.b2ArenaEntryArray = type { ptr, i32, i32 }
%struct.b2BroadPhase = type { [3 x %struct.b2DynamicTree], i32, %struct.b2HashSet, %struct.b2IntArray, ptr, ptr, i32, %struct.b2AtomicInt, %struct.b2HashSet }
%struct.b2DynamicTree = type { ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32 }
%struct.b2IntArray = type { ptr, i32, i32 }
%struct.b2AtomicInt = type { i32 }
%struct.b2HashSet = type { ptr, i32, i32 }
%struct.b2ConstraintGraph = type { [12 x %struct.b2GraphColor] }
%struct.b2GraphColor = type { %struct.b2BitSet, %struct.b2ContactSimArray, %struct.b2JointSimArray, %union.anon }
%struct.b2ContactSimArray = type { ptr, i32, i32 }
%struct.b2JointSimArray = type { ptr, i32, i32 }
%union.anon = type { ptr }
%struct.b2BodyArray = type { ptr, i32, i32 }
%struct.b2SolverSetArray = type { ptr, i32, i32 }
%struct.b2JointArray = type { ptr, i32, i32 }
%struct.b2ContactArray = type { ptr, i32, i32 }
%struct.b2IslandArray = type { ptr, i32, i32 }
%struct.b2IdPool = type { %struct.b2IntArray, i32 }
%struct.b2ShapeArray = type { ptr, i32, i32 }
%struct.b2ChainShapeArray = type { ptr, i32, i32 }
%struct.b2SensorArray = type { ptr, i32, i32 }
%struct.b2TaskContextArray = type { ptr, i32, i32 }
%struct.b2SensorTaskContextArray = type { ptr, i32, i32 }
%struct.b2BodyMoveEventArray = type { ptr, i32, i32 }
%struct.b2SensorBeginTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactBeginTouchEventArray = type { ptr, i32, i32 }
%struct.b2SensorEndTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactEndTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactHitEventArray = type { ptr, i32, i32 }
%struct.b2BitSet = type { ptr, i32, i32 }
%struct.b2Vec2 = type { float, float }
%struct.b2Profile = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }
%struct.b2SolverSet = type { %struct.b2BodySimArray, %struct.b2BodyStateArray, %struct.b2JointSimArray, %struct.b2ContactSimArray, %struct.b2IslandSimArray, i32 }
%struct.b2BodySimArray = type { ptr, i32, i32 }
%struct.b2BodyStateArray = type { ptr, i32, i32 }
%struct.b2IslandSimArray = type { ptr, i32, i32 }
%struct.b2IslandSim = type { i32 }

@.str = external hidden unnamed_addr constant [59 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [56 x i8], align 1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

; Function Attrs: nounwind uwtable
define dso_local ptr @b2CreateIsland(ptr noundef %0, i32 noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.b2Island, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  br label %10

10:                                               ; preds = %2
  %11 = load i32, ptr %4, align 4, !tbaa !9
  %12 = icmp eq i32 %11, 2
  br i1 %12, label %20, label %13

13:                                               ; preds = %10
  %14 = load i32, ptr %4, align 4, !tbaa !9
  %15 = icmp sge i32 %14, 3
  br i1 %15, label %20, label %16

16:                                               ; preds = %13
  %17 = call i32 @b2InternalAssertFcn(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 20)
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %19, label %20

19:                                               ; preds = %16
  call void @llvm.trap()
  br label %20

20:                                               ; preds = %19, %16, %13, %10
  br label %21

21:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.b2World, ptr %22, i32 0, i32 11
  %24 = call i32 @b2AllocId(ptr noundef %23)
  store i32 %24, ptr %5, align 4, !tbaa !9
  %25 = load i32, ptr %5, align 4, !tbaa !9
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.b2World, ptr %26, i32 0, i32 12
  %28 = getelementptr inbounds %struct.b2IslandArray, ptr %27, i32 0, i32 1
  %29 = load i32, ptr %28, align 8, !tbaa !11
  %30 = icmp eq i32 %25, %29
  br i1 %30, label %31, label %34

31:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 56, ptr %6) #6
  call void @llvm.memset.p0.i64(ptr align 4 %6, i8 0, i64 56, i1 false)
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.b2World, ptr %32, i32 0, i32 12
  call void @b2IslandArray_Push(ptr noundef %33, ptr noundef byval(%struct.b2Island) align 8 %6)
  call void @llvm.lifetime.end.p0(i64 56, ptr %6) #6
  br label %53

34:                                               ; preds = %21
  br label %35

35:                                               ; preds = %34
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.b2World, ptr %36, i32 0, i32 12
  %38 = getelementptr inbounds %struct.b2IslandArray, ptr %37, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !27
  %40 = load i32, ptr %5, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds %struct.b2Island, ptr %39, i64 %41
  %43 = getelementptr inbounds %struct.b2Island, ptr %42, i32 0, i32 0
  %44 = load i32, ptr %43, align 4, !tbaa !28
  %45 = icmp eq i32 %44, -1
  br i1 %45, label %50, label %46

46:                                               ; preds = %35
  %47 = call i32 @b2InternalAssertFcn(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 31)
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %46
  call void @llvm.trap()
  br label %50

50:                                               ; preds = %49, %46, %35
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52, %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.b2World, ptr %54, i32 0, i32 6
  %56 = load i32, ptr %4, align 4, !tbaa !9
  %57 = call ptr @b2SolverSetArray_Get(ptr noundef %55, i32 noundef %56)
  store ptr %57, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.b2World, ptr %58, i32 0, i32 12
  %60 = load i32, ptr %5, align 4, !tbaa !9
  %61 = call ptr @b2IslandArray_Get(ptr noundef %59, i32 noundef %60)
  store ptr %61, ptr %8, align 8, !tbaa !5
  %62 = load i32, ptr %4, align 4, !tbaa !9
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.b2Island, ptr %63, i32 0, i32 0
  store i32 %62, ptr %64, align 4, !tbaa !28
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.b2SolverSet, ptr %65, i32 0, i32 4
  %67 = getelementptr inbounds %struct.b2IslandSimArray, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 8, !tbaa !30
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.b2Island, ptr %69, i32 0, i32 1
  store i32 %68, ptr %70, align 4, !tbaa !32
  %71 = load i32, ptr %5, align 4, !tbaa !9
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.b2Island, ptr %72, i32 0, i32 2
  store i32 %71, ptr %73, align 4, !tbaa !33
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.b2Island, ptr %74, i32 0, i32 3
  store i32 -1, ptr %75, align 4, !tbaa !34
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.b2Island, ptr %76, i32 0, i32 4
  store i32 -1, ptr %77, align 4, !tbaa !35
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.b2Island, ptr %78, i32 0, i32 5
  store i32 0, ptr %79, align 4, !tbaa !36
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.b2Island, ptr %80, i32 0, i32 6
  store i32 -1, ptr %81, align 4, !tbaa !37
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.b2Island, ptr %82, i32 0, i32 7
  store i32 -1, ptr %83, align 4, !tbaa !38
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.b2Island, ptr %84, i32 0, i32 8
  store i32 0, ptr %85, align 4, !tbaa !39
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.b2Island, ptr %86, i32 0, i32 9
  store i32 -1, ptr %87, align 4, !tbaa !40
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.b2Island, ptr %88, i32 0, i32 10
  store i32 -1, ptr %89, align 4, !tbaa !41
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.b2Island, ptr %90, i32 0, i32 11
  store i32 0, ptr %91, align 4, !tbaa !42
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.b2Island, ptr %92, i32 0, i32 12
  store i32 -1, ptr %93, align 4, !tbaa !43
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.b2Island, ptr %94, i32 0, i32 13
  store i32 0, ptr %95, align 4, !tbaa !44
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.b2SolverSet, ptr %96, i32 0, i32 4
  %98 = call ptr @b2IslandSimArray_Add(ptr noundef %97)
  store ptr %98, ptr %9, align 8, !tbaa !5
  %99 = load i32, ptr %5, align 4, !tbaa !9
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.b2IslandSim, ptr %100, i32 0, i32 0
  store i32 %99, ptr %101, align 4, !tbaa !45
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  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 4, ptr %5) #6
  ret ptr %102
}

declare i32 @b2InternalAssertFcn(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: cold noreturn nounwind memory(inaccessiblemem: write)
declare void @llvm.trap() #3

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

declare i32 @b2AllocId(ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @b2IslandArray_Push(ptr noundef, ptr noundef byval(%struct.b2Island) align 8) #5

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2SolverSetArray_Get(ptr noundef, i32 noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2IslandArray_Get(ptr noundef, i32 noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2IslandSimArray_Add(ptr noundef) #5

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { 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 = { "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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint 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 #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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 1200}
!12 = !{!"b2World", !13, i64 0, !15, i64 40, !18, i64 336, !19, i64 1008, !14, i64 1032, !19, i64 1048, !14, i64 1072, !19, i64 1088, !14, i64 1112, !19, i64 1128, !14, i64 1152, !19, i64 1168, !14, i64 1192, !19, i64 1208, !19, i64 1232, !14, i64 1256, !14, i64 1272, !14, i64 1288, !14, i64 1304, !14, i64 1320, !14, i64 1336, !14, i64 1352, !14, i64 1368, !7, i64 1384, !7, i64 1416, !10, i64 1448, !14, i64 1456, !20, i64 1472, !20, i64 1488, !20, i64 1504, !20, i64 1520, !21, i64 1536, !10, i64 1544, !22, i64 1548, !23, i64 1556, !23, i64 1560, !23, i64 1564, !23, i64 1568, !23, i64 1572, !23, i64 1576, !23, i64 1580, !23, i64 1584, !6, i64 1592, !6, i64 1600, !24, i64 1608, !25, i64 1612, !6, i64 1704, !6, i64 1712, !6, i64 1720, !6, i64 1728, !10, i64 1736, !6, i64 1744, !6, i64 1752, !6, i64 1760, !6, i64 1768, !6, i64 1776, !23, i64 1784, !10, i64 1788, !10, i64 1792, !24, i64 1796, !26, i64 1798, !26, i64 1799, !26, i64 1800, !26, i64 1801, !26, i64 1802, !26, i64 1803}
!13 = !{!"b2ArenaAllocator", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !14, i64 24}
!14 = !{!"", !6, i64 0, !10, i64 8, !10, i64 12}
!15 = !{!"b2BroadPhase", !7, i64 0, !10, i64 216, !16, i64 224, !14, i64 240, !6, i64 256, !6, i64 264, !10, i64 272, !17, i64 276, !16, i64 280}
!16 = !{!"b2HashSet", !6, i64 0, !10, i64 8, !10, i64 12}
!17 = !{!"b2AtomicInt", !10, i64 0}
!18 = !{!"b2ConstraintGraph", !7, i64 0}
!19 = !{!"b2IdPool", !14, i64 0, !10, i64 16}
!20 = !{!"b2BitSet", !6, i64 0, !10, i64 8, !10, i64 12}
!21 = !{!"long", !7, i64 0}
!22 = !{!"b2Vec2", !23, i64 0, !23, i64 4}
!23 = !{!"float", !7, i64 0}
!24 = !{!"short", !7, i64 0}
!25 = !{!"b2Profile", !23, i64 0, !23, i64 4, !23, i64 8, !23, i64 12, !23, i64 16, !23, i64 20, !23, i64 24, !23, i64 28, !23, i64 32, !23, i64 36, !23, i64 40, !23, i64 44, !23, i64 48, !23, i64 52, !23, i64 56, !23, i64 60, !23, i64 64, !23, i64 68, !23, i64 72, !23, i64 76, !23, i64 80, !23, i64 84}
!26 = !{!"_Bool", !7, i64 0}
!27 = !{!12, !6, i64 1192}
!28 = !{!29, !10, i64 0}
!29 = !{!"b2Island", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52}
!30 = !{!31, !10, i64 72}
!31 = !{!"b2SolverSet", !14, i64 0, !14, i64 16, !14, i64 32, !14, i64 48, !14, i64 64, !10, i64 80}
!32 = !{!29, !10, i64 4}
!33 = !{!29, !10, i64 8}
!34 = !{!29, !10, i64 12}
!35 = !{!29, !10, i64 16}
!36 = !{!29, !10, i64 20}
!37 = !{!29, !10, i64 24}
!38 = !{!29, !10, i64 28}
!39 = !{!29, !10, i64 32}
!40 = !{!29, !10, i64 36}
!41 = !{!29, !10, i64 40}
!42 = !{!29, !10, i64 44}
!43 = !{!29, !10, i64 48}
!44 = !{!29, !10, i64 52}
!45 = !{!46, !10, i64 0}
!46 = !{!"b2IslandSim", !10, i64 0}


; 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.b2Island = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [59 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [56 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @b2CreateIsland(ptr noundef %0, i32 noundef %1) local_unnamed_addr #1 {
  %3 = alloca %struct.b2Island, align 8
  %or.cond = icmp sgt i32 %1, 1
  br i1 %or.cond, label %7, label %4

4:                                                ; preds = %2
  %5 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 20) #6
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %7, label %6

6:                                                ; preds = %4
  tail call void @llvm.trap()
  unreachable

7:                                                ; preds = %2, %4
  %8 = getelementptr inbounds i8, ptr %0, i64 1168
  %9 = tail call i32 @b2AllocId(ptr noundef nonnull %8) #6
  %10 = getelementptr inbounds i8, ptr %0, i64 1192
  %11 = getelementptr inbounds i8, ptr %0, i64 1200
  %12 = load i32, ptr %11, align 8, !tbaa !5
  %13 = icmp eq i32 %9, %12
  br i1 %13, label %14, label %15

14:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %3) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(56) %3, i8 0, i64 56, i1 false)
  tail call void @b2IslandArray_Push(ptr noundef nonnull %10, ptr noundef nonnull byval(%struct.b2Island) align 8 %3)
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #6
  br label %24

15:                                               ; preds = %7
  %16 = load ptr, ptr %10, align 8, !tbaa !25
  %17 = sext i32 %9 to i64
  %18 = getelementptr inbounds %struct.b2Island, ptr %16, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !26
  %20 = icmp eq i32 %19, -1
  br i1 %20, label %24, label %21

21:                                               ; preds = %15
  %22 = tail call i32 @b2InternalAssertFcn(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 31) #6
  %.not33 = icmp eq i32 %22, 0
  br i1 %.not33, label %24, label %23

23:                                               ; preds = %21
  tail call void @llvm.trap()
  unreachable

24:                                               ; preds = %15, %21, %14
  %25 = getelementptr inbounds i8, ptr %0, i64 1072
  %26 = tail call ptr @b2SolverSetArray_Get(ptr noundef nonnull %25, i32 noundef %1)
  %27 = tail call ptr @b2IslandArray_Get(ptr noundef nonnull %10, i32 noundef %9)
  store i32 %1, ptr %27, align 4, !tbaa !26
  %28 = getelementptr inbounds i8, ptr %26, i64 64
  %29 = getelementptr inbounds i8, ptr %26, i64 72
  %30 = load i32, ptr %29, align 8, !tbaa !28
  %31 = getelementptr inbounds i8, ptr %27, i64 4
  store i32 %30, ptr %31, align 4, !tbaa !30
  %32 = getelementptr inbounds i8, ptr %27, i64 8
  store i32 %9, ptr %32, align 4, !tbaa !31
  %33 = getelementptr inbounds i8, ptr %27, i64 12
  store <4 x i32> <i32 -1, i32 -1, i32 0, i32 -1>, ptr %33, align 4, !tbaa !32
  %34 = getelementptr inbounds i8, ptr %27, i64 28
  store <4 x i32> <i32 -1, i32 0, i32 -1, i32 -1>, ptr %34, align 4, !tbaa !32
  %35 = getelementptr inbounds i8, ptr %27, i64 44
  store i32 0, ptr %35, align 4, !tbaa !33
  %36 = getelementptr inbounds i8, ptr %27, i64 48
  store i32 -1, ptr %36, align 4, !tbaa !34
  %37 = getelementptr inbounds i8, ptr %27, i64 52
  store i32 0, ptr %37, align 4, !tbaa !35
  %38 = tail call ptr @b2IslandSimArray_Add(ptr noundef nonnull %28)
  store i32 %9, ptr %38, align 4, !tbaa !36
  ret ptr %27
}

declare i32 @b2InternalAssertFcn(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: cold noreturn nounwind memory(inaccessiblemem: write)
declare void @llvm.trap() #3

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

declare i32 @b2AllocId(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @b2IslandArray_Push(ptr noundef, ptr noundef byval(%struct.b2Island) align 8) local_unnamed_addr #5

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2SolverSetArray_Get(ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2IslandArray_Get(ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @b2IslandSimArray_Add(ptr noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { 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 = { "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 = { cold noreturn nounwind memory(inaccessiblemem: write) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint 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 #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, !11, i64 1200}
!6 = !{!"b2World", !7, i64 0, !13, i64 40, !16, i64 336, !17, i64 1008, !12, i64 1032, !17, i64 1048, !12, i64 1072, !17, i64 1088, !12, i64 1112, !17, i64 1128, !12, i64 1152, !17, i64 1168, !12, i64 1192, !17, i64 1208, !17, i64 1232, !12, i64 1256, !12, i64 1272, !12, i64 1288, !12, i64 1304, !12, i64 1320, !12, i64 1336, !12, i64 1352, !12, i64 1368, !9, i64 1384, !9, i64 1416, !11, i64 1448, !12, i64 1456, !18, i64 1472, !18, i64 1488, !18, i64 1504, !18, i64 1520, !19, i64 1536, !11, i64 1544, !20, i64 1548, !21, i64 1556, !21, i64 1560, !21, i64 1564, !21, i64 1568, !21, i64 1572, !21, i64 1576, !21, i64 1580, !21, i64 1584, !8, i64 1592, !8, i64 1600, !22, i64 1608, !23, i64 1612, !8, i64 1704, !8, i64 1712, !8, i64 1720, !8, i64 1728, !11, i64 1736, !8, i64 1744, !8, i64 1752, !8, i64 1760, !8, i64 1768, !8, i64 1776, !21, i64 1784, !11, i64 1788, !11, i64 1792, !22, i64 1796, !24, i64 1798, !24, i64 1799, !24, i64 1800, !24, i64 1801, !24, i64 1802, !24, i64 1803}
!7 = !{!"b2ArenaAllocator", !8, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !12, i64 24}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"", !8, i64 0, !11, i64 8, !11, i64 12}
!13 = !{!"b2BroadPhase", !9, i64 0, !11, i64 216, !14, i64 224, !12, i64 240, !8, i64 256, !8, i64 264, !11, i64 272, !15, i64 276, !14, i64 280}
!14 = !{!"b2HashSet", !8, i64 0, !11, i64 8, !11, i64 12}
!15 = !{!"b2AtomicInt", !11, i64 0}
!16 = !{!"b2ConstraintGraph", !9, i64 0}
!17 = !{!"b2IdPool", !12, i64 0, !11, i64 16}
!18 = !{!"b2BitSet", !8, i64 0, !11, i64 8, !11, i64 12}
!19 = !{!"long", !9, i64 0}
!20 = !{!"b2Vec2", !21, i64 0, !21, i64 4}
!21 = !{!"float", !9, i64 0}
!22 = !{!"short", !9, i64 0}
!23 = !{!"b2Profile", !21, i64 0, !21, i64 4, !21, i64 8, !21, i64 12, !21, i64 16, !21, i64 20, !21, i64 24, !21, i64 28, !21, i64 32, !21, i64 36, !21, i64 40, !21, i64 44, !21, i64 48, !21, i64 52, !21, i64 56, !21, i64 60, !21, i64 64, !21, i64 68, !21, i64 72, !21, i64 76, !21, i64 80, !21, i64 84}
!24 = !{!"_Bool", !9, i64 0}
!25 = !{!6, !8, i64 1192}
!26 = !{!27, !11, i64 0}
!27 = !{!"b2Island", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52}
!28 = !{!29, !11, i64 72}
!29 = !{!"b2SolverSet", !12, i64 0, !12, i64 16, !12, i64 32, !12, i64 48, !12, i64 64, !11, i64 80}
!30 = !{!27, !11, i64 4}
!31 = !{!27, !11, i64 8}
!32 = !{!11, !11, i64 0}
!33 = !{!27, !11, i64 44}
!34 = !{!27, !11, i64 48}
!35 = !{!27, !11, i64 52}
!36 = !{!37, !11, i64 0}
!37 = !{!"b2IslandSim", !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass