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

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

64:                                               ; preds = %290, %3
  %65 = load i64, ptr %7, align 8, !tbaa !9
  %66 = load i64, ptr %11, align 8, !tbaa !9
  %67 = icmp slt i64 %65, %66
  br i1 %67, label %68, label %293

68:                                               ; preds = %64
  %69 = load ptr, ptr %21, align 8, !tbaa !5
  %70 = load i64, ptr %7, align 8, !tbaa !9
  %71 = getelementptr inbounds i64, ptr %69, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !9
  store i64 %72, ptr %14, align 8, !tbaa !9
  %73 = load ptr, ptr %17, align 8, !tbaa !5
  %74 = load i64, ptr %7, align 8, !tbaa !9
  %75 = getelementptr inbounds i64, ptr %73, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !9
  %77 = load ptr, ptr %20, align 8, !tbaa !5
  %78 = load i64, ptr %14, align 8, !tbaa !9
  %79 = getelementptr inbounds i64, ptr %77, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !9
  %81 = add nsw i64 %80, %76
  store i64 %81, ptr %79, align 8, !tbaa !9
  %82 = load ptr, ptr %24, align 8, !tbaa !5
  %83 = load i64, ptr %7, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.rinfodef, ptr %82, i64 %83
  store ptr %84, ptr %25, align 8, !tbaa !5
  %85 = load ptr, ptr %25, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.rinfodef, ptr %85, i32 0, i32 2
  store i64 0, ptr %86, align 8, !tbaa !28
  %87 = load ptr, ptr %25, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.rinfodef, ptr %87, i32 0, i32 1
  store i64 0, ptr %88, align 8, !tbaa !30
  %89 = load ptr, ptr %25, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.rinfodef, ptr %89, i32 0, i32 0
  store i64 0, ptr %90, align 8, !tbaa !31
  %91 = load ptr, ptr %25, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.rinfodef, ptr %91, i32 0, i32 3
  store ptr null, ptr %92, align 8, !tbaa !32
  %93 = load ptr, ptr %16, align 8, !tbaa !5
  %94 = load i64, ptr %7, align 8, !tbaa !9
  %95 = getelementptr inbounds i64, ptr %93, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !9
  store i64 %96, ptr %8, align 8, !tbaa !9
  br label %97

97:                                               ; preds = %125, %68
  %98 = load i64, ptr %8, align 8, !tbaa !9
  %99 = load ptr, ptr %16, align 8, !tbaa !5
  %100 = load i64, ptr %7, align 8, !tbaa !9
  %101 = add nsw i64 %100, 1
  %102 = getelementptr inbounds i64, ptr %99, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !9
  %104 = icmp slt i64 %98, %103
  br i1 %104, label %105, label %128

105:                                              ; preds = %97
  %106 = load i64, ptr %14, align 8, !tbaa !9
  %107 = load ptr, ptr %21, align 8, !tbaa !5
  %108 = load ptr, ptr %18, align 8, !tbaa !5
  %109 = load i64, ptr %8, align 8, !tbaa !9
  %110 = getelementptr inbounds i64, ptr %108, i64 %109
  %111 = load i64, ptr %110, align 8, !tbaa !9
  %112 = getelementptr inbounds i64, ptr %107, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !9
  %114 = icmp ne i64 %106, %113
  br i1 %114, label %115, label %124

115:                                              ; preds = %105
  %116 = load ptr, ptr %19, align 8, !tbaa !5
  %117 = load i64, ptr %8, align 8, !tbaa !9
  %118 = getelementptr inbounds i64, ptr %116, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !9
  %120 = load ptr, ptr %25, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.rinfodef, ptr %120, i32 0, i32 1
  %122 = load i64, ptr %121, align 8, !tbaa !30
  %123 = add nsw i64 %122, %119
  store i64 %123, ptr %121, align 8, !tbaa !30
  br label %124

124:                                              ; preds = %115, %105
  br label %125

125:                                              ; preds = %124
  %126 = load i64, ptr %8, align 8, !tbaa !9
  %127 = add nsw i64 %126, 1
  store i64 %127, ptr %8, align 8, !tbaa !9
  br label %97, !llvm.loop !33

