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

; 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
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [26 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

; Function Attrs: nounwind uwtable
define dso_local void @libmetis__GrowBisectionNode(ptr noundef %0, ptr noundef %1, float noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %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 [2 x i64], align 16
  %16 = alloca [2 x i64], align 16
  %17 = alloca [2 x i64], align 16
  %18 = alloca [2 x i64], align 16
  %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 i64, align 8
  %26 = alloca i64, 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
  %32 = alloca ptr, align 8
  %33 = alloca ptr, align 8
  %34 = alloca ptr, align 8
  %35 = alloca ptr, align 8
  %36 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store float %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.graphdef, ptr %37, i32 0, i32 0
  %39 = load i64, ptr %38, align 8, !tbaa !11
  store i64 %39, ptr %10, align 8, !tbaa !15
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.graphdef, ptr %40, i32 0, i32 2
  %42 = load ptr, ptr %41, align 8, !tbaa !16
  store ptr %42, ptr %27, align 8, !tbaa !5
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.graphdef, ptr %43, i32 0, i32 3
  %45 = load ptr, ptr %44, align 8, !tbaa !17
  store ptr %45, ptr %28, align 8, !tbaa !5
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.graphdef, ptr %46, i32 0, i32 5
  %48 = load ptr, ptr %47, align 8, !tbaa !18
  store ptr %48, ptr %29, align 8, !tbaa !5
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.graphdef, ptr %49, i32 0, i32 6
  %51 = load ptr, ptr %50, align 8, !tbaa !19
  store ptr %51, ptr %30, align 8, !tbaa !5
  %52 = load i64, ptr %10, align 8, !tbaa !15
  %53 = call ptr @libmetis__idxmalloc(i64 noundef %52, ptr noundef @.str.3)
  store ptr %53, ptr %36, align 8, !tbaa !5
  %54 = load i64, ptr %10, align 8, !tbaa !15
  %55 = call ptr @libmetis__idxmalloc(i64 noundef %54, ptr noundef @.str.4)
  store ptr %55, ptr %33, align 8, !tbaa !5
  %56 = load i64, ptr %10, align 8, !tbaa !15
  %57 = call ptr @libmetis__idxmalloc(i64 noundef %56, ptr noundef @.str.5)
  store ptr %57, ptr %34, align 8, !tbaa !5
  %58 = load i64, ptr %10, align 8, !tbaa !15
  %59 = load ptr, ptr %28, align 8, !tbaa !5
  %60 = call i64 @libmetis__idxsum(i64 noundef %58, ptr noundef %59, i64 noundef 1)
  %61 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 0
  store i64 %60, ptr %61, align 16, !tbaa !15
  %62 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 0
  %63 = load i64, ptr %62, align 16, !tbaa !15
  %64 = sdiv i64 %63, 2
  %65 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 1
  store i64 %64, ptr %65, align 8, !tbaa !15
  %66 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 1
  %67 = load i64, ptr %66, align 8, !tbaa !15
  %68 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 0
  %69 = load i64, ptr %68, align 16, !tbaa !15
  %70 = sub nsw i64 %69, %67
  store i64 %70, ptr %68, align 16, !tbaa !15
  %71 = load float, ptr %6, align 4, !tbaa !9
  %72 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 0
  %73 = load i64, ptr %72, align 16, !tbaa !15
  %74 = sitofp i64 %73 to float
  %75 = fmul float %71, %74
  %76 = fptosi float %75 to i64
  %77 = getelementptr inbounds [2 x i64], ptr %18, i64 0, i64 0
  store i64 %76, ptr %77, align 16, !tbaa !15
  %78 = load float, ptr %6, align 4, !tbaa !9
  %79 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 1
  %80 = load i64, ptr %79, align 8, !tbaa !15
  %81 = sitofp i64 %80 to float
  %82 = fmul float %78, %81
  %83 = fptosi float %82 to i64
  %84 = getelementptr inbounds [2 x i64], ptr %18, i64 0, i64 1
  store i64 %83, ptr %84, align 8, !tbaa !15
  %85 = load float, ptr %6, align 4, !tbaa !9
  %86 = fpext float %85 to double
  %87 = fdiv double 1.000000e+00, %86
  %88 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 0
  %89 = load i64, ptr %88, align 16, !tbaa !15
  %90 = sitofp i64 %89 to double
  %91 = fmul double %87, %90
  %92 = fptosi double %91 to i64
  %93 = getelementptr inbounds [2 x i64], ptr %17, i64 0, i64 0
  store i64 %92, ptr %93, align 16, !tbaa !15
  %94 = load float, ptr %6, align 4, !tbaa !9
  %95 = fpext float %94 to double
  %96 = fdiv double 1.000000e+00, %95
  %97 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 1
  %98 = load i64, ptr %97, align 8, !tbaa !15
  %99 = sitofp i64 %98 to double
  %100 = fmul double %96, %99
  %101 = fptosi double %100 to i64
  %102 = getelementptr inbounds [2 x i64], ptr %17, i64 0, i64 1
  store i64 %101, ptr %102, align 8, !tbaa !15
  %103 = call ptr @libmetis__idxmalloc(i64 noundef 3, ptr noundef @.str.6)
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.graphdef, ptr %104, i32 0, i32 19
  store ptr %103, ptr %105, align 8, !tbaa !20
  %106 = load i64, ptr %10, align 8, !tbaa !15
  %107 = call ptr @libmetis__idxmalloc(i64 noundef %106, ptr noundef @.str.7)
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.graphdef, ptr %108, i32 0, i32 18
  store ptr %107, ptr %109, align 8, !tbaa !21
  %110 = load i64, ptr %10, align 8, !tbaa !15
  %111 = call ptr @libmetis__idxmalloc(i64 noundef %110, ptr noundef @.str.8)
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.graphdef, ptr %112, i32 0, i32 21
  store ptr %111, ptr %113, align 8, !tbaa !22
  %114 = load i64, ptr %10, align 8, !tbaa !15
  %115 = call ptr @libmetis__idxmalloc(i64 noundef %114, ptr noundef @.str.9)
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.graphdef, ptr %116, i32 0, i32 22
  store ptr %115, ptr %117, align 8, !tbaa !23
  %118 = load i64, ptr %10, align 8, !tbaa !15
  %119 = call ptr @libmetis__idxmalloc(i64 noundef %118, ptr noundef @.str.10)
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.graphdef, ptr %120, i32 0, i32 23
  store ptr %119, ptr %121, align 8, !tbaa !24
  %122 = load i64, ptr %10, align 8, !tbaa !15
  %123 = call ptr @libmetis__idxmalloc(i64 noundef %122, ptr noundef @.str.11)
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.graphdef, ptr %124, i32 0, i32 24
  store ptr %123, ptr %125, align 8, !tbaa !25
  %126 = load i64, ptr %10, align 8, !tbaa !15
  %127 = mul i64 %126, 16
  %128 = call ptr @gk_malloc(i64 noundef %127, ptr noundef @.str.12)
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.graphdef, ptr %129, i32 0, i32 27
  store ptr %128, ptr %130, align 8, !tbaa !26
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.graphdef, ptr %131, i32 0, i32 18
  %133 = load ptr, ptr %132, align 8, !tbaa !21
  store ptr %133, ptr %31, align 8, !tbaa !5
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.graphdef, ptr %134, i32 0, i32 22
  %136 = load ptr, ptr %135, align 8, !tbaa !23
  store ptr %136, ptr %32, align 8, !tbaa !5
  %137 = load i64, ptr %10, align 8, !tbaa !15
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.controldef, ptr %138, i32 0, i32 0
  %140 = load i64, ptr %139, align 8, !tbaa !27
  %141 = icmp sle i64 %137, %140
  %142 = zext i1 %141 to i64
  %143 = select i1 %141, i32 3, i32 8
  %144 = add nsw i32 %143, 1
  %145 = sext i32 %144 to i64
  store i64 %145, ptr %25, align 8, !tbaa !15
  store i64 0, ptr %26, align 8, !tbaa !15
  br label %146

146:                                              ; preds = %368, %3
  %147 = load i64, ptr %26, align 8, !tbaa !15
  %148 = load i64, ptr %25, align 8, !tbaa !15
  %149 = icmp slt i64 %147, %148
  br i1 %149, label %150, label %371

150:                                              ; preds = %146
  %151 = load i64, ptr %10, align 8, !tbaa !15
  %152 = load ptr, ptr %34, align 8, !tbaa !5
  %153 = call ptr @libmetis__idxset(i64 noundef %151, i64 noundef 0, ptr noundef %152)
  %154 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 0
  %155 = load i64, ptr %154, align 16, !tbaa !15
  %156 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 1
  %157 = load i64, ptr %156, align 8, !tbaa !15
  %158 = add nsw i64 %155, %157
  %159 = getelementptr inbounds [2 x i64], ptr %15, i64 0, i64 1
  store i64 %158, ptr %159, align 8, !tbaa !15
  %160 = getelementptr inbounds [2 x i64], ptr %15, i64 0, i64 0
  store i64 0, ptr %160, align 16, !tbaa !15
  %161 = load i64, ptr %10, align 8, !tbaa !15
  %162 = load ptr, ptr %31, align 8, !tbaa !5
  %163 = call ptr @libmetis__idxset(i64 noundef %161, i64 noundef 1, ptr noundef %162)
  %164 = load i64, ptr %10, align 8, !tbaa !15
  %165 = sitofp i64 %164 to double
  %166 = fmul double 0x3E00000000000000, %165
  %167 = call i32 @rand() #5
  %168 = sitofp i32 %167 to double
  %169 = fmul double %166, %168
  %170 = fptosi double %169 to i32
  %171 = sext i32 %170 to i64
  %172 = load ptr, ptr %33, align 8, !tbaa !5
  %173 = getelementptr inbounds i64, ptr %172, i64 0
  store i64 %171, ptr %173, align 8, !tbaa !15
  %174 = load ptr, ptr %34, align 8, !tbaa !5
  %175 = load ptr, ptr %33, align 8, !tbaa !5
  %176 = getelementptr inbounds i64, ptr %175, i64 0
  %177 = load i64, ptr %176, align 8, !tbaa !15
  %178 = getelementptr inbounds i64, ptr %174, i64 %177
  store i64 1, ptr %178, align 8, !tbaa !15
  store i64 0, ptr %13, align 8, !tbaa !15
  store i64 1, ptr %14, align 8, !tbaa !15
  %179 = load i64, ptr %10, align 8, !tbaa !15
  %180 = sub nsw i64 %179, 1
  store i64 %180, ptr %12, align 8, !tbaa !15
  store i64 0, ptr %11, align 8, !tbaa !15
  %181 = load i64, ptr %25, align 8, !tbaa !15
  %182 = icmp sge i64 %181, 1
  br i1 %182, label %183, label %319

183:                                              ; preds = %150
  br label %184

184:                                              ; preds = %317, %251, %183
  %185 = load i64, ptr %13, align 8, !tbaa !15
  %186 = load i64, ptr %14, align 8, !tbaa !15
  %187 = icmp eq i64 %185, %186
  br i1 %187, label %188, label %235

188:                                              ; preds = %184
  %189 = load i64, ptr %12, align 8, !tbaa !15
  %190 = icmp eq i64 %189, 0
  br i1 %190, label %194, label %191

191:                                              ; preds = %188
  %192 = load i64, ptr %11, align 8, !tbaa !15
  %193 = icmp ne i64 %192, 0
  br i1 %193, label %194, label %195

194:                                              ; preds = %191, %188
  br label %318

195:                                              ; preds = %191
  %196 = load i64, ptr %12, align 8, !tbaa !15
  %197 = sitofp i64 %196 to double
  %198 = fmul double 0x3E00000000000000, %197
  %199 = call i32 @rand() #5
  %200 = sitofp i32 %199 to double
  %201 = fmul double %198, %200
  %202 = fptosi double %201 to i32
  %203 = sext i32 %202 to i64
  store i64 %203, ptr %9, align 8, !tbaa !15
  store i64 0, ptr %7, align 8, !tbaa !15
  br label %204

204:                                              ; preds = %223, %195
  %205 = load i64, ptr %7, align 8, !tbaa !15
  %206 = load i64, ptr %10, align 8, !tbaa !15
  %207 = icmp slt i64 %205, %206
  br i1 %207, label %208, label %226

208:                                              ; preds = %204
  %209 = load ptr, ptr %34, align 8, !tbaa !5
  %210 = load i64, ptr %7, align 8, !tbaa !15
  %211 = getelementptr inbounds i64, ptr %209, i64 %210
  %212 = load i64, ptr %211, align 8, !tbaa !15
  %213 = icmp eq i64 %212, 0
  br i1 %213, label %214, label %222

214:                                              ; preds = %208
  %215 = load i64, ptr %9, align 8, !tbaa !15
  %216 = icmp eq i64 %215, 0
  br i1 %216, label %217, label %218

217:                                              ; preds = %214
  br label %226

218:                                              ; preds = %214
  %219 = load i64, ptr %9, align 8, !tbaa !15
  %220 = add nsw i64 %219, -1
  store i64 %220, ptr %9, align 8, !tbaa !15
  br label %221

221:                                              ; preds = %218
  br label %222

222:                                              ; preds = %221, %208
  br label %223

223:                                              ; preds = %222
  %224 = load i64, ptr %7, align 8, !tbaa !15
  %225 = add nsw i64 %224, 1
  store i64 %225, ptr %7, align 8, !tbaa !15
  br label %204, !llvm.loop !31

226:                                              ; preds = %217, %204
  %227 = load i64, ptr %7, align 8, !tbaa !15
  %228 = load ptr, ptr %33, align 8, !tbaa !5
  %229 = getelementptr inbounds i64, ptr %228, i64 0
  store i64 %227, ptr %229, align 8, !tbaa !15
  %230 = load ptr, ptr %34, align 8, !tbaa !5
  %231 = load i64, ptr %7, align 8, !tbaa !15
  %232 = getelementptr inbounds i64, ptr %230, i64 %231
  store i64 1, ptr %232, align 8, !tbaa !15
  store i64 0, ptr %13, align 8, !tbaa !15
  store i64 1, ptr %14, align 8, !tbaa !15
  %233 = load i64, ptr %12, align 8, !tbaa !15
  %234 = add nsw i64 %233, -1
  store i64 %234, ptr %12, align 8, !tbaa !15
  br label %235

235:                                              ; preds = %226, %184
  %236 = load ptr, ptr %33, align 8, !tbaa !5
  %237 = load i64, ptr %13, align 8, !tbaa !15
  %238 = add nsw i64 %237, 1
  store i64 %238, ptr %13, align 8, !tbaa !15
  %239 = getelementptr inbounds i64, ptr %236, i64 %237
  %240 = load i64, ptr %239, align 8, !tbaa !15
  store i64 %240, ptr %7, align 8, !tbaa !15
  %241 = getelementptr inbounds [2 x i64], ptr %15, i64 0, i64 1
  %242 = load i64, ptr %241, align 8, !tbaa !15
  %243 = load ptr, ptr %28, align 8, !tbaa !5
  %244 = load i64, ptr %7, align 8, !tbaa !15
  %245 = getelementptr inbounds i64, ptr %243, i64 %244
  %246 = load i64, ptr %245, align 8, !tbaa !15
  %247 = sub nsw i64 %242, %246
  %248 = getelementptr inbounds [2 x i64], ptr %17, i64 0, i64 1
  %249 = load i64, ptr %248, align 8, !tbaa !15
  %250 = icmp slt i64 %247, %249
  br i1 %250, label %251, label %252

251:                                              ; preds = %235
  store i64 1, ptr %11, align 8, !tbaa !15
  br label %184

252:                                              ; preds = %235
  %253 = load ptr, ptr %31, align 8, !tbaa !5
  %254 = load i64, ptr %7, align 8, !tbaa !15
  %255 = getelementptr inbounds i64, ptr %253, i64 %254
  store i64 0, ptr %255, align 8, !tbaa !15
  br label %256

256:                                              ; preds = %252
  %257 = load ptr, ptr %28, align 8, !tbaa !5
  %258 = load i64, ptr %7, align 8, !tbaa !15
  %259 = getelementptr inbounds i64, ptr %257, i64 %258
  %260 = load i64, ptr %259, align 8, !tbaa !15
  %261 = getelementptr inbounds [2 x i64], ptr %15, i64 0, i64 0
  %262 = load i64, ptr %261, align 16, !tbaa !15
  %263 = add nsw i64 %262, %260
  store i64 %263, ptr %261, align 16, !tbaa !15
  %264 = load ptr, ptr %28, align 8, !tbaa !5
  %265 = load i64, ptr %7, align 8, !tbaa !15
  %266 = getelementptr inbounds i64, ptr %264, i64 %265
  %267 = load i64, ptr %266, align 8, !tbaa !15
  %268 = getelementptr inbounds [2 x i64], ptr %15, i64 0, i64 1
  %269 = load i64, ptr %268, align 8, !tbaa !15
  %270 = sub nsw i64 %269, %267
  store i64 %270, ptr %268, align 8, !tbaa !15
  br label %271

271:                                              ; preds = %256
  br label %272

272:                                              ; preds = %271
  %273 = getelementptr inbounds [2 x i64], ptr %15, i64 0, i64 1
  %274 = load i64, ptr %273, align 8, !tbaa !15
  %275 = getelementptr inbounds [2 x i64], ptr %18, i64 0, i64 1
  %276 = load i64, ptr %275, align 8, !tbaa !15
  %277 = icmp sle i64 %274, %276
  br i1 %277, label %278, label %279

278:                                              ; preds = %272
  br label %318

279:                                              ; preds = %272
  store i64 0, ptr %11, align 8, !tbaa !15
  %280 = load ptr, ptr %27, align 8, !tbaa !5
  %281 = load i64, ptr %7, align 8, !tbaa !15
  %282 = getelementptr inbounds i64, ptr %280, i64 %281
  %283 = load i64, ptr %282, align 8, !tbaa !15
  store i64 %283, ptr %8, align 8, !tbaa !15
  br label %284

284:                                              ; preds = %314, %279
  %285 = load i64, ptr %8, align 8, !tbaa !15
  %286 = load ptr, ptr %27, align 8, !tbaa !5
  %287 = load i64, ptr %7, align 8, !tbaa !15
  %288 = add nsw i64 %287, 1
  %289 = getelementptr inbounds i64, ptr %286, i64 %288
  %290 = load i64, ptr %289, align 8, !tbaa !15
  %291 = icmp slt i64 %285, %290
  br i1 %291, label %292, label %317

292:                                              ; preds = %284
  %293 = load ptr, ptr %29, align 8, !tbaa !5
  %294 = load i64, ptr %8, align 8, !tbaa !15
  %295 = getelementptr inbounds i64, ptr %293, i64 %294
  %296 = load i64, ptr %295, align 8, !tbaa !15
  store i64 %296, ptr %9, align 8, !tbaa !15
  %297 = load ptr, ptr %34, align 8, !tbaa !5
  %298 = load i64, ptr %9, align 8, !tbaa !15
  %299 = getelementptr inbounds i64, ptr %297, i64 %298
  %300 = load i64, ptr %299, align 8, !tbaa !15
  %301 = icmp eq i64 %300, 0
  br i1 %301, label %302, label %313

302:                                              ; preds = %292
  %303 = load i64, ptr %9, align 8, !tbaa !15
  %304 = load ptr, ptr %33, align 8, !tbaa !5
  %305 = load i64, ptr %14, align 8, !tbaa !15
  %306 = add nsw i64 %305, 1
  store i64 %306, ptr %14, align 8, !tbaa !15
  %307 = getelementptr inbounds i64, ptr %304, i64 %305
  store i64 %303, ptr %307, align 8, !tbaa !15
  %308 = load ptr, ptr %34, align 8, !tbaa !5
  %309 = load i64, ptr %9, align 8, !tbaa !15
  %310 = getelementptr inbounds i64, ptr %308, i64 %309
  store i64 1, ptr %310, align 8, !tbaa !15
  %311 = load i64, ptr %12, align 8, !tbaa !15
  %312 = add nsw i64 %311, -1
  store i64 %312, ptr %12, align 8, !tbaa !15
  br label %313

313:                                              ; preds = %302, %292
  br label %314

314:                                              ; preds = %313
  %315 = load i64, ptr %8, align 8, !tbaa !15
  %316 = add nsw i64 %315, 1
  store i64 %316, ptr %8, align 8, !tbaa !15
  br label %284, !llvm.loop !33

317:                                              ; preds = %284
  br label %184

318:                                              ; preds = %278, %194
  br label %319

319:                                              ; preds = %318, %150
  %320 = load ptr, ptr %4, align 8, !tbaa !5
  %321 = load ptr, ptr %5, align 8, !tbaa !5
  call void @libmetis__Compute2WayPartitionParams(ptr noundef %320, ptr noundef %321)
  %322 = load ptr, ptr %4, align 8, !tbaa !5
  %323 = load ptr, ptr %5, align 8, !tbaa !5
  %324 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 0
  %325 = load float, ptr %6, align 4, !tbaa !9
  call void @libmetis__Balance2Way(ptr noundef %322, ptr noundef %323, ptr noundef %324, float noundef %325)
  %326 = load ptr, ptr %4, align 8, !tbaa !5
  %327 = load ptr, ptr %5, align 8, !tbaa !5
  %328 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 0
  call void @libmetis__FM_2WayEdgeRefine(ptr noundef %326, ptr noundef %327, ptr noundef %328, i64 noundef 4)
  store i64 0, ptr %7, align 8, !tbaa !15
  br label %329

329:                                              ; preds = %342, %319
  %330 = load i64, ptr %7, align 8, !tbaa !15
  %331 = load ptr, ptr %5, align 8, !tbaa !5
  %332 = getelementptr inbounds %struct.graphdef, ptr %331, i32 0, i32 20
  %333 = load i64, ptr %332, align 8, !tbaa !34
  %334 = icmp slt i64 %330, %333
  br i1 %334, label %335, label %345

335:                                              ; preds = %329
  %336 = load ptr, ptr %31, align 8, !tbaa !5
  %337 = load ptr, ptr %32, align 8, !tbaa !5
  %338 = load i64, ptr %7, align 8, !tbaa !15
  %339 = getelementptr inbounds i64, ptr %337, i64 %338
  %340 = load i64, ptr %339, align 8, !tbaa !15
  %341 = getelementptr inbounds i64, ptr %336, i64 %340
  store i64 2, ptr %341, align 8, !tbaa !15
  br label %342

342:                                              ; preds = %335
  %343 = load i64, ptr %7, align 8, !tbaa !15
  %344 = add nsw i64 %343, 1
  store i64 %344, ptr %7, align 8, !tbaa !15
  br label %329, !llvm.loop !35

345:                                              ; preds = %329
  %346 = load ptr, ptr %4, align 8, !tbaa !5
  %347 = load ptr, ptr %5, align 8, !tbaa !5
  call void @libmetis__Compute2WayNodePartitionParams(ptr noundef %346, ptr noundef %347)
  %348 = load ptr, ptr %4, align 8, !tbaa !5
  %349 = load ptr, ptr %5, align 8, !tbaa !5
  %350 = load float, ptr %6, align 4, !tbaa !9
  call void @libmetis__FM_2WayNodeRefine(ptr noundef %348, ptr noundef %349, float noundef %350, i64 noundef 6)
  %351 = load i64, ptr %26, align 8, !tbaa !15
  %352 = icmp eq i64 %351, 0
  br i1 %352, label %359, label %353

353:                                              ; preds = %345
  %354 = load i64, ptr %20, align 8, !tbaa !15
  %355 = load ptr, ptr %5, align 8, !tbaa !5
  %356 = getelementptr inbounds %struct.graphdef, ptr %355, i32 0, i32 16
  %357 = load i64, ptr %356, align 8, !tbaa !36
  %358 = icmp sgt i64 %354, %357
  br i1 %358, label %359, label %367

359:                                              ; preds = %353, %345
  %360 = load ptr, ptr %5, align 8, !tbaa !5
  %361 = getelementptr inbounds %struct.graphdef, ptr %360, i32 0, i32 16
  %362 = load i64, ptr %361, align 8, !tbaa !36
  store i64 %362, ptr %20, align 8, !tbaa !15
  %363 = load ptr, ptr %36, align 8, !tbaa !5
  %364 = load ptr, ptr %31, align 8, !tbaa !5
  %365 = load i64, ptr %10, align 8, !tbaa !15
  %366 = mul i64 8, %365
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %363, ptr align 1 %364, i64 %366, i1 false)
  br label %367

367:                                              ; preds = %359, %353
  br label %368

368:                                              ; preds = %367
  %369 = load i64, ptr %26, align 8, !tbaa !15
  %370 = add nsw i64 %369, 1
  store i64 %370, ptr %26, align 8, !tbaa !15
  br label %146, !llvm.loop !37

371:                                              ; preds = %146
  %372 = load i64, ptr %20, align 8, !tbaa !15
  %373 = load ptr, ptr %5, align 8, !tbaa !5
  %374 = getelementptr inbounds %struct.graphdef, ptr %373, i32 0, i32 16
  store i64 %372, ptr %374, align 8, !tbaa !36
  %375 = load ptr, ptr %31, align 8, !tbaa !5
  %376 = load ptr, ptr %36, align 8, !tbaa !5
  %377 = load i64, ptr %10, align 8, !tbaa !15
  %378 = mul i64 8, %377
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %375, ptr align 1 %376, i64 %378, i1 false)
  %379 = load ptr, ptr %4, align 8, !tbaa !5
  %380 = load ptr, ptr %5, align 8, !tbaa !5
  call void @libmetis__Compute2WayNodePartitionParams(ptr noundef %379, ptr noundef %380)
  call void (ptr, ...) @gk_free(ptr noundef %36, ptr noundef %33, ptr noundef %34, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void
}

