; LLVM IR from ekoontz/graphlab :: src/graphlab/extern/metis/libmetis/ometis.ll_libmetis (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 { i64, i64, i64, i64, i64, i64, float, i64, i64, i64, i64, %struct.workspacedef, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
%struct.workspacedef = type { ptr, i64, i64, ptr, ptr, i64, ptr, ptr }
%struct.graphdef = type { i64, i64, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i64, i64, ptr, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, 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 @libmetis__idxmalloc(i64 noundef, ptr noundef) #1

declare void @gk_free(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 @libmetis__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 i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %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 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.controldef, ptr %17, i32 0, i32 9
  %19 = load i64, ptr %18, align 8, !tbaa !11
  %20 = icmp eq i64 %19, 1
  br i1 %20, label %34, label %21

21:                                               ; preds = %4
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.graphdef, ptr %22, i32 0, i32 0
  %24 = load i64, 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 i64, ptr %26, align 8, !tbaa !19
  %28 = and i64 %27, 1
  %29 = icmp ne i64 %28, 0
  %30 = zext i1 %29 to i64
  %31 = select i1 %29, i32 1000, i32 2000
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %24, %32
  br i1 %33, label %34, label %39

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

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

48:                                               ; preds = %39
  %49 = load i64, ptr %10, align 8, !tbaa !20
  %50 = call ptr @libmetis__idxmalloc(i64 noundef %49, ptr noundef @.str.7)
  store ptr %50, ptr %15, align 8, !tbaa !5
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.controldef, ptr %51, i32 0, i32 9
  %53 = load i64, ptr %52, align 8, !tbaa !11
  store i64 %53, ptr %9, align 8, !tbaa !20
  br label %54

54:                                               ; preds = %89, %48
  %55 = load i64, ptr %9, align 8, !tbaa !20
  %56 = icmp sgt i64 %55, 0
  br i1 %56, label %57, label %92

57:                                               ; preds = %54
  %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 @libmetis__MlevelNodeBisection(ptr noundef %58, ptr noundef %59, ptr noundef %60, float noundef %61)
  %62 = load i64, ptr %9, align 8, !tbaa !20
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.controldef, ptr %63, i32 0, i32 9
  %65 = load i64, ptr %64, align 8, !tbaa !11
  %66 = icmp eq i64 %62, %65
  br i1 %66, label %73, label %67

67:                                               ; preds = %57
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.graphdef, ptr %68, i32 0, i32 16
  %70 = load i64, ptr %69, align 8, !tbaa !21
  %71 = load i64, ptr %12, align 8, !tbaa !20
  %72 = icmp slt i64 %70, %71
  br i1 %72, label %73, label %83

73:                                               ; preds = %67, %57
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.graphdef, ptr %74, i32 0, i32 16
  %76 = load i64, ptr %75, align 8, !tbaa !21
  store i64 %76, ptr %12, align 8, !tbaa !20
  %77 = load ptr, ptr %15, align 8, !tbaa !5
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.graphdef, ptr %78, i32 0, i32 18
  %80 = load ptr, ptr %79, align 8, !tbaa !22
  %81 = load i64, ptr %10, align 8, !tbaa !20
  %82 = mul i64 8, %81
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %77, ptr align 1 %80, i64 %82, i1 false)
  br label %83

83:                                               ; preds = %73, %67
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  call void @libmetis__FreeRData(ptr noundef %84)
  %85 = load i64, ptr %12, align 8, !tbaa !20
  %86 = icmp eq i64 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %83
  br label %92

88:                                               ; preds = %83
  br label %89

89:                                               ; preds = %88
  %90 = load i64, ptr %9, align 8, !tbaa !20
  %91 = add nsw i64 %90, -1
  store i64 %91, ptr %9, align 8, !tbaa !20
  br label %54, !llvm.loop !23

92:                                               ; preds = %87, %54
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  call void @libmetis__Allocate2WayNodePartitionMemory(ptr noundef %93, ptr noundef %94)
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.graphdef, ptr %95, i32 0, i32 18
  %97 = load ptr, ptr %96, align 8, !tbaa !22
  %98 = load ptr, ptr %15, align 8, !tbaa !5
  %99 = load i64, ptr %10, align 8, !tbaa !20
  %100 = mul i64 8, %99
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %97, ptr align 1 %98, i64 %100, i1 false)
  call void (ptr, ...) @gk_free(ptr noundef %15, ptr noundef null)
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  call void @libmetis__Compute2WayNodePartitionParams(ptr noundef %101, ptr noundef %102)
  br label %176

103:                                              ; preds = %39
  %104 = load i64, ptr %10, align 8, !tbaa !20
  %105 = sub nsw i64 %104, 1
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.controldef, ptr %106, i32 0, i32 0
  store i64 %105, ptr %107, align 8, !tbaa !25
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = call ptr @libmetis__Coarsen2Way(ptr noundef %108, ptr noundef %109)
  store ptr %110, ptr %14, align 8, !tbaa !5
  %111 = load ptr, ptr %14, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.graphdef, ptr %111, i32 0, i32 0
  %113 = load i64, ptr %112, align 8, !tbaa !16
  store i64 %113, ptr %11, align 8, !tbaa !20
  %114 = load i64, ptr %11, align 8, !tbaa !20
  %115 = call ptr @libmetis__idxmalloc(i64 noundef %114, ptr noundef @.str.7)
  store ptr %115, ptr %15, align 8, !tbaa !5
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.controldef, ptr %116, i32 0, i32 9
  %118 = load i64, ptr %117, align 8, !tbaa !11
  store i64 %118, ptr %9, align 8, !tbaa !20
  br label %119

119:                                              ; preds = %158, %103
  %120 = load i64, ptr %9, align 8, !tbaa !20
  %121 = icmp sgt i64 %120, 0
  br i1 %121, label %122, label %161

122:                                              ; preds = %119
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.controldef, ptr %123, i32 0, i32 2
  %125 = load i64, ptr %124, align 8, !tbaa !26
  %126 = add nsw i64 %125, 20
  store i64 %126, ptr %124, align 8, !tbaa !26
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = load ptr, ptr %14, align 8, !tbaa !5
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = load float, ptr %8, align 4, !tbaa !9
  call void @libmetis__MlevelNodeBisection(ptr noundef %127, ptr noundef %128, ptr noundef %129, float noundef %130)
  %131 = load i64, ptr %9, align 8, !tbaa !20
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.controldef, ptr %132, i32 0, i32 9
  %134 = load i64, ptr %133, align 8, !tbaa !11
  %135 = icmp eq i64 %131, %134
  br i1 %135, label %142, label %136

136:                                              ; preds = %122
  %137 = load ptr, ptr %14, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.graphdef, ptr %137, i32 0, i32 16
  %139 = load i64, ptr %138, align 8, !tbaa !21
  %140 = load i64, ptr %12, align 8, !tbaa !20
  %141 = icmp slt i64 %139, %140
  br i1 %141, label %142, label %152

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

152:                                              ; preds = %142, %136
  %153 = load ptr, ptr %6, align 8, !tbaa !5
  call void @libmetis__FreeRData(ptr noundef %153)
  %154 = load i64, ptr %12, align 8, !tbaa !20
  %155 = icmp eq i64 %154, 0
  br i1 %155, label %156, label %157

156:                                              ; preds = %152
  br label %161

157:                                              ; preds = %152
  br label %158

158:                                              ; preds = %157
  %159 = load i64, ptr %9, align 8, !tbaa !20
  %160 = add nsw i64 %159, -1
  store i64 %160, ptr %9, align 8, !tbaa !20
  br label %119, !llvm.loop !27

161:                                              ; preds = %156, %119
  %162 = load ptr, ptr %5, align 8, !tbaa !5
  %163 = load ptr, ptr %14, align 8, !tbaa !5
  call void @libmetis__Allocate2WayNodePartitionMemory(ptr noundef %162, ptr noundef %163)
  %164 = load ptr, ptr %14, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.graphdef, ptr %164, i32 0, i32 18
  %166 = load ptr, ptr %165, align 8, !tbaa !22
  %167 = load ptr, ptr %15, align 8, !tbaa !5
  %168 = load i64, ptr %11, align 8, !tbaa !20
  %169 = mul i64 8, %168
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %166, ptr align 1 %167, i64 %169, i1 false)
  call void (ptr, ...) @gk_free(ptr noundef %15, ptr noundef null)
  %170 = load ptr, ptr %5, align 8, !tbaa !5
  %171 = load ptr, ptr %14, align 8, !tbaa !5
  call void @libmetis__Compute2WayNodePartitionParams(ptr noundef %170, ptr noundef %171)
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  %174 = load ptr, ptr %14, align 8, !tbaa !5
  %175 = load float, ptr %8, align 4, !tbaa !9
  call void @libmetis__Refine2WayNode(ptr noundef %172, ptr noundef %173, ptr noundef %174, float noundef %175)
  br label %176

176:                                              ; preds = %161, %92
  store i32 0, ptr %16, align 4
  br label %177

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

179:                                              ; preds = %177, %177
  ret void

180:                                              ; preds = %177
  unreachable
}

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

