; LLVM IR from siconos/siconos :: externals/lbl/metis4/ometis.ll_ (MlevelNodeBisectionMultiple)

; 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.controldef = type { i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, %struct.workspacedef, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
%struct.workspacedef = type { ptr, i32, i32, ptr, ptr, i32, ptr, ptr }
%struct.graphdef = type { ptr, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr }

@.str.7 = external hidden unnamed_addr constant [32 x i8], align 1

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

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

declare ptr @__idxmalloc(i32 noundef, ptr noundef) #1

declare void @GKfree(ptr noundef, ...) #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

; Function Attrs: nounwind uwtable
define dso_local void @__MlevelNodeBisectionMultiple(ptr noundef %0, ptr noundef %1, ptr noundef %2, float noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca float, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store float %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.controldef, ptr %17, i32 0, i32 9
  %19 = load i32, ptr %18, align 4, !tbaa !11
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %33, label %21

21:                                               ; preds = %4
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.graphdef, ptr %22, i32 0, i32 2
  %24 = load i32, ptr %23, align 8, !tbaa !16
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.controldef, ptr %25, i32 0, i32 10
  %27 = load i32, ptr %26, align 8, !tbaa !18
  %28 = and i32 %27, 1
  %29 = icmp ne i32 %28, 0
  %30 = zext i1 %29 to i64
  %31 = select i1 %29, i32 1000, i32 2000
  %32 = icmp slt i32 %24, %31
  br i1 %32, label %33, label %38

33:                                               ; preds = %21, %4
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = load float, ptr %8, align 4, !tbaa !9
  call void @__MlevelNodeBisection(ptr noundef %34, ptr noundef %35, ptr noundef %36, float noundef %37)
  store i32 1, ptr %16, align 4
  br label %180

38:                                               ; preds = %21
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.graphdef, ptr %39, i32 0, i32 2
  %41 = load i32, ptr %40, align 8, !tbaa !16
  store i32 %41, ptr %10, align 4, !tbaa !19
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.controldef, ptr %42, i32 0, i32 10
  %44 = load i32, ptr %43, align 8, !tbaa !18
  %45 = and i32 %44, 1
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %104

47:                                               ; preds = %38
  %48 = load i32, ptr %10, align 4, !tbaa !19
  %49 = call ptr @__idxmalloc(i32 noundef %48, ptr noundef @.str.7)
  store ptr %49, ptr %15, align 8, !tbaa !5
  %50 = load i32, ptr %10, align 4, !tbaa !19
  store i32 %50, ptr %12, align 4, !tbaa !19
  store i32 0, ptr %9, align 4, !tbaa !19
  br label %51

51:                                               ; preds = %88, %47
  %52 = load i32, ptr %9, align 4, !tbaa !19
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.controldef, ptr %53, i32 0, i32 9
  %55 = load i32, ptr %54, align 4, !tbaa !11
  %56 = icmp slt i32 %52, %55
  br i1 %56, label %57, label %91

57:                                               ; preds = %51
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = load float, ptr %8, align 4, !tbaa !9
  call void @__MlevelNodeBisection(ptr noundef %58, ptr noundef %59, ptr noundef %60, float noundef %61)
  %62 = load i32, ptr %9, align 4, !tbaa !19
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %70, label %64

64:                                               ; preds = %57
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.graphdef, ptr %65, i32 0, i32 12
  %67 = load i32, ptr %66, align 8, !tbaa !20
  %68 = load i32, ptr %12, align 4, !tbaa !19
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %70, label %81

70:                                               ; preds = %64, %57
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.graphdef, ptr %71, i32 0, i32 12
  %73 = load i32, ptr %72, align 8, !tbaa !20
  store i32 %73, ptr %12, align 4, !tbaa !19
  %74 = load ptr, ptr %15, align 8, !tbaa !5
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.graphdef, ptr %75, i32 0, i32 14
  %77 = load ptr, ptr %76, align 8, !tbaa !21
  %78 = load i32, ptr %10, align 4, !tbaa !19
  %79 = sext i32 %78 to i64
  %80 = mul i64 4, %79
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %74, ptr align 1 %77, i64 %80, i1 false)
  br label %81

81:                                               ; preds = %70, %64
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.graphdef, ptr %82, i32 0, i32 1
  call void (ptr, ...) @GKfree(ptr noundef %83, ptr noundef null)
  %84 = load i32, ptr %12, align 4, !tbaa !19
  %85 = icmp eq i32 %84, 0
  br i1 %85, label %86, label %87

86:                                               ; preds = %81
  br label %91

87:                                               ; preds = %81
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %9, align 4, !tbaa !19
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %9, align 4, !tbaa !19
  br label %51, !llvm.loop !22

91:                                               ; preds = %86, %51
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  call void @__Allocate2WayNodePartitionMemory(ptr noundef %92, ptr noundef %93)
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.graphdef, ptr %94, i32 0, i32 14
  %96 = load ptr, ptr %95, align 8, !tbaa !21
  %97 = load ptr, ptr %15, align 8, !tbaa !5
  %98 = load i32, ptr %10, align 4, !tbaa !19
  %99 = sext i32 %98 to i64
  %100 = mul i64 4, %99
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %96, ptr align 1 %97, i64 %100, i1 false)
  %101 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %101) #5
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  call void @__Compute2WayNodePartitionParams(ptr noundef %102, ptr noundef %103)
  br label %179

