; LLVM IR from ekoontz/graphlab :: src/graphlab/extern/metis/libmetis/minitpart.ll_libmetis (MocRandomBisection)

; 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.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 }
%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 }

@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 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: nounwind uwtable
define dso_local void @libmetis__MocRandomBisection(ptr noundef %0, ptr noundef %1, ptr noundef %2, float noundef %3) #1 {
  %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 i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca [16 x i64], align 16
  %25 = alloca ptr, align 8
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 128, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.graphdef, ptr %26, i32 0, i32 0
  %28 = load i64, ptr %27, align 8, !tbaa !11
  store i64 %28, ptr %13, align 8, !tbaa !15
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.graphdef, ptr %29, i32 0, i32 28
  %31 = load i64, ptr %30, align 8, !tbaa !16
  store i64 %31, ptr %14, align 8, !tbaa !15
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.graphdef, ptr %32, i32 0, i32 29
  %34 = load ptr, ptr %33, align 8, !tbaa !17
  store ptr %34, ptr %25, align 8, !tbaa !5
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  call void @libmetis__MocAllocate2WayPartitionMemory(ptr noundef %35, ptr noundef %36)
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.graphdef, ptr %37, i32 0, i32 18
  %39 = load ptr, ptr %38, align 8, !tbaa !18
  store ptr %39, ptr %22, align 8, !tbaa !5
  %40 = load i64, ptr %13, align 8, !tbaa !15
  %41 = call ptr @libmetis__idxmalloc(i64 noundef %40, ptr noundef @.str.2)
  store ptr %41, ptr %21, align 8, !tbaa !5
  %42 = load i64, ptr %13, align 8, !tbaa !15
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.controldef, ptr %43, i32 0, i32 0
  %45 = load i64, ptr %44, align 8, !tbaa !19
  %46 = icmp sle i64 %42, %45
  %47 = zext i1 %46 to i64
  %48 = select i1 %46, i32 3, i32 8
  %49 = mul nsw i32 2, %48
  %50 = sext i32 %49 to i64
  store i64 %50, ptr %18, align 8, !tbaa !15
  %51 = load i64, ptr %13, align 8, !tbaa !15
  %52 = call ptr @libmetis__idxmalloc(i64 noundef %51, ptr noundef @.str.3)
  store ptr %52, ptr %23, align 8, !tbaa !5
  store i64 0, ptr %19, align 8, !tbaa !15
  br label %53

53:                                               ; preds = %142, %4
  %54 = load i64, ptr %19, align 8, !tbaa !15
  %55 = load i64, ptr %18, align 8, !tbaa !15
  %56 = icmp slt i64 %54, %55
  br i1 %56, label %57, label %145

57:                                               ; preds = %53
  store i64 0, ptr %9, align 8, !tbaa !15
  br label %58

58:                                               ; preds = %65, %57
  %59 = load i64, ptr %9, align 8, !tbaa !15
  %60 = load i64, ptr %14, align 8, !tbaa !15
  %61 = icmp slt i64 %59, %60
  br i1 %61, label %62, label %68

62:                                               ; preds = %58
  %63 = load i64, ptr %9, align 8, !tbaa !15
  %64 = getelementptr inbounds [16 x i64], ptr %24, i64 0, i64 %63
  store i64 0, ptr %64, align 8, !tbaa !15
  br label %65

65:                                               ; preds = %62
  %66 = load i64, ptr %9, align 8, !tbaa !15
  %67 = add nsw i64 %66, 1
  store i64 %67, ptr %9, align 8, !tbaa !15
  br label %58, !llvm.loop !23

68:                                               ; preds = %58
  %69 = load i64, ptr %13, align 8, !tbaa !15
  %70 = load ptr, ptr %23, align 8, !tbaa !5
  call void @libmetis__RandomPermute(i64 noundef %69, ptr noundef %70, i64 noundef 1)
  store i64 0, ptr %10, align 8, !tbaa !15
  br label %71

71:                                               ; preds = %100, %68
  %72 = load i64, ptr %10, align 8, !tbaa !15
  %73 = load i64, ptr %13, align 8, !tbaa !15
  %74 = icmp slt i64 %72, %73
  br i1 %74, label %75, label %103

