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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @b2DestroyIsland(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @b2MergeAwakeIslands(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.b2World, ptr %16, i32 0, i32 6
  %18 = call ptr @b2SolverSetArray_Get(ptr noundef %17, i32 noundef 2)
  store ptr %18, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.b2SolverSet, ptr %19, i32 0, i32 4
  %21 = getelementptr inbounds %struct.b2IslandSimArray, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  store ptr %22, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.b2SolverSet, ptr %23, i32 0, i32 4
  %25 = getelementptr inbounds %struct.b2IslandSimArray, ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 8, !tbaa !13
  store i32 %26, ptr %5, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !14
  br label %27

27:                                               ; preds = %81, %1
  %28 = load i32, ptr %6, align 4, !tbaa !14
  %29 = load i32, ptr %5, align 4, !tbaa !14
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %84

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = load i32, ptr %6, align 4, !tbaa !14
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds %struct.b2IslandSim, ptr %33, i64 %35
  %37 = getelementptr inbounds %struct.b2IslandSim, ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 4, !tbaa !15
  store i32 %38, ptr %7, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.b2World, ptr %39, i32 0, i32 12
  %41 = load i32, ptr %7, align 4, !tbaa !14
  %42 = call ptr @b2IslandArray_Get(ptr noundef %40, i32 noundef %41)
  store ptr %42, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %43 = load i32, ptr %7, align 4, !tbaa !14
  store i32 %43, ptr %9, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %44, ptr %10, align 8, !tbaa !5
  br label %45

45:                                               ; preds = %67, %32
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.b2Island, ptr %46, i32 0, i32 12
  %48 = load i32, ptr %47, align 4, !tbaa !17
  %49 = icmp ne i32 %48, -1
  br i1 %49, label %50, label %72

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.b2World, ptr %51, i32 0, i32 12
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.b2Island, ptr %53, i32 0, i32 12
  %55 = load i32, ptr %54, align 4, !tbaa !17
  %56 = call ptr @b2IslandArray_Get(ptr noundef %52, i32 noundef %55)
  store ptr %56, ptr %11, align 8, !tbaa !5
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.b2Island, ptr %57, i32 0, i32 12
  %59 = load i32, ptr %58, align 4, !tbaa !17
  %60 = icmp ne i32 %59, -1
  br i1 %60, label %61, label %67

61:                                               ; preds = %50
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.b2Island, ptr %62, i32 0, i32 12
  %64 = load i32, ptr %63, align 4, !tbaa !17
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.b2Island, ptr %65, i32 0, i32 12
  store i32 %64, ptr %66, align 4, !tbaa !17
  br label %67

67:                                               ; preds = %61, %50
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.b2Island, ptr %68, i32 0, i32 12
  %70 = load i32, ptr %69, align 4, !tbaa !17
  store i32 %70, ptr %9, align 4, !tbaa !14
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %71, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %45, !llvm.loop !19

72:                                               ; preds = %45
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = icmp ne ptr %73, %74
  br i1 %75, label %76, label %80

76:                                               ; preds = %72
  %77 = load i32, ptr %9, align 4, !tbaa !14
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.b2Island, ptr %78, i32 0, i32 12
  store i32 %77, ptr %79, align 4, !tbaa !17
  br label %80

80:                                               ; preds = %76, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %6, align 4, !tbaa !14
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %6, align 4, !tbaa !14
  br label %27, !llvm.loop !21

84:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %85 = load i32, ptr %5, align 4, !tbaa !14
  %86 = sub nsw i32 %85, 1
  store i32 %86, ptr %12, align 4, !tbaa !14
  br label %87

87:                                               ; preds = %115, %84
  %88 = load i32, ptr %12, align 4, !tbaa !14
  %89 = icmp sge i32 %88, 0
  br i1 %89, label %91, label %90

90:                                               ; preds = %87
  store i32 7, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %118

91:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = load i32, ptr %12, align 4, !tbaa !14
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds %struct.b2IslandSim, ptr %92, i64 %94
  %96 = getelementptr inbounds %struct.b2IslandSim, ptr %95, i32 0, i32 0
  %97 = load i32, ptr %96, align 4, !tbaa !15
  store i32 %97, ptr %14, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.b2World, ptr %98, i32 0, i32 12
  %100 = load i32, ptr %14, align 4, !tbaa !14
  %101 = call ptr @b2IslandArray_Get(ptr noundef %99, i32 noundef %100)
  store ptr %101, ptr %15, align 8, !tbaa !5
  %102 = load ptr, ptr %15, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.b2Island, ptr %102, i32 0, i32 12
  %104 = load i32, ptr %103, align 4, !tbaa !17
  %105 = icmp eq i32 %104, -1
  br i1 %105, label %106, label %107

106:                                              ; preds = %91
  store i32 9, ptr %13, align 4
  br label %112

107:                                              ; preds = %91
  %108 = load ptr, ptr %2, align 8, !tbaa !5
  %109 = load ptr, ptr %15, align 8, !tbaa !5
  call void @b2MergeIsland(ptr noundef %108, ptr noundef %109)
  %110 = load ptr, ptr %2, align 8, !tbaa !5
  %111 = load i32, ptr %14, align 4, !tbaa !14
  call void @b2DestroyIsland(ptr noundef %110, i32 noundef %111)
  store i32 0, ptr %13, align 4
  br label %112

112:                                              ; preds = %107, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %113 = load i32, ptr %13, align 4
  switch i32 %113, label %120 [
    i32 0, label %114
    i32 9, label %115
  ]

114:                                              ; preds = %112
  br label %115

115:                                              ; preds = %114, %112
  %116 = load i32, ptr %12, align 4, !tbaa !14
  %117 = add nsw i32 %116, -1
  store i32 %117, ptr %12, align 4, !tbaa !14
  br label %87, !llvm.loop !22

118:                                              ; preds = %90
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  call void @b2ValidateConnectivity(ptr noundef %119)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret void

120:                                              ; preds = %112
  unreachable
}

; Function Attrs: nounwind uwtable
declare hidden void @b2MergeIsland(ptr noundef, ptr noundef) #2

declare void @b2ValidateConnectivity(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 }

!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, !6, i64 64}
!10 = !{!"b2SolverSet", !11, i64 0, !11, i64 16, !11, i64 32, !11, i64 48, !11, i64 64, !12, i64 80}
!11 = !{!"", !6, i64 0, !12, i64 8, !12, i64 12}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !12, i64 72}
!14 = !{!12, !12, i64 0}
!15 = !{!16, !12, i64 0}
!16 = !{!"b2IslandSim", !12, i64 0}
!17 = !{!18, !12, i64 48}
!18 = !{!"b2Island", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}


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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @b2DestroyIsland(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @b2MergeAwakeIslands(ptr noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 1072
  %3 = tail call ptr @b2SolverSetArray_Get(ptr noundef nonnull %2, i32 noundef 2)
  %4 = getelementptr inbounds i8, ptr %3, i64 64
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %3, i64 72
  %7 = load i32, ptr %6, align 8, !tbaa !12
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph49, label %._crit_edge53

.lr.ph49:                                         ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 1192
  %wide.trip.count = zext nneg i32 %7 to i64
  br label %12

.preheader:                                       ; preds = %._crit_edge.thread
  br i1 %8, label %.lr.ph52, label %._crit_edge53

.lr.ph52:                                         ; preds = %.preheader
  %10 = getelementptr inbounds i8, ptr %0, i64 1192
  %11 = zext nneg i32 %7 to i64
  br label %25

12:                                               ; preds = %.lr.ph49, %._crit_edge.thread
  %indvars.iv = phi i64 [ 0, %.lr.ph49 ], [ %indvars.iv.next, %._crit_edge.thread ]
  %13 = getelementptr inbounds %struct.b2IslandSim, ptr %5, i64 %indvars.iv
  %14 = load i32, ptr %13, align 4, !tbaa !13
  %15 = tail call ptr @b2IslandArray_Get(ptr noundef nonnull %9, i32 noundef %14)
  %16 = getelementptr inbounds i8, ptr %15, i64 48
  %17 = load i32, ptr %16, align 4, !tbaa !15
  %.not45 = icmp eq i32 %17, -1
  br i1 %.not45, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %12, %23
  %18 = phi i32 [ %.pre59, %23 ], [ %17, %12 ]
  %19 = phi ptr [ %21, %23 ], [ %16, %12 ]
  %20 = tail call ptr @b2IslandArray_Get(ptr noundef nonnull %9, i32 noundef %18)
  %21 = getelementptr inbounds i8, ptr %20, i64 48
  %22 = load i32, ptr %21, align 4, !tbaa !15
  %.not44 = icmp eq i32 %22, -1
  br i1 %.not44, label %.thread, label %23

.thread:                                          ; preds = %.lr.ph
  %.pre = load i32, ptr %19, align 4, !tbaa !15
  br label %._crit_edge

23:                                               ; preds = %.lr.ph
  store i32 %22, ptr %19, align 4, !tbaa !15
  %.pre59 = load i32, ptr %21, align 4, !tbaa !15
  %.not = icmp eq i32 %.pre59, -1
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !17

._crit_edge:                                      ; preds = %23, %.thread
  %.036.lcssa = phi i32 [ %.pre, %.thread ], [ %22, %23 ]
  %.not43 = icmp eq ptr %20, %15
  br i1 %.not43, label %._crit_edge.thread, label %24

24:                                               ; preds = %._crit_edge
  store i32 %.036.lcssa, ptr %16, align 4, !tbaa !15
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %12, %24, %._crit_edge
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %12, !llvm.loop !19

._crit_edge53:                                    ; preds = %33, %1, %.preheader
  tail call void @b2ValidateConnectivity(ptr noundef %0) #3
  ret void

25:                                               ; preds = %.lr.ph52, %33
  %indvars.iv56 = phi i64 [ %11, %.lr.ph52 ], [ %indvars.iv.next57, %33 ]
  %indvars.iv.next57 = add nsw i64 %indvars.iv56, -1
  %26 = getelementptr inbounds %struct.b2IslandSim, ptr %5, i64 %indvars.iv.next57
  %27 = load i32, ptr %26, align 4, !tbaa !13
  %28 = tail call ptr @b2IslandArray_Get(ptr noundef nonnull %10, i32 noundef %27)
  %29 = getelementptr inbounds i8, ptr %28, i64 48
  %30 = load i32, ptr %29, align 4, !tbaa !15
  %31 = icmp eq i32 %30, -1
  br i1 %31, label %33, label %32

32:                                               ; preds = %25
  tail call void @b2MergeIsland(ptr noundef %0, ptr noundef nonnull %28)
  tail call void @b2DestroyIsland(ptr noundef %0, i32 noundef %27)
  br label %33

33:                                               ; preds = %25, %32
  %34 = icmp ugt i64 %indvars.iv56, 1
  br i1 %34, label %25, label %._crit_edge53, !llvm.loop !20
}

; Function Attrs: nounwind uwtable
declare hidden void @b2MergeIsland(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @b2ValidateConnectivity(ptr noundef) local_unnamed_addr #2

attributes #0 = { 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 #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 = { 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, !8, i64 64}
!6 = !{!"b2SolverSet", !7, i64 0, !7, i64 16, !7, i64 32, !7, i64 48, !7, i64 64, !11, i64 80}
!7 = !{!"", !8, i64 0, !11, i64 8, !11, i64 12}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!6, !11, i64 72}
!13 = !{!14, !11, i64 0}
!14 = !{!"b2IslandSim", !11, i64 0}
!15 = !{!16, !11, i64 48}
!16 = !{!"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}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


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