declare void @libmetis__Compute2WayNodePartitionParams(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

; Function Attrs: nounwind
declare i32 @rand() #3

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) #4

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

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

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

declare void @libmetis__FM_2WayNodeRefine(ptr noundef, ptr noundef, float 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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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 136}
!21 = !{!12, !6, i64 128}
!22 = !{!12, !6, i64 152}
!23 = !{!12, !6, i64 160}
!24 = !{!12, !6, i64 168}
!25 = !{!12, !6, i64 176}
!26 = !{!12, !6, i64 200}
!27 = !{!28, !13, i64 0}
!28 = !{!"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, !29, i64 88, !30, i64 152, !30, i64 160, !30, i64 168, !30, i64 176, !30, i64 184, !30, i64 192, !30, i64 200, !30, i64 208, !30, i64 216, !30, i64 224, !30, i64 232, !30, i64 240, !30, i64 248, !30, i64 256, !30, i64 264, !30, i64 272}
!29 = !{!"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}
!30 = !{!"double", !7, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = distinct !{!33, !32}
!34 = !{!12, !13, i64 144}
!35 = distinct !{!35, !32}
!36 = !{!12, !13, i64 112}
!37 = distinct !{!37, !32}


; 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
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [26 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

; Function Attrs: nounwind uwtable
define dso_local void @libmetis__GrowBisectionNode(ptr noundef %0, ptr noundef %1, float noundef %2) local_unnamed_addr #1 {
  %4 = alloca [2 x i64], align 16
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  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 8, ptr nonnull %7) #5
  %8 = load i64, ptr %1, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  %10 = load ptr, ptr %9, align 8, !tbaa !12
  %11 = getelementptr inbounds i8, ptr %1, i64 24
  %12 = load ptr, ptr %11, align 8, !tbaa !13
  %13 = getelementptr inbounds i8, ptr %1, i64 40
  %14 = load ptr, ptr %13, align 8, !tbaa !14
  %15 = tail call ptr @libmetis__idxmalloc(i64 noundef %8, ptr noundef nonnull @.str.3) #5
  store ptr %15, ptr %7, align 8, !tbaa !15
  %16 = tail call ptr @libmetis__idxmalloc(i64 noundef %8, ptr noundef nonnull @.str.4) #5
  store ptr %16, ptr %5, align 8, !tbaa !15
  %17 = tail call ptr @libmetis__idxmalloc(i64 noundef %8, ptr noundef nonnull @.str.5) #5
  store ptr %17, ptr %6, align 8, !tbaa !15
  %18 = tail call i64 @libmetis__idxsum(i64 noundef %8, ptr noundef %12, i64 noundef 1) #5
  %19 = sdiv i64 %18, 2
  %20 = getelementptr inbounds i8, ptr %4, i64 8
  store i64 %19, ptr %20, align 8, !tbaa !16
  %21 = sub nsw i64 %18, %19
  store i64 %21, ptr %4, align 16, !tbaa !16
  %22 = sitofp i64 %19 to float
  %23 = fmul float %22, %2
  %24 = fptosi float %23 to i64
  %25 = fpext float %2 to double
  %26 = fdiv double 1.000000e+00, %25
  %27 = sitofp i64 %19 to double
  %28 = fmul double %26, %27
  %29 = fptosi double %28 to i64
  %30 = tail call ptr @libmetis__idxmalloc(i64 noundef 3, ptr noundef nonnull @.str.6) #5
  %31 = getelementptr inbounds i8, ptr %1, i64 136
  store ptr %30, ptr %31, align 8, !tbaa !17
  %32 = tail call ptr @libmetis__idxmalloc(i64 noundef %8, ptr noundef nonnull @.str.7) #5
  %33 = getelementptr inbounds i8, ptr %1, i64 128
  store ptr %32, ptr %33, align 8, !tbaa !18
  %34 = tail call ptr @libmetis__idxmalloc(i64 noundef %8, ptr noundef nonnull @.str.8) #5
  %35 = getelementptr inbounds i8, ptr %1, i64 152
  store ptr %34, ptr %35, align 8, !tbaa !19
  %36 = tail call ptr @libmetis__idxmalloc(i64 noundef %8, ptr noundef nonnull @.str.9) #5
  %37 = getelementptr inbounds i8, ptr %1, i64 160
  store ptr %36, ptr %37, align 8, !tbaa !20
  %38 = tail call ptr @libmetis__idxmalloc(i64 noundef %8, ptr noundef nonnull @.str.10) #5
  %39 = getelementptr inbounds i8, ptr %1, i64 168
  store ptr %38, ptr %39, align 8, !tbaa !21
  %40 = tail call ptr @libmetis__idxmalloc(i64 noundef %8, ptr noundef nonnull @.str.11) #5
  %41 = getelementptr inbounds i8, ptr %1, i64 176
  store ptr %40, ptr %41, align 8, !tbaa !22
  %42 = shl i64 %8, 4
  %43 = tail call ptr @gk_malloc(i64 noundef %42, ptr noundef nonnull @.str.12) #5
  %44 = getelementptr inbounds i8, ptr %1, i64 200
  store ptr %43, ptr %44, align 8, !tbaa !23
  %45 = load ptr, ptr %33, align 8, !tbaa !18
  %46 = load ptr, ptr %37, align 8, !tbaa !20
  %47 = load i64, ptr %0, align 8, !tbaa !24
  %.not = icmp sgt i64 %8, %47
  %48 = select i1 %.not, i64 9, i64 4
  %49 = sitofp i64 %8 to double
  %50 = fmul double %49, 0x3E00000000000000
  %51 = add nsw i64 %8, -1
  %52 = icmp sgt i64 %8, 0
  %53 = getelementptr inbounds i8, ptr %1, i64 144
  %54 = getelementptr inbounds i8, ptr %1, i64 112
  %55 = shl i64 %8, 3
  br label %56

56:                                               ; preds = %3, %141
  %57 = phi ptr [ %17, %3 ], [ %69, %141 ]
  %.0123150 = phi i64 [ 0, %3 ], [ %142, %141 ]
  %.0124149 = phi i64 [ undef, %3 ], [ %.1125, %141 ]
  %58 = call ptr @libmetis__idxset(i64 noundef %8, i64 noundef 0, ptr noundef %57) #5
  %59 = load i64, ptr %4, align 16, !tbaa !16
  %60 = load i64, ptr %20, align 8, !tbaa !16
  %61 = add nsw i64 %60, %59
  %62 = call ptr @libmetis__idxset(i64 noundef %8, i64 noundef 1, ptr noundef %45) #5
  %63 = call i32 @rand() #5
  %64 = sitofp i32 %63 to double
  %65 = fmul double %50, %64
  %66 = fptosi double %65 to i32
  %67 = sext i32 %66 to i64
  %68 = load ptr, ptr %5, align 8, !tbaa !15
  store i64 %67, ptr %68, align 8, !tbaa !16
  %69 = load ptr, ptr %6, align 8, !tbaa !15
  %70 = getelementptr inbounds i64, ptr %69, i64 %67
  store i64 1, ptr %70, align 8, !tbaa !16
  br label %.outer

.outer:                                           ; preds = %.outer.backedge, %56
  %.sroa.5.0.ph = phi i64 [ %61, %56 ], [ %108, %.outer.backedge ]
  %.0119.ph = phi i64 [ 1, %56 ], [ %.0119.ph.be, %.outer.backedge ]
  %.0117.ph = phi i64 [ 0, %56 ], [ %97, %.outer.backedge ]
  %.0115.ph = phi i64 [ %51, %56 ], [ %.0115.ph.be, %.outer.backedge ]
  br label %71

71:                                               ; preds = %.outer, %96
  %.0119 = phi i64 [ %.1120, %96 ], [ %.0119.ph, %.outer ]
  %.0117 = phi i64 [ %97, %96 ], [ %.0117.ph, %.outer ]
  %.0115 = phi i64 [ %.1116, %96 ], [ %.0115.ph, %.outer ]
  %72 = phi i1 [ true, %96 ], [ false, %.outer ]
  %73 = icmp eq i64 %.0117, %.0119
  br i1 %73, label %74, label %96

74:                                               ; preds = %71
  %75 = icmp eq i64 %.0115, 0
  %or.cond = or i1 %75, %72
  br i1 %or.cond, label %.loopexit128, label %76

76:                                               ; preds = %74
  %77 = call i32 @rand() #5
  br i1 %52, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %76
  %78 = sitofp i64 %.0115 to double
  %79 = fmul double %78, 0x3E00000000000000
  %80 = sitofp i32 %77 to double
  %81 = fmul double %79, %80
  %82 = fptosi double %81 to i32
  %83 = sext i32 %82 to i64
  br label %84

84:                                               ; preds = %.lr.ph, %92
  %.0134 = phi i64 [ 0, %.lr.ph ], [ %93, %92 ]
  %.0112133 = phi i64 [ %83, %.lr.ph ], [ %.1113, %92 ]
  %85 = getelementptr inbounds i64, ptr %69, i64 %.0134
  %86 = load i64, ptr %85, align 8, !tbaa !16
  %87 = icmp eq i64 %86, 0
  br i1 %87, label %88, label %92

88:                                               ; preds = %84
  %89 = icmp eq i64 %.0112133, 0
  br i1 %89, label %._crit_edge, label %90

90:                                               ; preds = %88
  %91 = add nsw i64 %.0112133, -1
  br label %92

92:                                               ; preds = %84, %90
  %.1113 = phi i64 [ %91, %90 ], [ %.0112133, %84 ]
  %93 = add nuw nsw i64 %.0134, 1
  %exitcond.not = icmp eq i64 %93, %8
  br i1 %exitcond.not, label %._crit_edge, label %84, !llvm.loop !29

._crit_edge:                                      ; preds = %92, %88, %76
  %.0.lcssa = phi i64 [ 0, %76 ], [ %.0134, %88 ], [ %8, %92 ]
  store i64 %.0.lcssa, ptr %68, align 8, !tbaa !16
  %94 = getelementptr inbounds i64, ptr %69, i64 %.0.lcssa
  store i64 1, ptr %94, align 8, !tbaa !16
  %95 = add nsw i64 %.0115, -1
  br label %96

96:                                               ; preds = %._crit_edge, %71
  %.1120 = phi i64 [ 1, %._crit_edge ], [ %.0119, %71 ]
  %.1118 = phi i64 [ 0, %._crit_edge ], [ %.0117, %71 ]
  %.1116 = phi i64 [ %95, %._crit_edge ], [ %.0115, %71 ]
  %97 = add nsw i64 %.1118, 1
  %98 = getelementptr inbounds i64, ptr %68, i64 %.1118
  %99 = load i64, ptr %98, align 8, !tbaa !16
  %100 = getelementptr inbounds i64, ptr %12, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !16
  %102 = sub nsw i64 %.sroa.5.0.ph, %101
  %103 = icmp slt i64 %102, %29
  br i1 %103, label %71, label %104

104:                                              ; preds = %96
  %105 = getelementptr inbounds i64, ptr %12, i64 %99
  %106 = getelementptr inbounds i64, ptr %45, i64 %99
  store i64 0, ptr %106, align 8, !tbaa !16
  %107 = load i64, ptr %105, align 8, !tbaa !16
  %108 = sub nsw i64 %.sroa.5.0.ph, %107
  %.not127 = icmp sgt i64 %108, %24
  br i1 %.not127, label %109, label %.loopexit128

109:                                              ; preds = %104
  %110 = getelementptr inbounds i64, ptr %10, i64 %99
  %111 = load i64, ptr %110, align 8, !tbaa !16
  %112 = getelementptr i8, ptr %110, i64 8
  %113 = load i64, ptr %112, align 8, !tbaa !16
  %114 = icmp slt i64 %111, %113
  br i1 %114, label %.lr.ph142, label %.outer.backedge

.outer.backedge:                                  ; preds = %125, %109
  %.0119.ph.be = phi i64 [ %.1120, %109 ], [ %.3122, %125 ]
  %.0115.ph.be = phi i64 [ %.1116, %109 ], [ %.3, %125 ]
  br label %.outer

.lr.ph142:                                        ; preds = %109, %125
  %115 = phi i64 [ %126, %125 ], [ %113, %109 ]
  %.0111140 = phi i64 [ %127, %125 ], [ %111, %109 ]
  %.2139 = phi i64 [ %.3, %125 ], [ %.1116, %109 ]
  %.2121138 = phi i64 [ %.3122, %125 ], [ %.1120, %109 ]
  %116 = getelementptr inbounds i64, ptr %14, i64 %.0111140
  %117 = load i64, ptr %116, align 8, !tbaa !16
  %118 = getelementptr inbounds i64, ptr %69, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !16
  %120 = icmp eq i64 %119, 0
  br i1 %120, label %121, label %125

121:                                              ; preds = %.lr.ph142
  %122 = add nsw i64 %.2121138, 1
  %123 = getelementptr inbounds i64, ptr %68, i64 %.2121138
  store i64 %117, ptr %123, align 8, !tbaa !16
  store i64 1, ptr %118, align 8, !tbaa !16
  %124 = add nsw i64 %.2139, -1
  %.pre = load i64, ptr %112, align 8, !tbaa !16
  br label %125

125:                                              ; preds = %.lr.ph142, %121
  %126 = phi i64 [ %.pre, %121 ], [ %115, %.lr.ph142 ]
  %.3122 = phi i64 [ %122, %121 ], [ %.2121138, %.lr.ph142 ]
  %.3 = phi i64 [ %124, %121 ], [ %.2139, %.lr.ph142 ]
  %127 = add nsw i64 %.0111140, 1
  %128 = icmp slt i64 %127, %126
  br i1 %128, label %.lr.ph142, label %.outer.backedge, !llvm.loop !31

.loopexit128:                                     ; preds = %104, %74
  call void @libmetis__Compute2WayPartitionParams(ptr noundef nonnull %0, ptr noundef nonnull %1) #5
  call void @libmetis__Balance2Way(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %4, float noundef %2) #5
  call void @libmetis__FM_2WayEdgeRefine(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %4, i64 noundef 4) #5
  %129 = load i64, ptr %53, align 8, !tbaa !32
  %130 = icmp sgt i64 %129, 0
  br i1 %130, label %.lr.ph147, label %._crit_edge148

.lr.ph147:                                        ; preds = %.loopexit128, %.lr.ph147
  %.1145 = phi i64 [ %134, %.lr.ph147 ], [ 0, %.loopexit128 ]
  %131 = getelementptr inbounds i64, ptr %46, i64 %.1145
  %132 = load i64, ptr %131, align 8, !tbaa !16
  %133 = getelementptr inbounds i64, ptr %45, i64 %132
  store i64 2, ptr %133, align 8, !tbaa !16
  %134 = add nuw nsw i64 %.1145, 1
  %135 = load i64, ptr %53, align 8, !tbaa !32
  %136 = icmp slt i64 %134, %135
  br i1 %136, label %.lr.ph147, label %._crit_edge148, !llvm.loop !33

._crit_edge148:                                   ; preds = %.lr.ph147, %.loopexit128
  call void @libmetis__Compute2WayNodePartitionParams(ptr noundef nonnull %0, ptr noundef nonnull %1) #5
  call void @libmetis__FM_2WayNodeRefine(ptr noundef nonnull %0, ptr noundef nonnull %1, float noundef %2, i64 noundef 6) #5
  %137 = icmp eq i64 %.0123150, 0
  %.pre155 = load i64, ptr %54, align 8, !tbaa !34
  %138 = icmp sgt i64 %.0124149, %.pre155
  %or.cond160 = select i1 %137, i1 true, i1 %138
  br i1 %or.cond160, label %139, label %141

139:                                              ; preds = %._crit_edge148
  %140 = load ptr, ptr %7, align 8, !tbaa !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %140, ptr align 1 %45, i64 %55, i1 false)
  br label %141

141:                                              ; preds = %._crit_edge148, %139
  %.1125 = phi i64 [ %.pre155, %139 ], [ %.0124149, %._crit_edge148 ]
  %142 = add nuw nsw i64 %.0123150, 1
  %exitcond154.not = icmp eq i64 %142, %48
  br i1 %exitcond154.not, label %143, label %56, !llvm.loop !35

143:                                              ; preds = %141
  store i64 %.1125, ptr %54, align 8, !tbaa !34
  %144 = load ptr, ptr %7, align 8, !tbaa !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %45, ptr align 1 %144, i64 %55, i1 false)
  call void @libmetis__Compute2WayNodePartitionParams(ptr noundef nonnull %0, ptr noundef nonnull %1) #5
  call void (ptr, ...) @gk_free(ptr noundef nonnull %7, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef null) #5
  call void @llvm.lifetime.end.p0(i64 8, 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
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  ret void
}

declare void @libmetis__Compute2WayNodePartitionParams(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

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #3

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) #4

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

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

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

declare void @libmetis__FM_2WayNodeRefine(ptr noundef, ptr noundef, float 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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 16}
!13 = !{!6, !10, i64 24}
!14 = !{!6, !10, i64 40}
!15 = !{!10, !10, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!6, !10, i64 136}
!18 = !{!6, !10, i64 128}
!19 = !{!6, !10, i64 152}
!20 = !{!6, !10, i64 160}
!21 = !{!6, !10, i64 168}
!22 = !{!6, !10, i64 176}
!23 = !{!6, !10, i64 200}
!24 = !{!25, !7, i64 0}
!25 = !{!"controldef", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !26, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !27, i64 88, !28, i64 152, !28, i64 160, !28, i64 168, !28, i64 176, !28, i64 184, !28, i64 192, !28, i64 200, !28, i64 208, !28, i64 216, !28, i64 224, !28, i64 232, !28, i64 240, !28, i64 248, !28, i64 256, !28, i64 264, !28, i64 272}
!26 = !{!"float", !8, i64 0}
!27 = !{!"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}
!28 = !{!"double", !8, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}
!32 = !{!6, !7, i64 144}
!33 = distinct !{!33, !30}
!34 = !{!6, !7, i64 112}
!35 = distinct !{!35, !30}


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