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

; 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.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 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__RandomBisection(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 [2 x i64], align 16
  %15 = alloca [2 x i64], align 16
  %16 = alloca [2 x i64], align 16
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = 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 16, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 16, 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 8, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #4
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.graphdef, ptr %32, i32 0, i32 0
  %34 = load i64, ptr %33, align 8, !tbaa !11
  store i64 %34, ptr %13, align 8, !tbaa !15
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.graphdef, ptr %35, i32 0, i32 2
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  store ptr %37, ptr %25, align 8, !tbaa !5
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.graphdef, ptr %38, i32 0, i32 3
  %40 = load ptr, ptr %39, align 8, !tbaa !17
  store ptr %40, ptr %26, align 8, !tbaa !5
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.graphdef, ptr %41, i32 0, i32 5
  %43 = load ptr, ptr %42, align 8, !tbaa !18
  store ptr %43, ptr %27, align 8, !tbaa !5
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.graphdef, ptr %44, i32 0, i32 6
  %46 = load ptr, ptr %45, align 8, !tbaa !19
  store ptr %46, ptr %28, align 8, !tbaa !5
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  call void @libmetis__Allocate2WayPartitionMemory(ptr noundef %47, ptr noundef %48)
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.graphdef, ptr %49, i32 0, i32 18
  %51 = load ptr, ptr %50, align 8, !tbaa !20
  store ptr %51, ptr %29, align 8, !tbaa !5
  %52 = load i64, ptr %13, align 8, !tbaa !15
  %53 = call ptr @libmetis__idxmalloc(i64 noundef %52, ptr noundef @.str.3)
  store ptr %53, ptr %31, align 8, !tbaa !5
  %54 = load i64, ptr %13, align 8, !tbaa !15
  %55 = call ptr @libmetis__idxmalloc(i64 noundef %54, ptr noundef @.str.4)
  store ptr %55, ptr %30, align 8, !tbaa !5
  %56 = load float, ptr %8, align 4, !tbaa !9
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds i64, ptr %57, i64 0
  %59 = load i64, ptr %58, align 8, !tbaa !15
  %60 = sitofp i64 %59 to float
  %61 = fmul float %56, %60
  %62 = fptosi float %61 to i64
  %63 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 0
  store i64 %62, ptr %63, align 16, !tbaa !15
  %64 = load float, ptr %8, align 4, !tbaa !9
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds i64, ptr %65, i64 1
  %67 = load i64, ptr %66, align 8, !tbaa !15
  %68 = sitofp i64 %67 to float
  %69 = fmul float %64, %68
  %70 = fptosi float %69 to i64
  %71 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 1
  store i64 %70, ptr %71, align 8, !tbaa !15
  %72 = load float, ptr %8, align 4, !tbaa !9
  %73 = fpext float %72 to double
  %74 = fdiv double 1.000000e+00, %73
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = getelementptr inbounds i64, ptr %75, i64 0
  %77 = load i64, ptr %76, align 8, !tbaa !15
  %78 = sitofp i64 %77 to double
  %79 = fmul double %74, %78
  %80 = fptosi double %79 to i64
  %81 = getelementptr inbounds [2 x i64], ptr %15, i64 0, i64 0
  store i64 %80, ptr %81, align 16, !tbaa !15
  %82 = load float, ptr %8, align 4, !tbaa !9
  %83 = fpext float %82 to double
  %84 = fdiv double 1.000000e+00, %83
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = getelementptr inbounds i64, ptr %85, i64 1
  %87 = load i64, ptr %86, align 8, !tbaa !15
  %88 = sitofp i64 %87 to double
  %89 = fmul double %84, %88
  %90 = fptosi double %89 to i64
  %91 = getelementptr inbounds [2 x i64], ptr %15, i64 0, i64 1
  store i64 %90, ptr %91, align 8, !tbaa !15
  %92 = load i64, ptr %13, align 8, !tbaa !15
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.controldef, ptr %93, i32 0, i32 0
  %95 = load i64, ptr %94, align 8, !tbaa !21
  %96 = icmp sle i64 %92, %95
  %97 = zext i1 %96 to i64
  %98 = select i1 %96, i32 3, i32 8
  %99 = sext i32 %98 to i64
  store i64 %99, ptr %23, align 8, !tbaa !15
  store i64 0, ptr %24, align 8, !tbaa !15
  br label %100

100:                                              ; preds = %202, %4
  %101 = load i64, ptr %24, align 8, !tbaa !15
  %102 = load i64, ptr %23, align 8, !tbaa !15
  %103 = icmp slt i64 %101, %102
  br i1 %103, label %104, label %205

104:                                              ; preds = %100
  %105 = load i64, ptr %13, align 8, !tbaa !15
  %106 = load ptr, ptr %30, align 8, !tbaa !5
  call void @libmetis__RandomPermute(i64 noundef %105, ptr noundef %106, i64 noundef 1)
  %107 = load i64, ptr %13, align 8, !tbaa !15
  %108 = load ptr, ptr %29, align 8, !tbaa !5
  %109 = call ptr @libmetis__idxset(i64 noundef %107, i64 noundef 1, ptr noundef %108)
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = getelementptr inbounds i64, ptr %110, i64 0
  %112 = load i64, ptr %111, align 8, !tbaa !15
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds i64, ptr %113, i64 1
  %115 = load i64, ptr %114, align 8, !tbaa !15
  %116 = add nsw i64 %112, %115
  %117 = getelementptr inbounds [2 x i64], ptr %14, i64 0, i64 1
  store i64 %116, ptr %117, align 8, !tbaa !15
  %118 = getelementptr inbounds [2 x i64], ptr %14, i64 0, i64 0
  store i64 0, ptr %118, align 16, !tbaa !15
  %119 = load i64, ptr %23, align 8, !tbaa !15
  %120 = icmp ne i64 %119, 1
  br i1 %120, label %121, label %171

121:                                              ; preds = %104
  store i64 0, ptr %10, align 8, !tbaa !15
  br label %122

122:                                              ; preds = %167, %121
  %123 = load i64, ptr %10, align 8, !tbaa !15
  %124 = load i64, ptr %13, align 8, !tbaa !15
  %125 = icmp slt i64 %123, %124
  br i1 %125, label %126, label %170

126:                                              ; preds = %122
  %127 = load ptr, ptr %30, align 8, !tbaa !5
  %128 = load i64, ptr %10, align 8, !tbaa !15
  %129 = getelementptr inbounds i64, ptr %127, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !15
  store i64 %130, ptr %9, align 8, !tbaa !15
  %131 = getelementptr inbounds [2 x i64], ptr %14, i64 0, i64 0
  %132 = load i64, ptr %131, align 16, !tbaa !15
  %133 = load ptr, ptr %26, align 8, !tbaa !5
  %134 = load i64, ptr %9, align 8, !tbaa !15
  %135 = getelementptr inbounds i64, ptr %133, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !15
  %137 = add nsw i64 %132, %136
  %138 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 0
  %139 = load i64, ptr %138, align 16, !tbaa !15
  %140 = icmp slt i64 %137, %139
  br i1 %140, label %141, label %166

141:                                              ; preds = %126
  %142 = load ptr, ptr %29, align 8, !tbaa !5
  %143 = load i64, ptr %9, align 8, !tbaa !15
  %144 = getelementptr inbounds i64, ptr %142, i64 %143
  store i64 0, ptr %144, align 8, !tbaa !15
  %145 = load ptr, ptr %26, align 8, !tbaa !5
  %146 = load i64, ptr %9, align 8, !tbaa !15
  %147 = getelementptr inbounds i64, ptr %145, i64 %146
  %148 = load i64, ptr %147, align 8, !tbaa !15
  %149 = getelementptr inbounds [2 x i64], ptr %14, i64 0, i64 0
  %150 = load i64, ptr %149, align 16, !tbaa !15
  %151 = add nsw i64 %150, %148
  store i64 %151, ptr %149, align 16, !tbaa !15
  %152 = load ptr, ptr %26, align 8, !tbaa !5
  %153 = load i64, ptr %9, align 8, !tbaa !15
  %154 = getelementptr inbounds i64, ptr %152, i64 %153
  %155 = load i64, ptr %154, align 8, !tbaa !15
  %156 = getelementptr inbounds [2 x i64], ptr %14, i64 0, i64 1
  %157 = load i64, ptr %156, align 8, !tbaa !15
  %158 = sub nsw i64 %157, %155
  store i64 %158, ptr %156, align 8, !tbaa !15
  %159 = getelementptr inbounds [2 x i64], ptr %14, i64 0, i64 0
  %160 = load i64, ptr %159, align 16, !tbaa !15
  %161 = getelementptr inbounds [2 x i64], ptr %15, i64 0, i64 0
  %162 = load i64, ptr %161, align 16, !tbaa !15
  %163 = icmp sgt i64 %160, %162
  br i1 %163, label %164, label %165

164:                                              ; preds = %141
  br label %170

165:                                              ; preds = %141
  br label %166

166:                                              ; preds = %165, %126
  br label %167

167:                                              ; preds = %166
  %168 = load i64, ptr %10, align 8, !tbaa !15
  %169 = add nsw i64 %168, 1
  store i64 %169, ptr %10, align 8, !tbaa !15
  br label %122, !llvm.loop !25

170:                                              ; preds = %164, %122
  br label %171

171:                                              ; preds = %170, %104
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  call void @libmetis__Compute2WayPartitionParams(ptr noundef %172, ptr noundef %173)
  %174 = load ptr, ptr %5, align 8, !tbaa !5
  %175 = load ptr, ptr %6, align 8, !tbaa !5
  %176 = load ptr, ptr %7, align 8, !tbaa !5
  %177 = load float, ptr %8, align 4, !tbaa !9
  call void @libmetis__Balance2Way(ptr noundef %174, ptr noundef %175, ptr noundef %176, float noundef %177)
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = load ptr, ptr %6, align 8, !tbaa !5
  %180 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__FM_2WayEdgeRefine(ptr noundef %178, ptr noundef %179, ptr noundef %180, i64 noundef 4)
  %181 = load i64, ptr %24, align 8, !tbaa !15
  %182 = icmp eq i64 %181, 0
  br i1 %182, label %189, label %183

183:                                              ; preds = %171
  %184 = load i64, ptr %18, align 8, !tbaa !15
  %185 = load ptr, ptr %6, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.graphdef, ptr %185, i32 0, i32 16
  %187 = load i64, ptr %186, align 8, !tbaa !27
  %188 = icmp sgt i64 %184, %187
  br i1 %188, label %189, label %201

189:                                              ; preds = %183, %171
  %190 = load ptr, ptr %6, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.graphdef, ptr %190, i32 0, i32 16
  %192 = load i64, ptr %191, align 8, !tbaa !27
  store i64 %192, ptr %18, align 8, !tbaa !15
  %193 = load ptr, ptr %31, align 8, !tbaa !5
  %194 = load ptr, ptr %29, align 8, !tbaa !5
  %195 = load i64, ptr %13, align 8, !tbaa !15
  %196 = mul i64 8, %195
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %193, ptr align 1 %194, i64 %196, i1 false)
  %197 = load i64, ptr %18, align 8, !tbaa !15
  %198 = icmp eq i64 %197, 0
  br i1 %198, label %199, label %200