104:                                              ; preds = %38
  %105 = load i32, ptr %10, align 4, !tbaa !19
  %106 = sub nsw i32 %105, 1
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.controldef, ptr %107, i32 0, i32 0
  store i32 %106, ptr %108, align 8, !tbaa !24
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = call ptr @__Coarsen2Way(ptr noundef %109, ptr noundef %110)
  store ptr %111, ptr %14, align 8, !tbaa !5
  %112 = load ptr, ptr %14, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.graphdef, ptr %112, i32 0, i32 2
  %114 = load i32, ptr %113, align 8, !tbaa !16
  store i32 %114, ptr %11, align 4, !tbaa !19
  %115 = load i32, ptr %11, align 4, !tbaa !19
  %116 = call ptr @__idxmalloc(i32 noundef %115, ptr noundef @.str.7)
  store ptr %116, ptr %15, align 8, !tbaa !5
  %117 = load i32, ptr %10, align 4, !tbaa !19
  store i32 %117, ptr %12, align 4, !tbaa !19
  store i32 0, ptr %9, align 4, !tbaa !19
  br label %118

118:                                              ; preds = %159, %104
  %119 = load i32, ptr %9, align 4, !tbaa !19
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.controldef, ptr %120, i32 0, i32 9
  %122 = load i32, ptr %121, align 4, !tbaa !11
  %123 = icmp slt i32 %119, %122
  br i1 %123, label %124, label %162

124:                                              ; preds = %118
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.controldef, ptr %125, i32 0, i32 2
  %127 = load i32, ptr %126, align 8, !tbaa !25
  %128 = add nsw i32 %127, 20
  store i32 %128, ptr %126, align 8, !tbaa !25
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = load ptr, ptr %14, align 8, !tbaa !5
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = load float, ptr %8, align 4, !tbaa !9
  call void @__MlevelNodeBisection(ptr noundef %129, ptr noundef %130, ptr noundef %131, float noundef %132)
  %133 = load i32, ptr %9, align 4, !tbaa !19
  %134 = icmp eq i32 %133, 0
  br i1 %134, label %141, label %135

135:                                              ; preds = %124
  %136 = load ptr, ptr %14, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.graphdef, ptr %136, i32 0, i32 12
  %138 = load i32, ptr %137, align 8, !tbaa !20
  %139 = load i32, ptr %12, align 4, !tbaa !19
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %141, label %152

