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

; 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.vrinfodef = type { i64, i64, i64, i64, i64, 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 }
%struct.vedegreedef = type { i64, i64, i64, i64 }

; 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__ProjectVolKWayPartition(ptr noundef %0, ptr noundef %1, i64 noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %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 i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  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 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
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.graphdef, ptr %29, i32 0, i32 31
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  store ptr %31, ptr %23, align 8, !tbaa !5
  %32 = load ptr, ptr %23, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.graphdef, ptr %32, i32 0, i32 18
  %34 = load ptr, ptr %33, align 8, !tbaa !14
  store ptr %34, ptr %22, align 8, !tbaa !5
  %35 = load ptr, ptr %23, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.graphdef, ptr %35, i32 0, i32 26
  %37 = load ptr, ptr %36, align 8, !tbaa !15
  store ptr %37, ptr %24, align 8, !tbaa !5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.graphdef, ptr %38, i32 0, i32 0
  %40 = load i64, ptr %39, align 8, !tbaa !16
  store i64 %40, ptr %10, align 8, !tbaa !9
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.graphdef, ptr %41, i32 0, i32 15
  %43 = load ptr, ptr %42, align 8, !tbaa !17
  store ptr %43, ptr %20, align 8, !tbaa !5
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.graphdef, ptr %44, i32 0, i32 2
  %46 = load ptr, ptr %45, align 8, !tbaa !18
  store ptr %46, ptr %16, align 8, !tbaa !5
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.graphdef, ptr %47, i32 0, i32 5
  %49 = load ptr, ptr %48, align 8, !tbaa !19
  store ptr %49, ptr %17, align 8, !tbaa !5
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.graphdef, ptr %50, i32 0, i32 6
  %52 = load ptr, ptr %51, align 8, !tbaa !20
  store ptr %52, ptr %18, align 8, !tbaa !5
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.graphdef, ptr %53, i32 0, i32 13
  %55 = load ptr, ptr %54, align 8, !tbaa !21
  store ptr %55, ptr %19, align 8, !tbaa !5
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = load i64, ptr %6, align 8, !tbaa !9
  call void @libmetis__AllocateVolKWayPartitionMemory(ptr noundef %56, ptr noundef %57, i64 noundef %58)
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.graphdef, ptr %59, i32 0, i32 18
  %61 = load ptr, ptr %60, align 8, !tbaa !14
  store ptr %61, ptr %21, align 8, !tbaa !5
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.graphdef, ptr %62, i32 0, i32 26
  %64 = load ptr, ptr %63, align 8, !tbaa !15
  store ptr %64, ptr %25, align 8, !tbaa !5
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %65

65:                                               ; preds = %89, %3
  %66 = load i64, ptr %7, align 8, !tbaa !9
  %67 = load i64, ptr %10, align 8, !tbaa !9
  %68 = icmp slt i64 %66, %67
  br i1 %68, label %69, label %92

69:                                               ; preds = %65
  %70 = load ptr, ptr %20, align 8, !tbaa !5
  %71 = load i64, ptr %7, align 8, !tbaa !9
  %72 = getelementptr inbounds i64, ptr %70, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !9
  store i64 %73, ptr %9, align 8, !tbaa !9
  %74 = load ptr, ptr %22, align 8, !tbaa !5
  %75 = load i64, ptr %9, align 8, !tbaa !9
  %76 = getelementptr inbounds i64, ptr %74, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !9
  %78 = load ptr, ptr %21, align 8, !tbaa !5
  %79 = load i64, ptr %7, align 8, !tbaa !9
  %80 = getelementptr inbounds i64, ptr %78, i64 %79
  store i64 %77, ptr %80, align 8, !tbaa !9
  %81 = load ptr, ptr %24, align 8, !tbaa !5
  %82 = load i64, ptr %9, align 8, !tbaa !9
  %83 = getelementptr inbounds %struct.vrinfodef, ptr %81, i64 %82
  %84 = getelementptr inbounds %struct.vrinfodef, ptr %83, i32 0, i32 1
  %85 = load i64, ptr %84, align 8, !tbaa !22
  %86 = load ptr, ptr %20, align 8, !tbaa !5
  %87 = load i64, ptr %7, align 8, !tbaa !9
  %88 = getelementptr inbounds i64, ptr %86, i64 %87
  store i64 %85, ptr %88, align 8, !tbaa !9
  br label %89

89:                                               ; preds = %69
  %90 = load i64, ptr %7, align 8, !tbaa !9
  %91 = add nsw i64 %90, 1
  store i64 %91, ptr %7, align 8, !tbaa !9
  br label %65, !llvm.loop !24

92:                                               ; preds = %65
  %93 = load i64, ptr %6, align 8, !tbaa !9
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = load i64, ptr %6, align 8, !tbaa !9
  %96 = call ptr @libmetis__idxwspacemalloc(ptr noundef %94, i64 noundef %95)
  %97 = call ptr @libmetis__idxset(i64 noundef %93, i64 noundef -1, ptr noundef %96)
  store ptr %97, ptr %28, align 8, !tbaa !5
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.controldef, ptr %98, i32 0, i32 11
  %100 = getelementptr inbounds %struct.workspacedef, ptr %99, i32 0, i32 5
  store i64 0, ptr %100, align 8, !tbaa !26
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %101

101:                                              ; preds = %303, %92
  %102 = load i64, ptr %7, align 8, !tbaa !9
  %103 = load i64, ptr %10, align 8, !tbaa !9
  %104 = icmp slt i64 %102, %103
  br i1 %104, label %105, label %306

105:                                              ; preds = %101
  %106 = load ptr, ptr %21, align 8, !tbaa !5
  %107 = load i64, ptr %7, align 8, !tbaa !9
  %108 = getelementptr inbounds i64, ptr %106, i64 %107
  %109 = load i64, ptr %108, align 8, !tbaa !9
  store i64 %109, ptr %11, align 8, !tbaa !9
  %110 = load ptr, ptr %25, align 8, !tbaa !5
  %111 = load i64, ptr %7, align 8, !tbaa !9
  %112 = getelementptr inbounds %struct.vrinfodef, ptr %110, i64 %111
  store ptr %112, ptr %26, align 8, !tbaa !5
  %113 = load ptr, ptr %26, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.vrinfodef, ptr %113, i32 0, i32 4
  store i64 0, ptr %114, align 8, !tbaa !31
  %115 = load ptr, ptr %26, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.vrinfodef, ptr %115, i32 0, i32 2
  store i64 0, ptr %116, align 8, !tbaa !32
  %117 = load ptr, ptr %26, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.vrinfodef, ptr %117, i32 0, i32 1
  store i64 0, ptr %118, align 8, !tbaa !22
  %119 = load ptr, ptr %26, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.vrinfodef, ptr %119, i32 0, i32 0
  store i64 0, ptr %120, align 8, !tbaa !33
  %121 = load ptr, ptr %26, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.vrinfodef, ptr %121, i32 0, i32 5
  store ptr null, ptr %122, align 8, !tbaa !34
  %123 = load ptr, ptr %19, align 8, !tbaa !5
  %124 = load i64, ptr %7, align 8, !tbaa !9
  %125 = getelementptr inbounds i64, ptr %123, i64 %124
  %126 = load i64, ptr %125, align 8, !tbaa !9
  %127 = load ptr, ptr %26, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.vrinfodef, ptr %127, i32 0, i32 0
  store i64 %126, ptr %128, align 8, !tbaa !33
  %129 = load ptr, ptr %16, align 8, !tbaa !5
  %130 = load i64, ptr %7, align 8, !tbaa !9
  %131 = add nsw i64 %130, 1
  %132 = getelementptr inbounds i64, ptr %129, i64 %131
  %133 = load i64, ptr %132, align 8, !tbaa !9
  %134 = load ptr, ptr %16, align 8, !tbaa !5
  %135 = load i64, ptr %7, align 8, !tbaa !9
  %136 = getelementptr inbounds i64, ptr %134, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !9
  %138 = sub nsw i64 %133, %137
  %139 = load ptr, ptr %26, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.vrinfodef, ptr %139, i32 0, i32 2
  store i64 %138, ptr %140, align 8, !tbaa !32
  %141 = load ptr, ptr %20, align 8, !tbaa !5
  %142 = load i64, ptr %7, align 8, !tbaa !9
  %143 = getelementptr inbounds i64, ptr %141, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !9
  %145 = icmp sgt i64 %144, 0
  br i1 %145, label %146, label %302

146:                                              ; preds = %105
  %147 = load ptr, ptr %16, align 8, !tbaa !5
  %148 = load i64, ptr %7, align 8, !tbaa !9
  %149 = getelementptr inbounds i64, ptr %147, i64 %148
  %150 = load i64, ptr %149, align 8, !tbaa !9
  store i64 %150, ptr %13, align 8, !tbaa !9
  %151 = load ptr, ptr %16, align 8, !tbaa !5
  %152 = load i64, ptr %7, align 8, !tbaa !9
  %153 = add nsw i64 %152, 1
  %154 = getelementptr inbounds i64, ptr %151, i64 %153
  %155 = load i64, ptr %154, align 8, !tbaa !9
  store i64 %155, ptr %14, align 8, !tbaa !9
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.controldef, ptr %156, i32 0, i32 11
  %158 = getelementptr inbounds %struct.workspacedef, ptr %157, i32 0, i32 4
  %159 = load ptr, ptr %158, align 8, !tbaa !35
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.controldef, ptr %160, i32 0, i32 11
  %162 = getelementptr inbounds %struct.workspacedef, ptr %161, i32 0, i32 5
  %163 = load i64, ptr %162, align 8, !tbaa !26
  %164 = getelementptr inbounds %struct.vedegreedef, ptr %159, i64 %163
  %165 = load ptr, ptr %26, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.vrinfodef, ptr %165, i32 0, i32 5
  store ptr %164, ptr %166, align 8, !tbaa !34
  store ptr %164, ptr %27, align 8, !tbaa !5
  %167 = load i64, ptr %14, align 8, !tbaa !9
  %168 = load i64, ptr %13, align 8, !tbaa !9
  %169 = sub nsw i64 %167, %168
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.controldef, ptr %170, i32 0, i32 11
  %172 = getelementptr inbounds %struct.workspacedef, ptr %171, i32 0, i32 5
  %173 = load i64, ptr %172, align 8, !tbaa !26
  %174 = add nsw i64 %173, %169
  store i64 %174, ptr %172, align 8, !tbaa !26
  store i64 0, ptr %15, align 8, !tbaa !9
  %175 = load i64, ptr %13, align 8, !tbaa !9
  store i64 %175, ptr %8, align 8, !tbaa !9
  br label %176

176:                                              ; preds = %255, %146
  %177 = load i64, ptr %8, align 8, !tbaa !9
  %178 = load i64, ptr %14, align 8, !tbaa !9
  %179 = icmp slt i64 %177, %178
  br i1 %179, label %180, label %258

180:                                              ; preds = %176
  %181 = load ptr, ptr %21, align 8, !tbaa !5
  %182 = load ptr, ptr %17, align 8, !tbaa !5
  %183 = load i64, ptr %8, align 8, !tbaa !9
  %184 = getelementptr inbounds i64, ptr %182, i64 %183
  %185 = load i64, ptr %184, align 8, !tbaa !9
  %186 = getelementptr inbounds i64, ptr %181, i64 %185
  %187 = load i64, ptr %186, align 8, !tbaa !9
  store i64 %187, ptr %12, align 8, !tbaa !9
  %188 = load i64, ptr %11, align 8, !tbaa !9
  %189 = load i64, ptr %12, align 8, !tbaa !9
  %190 = icmp ne i64 %188, %189
  br i1 %190, label %191, label %254

191:                                              ; preds = %180
  %192 = load ptr, ptr %18, align 8, !tbaa !5
  %193 = load i64, ptr %8, align 8, !tbaa !9
  %194 = getelementptr inbounds i64, ptr %192, i64 %193
  %195 = load i64, ptr %194, align 8, !tbaa !9
  %196 = load ptr, ptr %26, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.vrinfodef, ptr %196, i32 0, i32 1
  %198 = load i64, ptr %197, align 8, !tbaa !22
  %199 = add nsw i64 %198, %195
  store i64 %199, ptr %197, align 8, !tbaa !22
  %200 = load ptr, ptr %26, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.vrinfodef, ptr %200, i32 0, i32 2
  %202 = load i64, ptr %201, align 8, !tbaa !32
  %203 = add nsw i64 %202, -1
  store i64 %203, ptr %201, align 8, !tbaa !32
  %204 = load ptr, ptr %28, align 8, !tbaa !5
  %205 = load i64, ptr %12, align 8, !tbaa !9
  %206 = getelementptr inbounds i64, ptr %204, i64 %205
  %207 = load i64, ptr %206, align 8, !tbaa !9
  store i64 %207, ptr %9, align 8, !tbaa !9
  %208 = icmp eq i64 %207, -1
  br i1 %208, label %209, label %236

209:                                              ; preds = %191
  %210 = load i64, ptr %15, align 8, !tbaa !9
  %211 = load ptr, ptr %28, align 8, !tbaa !5
  %212 = load i64, ptr %12, align 8, !tbaa !9
  %213 = getelementptr inbounds i64, ptr %211, i64 %212
  store i64 %210, ptr %213, align 8, !tbaa !9
  %214 = load ptr, ptr %27, align 8, !tbaa !5
  %215 = load i64, ptr %15, align 8, !tbaa !9
  %216 = getelementptr inbounds %struct.vedegreedef, ptr %214, i64 %215
  %217 = getelementptr inbounds %struct.vedegreedef, ptr %216, i32 0, i32 3
  store i64 0, ptr %217, align 8, !tbaa !36
  %218 = load i64, ptr %12, align 8, !tbaa !9
  %219 = load ptr, ptr %27, align 8, !tbaa !5
  %220 = load i64, ptr %15, align 8, !tbaa !9
  %221 = getelementptr inbounds %struct.vedegreedef, ptr %219, i64 %220
  %222 = getelementptr inbounds %struct.vedegreedef, ptr %221, i32 0, i32 0
  store i64 %218, ptr %222, align 8, !tbaa !38
  %223 = load ptr, ptr %18, align 8, !tbaa !5
  %224 = load i64, ptr %8, align 8, !tbaa !9
  %225 = getelementptr inbounds i64, ptr %223, i64 %224
  %226 = load i64, ptr %225, align 8, !tbaa !9
  %227 = load ptr, ptr %27, align 8, !tbaa !5
  %228 = load i64, ptr %15, align 8, !tbaa !9
  %229 = getelementptr inbounds %struct.vedegreedef, ptr %227, i64 %228
  %230 = getelementptr inbounds %struct.vedegreedef, ptr %229, i32 0, i32 1
  store i64 %226, ptr %230, align 8, !tbaa !39
  %231 = load ptr, ptr %27, align 8, !tbaa !5
  %232 = load i64, ptr %15, align 8, !tbaa !9
  %233 = add nsw i64 %232, 1
  store i64 %233, ptr %15, align 8, !tbaa !9
  %234 = getelementptr inbounds %struct.vedegreedef, ptr %231, i64 %232
  %235 = getelementptr inbounds %struct.vedegreedef, ptr %234, i32 0, i32 2
  store i64 1, ptr %235, align 8, !tbaa !40
  br label %253

236:                                              ; preds = %191
  %237 = load ptr, ptr %18, align 8, !tbaa !5
  %238 = load i64, ptr %8, align 8, !tbaa !9
  %239 = getelementptr inbounds i64, ptr %237, i64 %238
  %240 = load i64, ptr %239, align 8, !tbaa !9
  %241 = load ptr, ptr %27, align 8, !tbaa !5
  %242 = load i64, ptr %9, align 8, !tbaa !9
  %243 = getelementptr inbounds %struct.vedegreedef, ptr %241, i64 %242
  %244 = getelementptr inbounds %struct.vedegreedef, ptr %243, i32 0, i32 1
  %245 = load i64, ptr %244, align 8, !tbaa !39
  %246 = add nsw i64 %245, %240
  store i64 %246, ptr %244, align 8, !tbaa !39
  %247 = load ptr, ptr %27, align 8, !tbaa !5
  %248 = load i64, ptr %9, align 8, !tbaa !9
  %249 = getelementptr inbounds %struct.vedegreedef, ptr %247, i64 %248
  %250 = getelementptr inbounds %struct.vedegreedef, ptr %249, i32 0, i32 2
  %251 = load i64, ptr %250, align 8, !tbaa !40
  %252 = add nsw i64 %251, 1
  store i64 %252, ptr %250, align 8, !tbaa !40
  br label %253

253:                                              ; preds = %236, %209
  br label %254

254:                                              ; preds = %253, %180
  br label %255

255:                                              ; preds = %254
  %256 = load i64, ptr %8, align 8, !tbaa !9
  %257 = add nsw i64 %256, 1
  store i64 %257, ptr %8, align 8, !tbaa !9
  br label %176, !llvm.loop !41

258:                                              ; preds = %176
  %259 = load ptr, ptr %26, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.vrinfodef, ptr %259, i32 0, i32 1
  %261 = load i64, ptr %260, align 8, !tbaa !22
  %262 = load ptr, ptr %26, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct.vrinfodef, ptr %262, i32 0, i32 0
  %264 = load i64, ptr %263, align 8, !tbaa !33
  %265 = sub nsw i64 %264, %261
  store i64 %265, ptr %263, align 8, !tbaa !33
  %266 = load ptr, ptr %26, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.vrinfodef, ptr %266, i32 0, i32 1
  %268 = load i64, ptr %267, align 8, !tbaa !22
  %269 = icmp eq i64 %268, 0
  br i1 %269, label %270, label %281

270:                                              ; preds = %258
  %271 = load ptr, ptr %26, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.vrinfodef, ptr %271, i32 0, i32 5
  store ptr null, ptr %272, align 8, !tbaa !34
  %273 = load i64, ptr %14, align 8, !tbaa !9
  %274 = load i64, ptr %13, align 8, !tbaa !9
  %275 = sub nsw i64 %273, %274
  %276 = load ptr, ptr %4, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.controldef, ptr %276, i32 0, i32 11
  %278 = getelementptr inbounds %struct.workspacedef, ptr %277, i32 0, i32 5
  %279 = load i64, ptr %278, align 8, !tbaa !26
  %280 = sub nsw i64 %279, %275
  store i64 %280, ptr %278, align 8, !tbaa !26
  br label %301

281:                                              ; preds = %258
  %282 = load i64, ptr %15, align 8, !tbaa !9
  %283 = load ptr, ptr %26, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.vrinfodef, ptr %283, i32 0, i32 4
  store i64 %282, ptr %284, align 8, !tbaa !31
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %285

285:                                              ; preds = %297, %281
  %286 = load i64, ptr %8, align 8, !tbaa !9
  %287 = load i64, ptr %15, align 8, !tbaa !9
  %288 = icmp slt i64 %286, %287
  br i1 %288, label %289, label %300

289:                                              ; preds = %285
  %290 = load ptr, ptr %28, align 8, !tbaa !5
  %291 = load ptr, ptr %27, align 8, !tbaa !5
  %292 = load i64, ptr %8, align 8, !tbaa !9
  %293 = getelementptr inbounds %struct.vedegreedef, ptr %291, i64 %292
  %294 = getelementptr inbounds %struct.vedegreedef, ptr %293, i32 0, i32 0
  %295 = load i64, ptr %294, align 8, !tbaa !38
  %296 = getelementptr inbounds i64, ptr %290, i64 %295
  store i64 -1, ptr %296, align 8, !tbaa !9
  br label %297

297:                                              ; preds = %289
  %298 = load i64, ptr %8, align 8, !tbaa !9
  %299 = add nsw i64 %298, 1
  store i64 %299, ptr %8, align 8, !tbaa !9
  br label %285, !llvm.loop !42

300:                                              ; preds = %285
  br label %301

301:                                              ; preds = %300, %270
  br label %302

302:                                              ; preds = %301, %105
  br label %303

303:                                              ; preds = %302
  %304 = load i64, ptr %7, align 8, !tbaa !9
  %305 = add nsw i64 %304, 1
  store i64 %305, ptr %7, align 8, !tbaa !9
  br label %101, !llvm.loop !43

306:                                              ; preds = %101
  %307 = load ptr, ptr %4, align 8, !tbaa !5
  %308 = load ptr, ptr %5, align 8, !tbaa !5
  %309 = load i64, ptr %6, align 8, !tbaa !9
  call void @libmetis__ComputeKWayVolGains(ptr noundef %307, ptr noundef %308, i64 noundef %309)
  %310 = load ptr, ptr %5, align 8, !tbaa !5
  %311 = getelementptr inbounds %struct.graphdef, ptr %310, i32 0, i32 19
  %312 = load ptr, ptr %311, align 8, !tbaa !44
  %313 = load ptr, ptr %23, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.graphdef, ptr %313, i32 0, i32 19
  %315 = load ptr, ptr %314, align 8, !tbaa !44
  %316 = load i64, ptr %6, align 8, !tbaa !9
  %317 = mul i64 8, %316
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %312, ptr align 1 %315, i64 %317, i1 false)
  %318 = load ptr, ptr %23, align 8, !tbaa !5
  %319 = getelementptr inbounds %struct.graphdef, ptr %318, i32 0, i32 16
  %320 = load i64, ptr %319, align 8, !tbaa !45
  %321 = load ptr, ptr %5, align 8, !tbaa !5
  %322 = getelementptr inbounds %struct.graphdef, ptr %321, i32 0, i32 16
  store i64 %320, ptr %322, align 8, !tbaa !45
  %323 = load ptr, ptr %5, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct.graphdef, ptr %323, i32 0, i32 31
  %325 = load ptr, ptr %324, align 8, !tbaa !11
  call void @libmetis__FreeGraph(ptr noundef %325, i32 noundef 1)
  %326 = load ptr, ptr %5, align 8, !tbaa !5
  %327 = getelementptr inbounds %struct.graphdef, ptr %326, i32 0, i32 31
  store ptr null, ptr %327, align 8, !tbaa !11
  %328 = load ptr, ptr %4, align 8, !tbaa !5
  %329 = load i64, ptr %6, align 8, !tbaa !9
  call void @libmetis__idxwspacefree(ptr noundef %328, i64 noundef %329)
  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 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  ret void
}