128:                                              ; preds = %97
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.graphdef, ptr %129, i32 0, i32 13
  %131 = load ptr, ptr %130, align 8, !tbaa !35
  %132 = load i64, ptr %7, align 8, !tbaa !9
  %133 = getelementptr inbounds i64, ptr %131, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !9
  %135 = load ptr, ptr %25, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.rinfodef, ptr %135, i32 0, i32 1
  %137 = load i64, ptr %136, align 8, !tbaa !30
  %138 = sub nsw i64 %134, %137
  %139 = load ptr, ptr %25, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.rinfodef, ptr %139, i32 0, i32 0
  store i64 %138, ptr %140, align 8, !tbaa !31
  %141 = load ptr, ptr %25, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.rinfodef, ptr %141, i32 0, i32 1
  %143 = load i64, ptr %142, align 8, !tbaa !30
  %144 = icmp sgt i64 %143, 0
  br i1 %144, label %145, label %151

145:                                              ; preds = %128
  %146 = load ptr, ptr %25, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.rinfodef, ptr %146, i32 0, i32 1
  %148 = load i64, ptr %147, align 8, !tbaa !30
  %149 = load i64, ptr %13, align 8, !tbaa !9
  %150 = add nsw i64 %149, %148
  store i64 %150, ptr %13, align 8, !tbaa !9
  br label %151

151:                                              ; preds = %145, %128
  %152 = load ptr, ptr %25, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.rinfodef, ptr %152, i32 0, i32 1
  %154 = load i64, ptr %153, align 8, !tbaa !30
  %155 = load ptr, ptr %25, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.rinfodef, ptr %155, i32 0, i32 0
  %157 = load i64, ptr %156, align 8, !tbaa !31
  %158 = sub nsw i64 %154, %157
  %159 = icmp sge i64 %158, 0
  br i1 %159, label %160, label %173

160:                                              ; preds = %151
  br label %161

161:                                              ; preds = %160
  %162 = load i64, ptr %7, align 8, !tbaa !9
  %163 = load ptr, ptr %22, align 8, !tbaa !5
  %164 = load i64, ptr %12, align 8, !tbaa !9
  %165 = getelementptr inbounds i64, ptr %163, i64 %164
  store i64 %162, ptr %165, align 8, !tbaa !9
  %166 = load i64, ptr %12, align 8, !tbaa !9
  %167 = add nsw i64 %166, 1
  store i64 %167, ptr %12, align 8, !tbaa !9
  %168 = load ptr, ptr %23, align 8, !tbaa !5
  %169 = load i64, ptr %7, align 8, !tbaa !9
  %170 = getelementptr inbounds i64, ptr %168, i64 %169
  store i64 %166, ptr %170, align 8, !tbaa !9
  br label %171

171:                                              ; preds = %161
  br label %172

172:                                              ; preds = %171
  br label %173

173:                                              ; preds = %172, %151
  %174 = load ptr, ptr %25, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.rinfodef, ptr %174, i32 0, i32 1
  %176 = load i64, ptr %175, align 8, !tbaa !30
  %177 = icmp sgt i64 %176, 0
  br i1 %177, label %178, label %289