141:                                              ; preds = %135, %124
  %142 = load ptr, ptr %14, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.graphdef, ptr %142, i32 0, i32 12
  %144 = load i32, ptr %143, align 8, !tbaa !20
  store i32 %144, ptr %12, align 4, !tbaa !19
  %145 = load ptr, ptr %15, align 8, !tbaa !5
  %146 = load ptr, ptr %14, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.graphdef, ptr %146, i32 0, i32 14
  %148 = load ptr, ptr %147, align 8, !tbaa !21
  %149 = load i32, ptr %11, align 4, !tbaa !19
  %150 = sext i32 %149 to i64
  %151 = mul i64 4, %150
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %145, ptr align 1 %148, i64 %151, i1 false)
  br label %152

152:                                              ; preds = %141, %135
  %153 = load ptr, ptr %14, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.graphdef, ptr %153, i32 0, i32 1
  call void (ptr, ...) @GKfree(ptr noundef %154, ptr noundef null)
  %155 = load i32, ptr %12, align 4, !tbaa !19
  %156 = icmp eq i32 %155, 0
  br i1 %156, label %157, label %158

157:                                              ; preds = %152
  br label %162

158:                                              ; preds = %152
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %9, align 4, !tbaa !19
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %9, align 4, !tbaa !19
  br label %118, !llvm.loop !26

162:                                              ; preds = %157, %118
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = load ptr, ptr %14, align 8, !tbaa !5
  call void @__Allocate2WayNodePartitionMemory(ptr noundef %163, ptr noundef %164)
  %165 = load ptr, ptr %14, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.graphdef, ptr %165, i32 0, i32 14
  %167 = load ptr, ptr %166, align 8, !tbaa !21
  %168 = load ptr, ptr %15, align 8, !tbaa !5
  %169 = load i32, ptr %11, align 4, !tbaa !19
  %170 = sext i32 %169 to i64
  %171 = mul i64 4, %170
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %167, ptr align 1 %168, i64 %171, i1 false)
  %172 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %172) #5
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = load ptr, ptr %14, align 8, !tbaa !5
  call void @__Compute2WayNodePartitionParams(ptr noundef %173, ptr noundef %174)
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = load ptr, ptr %14, align 8, !tbaa !5
  %178 = load float, ptr %8, align 4, !tbaa !9
  call void @__Refine2WayNode(ptr noundef %175, ptr noundef %176, ptr noundef %177, float noundef %178)
  br label %179

179:                                              ; preds = %162, %91
  store i32 0, ptr %16, align 4
  br label %180

180:                                              ; preds = %179, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %181 = load i32, ptr %16, align 4
  switch i32 %181, label %183 [
    i32 0, label %182
    i32 1, label %182
  ]

182:                                              ; preds = %180, %180
  ret void

183:                                              ; preds = %180
  unreachable
}

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

; Function Attrs: nounwind uwtable
declare dso_local void @__MlevelNodeBisection(ptr noundef, ptr noundef, ptr noundef, float noundef) #3

declare void @__Allocate2WayNodePartitionMemory(ptr noundef, ptr noundef) #1

declare void @__Compute2WayNodePartitionParams(ptr noundef, ptr noundef) #1

declare ptr @__Coarsen2Way(ptr noundef, ptr noundef) #1

declare void @__Refine2WayNode(ptr noundef, ptr noundef, ptr noundef, float noundef) #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 = { 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 #4 = { 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 #5 = { 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 = !{!"float", !7, i64 0}
!11 = !{!12, !13, i64 36}
!12 = !{!"controldef", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !10, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !14, i64 48, !15, i64 104, !15, i64 112, !15, i64 120, !15, i64 128, !15, i64 136, !15, i64 144, !15, i64 152, !15, i64 160, !15, i64 168, !15, i64 176, !15, i64 184, !15, i64 192, !15, i64 200, !15, i64 208, !15, i64 216, !15, i64 224}
!13 = !{!"int", !7, i64 0}
!14 = !{!"workspacedef", !6, i64 0, !13, i64 8, !13, i64 12, !6, i64 16, !6, i64 24, !13, i64 32, !6, i64 40, !6, i64 48}
!15 = !{!"double", !7, i64 0}
!16 = !{!17, !13, i64 16}
!17 = !{!"graphdef", !6, i64 0, !6, i64 8, !13, i64 16, !13, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !13, i64 88, !13, i64 92, !6, i64 96, !6, i64 104, !13, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !13, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208}
!18 = !{!12, !13, i64 40}
!19 = !{!13, !13, i64 0}
!20 = !{!17, !13, i64 88}
!21 = !{!17, !6, i64 96}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!12, !13, i64 0}
!25 = !{!12, !13, i64 8}
!26 = distinct !{!26, !23}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.7 = external hidden unnamed_addr constant [32 x i8], align 1