199:                                              ; preds = %189
  br label %205

200:                                              ; preds = %189
  br label %201

201:                                              ; preds = %200, %183
  br label %202

202:                                              ; preds = %201
  %203 = load i64, ptr %24, align 8, !tbaa !15
  %204 = add nsw i64 %203, 1
  store i64 %204, ptr %24, align 8, !tbaa !15
  br label %100, !llvm.loop !28

205:                                              ; preds = %199, %100
  %206 = load i64, ptr %18, align 8, !tbaa !15
  %207 = load ptr, ptr %6, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.graphdef, ptr %207, i32 0, i32 16
  store i64 %206, ptr %208, align 8, !tbaa !27
  %209 = load ptr, ptr %29, align 8, !tbaa !5
  %210 = load ptr, ptr %31, align 8, !tbaa !5
  %211 = load i64, ptr %13, align 8, !tbaa !15
  %212 = mul i64 8, %211
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %209, ptr align 1 %210, i64 %212, i1 false)
  call void (ptr, ...) @gk_free(ptr noundef %31, ptr noundef %30, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, 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 16, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 16, 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__Allocate2WayPartitionMemory(ptr noundef, ptr noundef) #2

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

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

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

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

declare void @libmetis__FM_2WayEdgeRefine(ptr noundef, ptr noundef, ptr noundef, i64 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

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, !6, i64 16}
!17 = !{!12, !6, i64 24}
!18 = !{!12, !6, i64 40}
!19 = !{!12, !6, i64 48}
!20 = !{!12, !6, i64 128}
!21 = !{!22, !13, i64 0}
!22 = !{!"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, !23, i64 88, !24, i64 152, !24, i64 160, !24, i64 168, !24, i64 176, !24, i64 184, !24, i64 192, !24, i64 200, !24, i64 208, !24, i64 216, !24, i64 224, !24, i64 232, !24, i64 240, !24, i64 248, !24, i64 256, !24, i64 264, !24, i64 272}
!23 = !{!"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}
!24 = !{!"double", !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!12, !13, i64 112}
!28 = distinct !{!28, !26}


; 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.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 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__RandomBisection(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
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %7 = load i64, ptr %1, align 8, !tbaa !5
  %.fr78 = freeze i64 %7
  %8 = getelementptr inbounds i8, ptr %1, i64 24
  %9 = load ptr, ptr %8, align 8, !tbaa !12
  tail call void @libmetis__Allocate2WayPartitionMemory(ptr noundef %0, ptr noundef nonnull %1) #4
  %10 = getelementptr inbounds i8, ptr %1, i64 128
  %11 = load ptr, ptr %10, align 8, !tbaa !13
  %12 = tail call ptr @libmetis__idxmalloc(i64 noundef %.fr78, ptr noundef nonnull @.str.3) #4
  store ptr %12, ptr %6, align 8, !tbaa !14
  %13 = tail call ptr @libmetis__idxmalloc(i64 noundef %.fr78, ptr noundef nonnull @.str.4) #4
  store ptr %13, ptr %5, align 8, !tbaa !14
  %14 = load i64, ptr %2, align 8, !tbaa !15
  %15 = sitofp i64 %14 to float
  %16 = fmul float %15, %3
  %17 = fptosi float %16 to i64
  %18 = fpext float %3 to double
  %19 = fdiv double 1.000000e+00, %18
  %20 = sitofp i64 %14 to double
  %21 = fmul double %19, %20
  %22 = fptosi double %21 to i64
  %23 = load i64, ptr %0, align 8, !tbaa !16
  %.not = icmp sgt i64 %.fr78, %23
  %24 = select i1 %.not, i64 8, i64 3
  %25 = icmp sgt i64 %.fr78, 0
  %26 = getelementptr inbounds i8, ptr %1, i64 112
  %27 = shl i64 %.fr78, 3
  br i1 %25, label %.lr.ph.us, label %28

28:                                               ; preds = %4
  tail call void @libmetis__RandomPermute(i64 noundef %.fr78, ptr noundef %13, i64 noundef 1) #4
  %29 = tail call ptr @libmetis__idxset(i64 noundef %.fr78, i64 noundef 1, ptr noundef %11) #4
  tail call void @libmetis__Compute2WayPartitionParams(ptr noundef nonnull %0, ptr noundef nonnull %1) #4
  tail call void @libmetis__Balance2Way(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, float noundef %3) #4
  tail call void @libmetis__FM_2WayEdgeRefine(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, i64 noundef 4) #4
  %.pre = load i64, ptr %26, align 8, !tbaa !21
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %12, ptr align 1 %11, i64 %27, i1 false)
  %30 = icmp eq i64 %.pre, 0
  br i1 %30, label %.split77.us, label %.split.peel.next

.lr.ph.us:                                        ; preds = %4, %50
  %.06575.us = phi i64 [ %.1.us, %50 ], [ undef, %4 ]
  %.06674.us = phi i64 [ %51, %50 ], [ 0, %4 ]
  tail call void @libmetis__RandomPermute(i64 noundef %.fr78, ptr noundef %13, i64 noundef 1) #4
  %31 = tail call ptr @libmetis__idxset(i64 noundef %.fr78, i64 noundef 1, ptr noundef %11) #4
  br label %32

32:                                               ; preds = %.lr.ph.us, %44
  %.072.us = phi i64 [ 0, %.lr.ph.us ], [ %45, %44 ]
  %.sroa.016.070.us = phi i64 [ 0, %.lr.ph.us ], [ %.sroa.016.1.us, %44 ]
  %33 = getelementptr inbounds i64, ptr %13, i64 %.072.us
  %34 = load i64, ptr %33, align 8, !tbaa !15
  %35 = getelementptr inbounds i64, ptr %9, i64 %34
  %36 = load i64, ptr %35, align 8, !tbaa !15
  %37 = add nsw i64 %36, %.sroa.016.070.us
  %38 = icmp slt i64 %37, %17
  br i1 %38, label %39, label %44

39:                                               ; preds = %32
  %40 = getelementptr inbounds i64, ptr %11, i64 %34
  store i64 0, ptr %40, align 8, !tbaa !15
  %41 = load i64, ptr %35, align 8, !tbaa !15
  %42 = add nsw i64 %41, %.sroa.016.070.us
  %43 = icmp sgt i64 %42, %22
  br i1 %43, label %._crit_edge.us, label %44

44:                                               ; preds = %39, %32
  %.sroa.016.1.us = phi i64 [ %42, %39 ], [ %.sroa.016.070.us, %32 ]
  %45 = add nuw nsw i64 %.072.us, 1
  %exitcond82.not = icmp eq i64 %45, %.fr78
  br i1 %exitcond82.not, label %._crit_edge.us, label %32, !llvm.loop !22

._crit_edge.us:                                   ; preds = %39, %44
  tail call void @libmetis__Compute2WayPartitionParams(ptr noundef nonnull %0, ptr noundef nonnull %1) #4
  tail call void @libmetis__Balance2Way(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, float noundef %3) #4
  tail call void @libmetis__FM_2WayEdgeRefine(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, i64 noundef 4) #4
  %46 = icmp eq i64 %.06674.us, 0
  %.pre87 = load i64, ptr %26, align 8, !tbaa !21
  %47 = icmp sgt i64 %.06575.us, %.pre87
  %or.cond = select i1 %46, i1 true, i1 %47
  br i1 %or.cond, label %48, label %50

48:                                               ; preds = %._crit_edge.us
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %12, ptr align 1 %11, i64 %27, i1 false)
  %49 = icmp eq i64 %.pre87, 0
  br i1 %49, label %.split77.us, label %50

50:                                               ; preds = %._crit_edge.us, %48
  %.1.us = phi i64 [ %.pre87, %48 ], [ %.06575.us, %._crit_edge.us ]
  %51 = add nuw nsw i64 %.06674.us, 1
  %exitcond84.not = icmp eq i64 %51, %24
  br i1 %exitcond84.not, label %.split77.us, label %.lr.ph.us, !llvm.loop !24

.split.peel.next:                                 ; preds = %28, %57
  %.06575 = phi i64 [ %.1, %57 ], [ %.pre, %28 ]
  %.06674 = phi i64 [ %58, %57 ], [ 1, %28 ]
  tail call void @libmetis__RandomPermute(i64 noundef %.fr78, ptr noundef %13, i64 noundef 1) #4
  %52 = tail call ptr @libmetis__idxset(i64 noundef %.fr78, i64 noundef 1, ptr noundef %11) #4
  tail call void @libmetis__Compute2WayPartitionParams(ptr noundef nonnull %0, ptr noundef nonnull %1) #4
  tail call void @libmetis__Balance2Way(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, float noundef %3) #4
  tail call void @libmetis__FM_2WayEdgeRefine(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, i64 noundef 4) #4
  %53 = load i64, ptr %26, align 8, !tbaa !21
  %54 = icmp sgt i64 %.06575, %53
  br i1 %54, label %55, label %57

55:                                               ; preds = %.split.peel.next
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %12, ptr align 1 %11, i64 %27, i1 false)
  %56 = icmp eq i64 %53, 0
  br i1 %56, label %.split77.us, label %57

57:                                               ; preds = %.split.peel.next, %55
  %.1 = phi i64 [ %53, %55 ], [ %.06575, %.split.peel.next ]
  %58 = add nuw nsw i64 %.06674, 1
  %exitcond.not = icmp eq i64 %58, %24
  br i1 %exitcond.not, label %.split77.us, label %.split.peel.next, !llvm.loop !25

.split77.us:                                      ; preds = %57, %55, %48, %50, %28
  %.us-phi = phi i64 [ 0, %28 ], [ 0, %48 ], [ %.1.us, %50 ], [ %.1, %57 ], [ 0, %55 ]
  store i64 %.us-phi, ptr %26, align 8, !tbaa !21
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %11, ptr align 1 %12, i64 %27, i1 false)
  call void (ptr, ...) @gk_free(ptr noundef nonnull %6, ptr noundef nonnull %5, ptr noundef null) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  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__Allocate2WayPartitionMemory(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

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

declare void @libmetis__FM_2WayEdgeRefine(ptr noundef, ptr noundef, ptr noundef, i64 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

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 = { 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, !10, i64 24}
!13 = !{!6, !10, i64 128}
!14 = !{!10, !10, i64 0}
!15 = !{!7, !7, 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 = !{!6, !7, i64 112}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = distinct !{!25, !23, !26}
!26 = !{!"llvm.loop.peeled.count", i32 1}


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