; 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
declare dso_local void @libmetis__AllocateVolKWayPartitionMemory(ptr noundef, ptr noundef, i64 noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @libmetis__ComputeKWayVolGains(ptr noundef, ptr noundef, i64 noundef) #1

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

declare void @libmetis__idxwspacefree(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 @libmetis__FreeGraph(ptr noundef, i32 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 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 232}
!12 = !{!"graphdef", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !13, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !10, i64 112, !10, i64 120, !6, i64 128, !6, i64 136, !10, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !10, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !6, i64 128}
!15 = !{!12, !6, i64 192}
!16 = !{!12, !10, i64 0}
!17 = !{!12, !6, i64 104}
!18 = !{!12, !6, i64 16}
!19 = !{!12, !6, i64 40}
!20 = !{!12, !6, i64 48}
!21 = !{!12, !6, i64 88}
!22 = !{!23, !10, i64 8}
!23 = !{!"vrinfodef", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !6, i64 40}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !10, i64 128}
!27 = !{!"controldef", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !28, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, 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}
!28 = !{!"float", !7, i64 0}
!29 = !{!"workspacedef", !6, i64 0, !10, i64 8, !10, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !6, i64 48, !6, i64 56}
!30 = !{!"double", !7, i64 0}
!31 = !{!23, !10, i64 32}
!32 = !{!23, !10, i64 16}
!33 = !{!23, !10, i64 0}
!34 = !{!23, !6, i64 40}
!35 = !{!27, !6, i64 120}
!36 = !{!37, !10, i64 24}
!37 = !{!"vedegreedef", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!38 = !{!37, !10, i64 0}
!39 = !{!37, !10, i64 8}
!40 = !{!37, !10, i64 16}
!41 = distinct !{!41, !25}
!42 = distinct !{!42, !25}
!43 = distinct !{!43, !25}
!44 = !{!12, !6, i64 136}
!45 = !{!12, !10, i64 112}


; 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"

%struct.vrinfodef = type { i64, i64, i64, i64, i64, ptr }
%struct.vedegreedef = type { i64, i64, i64, i64 }

; Function Attrs: nounwind uwtable
define dso_local void @libmetis__ProjectVolKWayPartition(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %1, i64 232
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %5, i64 128
  %7 = load ptr, ptr %6, align 8, !tbaa !12
  %8 = getelementptr inbounds i8, ptr %5, i64 192
  %9 = load ptr, ptr %8, align 8, !tbaa !13
  %10 = load i64, ptr %1, align 8, !tbaa !14
  %11 = getelementptr inbounds i8, ptr %1, i64 104
  %12 = load ptr, ptr %11, align 8, !tbaa !15
  %13 = getelementptr inbounds i8, ptr %1, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %1, i64 40
  %16 = load ptr, ptr %15, align 8, !tbaa !17
  %17 = getelementptr inbounds i8, ptr %1, i64 48
  %18 = load ptr, ptr %17, align 8, !tbaa !18
  %19 = getelementptr inbounds i8, ptr %1, i64 88
  %20 = load ptr, ptr %19, align 8, !tbaa !19
  tail call void @libmetis__AllocateVolKWayPartitionMemory(ptr noundef %0, ptr noundef nonnull %1, i64 noundef %2)
  %21 = getelementptr inbounds i8, ptr %1, i64 128
  %22 = load ptr, ptr %21, align 8, !tbaa !12
  %23 = getelementptr inbounds i8, ptr %1, i64 192
  %24 = load ptr, ptr %23, align 8, !tbaa !13
  %25 = icmp sgt i64 %10, 0
  br i1 %25, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %3
  %xtraiter = and i64 %10, 1
  %26 = icmp eq i64 %10, 1
  br i1 %26, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %10, 9223372036854775806
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.0131 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %42, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %27 = getelementptr inbounds i64, ptr %12, i64 %.0131
  %28 = load i64, ptr %27, align 8, !tbaa !20
  %29 = getelementptr inbounds i64, ptr %7, i64 %28
  %30 = load i64, ptr %29, align 8, !tbaa !20
  %31 = getelementptr inbounds i64, ptr %22, i64 %.0131
  store i64 %30, ptr %31, align 8, !tbaa !20
  %32 = getelementptr inbounds %struct.vrinfodef, ptr %9, i64 %28, i32 1
  %33 = load i64, ptr %32, align 8, !tbaa !21
  store i64 %33, ptr %27, align 8, !tbaa !20
  %34 = or disjoint i64 %.0131, 1
  %35 = getelementptr inbounds i64, ptr %12, i64 %34
  %36 = load i64, ptr %35, align 8, !tbaa !20
  %37 = getelementptr inbounds i64, ptr %7, i64 %36
  %38 = load i64, ptr %37, align 8, !tbaa !20
  %39 = getelementptr inbounds i64, ptr %22, i64 %34
  store i64 %38, ptr %39, align 8, !tbaa !20
  %40 = getelementptr inbounds %struct.vrinfodef, ptr %9, i64 %36, i32 1
  %41 = load i64, ptr %40, align 8, !tbaa !21
  store i64 %41, ptr %35, align 8, !tbaa !20
  %42 = add nuw nsw i64 %.0131, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !23

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %.0131.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %42, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa
  %43 = getelementptr inbounds i64, ptr %12, i64 %.0131.unr
  %44 = load i64, ptr %43, align 8, !tbaa !20
  %45 = getelementptr inbounds i64, ptr %7, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !20
  %47 = getelementptr inbounds i64, ptr %22, i64 %.0131.unr
  store i64 %46, ptr %47, align 8, !tbaa !20
  %48 = getelementptr inbounds %struct.vrinfodef, ptr %9, i64 %44, i32 1
  %49 = load i64, ptr %48, align 8, !tbaa !21
  store i64 %49, ptr %43, align 8, !tbaa !20
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.epil, %._crit_edge.loopexit.unr-lcssa, %3
  %50 = tail call ptr @libmetis__idxwspacemalloc(ptr noundef %0, i64 noundef %2) #4
  %51 = tail call ptr @libmetis__idxset(i64 noundef %2, i64 noundef -1, ptr noundef %50) #4
  %52 = getelementptr inbounds i8, ptr %0, i64 128
  store i64 0, ptr %52, align 8, !tbaa !25
  br i1 %25, label %.lr.ph142, label %._crit_edge143

.lr.ph142:                                        ; preds = %._crit_edge
  %53 = getelementptr inbounds i8, ptr %0, i64 120
  br label %54

54:                                               ; preds = %.lr.ph142, %.loopexit
  %.1140 = phi i64 [ 0, %.lr.ph142 ], [ %64, %.loopexit ]
  %55 = getelementptr inbounds i64, ptr %22, i64 %.1140
  %56 = load i64, ptr %55, align 8, !tbaa !20
  %57 = getelementptr inbounds %struct.vrinfodef, ptr %24, i64 %.1140
  %58 = getelementptr inbounds i8, ptr %57, i64 32
  %59 = getelementptr inbounds i8, ptr %57, i64 16
  %60 = getelementptr inbounds i8, ptr %57, i64 8
  %61 = getelementptr inbounds i8, ptr %57, i64 40
  %62 = getelementptr inbounds i64, ptr %20, i64 %.1140
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %57, i8 0, i64 24, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %58, i8 0, i64 16, i1 false)
  %63 = load i64, ptr %62, align 8, !tbaa !20
  store i64 %63, ptr %57, align 8, !tbaa !30
  %64 = add nuw nsw i64 %.1140, 1
  %65 = getelementptr inbounds i64, ptr %14, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !20
  %67 = getelementptr inbounds i64, ptr %14, i64 %.1140
  %68 = load i64, ptr %67, align 8, !tbaa !20
  %69 = sub nsw i64 %66, %68
  store i64 %69, ptr %59, align 8, !tbaa !31
  %70 = getelementptr inbounds i64, ptr %12, i64 %.1140
  %71 = load i64, ptr %70, align 8, !tbaa !20
  %72 = icmp sgt i64 %71, 0
  br i1 %72, label %73, label %.loopexit

73:                                               ; preds = %54
  %74 = load i64, ptr %67, align 8, !tbaa !20
  %75 = load i64, ptr %65, align 8, !tbaa !20
  %76 = load ptr, ptr %53, align 8, !tbaa !32
  %77 = load i64, ptr %52, align 8, !tbaa !25
  %78 = getelementptr inbounds %struct.vedegreedef, ptr %76, i64 %77
  store ptr %78, ptr %61, align 8, !tbaa !33
  %79 = sub nsw i64 %75, %74
  %80 = add nsw i64 %77, %79
  store i64 %80, ptr %52, align 8, !tbaa !25
  %81 = icmp slt i64 %74, %75
  br i1 %81, label %.lr.ph135, label %._crit_edge136.thread

._crit_edge136.thread:                            ; preds = %73
  store i64 %63, ptr %57, align 8, !tbaa !30
  br label %112

.lr.ph135:                                        ; preds = %73, %108
  %.0124133 = phi i64 [ %109, %108 ], [ %74, %73 ]
  %.0126132 = phi i64 [ %.1127, %108 ], [ 0, %73 ]
  %82 = getelementptr inbounds i64, ptr %16, i64 %.0124133
  %83 = load i64, ptr %82, align 8, !tbaa !20
  %84 = getelementptr inbounds i64, ptr %22, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !20
  %.not = icmp eq i64 %56, %85
  br i1 %.not, label %108, label %86

86:                                               ; preds = %.lr.ph135
  %87 = getelementptr inbounds i64, ptr %18, i64 %.0124133
  %88 = load i64, ptr %87, align 8, !tbaa !20
  %89 = load <2 x i64>, ptr %60, align 8, !tbaa !20
  %90 = insertelement <2 x i64> <i64 poison, i64 -1>, i64 %88, i64 0
  %91 = add nsw <2 x i64> %89, %90
  store <2 x i64> %91, ptr %60, align 8, !tbaa !20
  %92 = getelementptr inbounds i64, ptr %51, i64 %85
  %93 = load i64, ptr %92, align 8, !tbaa !20
  %94 = icmp eq i64 %93, -1
  br i1 %94, label %95, label %102

95:                                               ; preds = %86
  store i64 %.0126132, ptr %92, align 8, !tbaa !20
  %96 = getelementptr inbounds %struct.vedegreedef, ptr %78, i64 %.0126132
  %97 = getelementptr inbounds i8, ptr %96, i64 24
  store i64 0, ptr %97, align 8, !tbaa !34
  store i64 %85, ptr %96, align 8, !tbaa !36
  %98 = load i64, ptr %87, align 8, !tbaa !20
  %99 = getelementptr inbounds i8, ptr %96, i64 8
  store i64 %98, ptr %99, align 8, !tbaa !37
  %100 = add nsw i64 %.0126132, 1
  %101 = getelementptr inbounds i8, ptr %96, i64 16
  store i64 1, ptr %101, align 8, !tbaa !38
  br label %108

102:                                              ; preds = %86
  %103 = load i64, ptr %87, align 8, !tbaa !20
  %104 = getelementptr inbounds %struct.vedegreedef, ptr %78, i64 %93, i32 1
  %105 = load <2 x i64>, ptr %104, align 8, !tbaa !20
  %106 = insertelement <2 x i64> <i64 poison, i64 1>, i64 %103, i64 0
  %107 = add nsw <2 x i64> %105, %106
  store <2 x i64> %107, ptr %104, align 8, !tbaa !20
  br label %108

108:                                              ; preds = %.lr.ph135, %102, %95
  %.1127 = phi i64 [ %100, %95 ], [ %.0126132, %102 ], [ %.0126132, %.lr.ph135 ]
  %109 = add nsw i64 %.0124133, 1
  %exitcond144.not = icmp eq i64 %109, %75
  br i1 %exitcond144.not, label %._crit_edge136, label %.lr.ph135, !llvm.loop !39

._crit_edge136:                                   ; preds = %108
  %.pre = load i64, ptr %60, align 8, !tbaa !21
  %.pre147 = load i64, ptr %57, align 8, !tbaa !30
  %110 = sub nsw i64 %.pre147, %.pre
  store i64 %110, ptr %57, align 8, !tbaa !30
  %111 = icmp eq i64 %.pre, 0
  br i1 %111, label %112, label %115

112:                                              ; preds = %._crit_edge136.thread, %._crit_edge136
  store ptr null, ptr %61, align 8, !tbaa !33
  %113 = load i64, ptr %52, align 8, !tbaa !25
  %114 = sub nsw i64 %113, %79
  store i64 %114, ptr %52, align 8, !tbaa !25
  br label %.loopexit

115:                                              ; preds = %._crit_edge136
  store i64 %.1127, ptr %58, align 8, !tbaa !40
  %116 = icmp sgt i64 %.1127, 0
  br i1 %116, label %.lr.ph139.preheader, label %.loopexit

.lr.ph139.preheader:                              ; preds = %115
  %xtraiter149 = and i64 %.1127, 3
  %117 = icmp ult i64 %.1127, 4
  br i1 %117, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph139.preheader.new

.lr.ph139.preheader.new:                          ; preds = %.lr.ph139.preheader
  %unroll_iter151 = and i64 %.1127, 9223372036854775804
  br label %.lr.ph139

.lr.ph139:                                        ; preds = %.lr.ph139, %.lr.ph139.preheader.new
  %.1125137 = phi i64 [ 0, %.lr.ph139.preheader.new ], [ %133, %.lr.ph139 ]
  %niter152 = phi i64 [ 0, %.lr.ph139.preheader.new ], [ %niter152.next.3, %.lr.ph139 ]
  %118 = getelementptr inbounds %struct.vedegreedef, ptr %78, i64 %.1125137
  %119 = load i64, ptr %118, align 8, !tbaa !36
  %120 = getelementptr inbounds i64, ptr %51, i64 %119
  store i64 -1, ptr %120, align 8, !tbaa !20
  %121 = or disjoint i64 %.1125137, 1
  %122 = getelementptr inbounds %struct.vedegreedef, ptr %78, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !36
  %124 = getelementptr inbounds i64, ptr %51, i64 %123
  store i64 -1, ptr %124, align 8, !tbaa !20
  %125 = or disjoint i64 %.1125137, 2
  %126 = getelementptr inbounds %struct.vedegreedef, ptr %78, i64 %125
  %127 = load i64, ptr %126, align 8, !tbaa !36
  %128 = getelementptr inbounds i64, ptr %51, i64 %127
  store i64 -1, ptr %128, align 8, !tbaa !20
  %129 = or disjoint i64 %.1125137, 3
  %130 = getelementptr inbounds %struct.vedegreedef, ptr %78, i64 %129
  %131 = load i64, ptr %130, align 8, !tbaa !36
  %132 = getelementptr inbounds i64, ptr %51, i64 %131
  store i64 -1, ptr %132, align 8, !tbaa !20
  %133 = add nuw nsw i64 %.1125137, 4
  %niter152.next.3 = add i64 %niter152, 4
  %niter152.ncmp.3 = icmp eq i64 %niter152.next.3, %unroll_iter151
  br i1 %niter152.ncmp.3, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph139, !llvm.loop !41

.loopexit.loopexit.unr-lcssa:                     ; preds = %.lr.ph139, %.lr.ph139.preheader
  %.1125137.unr = phi i64 [ 0, %.lr.ph139.preheader ], [ %133, %.lr.ph139 ]
  %lcmp.mod150.not = icmp eq i64 %xtraiter149, 0
  br i1 %lcmp.mod150.not, label %.loopexit, label %.lr.ph139.epil

.lr.ph139.epil:                                   ; preds = %.loopexit.loopexit.unr-lcssa, %.lr.ph139.epil
  %.1125137.epil = phi i64 [ %137, %.lr.ph139.epil ], [ %.1125137.unr, %.loopexit.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph139.epil ], [ 0, %.loopexit.loopexit.unr-lcssa ]
  %134 = getelementptr inbounds %struct.vedegreedef, ptr %78, i64 %.1125137.epil
  %135 = load i64, ptr %134, align 8, !tbaa !36
  %136 = getelementptr inbounds i64, ptr %51, i64 %135
  store i64 -1, ptr %136, align 8, !tbaa !20
  %137 = add nuw nsw i64 %.1125137.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter149
  br i1 %epil.iter.cmp.not, label %.loopexit, label %.lr.ph139.epil, !llvm.loop !42

.loopexit:                                        ; preds = %.loopexit.loopexit.unr-lcssa, %.lr.ph139.epil, %115, %54, %112
  %exitcond146.not = icmp eq i64 %64, %10
  br i1 %exitcond146.not, label %._crit_edge143, label %54, !llvm.loop !44

._crit_edge143:                                   ; preds = %.loopexit, %._crit_edge
  tail call void @libmetis__ComputeKWayVolGains(ptr noundef %0, ptr noundef nonnull %1, i64 noundef %2)
  %138 = getelementptr inbounds i8, ptr %1, i64 136
  %139 = load ptr, ptr %138, align 8, !tbaa !45
  %140 = getelementptr inbounds i8, ptr %5, i64 136
  %141 = load ptr, ptr %140, align 8, !tbaa !45
  %142 = shl i64 %2, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %139, ptr align 1 %141, i64 %142, i1 false)
  %143 = getelementptr inbounds i8, ptr %5, i64 112
  %144 = load i64, ptr %143, align 8, !tbaa !46
  %145 = getelementptr inbounds i8, ptr %1, i64 112
  store i64 %144, ptr %145, align 8, !tbaa !46
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  tail call void @libmetis__FreeGraph(ptr noundef %146, i32 noundef 1) #4
  store ptr null, ptr %4, align 8, !tbaa !5
  tail call void @libmetis__idxwspacefree(ptr noundef %0, i64 noundef %2) #4
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @libmetis__AllocateVolKWayPartitionMemory(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @libmetis__ComputeKWayVolGains(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

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

declare void @libmetis__idxwspacefree(ptr noundef, i64 noundef) local_unnamed_addr #1

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

declare void @libmetis__FreeGraph(ptr noundef, i32 noundef) local_unnamed_addr #1

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

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !10, i64 232}
!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 128}
!13 = !{!6, !10, i64 192}
!14 = !{!6, !7, i64 0}
!15 = !{!6, !10, i64 104}
!16 = !{!6, !10, i64 16}
!17 = !{!6, !10, i64 40}
!18 = !{!6, !10, i64 48}
!19 = !{!6, !10, i64 88}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !7, i64 8}
!22 = !{!"vrinfodef", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !7, i64 128}
!26 = !{!"controldef", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !27, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !28, i64 88, !29, i64 152, !29, i64 160, !29, i64 168, !29, i64 176, !29, i64 184, !29, i64 192, !29, i64 200, !29, i64 208, !29, i64 216, !29, i64 224, !29, i64 232, !29, i64 240, !29, i64 248, !29, i64 256, !29, i64 264, !29, i64 272}
!27 = !{!"float", !8, i64 0}
!28 = !{!"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}
!29 = !{!"double", !8, i64 0}
!30 = !{!22, !7, i64 0}
!31 = !{!22, !7, i64 16}
!32 = !{!26, !10, i64 120}
!33 = !{!22, !10, i64 40}
!34 = !{!35, !7, i64 24}
!35 = !{!"vedegreedef", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!36 = !{!35, !7, i64 0}
!37 = !{!35, !7, i64 8}
!38 = !{!35, !7, i64 16}
!39 = distinct !{!39, !24}
!40 = !{!22, !7, i64 32}
!41 = distinct !{!41, !24}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.unroll.disable"}
!44 = distinct !{!44, !24}
!45 = !{!6, !10, i64 136}
!46 = !{!6, !7, i64 112}


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