declare ptr @__idxmalloc(i32 noundef, ptr noundef) local_unnamed_addr #0

declare void @GKfree(ptr noundef, ...) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local void @__MlevelNodeBisectionMultiple(ptr noundef %0, ptr noundef %1, ptr noundef %2, float noundef %3) local_unnamed_addr #2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 36
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = icmp eq i32 %6, 1
  br i1 %7, label %16, label %8

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  %10 = load i32, ptr %9, align 8, !tbaa !14
  %11 = getelementptr inbounds i8, ptr %0, i64 40
  %12 = load i32, ptr %11, align 8, !tbaa !16
  %13 = and i32 %12, 1
  %.not = icmp eq i32 %13, 0
  %14 = select i1 %.not, i32 2000, i32 1000
  %15 = icmp slt i32 %10, %14
  br i1 %15, label %16, label %17

16:                                               ; preds = %8, %4
  tail call void @__MlevelNodeBisection(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %2, float noundef %3)
  br label %75

17:                                               ; preds = %8
  br i1 %.not, label %42, label %18

18:                                               ; preds = %17
  %19 = tail call ptr @__idxmalloc(i32 noundef %10, ptr noundef nonnull @.str.7) #4
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %22, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %18
  %.pre105 = zext nneg i32 %10 to i64
  %.pre107 = shl nuw nsw i64 %.pre105, 2
  br label %._crit_edge

22:                                               ; preds = %18
  %23 = getelementptr inbounds i8, ptr %1, i64 88
  %24 = getelementptr inbounds i8, ptr %1, i64 8
  %25 = getelementptr inbounds i8, ptr %1, i64 96
  %26 = zext nneg i32 %10 to i64
  %27 = shl nuw nsw i64 %26, 2
  tail call void @__MlevelNodeBisection(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, float noundef %3)
  %.pre = load i32, ptr %23, align 8, !tbaa !17
  %28 = load ptr, ptr %25, align 8, !tbaa !18
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %19, ptr align 1 %28, i64 %27, i1 false)
  tail call void (ptr, ...) @GKfree(ptr noundef nonnull %24, ptr noundef null) #4
  %29 = icmp eq i32 %.pre, 0
  br i1 %29, label %._crit_edge, label %._crit_edge92

._crit_edge92:                                    ; preds = %22
  %.pre93 = load i32, ptr %5, align 4, !tbaa !5
  %30 = icmp sgt i32 %.pre93, 1
  br i1 %30, label %.peel.next, label %._crit_edge

.peel.next:                                       ; preds = %._crit_edge92, %36
  %.079 = phi i32 [ %37, %36 ], [ 1, %._crit_edge92 ]
  %.07078 = phi i32 [ %.17174, %36 ], [ %.pre, %._crit_edge92 ]
  tail call void @__MlevelNodeBisection(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, float noundef %3)
  %31 = load i32, ptr %23, align 8, !tbaa !17
  %32 = icmp slt i32 %31, %.07078
  br i1 %32, label %33, label %.thread

.thread:                                          ; preds = %.peel.next
  tail call void (ptr, ...) @GKfree(ptr noundef nonnull %24, ptr noundef null) #4
  br label %36