75:                                               ; preds = %71
  %76 = load ptr, ptr %23, align 8, !tbaa !5
  %77 = load i64, ptr %10, align 8, !tbaa !15
  %78 = getelementptr inbounds i64, ptr %76, i64 %77
  %79 = load i64, ptr %78, align 8, !tbaa !15
  store i64 %79, ptr %9, align 8, !tbaa !15
  %80 = load i64, ptr %14, align 8, !tbaa !15
  %81 = load ptr, ptr %25, align 8, !tbaa !5
  %82 = load i64, ptr %9, align 8, !tbaa !15
  %83 = load i64, ptr %14, align 8, !tbaa !15
  %84 = mul nsw i64 %82, %83
  %85 = getelementptr inbounds float, ptr %81, i64 %84
  %86 = call i64 @gk_fargmax(i64 noundef %80, ptr noundef %85)
  store i64 %86, ptr %20, align 8, !tbaa !15
  %87 = load i64, ptr %20, align 8, !tbaa !15
  %88 = getelementptr inbounds [16 x i64], ptr %24, i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !15
  %90 = load ptr, ptr %22, align 8, !tbaa !5
  %91 = load i64, ptr %9, align 8, !tbaa !15
  %92 = getelementptr inbounds i64, ptr %90, i64 %91
  store i64 %89, ptr %92, align 8, !tbaa !15
  %93 = load i64, ptr %20, align 8, !tbaa !15
  %94 = getelementptr inbounds [16 x i64], ptr %24, i64 0, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !15
  %96 = add nsw i64 %95, 1
  %97 = srem i64 %96, 2
  %98 = load i64, ptr %20, align 8, !tbaa !15
  %99 = getelementptr inbounds [16 x i64], ptr %24, i64 0, i64 %98
  store i64 %97, ptr %99, align 8, !tbaa !15
  br label %100

100:                                              ; preds = %75
  %101 = load i64, ptr %10, align 8, !tbaa !15
  %102 = add nsw i64 %101, 1
  store i64 %102, ptr %10, align 8, !tbaa !15
  br label %71, !llvm.loop !25

103:                                              ; preds = %71
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  call void @libmetis__MocCompute2WayPartitionParams(ptr noundef %104, ptr noundef %105)
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MocFM_2WayEdgeRefine(ptr noundef %106, ptr noundef %107, ptr noundef %108, i64 noundef 6)
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MocBalance2Way(ptr noundef %109, ptr noundef %110, ptr noundef %111, float noundef 0x3FF051EB80000000)
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MocFM_2WayEdgeRefine(ptr noundef %112, ptr noundef %113, ptr noundef %114, i64 noundef 6)
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MocBalance2Way(ptr noundef %115, ptr noundef %116, ptr noundef %117, float noundef 0x3FF051EB80000000)
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__MocFM_2WayEdgeRefine(ptr noundef %118, ptr noundef %119, ptr noundef %120, i64 noundef 6)
  %121 = load i64, ptr %19, align 8, !tbaa !15
  %122 = icmp eq i64 %121, 0
  br i1 %122, label %129, label %123

123:                                              ; preds = %103
  %124 = load i64, ptr %16, align 8, !tbaa !15
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.graphdef, ptr %125, i32 0, i32 16
  %127 = load i64, ptr %126, align 8, !tbaa !26
  %128 = icmp sge i64 %124, %127
  br i1 %128, label %129, label %141

129:                                              ; preds = %123, %103
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.graphdef, ptr %130, i32 0, i32 16
  %132 = load i64, ptr %131, align 8, !tbaa !26
  store i64 %132, ptr %16, align 8, !tbaa !15
  %133 = load ptr, ptr %21, align 8, !tbaa !5
  %134 = load ptr, ptr %22, align 8, !tbaa !5
  %135 = load i64, ptr %13, align 8, !tbaa !15
  %136 = mul i64 8, %135
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %133, ptr align 1 %134, i64 %136, i1 false)
  %137 = load i64, ptr %16, align 8, !tbaa !15
  %138 = icmp eq i64 %137, 0
  br i1 %138, label %139, label %140

139:                                              ; preds = %129
  br label %145

140:                                              ; preds = %129
  br label %141