178:                                              ; preds = %173
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.controldef, ptr %179, i32 0, i32 11
  %181 = getelementptr inbounds %struct.workspacedef, ptr %180, i32 0, i32 3
  %182 = load ptr, ptr %181, align 8, !tbaa !36
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.controldef, ptr %183, i32 0, i32 11
  %185 = getelementptr inbounds %struct.workspacedef, ptr %184, i32 0, i32 5
  %186 = load i64, ptr %185, align 8, !tbaa !23
  %187 = getelementptr inbounds %struct.edegreedef, ptr %182, i64 %186
  %188 = load ptr, ptr %25, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.rinfodef, ptr %188, i32 0, i32 3
  store ptr %187, ptr %189, align 8, !tbaa !32
  store ptr %187, ptr %26, align 8, !tbaa !5
  %190 = load ptr, ptr %16, align 8, !tbaa !5
  %191 = load i64, ptr %7, align 8, !tbaa !9
  %192 = add nsw i64 %191, 1
  %193 = getelementptr inbounds i64, ptr %190, i64 %192
  %194 = load i64, ptr %193, align 8, !tbaa !9
  %195 = load ptr, ptr %16, align 8, !tbaa !5
  %196 = load i64, ptr %7, align 8, !tbaa !9
  %197 = getelementptr inbounds i64, ptr %195, i64 %196
  %198 = load i64, ptr %197, align 8, !tbaa !9
  %199 = sub nsw i64 %194, %198
  %200 = load ptr, ptr %4, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.controldef, ptr %200, i32 0, i32 11
  %202 = getelementptr inbounds %struct.workspacedef, ptr %201, i32 0, i32 5
  %203 = load i64, ptr %202, align 8, !tbaa !23
  %204 = add nsw i64 %203, %199
  store i64 %204, ptr %202, align 8, !tbaa !23
  %205 = load ptr, ptr %16, align 8, !tbaa !5
  %206 = load i64, ptr %7, align 8, !tbaa !9
  %207 = getelementptr inbounds i64, ptr %205, i64 %206
  %208 = load i64, ptr %207, align 8, !tbaa !9
  store i64 %208, ptr %8, align 8, !tbaa !9
  br label %209

209:                                              ; preds = %285, %178
  %210 = load i64, ptr %8, align 8, !tbaa !9
  %211 = load ptr, ptr %16, align 8, !tbaa !5
  %212 = load i64, ptr %7, align 8, !tbaa !9
  %213 = add nsw i64 %212, 1
  %214 = getelementptr inbounds i64, ptr %211, i64 %213
  %215 = load i64, ptr %214, align 8, !tbaa !9
  %216 = icmp slt i64 %210, %215
  br i1 %216, label %217, label %288

217:                                              ; preds = %209
  %218 = load ptr, ptr %21, align 8, !tbaa !5
  %219 = load ptr, ptr %18, align 8, !tbaa !5
  %220 = load i64, ptr %8, align 8, !tbaa !9
  %221 = getelementptr inbounds i64, ptr %219, i64 %220
  %222 = load i64, ptr %221, align 8, !tbaa !9
  %223 = getelementptr inbounds i64, ptr %218, i64 %222
  %224 = load i64, ptr %223, align 8, !tbaa !9
  store i64 %224, ptr %15, align 8, !tbaa !9
  %225 = load i64, ptr %14, align 8, !tbaa !9
  %226 = load i64, ptr %15, align 8, !tbaa !9
  %227 = icmp ne i64 %225, %226
  br i1 %227, label %228, label %284

228:                                              ; preds = %217
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %229

229:                                              ; preds = %255, %228
  %230 = load i64, ptr %9, align 8, !tbaa !9
  %231 = load ptr, ptr %25, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.rinfodef, ptr %231, i32 0, i32 2
  %233 = load i64, ptr %232, align 8, !tbaa !28
  %234 = icmp slt i64 %230, %233
  br i1 %234, label %235, label %258

235:                                              ; preds = %229
  %236 = load ptr, ptr %26, align 8, !tbaa !5
  %237 = load i64, ptr %9, align 8, !tbaa !9
  %238 = getelementptr inbounds %struct.edegreedef, ptr %236, i64 %237
  %239 = getelementptr inbounds %struct.edegreedef, ptr %238, i32 0, i32 0
  %240 = load i64, ptr %239, align 8, !tbaa !37
  %241 = load i64, ptr %15, align 8, !tbaa !9
  %242 = icmp eq i64 %240, %241
  br i1 %242, label %243, label %254

243:                                              ; preds = %235
  %244 = load ptr, ptr %19, align 8, !tbaa !5
  %245 = load i64, ptr %8, align 8, !tbaa !9
  %246 = getelementptr inbounds i64, ptr %244, i64 %245
  %247 = load i64, ptr %246, align 8, !tbaa !9
  %248 = load ptr, ptr %26, align 8, !tbaa !5
  %249 = load i64, ptr %9, align 8, !tbaa !9
  %250 = getelementptr inbounds %struct.edegreedef, ptr %248, i64 %249
  %251 = getelementptr inbounds %struct.edegreedef, ptr %250, i32 0, i32 1
  %252 = load i64, ptr %251, align 8, !tbaa !39
  %253 = add nsw i64 %252, %247
  store i64 %253, ptr %251, align 8, !tbaa !39
  br label %258

254:                                              ; preds = %235
  br label %255

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

258:                                              ; preds = %243, %229
  %259 = load i64, ptr %9, align 8, !tbaa !9
  %260 = load ptr, ptr %25, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.rinfodef, ptr %260, i32 0, i32 2
  %262 = load i64, ptr %261, align 8, !tbaa !28
  %263 = icmp eq i64 %259, %262
  br i1 %263, label %264, label %283

264:                                              ; preds = %258
  %265 = load i64, ptr %15, align 8, !tbaa !9
  %266 = load ptr, ptr %26, align 8, !tbaa !5
  %267 = load ptr, ptr %25, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.rinfodef, ptr %267, i32 0, i32 2
  %269 = load i64, ptr %268, align 8, !tbaa !28
  %270 = getelementptr inbounds %struct.edegreedef, ptr %266, i64 %269
  %271 = getelementptr inbounds %struct.edegreedef, ptr %270, i32 0, i32 0
  store i64 %265, ptr %271, align 8, !tbaa !37
  %272 = load ptr, ptr %19, align 8, !tbaa !5
  %273 = load i64, ptr %8, align 8, !tbaa !9
  %274 = getelementptr inbounds i64, ptr %272, i64 %273
  %275 = load i64, ptr %274, align 8, !tbaa !9
  %276 = load ptr, ptr %26, align 8, !tbaa !5
  %277 = load ptr, ptr %25, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.rinfodef, ptr %277, i32 0, i32 2
  %279 = load i64, ptr %278, align 8, !tbaa !28
  %280 = add nsw i64 %279, 1
  store i64 %280, ptr %278, align 8, !tbaa !28
  %281 = getelementptr inbounds %struct.edegreedef, ptr %276, i64 %279
  %282 = getelementptr inbounds %struct.edegreedef, ptr %281, i32 0, i32 1
  store i64 %275, ptr %282, align 8, !tbaa !39
  br label %283

283:                                              ; preds = %264, %258
  br label %284

284:                                              ; preds = %283, %217
  br label %285

285:                                              ; preds = %284
  %286 = load i64, ptr %8, align 8, !tbaa !9
  %287 = add nsw i64 %286, 1
  store i64 %287, ptr %8, align 8, !tbaa !9
  br label %209, !llvm.loop !41

288:                                              ; preds = %209
  br label %289

289:                                              ; preds = %288, %173
  br label %290

290:                                              ; preds = %289
  %291 = load i64, ptr %7, align 8, !tbaa !9
  %292 = add nsw i64 %291, 1
  store i64 %292, ptr %7, align 8, !tbaa !9
  br label %64, !llvm.loop !42

293:                                              ; preds = %64
  %294 = load i64, ptr %13, align 8, !tbaa !9
  %295 = sdiv i64 %294, 2
  %296 = load ptr, ptr %5, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.graphdef, ptr %296, i32 0, i32 16
  store i64 %295, ptr %297, align 8, !tbaa !43
  %298 = load i64, ptr %12, align 8, !tbaa !9
  %299 = load ptr, ptr %5, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.graphdef, ptr %299, i32 0, i32 20
  store i64 %298, ptr %300, align 8, !tbaa !44
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret void
}

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

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

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


; 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.rinfodef = type { i64, i64, i64, ptr }
%struct.edegreedef = type { i64, i64 }

; Function Attrs: nounwind uwtable
define dso_local void @libmetis__ComputeKWayPartitionParams(ptr nocapture noundef %0, ptr nocapture noundef %1, i64 noundef %2) local_unnamed_addr #0 {
  %4 = load i64, ptr %1, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 16
  %6 = load ptr, ptr %5, align 8, !tbaa !12
  %7 = getelementptr inbounds i8, ptr %1, i64 24
  %8 = load ptr, ptr %7, align 8, !tbaa !13
  %9 = getelementptr inbounds i8, ptr %1, i64 40
  %10 = load ptr, ptr %9, align 8, !tbaa !14
  %11 = getelementptr inbounds i8, ptr %1, i64 48
  %12 = load ptr, ptr %11, align 8, !tbaa !15
  %13 = getelementptr inbounds i8, ptr %1, i64 128
  %14 = load ptr, ptr %13, align 8, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %1, i64 136
  %16 = load ptr, ptr %15, align 8, !tbaa !17
  %17 = tail call ptr @libmetis__idxset(i64 noundef %2, i64 noundef 0, ptr noundef %16) #4
  %18 = getelementptr inbounds i8, ptr %1, i64 160
  %19 = load ptr, ptr %18, align 8, !tbaa !18
  %20 = getelementptr inbounds i8, ptr %1, i64 152
  %21 = load ptr, ptr %20, align 8, !tbaa !19
  %22 = tail call ptr @libmetis__idxset(i64 noundef %4, i64 noundef -1, ptr noundef %21) #4
  %23 = getelementptr inbounds i8, ptr %1, i64 184
  %24 = load ptr, ptr %23, align 8, !tbaa !20
  %25 = getelementptr inbounds i8, ptr %0, i64 128
  store i64 0, ptr %25, align 8, !tbaa !21
  %26 = icmp sgt i64 %4, 0
  br i1 %26, label %.lr.ph132, label %._crit_edge133

.lr.ph132:                                        ; preds = %3
  %27 = getelementptr inbounds i8, ptr %1, i64 88
  %28 = load ptr, ptr %27, align 8, !tbaa !26
  %29 = getelementptr inbounds i8, ptr %0, i64 112
  br label %30

30:                                               ; preds = %.lr.ph132, %.loopexit109
  %.0130 = phi i64 [ 0, %.lr.ph132 ], [ %44, %.loopexit109 ]
  %.0100129 = phi i64 [ 0, %.lr.ph132 ], [ %.1101, %.loopexit109 ]
  %.0102128 = phi i64 [ 0, %.lr.ph132 ], [ %spec.select, %.loopexit109 ]
  %31 = getelementptr inbounds i64, ptr %14, i64 %.0130
  %32 = load i64, ptr %31, align 8, !tbaa !27
  %33 = getelementptr inbounds i64, ptr %8, i64 %.0130
  %34 = load i64, ptr %33, align 8, !tbaa !27
  %35 = getelementptr inbounds i64, ptr %17, i64 %32
  %36 = load i64, ptr %35, align 8, !tbaa !27
  %37 = add nsw i64 %36, %34
  store i64 %37, ptr %35, align 8, !tbaa !27
  %38 = getelementptr inbounds %struct.rinfodef, ptr %24, i64 %.0130
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  %40 = getelementptr inbounds i8, ptr %38, i64 8
  %41 = getelementptr inbounds i8, ptr %38, i64 24
  %42 = getelementptr inbounds i64, ptr %6, i64 %.0130
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %38, i8 0, i64 32, i1 false)
  %43 = load i64, ptr %42, align 8, !tbaa !27
  %44 = add nuw nsw i64 %.0130, 1
  %45 = getelementptr inbounds i64, ptr %6, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !27
  %47 = icmp slt i64 %43, %46
  br i1 %47, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %30, %58
  %48 = phi i64 [ %59, %58 ], [ %46, %30 ]
  %49 = phi i64 [ %60, %58 ], [ 0, %30 ]
  %.098117 = phi i64 [ %61, %58 ], [ %43, %30 ]
  %50 = getelementptr inbounds i64, ptr %10, i64 %.098117
  %51 = load i64, ptr %50, align 8, !tbaa !27
  %52 = getelementptr inbounds i64, ptr %14, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !27
  %.not108 = icmp eq i64 %32, %53
  br i1 %.not108, label %58, label %54

54:                                               ; preds = %.lr.ph
  %55 = getelementptr inbounds i64, ptr %12, i64 %.098117
  %56 = load i64, ptr %55, align 8, !tbaa !27
  %57 = add nsw i64 %49, %56
  store i64 %57, ptr %40, align 8, !tbaa !28
  %.pre = load i64, ptr %45, align 8, !tbaa !27
  br label %58

58:                                               ; preds = %.lr.ph, %54
  %59 = phi i64 [ %48, %.lr.ph ], [ %.pre, %54 ]
  %60 = phi i64 [ %49, %.lr.ph ], [ %57, %54 ]
  %61 = add nsw i64 %.098117, 1
  %62 = icmp slt i64 %61, %59
  br i1 %62, label %.lr.ph, label %._crit_edge, !llvm.loop !30

._crit_edge:                                      ; preds = %58, %30
  %63 = phi i64 [ 0, %30 ], [ %60, %58 ]
  %64 = getelementptr inbounds i64, ptr %28, i64 %.0130
  %65 = load i64, ptr %64, align 8, !tbaa !27
  %66 = sub nsw i64 %65, %63
  store i64 %66, ptr %38, align 8, !tbaa !32
  %67 = tail call i64 @llvm.smax.i64(i64 %63, i64 0)
  %spec.select = add nuw nsw i64 %67, %.0102128
  %.not = icmp slt i64 %63, %66
  br i1 %.not, label %72, label %68

68:                                               ; preds = %._crit_edge
  %69 = getelementptr inbounds i64, ptr %19, i64 %.0100129
  store i64 %.0130, ptr %69, align 8, !tbaa !27
  %70 = add nsw i64 %.0100129, 1
  %71 = getelementptr inbounds i64, ptr %22, i64 %.0130
  store i64 %.0100129, ptr %71, align 8, !tbaa !27
  %.pre139 = load i64, ptr %40, align 8, !tbaa !28
  br label %72

72:                                               ; preds = %68, %._crit_edge
  %73 = phi i64 [ %.pre139, %68 ], [ %63, %._crit_edge ]
  %.1101 = phi i64 [ %70, %68 ], [ %.0100129, %._crit_edge ]
  %74 = icmp sgt i64 %73, 0
  br i1 %74, label %75, label %.loopexit109

75:                                               ; preds = %72
  %76 = load ptr, ptr %29, align 8, !tbaa !33
  %77 = load i64, ptr %25, align 8, !tbaa !21
  %78 = getelementptr inbounds %struct.edegreedef, ptr %76, i64 %77
  store ptr %78, ptr %41, align 8, !tbaa !34
  %79 = load i64, ptr %45, align 8, !tbaa !27
  %80 = load i64, ptr %42, align 8, !tbaa !27
  %81 = add i64 %79, %77
  %82 = sub i64 %81, %80
  store i64 %82, ptr %25, align 8, !tbaa !21
  %83 = load i64, ptr %42, align 8, !tbaa !27
  %84 = load i64, ptr %45, align 8, !tbaa !27
  %85 = icmp slt i64 %83, %84
  br i1 %85, label %.lr.ph127, label %.loopexit109

.lr.ph127:                                        ; preds = %75, %109
  %.1123 = phi i64 [ %110, %109 ], [ %83, %75 ]
  %86 = getelementptr inbounds i64, ptr %10, i64 %.1123
  %87 = load i64, ptr %86, align 8, !tbaa !27
  %88 = getelementptr inbounds i64, ptr %14, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !27
  %.not107 = icmp eq i64 %32, %89
  br i1 %.not107, label %109, label %.preheader

.preheader:                                       ; preds = %.lr.ph127
  %90 = load i64, ptr %39, align 8, !tbaa !35
  %91 = icmp sgt i64 %90, 0
  br i1 %91, label %.lr.ph120, label %.loopexit

.lr.ph120:                                        ; preds = %.preheader, %101
  %.099119 = phi i64 [ %102, %101 ], [ 0, %.preheader ]
  %92 = getelementptr inbounds %struct.edegreedef, ptr %78, i64 %.099119
  %93 = load i64, ptr %92, align 8, !tbaa !36
  %94 = icmp eq i64 %93, %89
  br i1 %94, label %95, label %101

95:                                               ; preds = %.lr.ph120
  %96 = getelementptr inbounds i64, ptr %12, i64 %.1123
  %97 = load i64, ptr %96, align 8, !tbaa !27
  %98 = getelementptr inbounds i8, ptr %92, i64 8
  %99 = load i64, ptr %98, align 8, !tbaa !38
  %100 = add nsw i64 %99, %97
  store i64 %100, ptr %98, align 8, !tbaa !38
  br label %.loopexit

101:                                              ; preds = %.lr.ph120
  %102 = add nuw nsw i64 %.099119, 1
  %exitcond.not = icmp eq i64 %102, %90
  br i1 %exitcond.not, label %.loopexit.thread, label %.lr.ph120, !llvm.loop !39

.loopexit:                                        ; preds = %.preheader, %95
  %.099114 = phi i64 [ %.099119, %95 ], [ 0, %.preheader ]
  %103 = icmp eq i64 %.099114, %90
  br i1 %103, label %.loopexit.thread, label %109

.loopexit.thread:                                 ; preds = %101, %.loopexit
  %104 = getelementptr inbounds %struct.edegreedef, ptr %78, i64 %90
  store i64 %89, ptr %104, align 8, !tbaa !36
  %105 = getelementptr inbounds i64, ptr %12, i64 %.1123
  %106 = load i64, ptr %105, align 8, !tbaa !27
  %107 = add nsw i64 %90, 1
  store i64 %107, ptr %39, align 8, !tbaa !35
  %108 = getelementptr inbounds %struct.edegreedef, ptr %78, i64 %90, i32 1
  store i64 %106, ptr %108, align 8, !tbaa !38
  br label %109

109:                                              ; preds = %.lr.ph127, %.loopexit.thread, %.loopexit
  %110 = add nsw i64 %.1123, 1
  %111 = load i64, ptr %45, align 8, !tbaa !27
  %112 = icmp slt i64 %110, %111
  br i1 %112, label %.lr.ph127, label %.loopexit109, !llvm.loop !40

.loopexit109:                                     ; preds = %109, %75, %72
  %exitcond138.not = icmp eq i64 %44, %4
  br i1 %exitcond138.not, label %._crit_edge133.loopexit, label %30, !llvm.loop !41

._crit_edge133.loopexit:                          ; preds = %.loopexit109
  %113 = lshr i64 %spec.select, 1
  br label %._crit_edge133

._crit_edge133:                                   ; preds = %._crit_edge133.loopexit, %3
  %.0102.lcssa = phi i64 [ 0, %3 ], [ %113, %._crit_edge133.loopexit ]
  %.0100.lcssa = phi i64 [ 0, %3 ], [ %.1101, %._crit_edge133.loopexit ]
  %114 = getelementptr inbounds i8, ptr %1, i64 112
  store i64 %.0102.lcssa, ptr %114, align 8, !tbaa !42
  %115 = getelementptr inbounds i8, ptr %1, i64 144
  store i64 %.0100.lcssa, ptr %115, align 8, !tbaa !43
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #2

; 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !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 = !{!6, !10, i64 48}
!16 = !{!6, !10, i64 128}
!17 = !{!6, !10, i64 136}
!18 = !{!6, !10, i64 160}
!19 = !{!6, !10, i64 152}
!20 = !{!6, !10, i64 184}
!21 = !{!22, !7, i64 128}
!22 = !{!"controldef", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !23, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !24, i64 88, !25, i64 152, !25, i64 160, !25, i64 168, !25, i64 176, !25, i64 184, !25, i64 192, !25, i64 200, !25, i64 208, !25, i64 216, !25, i64 224, !25, i64 232, !25, i64 240, !25, i64 248, !25, i64 256, !25, i64 264, !25, i64 272}
!23 = !{!"float", !8, i64 0}
!24 = !{!"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}
!25 = !{!"double", !8, i64 0}
!26 = !{!6, !10, i64 88}
!27 = !{!7, !7, i64 0}
!28 = !{!29, !7, i64 8}
!29 = !{!"rinfodef", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!29, !7, i64 0}
!33 = !{!22, !10, i64 112}
!34 = !{!29, !10, i64 24}
!35 = !{!29, !7, i64 16}
!36 = !{!37, !7, i64 0}
!37 = !{!"edegreedef", !7, i64 0, !7, i64 8}
!38 = !{!37, !7, i64 8}
!39 = distinct !{!39, !31}
!40 = distinct !{!40, !31}
!41 = distinct !{!41, !31}
!42 = !{!6, !7, i64 112}
!43 = !{!6, !7, i64 144}


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