33:                                               ; preds = %.peel.next
  %34 = load ptr, ptr %25, align 8, !tbaa !18
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %19, ptr align 1 %34, i64 %27, i1 false)
  tail call void (ptr, ...) @GKfree(ptr noundef nonnull %24, ptr noundef null) #4
  %35 = icmp eq i32 %31, 0
  br i1 %35, label %._crit_edge, label %36

36:                                               ; preds = %.thread, %33
  %.17174 = phi i32 [ %.07078, %.thread ], [ %31, %33 ]
  %37 = add nuw nsw i32 %.079, 1
  %38 = load i32, ptr %5, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %.peel.next, label %._crit_edge, !llvm.loop !19

._crit_edge:                                      ; preds = %36, %33, %22, %._crit_edge92, %.._crit_edge_crit_edge
  %.pre-phi108 = phi i64 [ %.pre107, %.._crit_edge_crit_edge ], [ %27, %._crit_edge92 ], [ %27, %22 ], [ %27, %33 ], [ %27, %36 ]
  tail call void @__Allocate2WayNodePartitionMemory(ptr noundef %0, ptr noundef nonnull %1) #4
  %40 = getelementptr inbounds i8, ptr %1, i64 96
  %41 = load ptr, ptr %40, align 8, !tbaa !18
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %41, ptr align 1 %19, i64 %.pre-phi108, i1 false)
  tail call void @free(ptr noundef %19) #4
  tail call void @__Compute2WayNodePartitionParams(ptr noundef %0, ptr noundef nonnull %1) #4
  br label %75

42:                                               ; preds = %17
  %43 = add nsw i32 %10, -1
  store i32 %43, ptr %0, align 8, !tbaa !22
  %44 = tail call ptr @__Coarsen2Way(ptr noundef nonnull %0, ptr noundef nonnull %1) #4
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  %46 = load i32, ptr %45, align 8, !tbaa !14
  %47 = tail call ptr @__idxmalloc(i32 noundef %46, ptr noundef nonnull @.str.7) #4
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %50, label %.._crit_edge85_crit_edge

.._crit_edge85_crit_edge:                         ; preds = %42
  %.pre102 = sext i32 %46 to i64
  %.pre103 = shl nsw i64 %.pre102, 2
  br label %._crit_edge85

50:                                               ; preds = %42
  %51 = getelementptr inbounds i8, ptr %0, i64 8
  %52 = getelementptr inbounds i8, ptr %44, i64 88
  %53 = getelementptr inbounds i8, ptr %44, i64 8
  %54 = getelementptr inbounds i8, ptr %44, i64 96
  %55 = sext i32 %46 to i64
  %56 = shl nsw i64 %55, 2
  %57 = load i32, ptr %51, align 8, !tbaa !23
  %58 = add nsw i32 %57, 20
  store i32 %58, ptr %51, align 8, !tbaa !23
  tail call void @__MlevelNodeBisection(ptr noundef nonnull %0, ptr noundef nonnull %44, ptr noundef %2, float noundef %3)
  %.pre97 = load i32, ptr %52, align 8, !tbaa !17
  %59 = load ptr, ptr %54, align 8, !tbaa !18
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %47, ptr align 1 %59, i64 %56, i1 false)
  tail call void (ptr, ...) @GKfree(ptr noundef nonnull %53, ptr noundef null) #4
  %60 = icmp eq i32 %.pre97, 0
  br i1 %60, label %._crit_edge85, label %._crit_edge98

._crit_edge98:                                    ; preds = %50
  %.pre99 = load i32, ptr %5, align 4, !tbaa !5
  %61 = icmp sgt i32 %.pre99, 1
  br i1 %61, label %.peel.next89, label %._crit_edge85