declare void @libmetis__FreeRData(ptr noundef) #1

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

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

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

declare void @libmetis__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 }

!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 72}
!12 = !{!"controldef", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !10, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !14, i64 88, !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, !15, i64 232, !15, i64 240, !15, i64 248, !15, i64 256, !15, i64 264, !15, i64 272}
!13 = !{!"long", !7, i64 0}
!14 = !{!"workspacedef", !6, i64 0, !13, i64 8, !13, i64 16, !6, i64 24, !6, i64 32, !13, i64 40, !6, i64 48, !6, i64 56}
!15 = !{!"double", !7, i64 0}
!16 = !{!17, !13, i64 0}
!17 = !{!"graphdef", !13, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !18, i64 56, !18, i64 60, !18, i64 64, !18, i64 68, !18, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !13, i64 112, !13, i64 120, !6, i64 128, !6, i64 136, !13, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !13, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240}
!18 = !{!"int", !7, i64 0}
!19 = !{!12, !13, i64 80}
!20 = !{!13, !13, i64 0}
!21 = !{!17, !13, i64 112}
!22 = !{!17, !6, i64 128}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!12, !13, i64 0}
!26 = !{!12, !13, i64 16}
!27 = distinct !{!27, !24}


; 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

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

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

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

declare void @gk_free(ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
define dso_local void @libmetis__MlevelNodeBisectionMultiple(ptr noundef %0, ptr noundef %1, ptr noundef %2, float noundef %3) local_unnamed_addr #3 {
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %6 = getelementptr inbounds i8, ptr %0, i64 72
  %7 = load i64, ptr %6, align 8, !tbaa !5
  %8 = icmp eq i64 %7, 1
  br i1 %8, label %16, label %9

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

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

17:                                               ; preds = %9
  br i1 %.not, label %37, label %18

18:                                               ; preds = %17
  %19 = tail call ptr @libmetis__idxmalloc(i64 noundef %10, ptr noundef nonnull @.str.7) #4
  store ptr %19, ptr %5, align 8, !tbaa !18
  %20 = load i64, ptr %6, align 8, !tbaa !5
  %21 = icmp sgt i64 %20, 0
  br i1 %21, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %18
  %.pre83 = shl i64 %10, 3
  br label %._crit_edge

.lr.ph:                                           ; preds = %18
  %22 = getelementptr inbounds i8, ptr %1, i64 112
  %23 = getelementptr inbounds i8, ptr %1, i64 128
  %24 = shl i64 %10, 3
  br label %25

25:                                               ; preds = %.lr.ph, %32
  %.073 = phi i64 [ %20, %.lr.ph ], [ %33, %32 ]
  %.06472 = phi i64 [ undef, %.lr.ph ], [ %.16568, %32 ]
  tail call void @libmetis__MlevelNodeBisection(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, float noundef %3)
  %26 = load i64, ptr %6, align 8, !tbaa !5
  %27 = icmp eq i64 %.073, %26
  %.pre = load i64, ptr %22, align 8, !tbaa !19
  %28 = icmp slt i64 %.pre, %.06472
  %or.cond = select i1 %27, i1 true, i1 %28
  br i1 %or.cond, label %29, label %.thread

.thread:                                          ; preds = %25
  tail call void @libmetis__FreeRData(ptr noundef nonnull %1) #4
  br label %32

29:                                               ; preds = %25
  %30 = load ptr, ptr %23, align 8, !tbaa !20
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %19, ptr align 1 %30, i64 %24, i1 false)
  tail call void @libmetis__FreeRData(ptr noundef nonnull %1) #4
  %31 = icmp eq i64 %.pre, 0
  br i1 %31, label %._crit_edge, label %32

32:                                               ; preds = %.thread, %29
  %.16568 = phi i64 [ %.06472, %.thread ], [ %.pre, %29 ]
  %33 = add nsw i64 %.073, -1
  %34 = icmp sgt i64 %.073, 1
  br i1 %34, label %25, label %._crit_edge, !llvm.loop !21

._crit_edge:                                      ; preds = %32, %29, %.._crit_edge_crit_edge
  %.pre-phi84 = phi i64 [ %.pre83, %.._crit_edge_crit_edge ], [ %24, %29 ], [ %24, %32 ]
  tail call void @libmetis__Allocate2WayNodePartitionMemory(ptr noundef nonnull %0, ptr noundef nonnull %1) #4
  %35 = getelementptr inbounds i8, ptr %1, i64 128
  %36 = load ptr, ptr %35, align 8, !tbaa !20
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %36, ptr align 1 %19, i64 %.pre-phi84, i1 false)
  call void (ptr, ...) @gk_free(ptr noundef nonnull %5, ptr noundef null) #4
  call void @libmetis__Compute2WayNodePartitionParams(ptr noundef nonnull %0, ptr noundef nonnull %1) #4
  br label %62

37:                                               ; preds = %17
  %38 = add nsw i64 %10, -1
  store i64 %38, ptr %0, align 8, !tbaa !23
  %39 = tail call ptr @libmetis__Coarsen2Way(ptr noundef nonnull %0, ptr noundef nonnull %1) #4
  %40 = load i64, ptr %39, align 8, !tbaa !14
  %41 = tail call ptr @libmetis__idxmalloc(i64 noundef %40, ptr noundef nonnull @.str.7) #4
  store ptr %41, ptr %5, align 8, !tbaa !18
  %42 = load i64, ptr %6, align 8, !tbaa !5
  %43 = icmp sgt i64 %42, 0
  br i1 %43, label %.lr.ph78, label %.._crit_edge79_crit_edge

.._crit_edge79_crit_edge:                         ; preds = %37
  %.pre82 = shl i64 %40, 3
  br label %._crit_edge79

.lr.ph78:                                         ; preds = %37
  %44 = getelementptr inbounds i8, ptr %0, i64 16
  %45 = getelementptr inbounds i8, ptr %39, i64 112
  %46 = getelementptr inbounds i8, ptr %39, i64 128
  %47 = shl i64 %40, 3
  br label %48

48:                                               ; preds = %.lr.ph78, %57
  %.176 = phi i64 [ %42, %.lr.ph78 ], [ %58, %57 ]
  %.275 = phi i64 [ undef, %.lr.ph78 ], [ %.371, %57 ]
  %49 = load i64, ptr %44, align 8, !tbaa !24
  %50 = add nsw i64 %49, 20
  store i64 %50, ptr %44, align 8, !tbaa !24
  tail call void @libmetis__MlevelNodeBisection(ptr noundef nonnull %0, ptr noundef nonnull %39, ptr noundef %2, float noundef %3)
  %51 = load i64, ptr %6, align 8, !tbaa !5
  %52 = icmp eq i64 %.176, %51
  %.pre81 = load i64, ptr %45, align 8, !tbaa !19
  %53 = icmp slt i64 %.pre81, %.275
  %or.cond85 = select i1 %52, i1 true, i1 %53
  br i1 %or.cond85, label %54, label %.thread69

.thread69:                                        ; preds = %48
  tail call void @libmetis__FreeRData(ptr noundef nonnull %1) #4
  br label %57

54:                                               ; preds = %48
  %55 = load ptr, ptr %46, align 8, !tbaa !20
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %41, ptr align 1 %55, i64 %47, i1 false)
  tail call void @libmetis__FreeRData(ptr noundef nonnull %1) #4
  %56 = icmp eq i64 %.pre81, 0
  br i1 %56, label %._crit_edge79, label %57

57:                                               ; preds = %.thread69, %54
  %.371 = phi i64 [ %.275, %.thread69 ], [ %.pre81, %54 ]
  %58 = add nsw i64 %.176, -1
  %59 = icmp sgt i64 %.176, 1
  br i1 %59, label %48, label %._crit_edge79, !llvm.loop !25

._crit_edge79:                                    ; preds = %57, %54, %.._crit_edge79_crit_edge
  %.pre-phi = phi i64 [ %.pre82, %.._crit_edge79_crit_edge ], [ %47, %54 ], [ %47, %57 ]
  tail call void @libmetis__Allocate2WayNodePartitionMemory(ptr noundef nonnull %0, ptr noundef nonnull %39) #4
  %60 = getelementptr inbounds i8, ptr %39, i64 128
  %61 = load ptr, ptr %60, align 8, !tbaa !20
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %61, ptr align 1 %41, i64 %.pre-phi, i1 false)
  call void (ptr, ...) @gk_free(ptr noundef nonnull %5, ptr noundef null) #4
  call void @libmetis__Compute2WayNodePartitionParams(ptr noundef nonnull %0, ptr noundef nonnull %39) #4
  call void @libmetis__Refine2WayNode(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %39, float noundef %3) #4
  br label %62

62:                                               ; preds = %._crit_edge, %._crit_edge79, %16
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  ret void
}

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

declare void @libmetis__FreeRData(ptr noundef) local_unnamed_addr #1

declare void @libmetis__Allocate2WayNodePartitionMemory(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @libmetis__Compute2WayNodePartitionParams(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @libmetis__Coarsen2Way(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @libmetis__Refine2WayNode(ptr noundef, ptr noundef, ptr noundef, float noundef) 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 = { mustprogress 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 }

!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 72}
!6 = !{!"controldef", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !10, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !11, i64 88, !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, !13, i64 232, !13, i64 240, !13, i64 248, !13, i64 256, !13, i64 264, !13, i64 272}
!7 = !{!"long", !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 16, !12, i64 24, !12, i64 32, !7, i64 40, !12, i64 48, !12, i64 56}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!15, !7, i64 0}
!15 = !{!"graphdef", !7, i64 0, !7, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !16, i64 56, !16, i64 60, !16, i64 64, !16, i64 68, !16, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !7, i64 112, !7, i64 120, !12, i64 128, !12, i64 136, !7, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !7, i64 208, !12, i64 216, !12, i64 224, !12, i64 232, !12, i64 240}
!16 = !{!"int", !8, i64 0}
!17 = !{!6, !7, i64 80}
!18 = !{!12, !12, i64 0}
!19 = !{!15, !7, i64 112}
!20 = !{!15, !12, i64 128}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!6, !7, i64 0}
!24 = !{!6, !7, i64 16}
!25 = distinct !{!25, !22}


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