141:                                              ; preds = %140, %123
  br label %142

142:                                              ; preds = %141
  %143 = load i64, ptr %19, align 8, !tbaa !15
  %144 = add nsw i64 %143, 1
  store i64 %144, ptr %19, align 8, !tbaa !15
  br label %53, !llvm.loop !27

145:                                              ; preds = %139, %53
  %146 = load i64, ptr %16, align 8, !tbaa !15
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.graphdef, ptr %147, i32 0, i32 16
  store i64 %146, ptr %148, align 8, !tbaa !26
  %149 = load ptr, ptr %22, align 8, !tbaa !5
  %150 = load ptr, ptr %21, align 8, !tbaa !5
  %151 = load i64, ptr %13, align 8, !tbaa !15
  %152 = mul i64 8, %151
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %149, ptr align 1 %150, i64 %152, i1 false)
  call void (ptr, ...) @gk_free(ptr noundef %21, ptr noundef %23, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  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
  ret void
}

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

declare void @libmetis__MocAllocate2WayPartitionMemory(ptr noundef, ptr noundef) #2

declare ptr @libmetis__idxmalloc(i64 noundef, ptr noundef) #2

declare void @libmetis__MocCompute2WayPartitionParams(ptr noundef, ptr noundef) #2

declare void @libmetis__MocFM_2WayEdgeRefine(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #2

declare void @libmetis__MocBalance2Way(ptr noundef, ptr noundef, ptr noundef, float noundef) #2

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

declare void @gk_free(ptr noundef, ...) #2

declare void @libmetis__RandomPermute(i64 noundef, ptr noundef, i64 noundef) #2

declare i64 @gk_fargmax(i64 noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 0}
!12 = !{!"graphdef", !13, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !14, i64 56, !14, i64 60, !14, i64 64, !14, i64 68, !14, 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}
!13 = !{!"long", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!13, !13, i64 0}
!16 = !{!12, !13, i64 208}
!17 = !{!12, !6, i64 216}
!18 = !{!12, !6, i64 128}
!19 = !{!20, !13, i64 0}
!20 = !{!"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, !21, i64 88, !22, i64 152, !22, i64 160, !22, i64 168, !22, i64 176, !22, i64 184, !22, i64 192, !22, i64 200, !22, i64 208, !22, i64 216, !22, i64 224, !22, i64 232, !22, i64 240, !22, i64 248, !22, i64 256, !22, i64 264, !22, i64 272}
!21 = !{!"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}
!22 = !{!"double", !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = !{!12, !13, i64 112}
!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.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 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: nounwind uwtable
define dso_local void @libmetis__MocRandomBisection(ptr noundef %0, ptr noundef %1, ptr noundef %2, float noundef %3) local_unnamed_addr #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [16 x i64], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %7) #5
  %8 = load i64, ptr %1, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %1, i64 208
  %10 = load i64, ptr %9, align 8, !tbaa !12
  %11 = getelementptr inbounds i8, ptr %1, i64 216
  %12 = load ptr, ptr %11, align 8, !tbaa !13
  tail call void @libmetis__MocAllocate2WayPartitionMemory(ptr noundef %0, ptr noundef nonnull %1) #5
  %13 = getelementptr inbounds i8, ptr %1, i64 128
  %14 = load ptr, ptr %13, align 8, !tbaa !14
  %15 = tail call ptr @libmetis__idxmalloc(i64 noundef %8, ptr noundef nonnull @.str.2) #5
  store ptr %15, ptr %5, align 8, !tbaa !15
  %16 = load i64, ptr %0, align 8, !tbaa !16
  %.not = icmp sgt i64 %8, %16
  %17 = select i1 %.not, i64 16, i64 6
  %18 = tail call ptr @libmetis__idxmalloc(i64 noundef %8, ptr noundef nonnull @.str.3) #5
  store ptr %18, ptr %6, align 8, !tbaa !15
  %19 = icmp sgt i64 %10, 0
  %20 = icmp sgt i64 %8, 0
  %21 = getelementptr inbounds i8, ptr %1, i64 112
  %22 = shl i64 %8, 3
  %23 = shl nuw i64 %10, 3
  br label %.preheader

.preheader:                                       ; preds = %4, %38
  %.05972 = phi i64 [ undef, %4 ], [ %.1, %38 ]
  %.06071 = phi i64 [ 0, %4 ], [ %39, %38 ]
  br i1 %19, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %7, i8 0, i64 %23, i1 false), !tbaa !21
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %.preheader
  tail call void @libmetis__RandomPermute(i64 noundef %8, ptr noundef %18, i64 noundef 1) #5
  br i1 %20, label %.lr.ph69, label %._crit_edge70

.lr.ph69:                                         ; preds = %._crit_edge, %.lr.ph69
  %.05867 = phi i64 [ %34, %.lr.ph69 ], [ 0, %._crit_edge ]
  %24 = getelementptr inbounds i64, ptr %18, i64 %.05867
  %25 = load i64, ptr %24, align 8, !tbaa !21
  %26 = mul nsw i64 %25, %10
  %27 = getelementptr inbounds float, ptr %12, i64 %26
  %28 = tail call i64 @gk_fargmax(i64 noundef %10, ptr noundef %27) #5
  %29 = getelementptr inbounds [16 x i64], ptr %7, i64 0, i64 %28
  %30 = load i64, ptr %29, align 8, !tbaa !21
  %31 = getelementptr inbounds i64, ptr %14, i64 %25
  store i64 %30, ptr %31, align 8, !tbaa !21
  %32 = add nsw i64 %30, 1
  %33 = srem i64 %32, 2
  store i64 %33, ptr %29, align 8, !tbaa !21
  %34 = add nuw nsw i64 %.05867, 1
  %exitcond.not = icmp eq i64 %34, %8
  br i1 %exitcond.not, label %._crit_edge70, label %.lr.ph69, !llvm.loop !22

._crit_edge70:                                    ; preds = %.lr.ph69, %._crit_edge
  tail call void @libmetis__MocCompute2WayPartitionParams(ptr noundef nonnull %0, ptr noundef nonnull %1) #5
  tail call void @libmetis__MocFM_2WayEdgeRefine(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, i64 noundef 6) #5
  tail call void @libmetis__MocBalance2Way(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, float noundef 0x3FF051EB80000000) #5
  tail call void @libmetis__MocFM_2WayEdgeRefine(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, i64 noundef 6) #5
  tail call void @libmetis__MocBalance2Way(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, float noundef 0x3FF051EB80000000) #5
  tail call void @libmetis__MocFM_2WayEdgeRefine(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %2, i64 noundef 6) #5
  %35 = icmp ne i64 %.06071, 0
  %.pre = load i64, ptr %21, align 8, !tbaa !24
  %.not65 = icmp slt i64 %.05972, %.pre
  %or.cond = select i1 %35, i1 %.not65, i1 false
  br i1 %or.cond, label %38, label %36

36:                                               ; preds = %._crit_edge70
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %15, ptr align 1 %14, i64 %22, i1 false)
  %37 = icmp eq i64 %.pre, 0
  br i1 %37, label %40, label %38

38:                                               ; preds = %._crit_edge70, %36
  %.1 = phi i64 [ %.pre, %36 ], [ %.05972, %._crit_edge70 ]
  %39 = add nuw nsw i64 %.06071, 1
  %exitcond73.not = icmp eq i64 %39, %17
  br i1 %exitcond73.not, label %40, label %.preheader, !llvm.loop !25

40:                                               ; preds = %36, %38
  %.2 = phi i64 [ 0, %36 ], [ %.1, %38 ]
  store i64 %.2, ptr %21, align 8, !tbaa !24
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %14, ptr align 1 %15, i64 %22, i1 false)
  call void (ptr, ...) @gk_free(ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef null) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  ret void
}

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

declare void @libmetis__MocAllocate2WayPartitionMemory(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @libmetis__MocCompute2WayPartitionParams(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @libmetis__MocFM_2WayEdgeRefine(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @libmetis__MocBalance2Way(ptr noundef, ptr noundef, ptr noundef, float noundef) local_unnamed_addr #2

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

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

declare void @libmetis__RandomPermute(i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare i64 @gk_fargmax(i64 noundef, ptr noundef) local_unnamed_addr #2

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

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


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