.peel.next89:                                     ; preds = %._crit_edge98, %69
  %.182 = phi i32 [ %70, %69 ], [ 1, %._crit_edge98 ]
  %.281 = phi i32 [ %.377, %69 ], [ %.pre97, %._crit_edge98 ]
  %62 = load i32, ptr %51, align 8, !tbaa !23
  %63 = add nsw i32 %62, 20
  store i32 %63, ptr %51, align 8, !tbaa !23
  tail call void @__MlevelNodeBisection(ptr noundef nonnull %0, ptr noundef nonnull %44, ptr noundef %2, float noundef %3)
  %64 = load i32, ptr %52, align 8, !tbaa !17
  %65 = icmp slt i32 %64, %.281
  br i1 %65, label %66, label %.thread75

.thread75:                                        ; preds = %.peel.next89
  tail call void (ptr, ...) @GKfree(ptr noundef nonnull %53, ptr noundef null) #4
  br label %69

66:                                               ; preds = %.peel.next89
  %67 = load ptr, ptr %54, align 8, !tbaa !18
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %47, ptr align 1 %67, i64 %56, i1 false)
  tail call void (ptr, ...) @GKfree(ptr noundef nonnull %53, ptr noundef null) #4
  %68 = icmp eq i32 %64, 0
  br i1 %68, label %._crit_edge85, label %69

69:                                               ; preds = %.thread75, %66
  %.377 = phi i32 [ %.281, %.thread75 ], [ %64, %66 ]
  %70 = add nuw nsw i32 %.182, 1
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %.peel.next89, label %._crit_edge85, !llvm.loop !24

._crit_edge85:                                    ; preds = %69, %66, %50, %._crit_edge98, %.._crit_edge85_crit_edge
  %.pre-phi104 = phi i64 [ %.pre103, %.._crit_edge85_crit_edge ], [ %56, %._crit_edge98 ], [ %56, %50 ], [ %56, %66 ], [ %56, %69 ]
  tail call void @__Allocate2WayNodePartitionMemory(ptr noundef nonnull %0, ptr noundef nonnull %44) #4
  %73 = getelementptr inbounds i8, ptr %44, i64 96
  %74 = load ptr, ptr %73, align 8, !tbaa !18
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %74, ptr align 1 %47, i64 %.pre-phi104, i1 false)
  tail call void @free(ptr noundef %47) #4
  tail call void @__Compute2WayNodePartitionParams(ptr noundef nonnull %0, ptr noundef nonnull %44) #4
  tail call void @__Refine2WayNode(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %44, float noundef %3) #4
  br label %75

75:                                               ; preds = %._crit_edge, %._crit_edge85, %16
  ret void
}

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

; Function Attrs: nounwind uwtable
declare dso_local void @__MlevelNodeBisection(ptr noundef, ptr noundef, ptr noundef, float noundef) local_unnamed_addr #2

declare void @__Allocate2WayNodePartitionMemory(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @__Compute2WayNodePartitionParams(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @__Coarsen2Way(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @__Refine2WayNode(ptr noundef, ptr noundef, ptr noundef, float noundef) local_unnamed_addr #0

attributes #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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, !7, i64 36}
!6 = !{!"controldef", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !10, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !11, i64 48, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !13, i64 136, !13, i64 144, !13, i64 152, !13, i64 160, !13, i64 168, !13, i64 176, !13, i64 184, !13, i64 192, !13, i64 200, !13, i64 208, !13, i64 216, !13, i64 224}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"workspacedef", !12, i64 0, !7, i64 8, !7, i64 12, !12, i64 16, !12, i64 24, !7, i64 32, !12, i64 40, !12, i64 48}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!15, !7, i64 16}
!15 = !{!"graphdef", !12, i64 0, !12, i64 8, !7, i64 16, !7, i64 20, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !7, i64 88, !7, i64 92, !12, i64 96, !12, i64 104, !7, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !7, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208}
!16 = !{!6, !7, i64 40}
!17 = !{!15, !7, i64 88}
!18 = !{!15, !12, i64 96}
!19 = distinct !{!19, !20, !21}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!"llvm.loop.peeled.count", i32 1}
!22 = !{!6, !7, i64 0}
!23 = !{!6, !7, i64 8}
!24 = distinct !{!24, !20, !21}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass