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

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

@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = 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

declare double @gk_CPUSeconds() #1

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

declare void @libmetis__EliminateComponents(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @libmetis__IsBalanced(ptr noundef, i64 noundef, ptr noundef, float noundef) #2

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

declare void @libmetis__Greedy_KWayEdgeBalanceMConn(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef, i64 noundef) #1

declare void @libmetis__Greedy_KWayEdgeBalance(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef, i64 noundef) #1

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

declare void @libmetis__Random_KWayEdgeRefine(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef, i64 noundef, i64 noundef) #1

declare void @libmetis__Greedy_KWayEdgeRefine(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef, i64 noundef) #1

declare void @libmetis__Random_KWayEdgeRefineMConn(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef, i64 noundef, i64 noundef) #1

declare ptr @libmetis__idxsmalloc(i64 noundef, i64 noundef, ptr noundef) #1

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

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

; 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 @RefineKWayRefinement(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, float noundef %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca float, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i64 %3, ptr %10, align 8, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !5
  store float %5, ptr %12, align 4, !tbaa !11
  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
  store i64 0, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.controldef, ptr %17, i32 0, i32 1
  %19 = load i64, ptr %18, align 8, !tbaa !13
  %20 = and i64 %19, 1
  %21 = icmp ne i64 %20, 0
  br i1 %21, label %22, label %28

22:                                               ; preds = %6
  %23 = call double @gk_CPUSeconds()
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.controldef, ptr %24, i32 0, i32 17
  %26 = load double, ptr %25, align 8, !tbaa !17
  %27 = fsub double %26, %23
  store double %27, ptr %25, align 8, !tbaa !17
  br label %28

28:                                               ; preds = %22, %6
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = load i64, ptr %10, align 8, !tbaa !9
  call void @libmetis__ComputeKWayPartitionParams(ptr noundef %29, ptr noundef %30, i64 noundef %31)
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %32, ptr %16, align 8, !tbaa !5
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %33

33:                                               ; preds = %38, %28
  %34 = load ptr, ptr %16, align 8, !tbaa !5
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = icmp ne ptr %34, %35
  br i1 %36, label %37, label %44

37:                                               ; preds = %33
  br label %38

38:                                               ; preds = %37
  %39 = load ptr, ptr %16, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.graphdef, ptr %39, i32 0, i32 32
  %41 = load ptr, ptr %40, align 8, !tbaa !18
  store ptr %41, ptr %16, align 8, !tbaa !5
  %42 = load i64, ptr %14, align 8, !tbaa !9
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %14, align 8, !tbaa !9
  br label %33, !llvm.loop !21

44:                                               ; preds = %33
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %45

45:                                               ; preds = %174, %44
  %46 = load i64, ptr %13, align 8, !tbaa !9
  %47 = mul nsw i64 2, %46
  %48 = load i64, ptr %14, align 8, !tbaa !9
  %49 = icmp sge i64 %47, %48
  br i1 %49, label %50, label %86

50:                                               ; preds = %45
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.graphdef, ptr %51, i32 0, i32 19
  %53 = load ptr, ptr %52, align 8, !tbaa !23
  %54 = load i64, ptr %10, align 8, !tbaa !9
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = load float, ptr %12, align 4, !tbaa !11
  %57 = fpext float %56 to double
  %58 = fmul double 1.040000e+00, %57
  %59 = fptrunc double %58 to float
  %60 = call i64 @libmetis__IsBalanced(ptr noundef %53, i64 noundef %54, ptr noundef %55, float noundef %59)
  %61 = icmp ne i64 %60, 0
  br i1 %61, label %86, label %62

62:                                               ; preds = %50
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = load i64, ptr %10, align 8, !tbaa !9
  call void @libmetis__ComputeKWayBalanceBoundary(ptr noundef %63, ptr noundef %64, i64 noundef %65)
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.controldef, ptr %66, i32 0, i32 4
  %68 = load i64, ptr %67, align 8, !tbaa !24
  %69 = icmp eq i64 %68, 3
  br i1 %69, label %70, label %76

70:                                               ; preds = %62
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = load i64, ptr %10, align 8, !tbaa !9
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  %75 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Greedy_KWayEdgeBalanceMConn(ptr noundef %71, ptr noundef %72, i64 noundef %73, ptr noundef %74, float noundef %75, i64 noundef 1)
  br label %82

76:                                               ; preds = %62
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = load i64, ptr %10, align 8, !tbaa !9
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Greedy_KWayEdgeBalance(ptr noundef %77, ptr noundef %78, i64 noundef %79, ptr noundef %80, float noundef %81, i64 noundef 1)
  br label %82

82:                                               ; preds = %76, %70
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = load i64, ptr %10, align 8, !tbaa !9
  call void @libmetis__ComputeKWayBoundary(ptr noundef %83, ptr noundef %84, i64 noundef %85)
  br label %86

86:                                               ; preds = %82, %50, %45
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.controldef, ptr %87, i32 0, i32 4
  %89 = load i64, ptr %88, align 8, !tbaa !24
  switch i64 %89, label %108 [
    i64 1, label %90
    i64 2, label %96
    i64 3, label %102
  ]

90:                                               ; preds = %86
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = load i64, ptr %10, align 8, !tbaa !9
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Random_KWayEdgeRefine(ptr noundef %91, ptr noundef %92, i64 noundef %93, ptr noundef %94, float noundef %95, i64 noundef 10, i64 noundef 1)
  br label %108

96:                                               ; preds = %86
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = load i64, ptr %10, align 8, !tbaa !9
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Greedy_KWayEdgeRefine(ptr noundef %97, ptr noundef %98, i64 noundef %99, ptr noundef %100, float noundef %101, i64 noundef 10)
  br label %108

102:                                              ; preds = %86
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = load i64, ptr %10, align 8, !tbaa !9
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Random_KWayEdgeRefineMConn(ptr noundef %103, ptr noundef %104, i64 noundef %105, ptr noundef %106, float noundef %107, i64 noundef 10, i64 noundef 1)
  br label %108

108:                                              ; preds = %102, %96, %90, %86
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.controldef, ptr %109, i32 0, i32 1
  %111 = load i64, ptr %110, align 8, !tbaa !13
  %112 = and i64 %111, 1
  %113 = icmp ne i64 %112, 0
  br i1 %113, label %114, label %120

114:                                              ; preds = %108
  %115 = call double @gk_CPUSeconds()
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.controldef, ptr %116, i32 0, i32 19
  %118 = load double, ptr %117, align 8, !tbaa !25
  %119 = fadd double %118, %115
  store double %119, ptr %117, align 8, !tbaa !25
  br label %120

120:                                              ; preds = %114, %108
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = icmp eq ptr %121, %122
  br i1 %123, label %124, label %125

124:                                              ; preds = %120
  br label %177

125:                                              ; preds = %120
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.graphdef, ptr %126, i32 0, i32 32
  %128 = load ptr, ptr %127, align 8, !tbaa !18
  store ptr %128, ptr %9, align 8, !tbaa !5
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.controldef, ptr %129, i32 0, i32 1
  %131 = load i64, ptr %130, align 8, !tbaa !13
  %132 = and i64 %131, 1
  %133 = icmp ne i64 %132, 0
  br i1 %133, label %134, label %140

134:                                              ; preds = %125
  %135 = call double @gk_CPUSeconds()
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.controldef, ptr %136, i32 0, i32 20
  %138 = load double, ptr %137, align 8, !tbaa !26
  %139 = fsub double %138, %135
  store double %139, ptr %137, align 8, !tbaa !26
  br label %140

140:                                              ; preds = %134, %125
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.graphdef, ptr %141, i32 0, i32 3
  %143 = load ptr, ptr %142, align 8, !tbaa !27
  %144 = icmp eq ptr %143, null
  br i1 %144, label %145, label %158

145:                                              ; preds = %140
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.graphdef, ptr %146, i32 0, i32 0
  %148 = load i64, ptr %147, align 8, !tbaa !28
  %149 = call ptr @libmetis__idxsmalloc(i64 noundef %148, i64 noundef 1, ptr noundef @.str)
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.graphdef, ptr %150, i32 0, i32 3
  store ptr %149, ptr %151, align 8, !tbaa !27
  %152 = load ptr, ptr %9, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.graphdef, ptr %152, i32 0, i32 1
  %154 = load i64, ptr %153, align 8, !tbaa !29
  %155 = call ptr @libmetis__idxsmalloc(i64 noundef %154, i64 noundef 1, ptr noundef @.str.1)
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.graphdef, ptr %156, i32 0, i32 6
  store ptr %155, ptr %157, align 8, !tbaa !30
  store i64 1, ptr %15, align 8, !tbaa !9
  br label %158

158:                                              ; preds = %145, %140
  %159 = load ptr, ptr %7, align 8, !tbaa !5
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = load i64, ptr %10, align 8, !tbaa !9
  call void @libmetis__ProjectKWayPartition(ptr noundef %159, ptr noundef %160, i64 noundef %161)
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.controldef, ptr %162, i32 0, i32 1
  %164 = load i64, ptr %163, align 8, !tbaa !13
  %165 = and i64 %164, 1
  %166 = icmp ne i64 %165, 0
  br i1 %166, label %167, label %173

167:                                              ; preds = %158
  %168 = call double @gk_CPUSeconds()
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.controldef, ptr %169, i32 0, i32 20
  %171 = load double, ptr %170, align 8, !tbaa !26
  %172 = fadd double %171, %168
  store double %172, ptr %170, align 8, !tbaa !26
  br label %173

173:                                              ; preds = %167, %158
  br label %174

174:                                              ; preds = %173
  %175 = load i64, ptr %13, align 8, !tbaa !9
  %176 = add nsw i64 %175, 1
  store i64 %176, ptr %13, align 8, !tbaa !9
  br label %45

177:                                              ; preds = %124
  %178 = load ptr, ptr %9, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.graphdef, ptr %178, i32 0, i32 19
  %180 = load ptr, ptr %179, align 8, !tbaa !23
  %181 = load i64, ptr %10, align 8, !tbaa !9
  %182 = load ptr, ptr %11, align 8, !tbaa !5
  %183 = load float, ptr %12, align 4, !tbaa !11
  %184 = call i64 @libmetis__IsBalanced(ptr noundef %180, i64 noundef %181, ptr noundef %182, float noundef %183)
  %185 = icmp ne i64 %184, 0
  br i1 %185, label %217, label %186

186:                                              ; preds = %177
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  %188 = load ptr, ptr %9, align 8, !tbaa !5
  %189 = load i64, ptr %10, align 8, !tbaa !9
  call void @libmetis__ComputeKWayBalanceBoundary(ptr noundef %187, ptr noundef %188, i64 noundef %189)
  %190 = load ptr, ptr %7, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.controldef, ptr %190, i32 0, i32 4
  %192 = load i64, ptr %191, align 8, !tbaa !24
  %193 = icmp eq i64 %192, 3
  br i1 %193, label %194, label %205

194:                                              ; preds = %186
  %195 = load ptr, ptr %7, align 8, !tbaa !5
  %196 = load ptr, ptr %9, align 8, !tbaa !5
  %197 = load i64, ptr %10, align 8, !tbaa !9
  %198 = load ptr, ptr %11, align 8, !tbaa !5
  %199 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Greedy_KWayEdgeBalanceMConn(ptr noundef %195, ptr noundef %196, i64 noundef %197, ptr noundef %198, float noundef %199, i64 noundef 8)
  %200 = load ptr, ptr %7, align 8, !tbaa !5
  %201 = load ptr, ptr %9, align 8, !tbaa !5
  %202 = load i64, ptr %10, align 8, !tbaa !9
  %203 = load ptr, ptr %11, align 8, !tbaa !5
  %204 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Random_KWayEdgeRefineMConn(ptr noundef %200, ptr noundef %201, i64 noundef %202, ptr noundef %203, float noundef %204, i64 noundef 10, i64 noundef 0)
  br label %216

205:                                              ; preds = %186
  %206 = load ptr, ptr %7, align 8, !tbaa !5
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = load i64, ptr %10, align 8, !tbaa !9
  %209 = load ptr, ptr %11, align 8, !tbaa !5
  %210 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Greedy_KWayEdgeBalance(ptr noundef %206, ptr noundef %207, i64 noundef %208, ptr noundef %209, float noundef %210, i64 noundef 8)
  %211 = load ptr, ptr %7, align 8, !tbaa !5
  %212 = load ptr, ptr %9, align 8, !tbaa !5
  %213 = load i64, ptr %10, align 8, !tbaa !9
  %214 = load ptr, ptr %11, align 8, !tbaa !5
  %215 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Random_KWayEdgeRefine(ptr noundef %211, ptr noundef %212, i64 noundef %213, ptr noundef %214, float noundef %215, i64 noundef 10, i64 noundef 0)
  br label %216

216:                                              ; preds = %205, %194
  br label %217

217:                                              ; preds = %216, %177
  %218 = load ptr, ptr %7, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.controldef, ptr %218, i32 0, i32 1
  %220 = load i64, ptr %219, align 8, !tbaa !13
  %221 = and i64 %220, 1
  %222 = icmp ne i64 %221, 0
  br i1 %222, label %223, label %229

223:                                              ; preds = %217
  %224 = call double @gk_CPUSeconds()
  %225 = load ptr, ptr %7, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.controldef, ptr %225, i32 0, i32 23
  %227 = load double, ptr %226, align 8, !tbaa !31
  %228 = fsub double %227, %224
  store double %228, ptr %226, align 8, !tbaa !31
  br label %229

229:                                              ; preds = %223, %217
  %230 = load ptr, ptr %7, align 8, !tbaa !5
  %231 = load ptr, ptr %9, align 8, !tbaa !5
  %232 = load i64, ptr %10, align 8, !tbaa !9
  %233 = load ptr, ptr %11, align 8, !tbaa !5
  %234 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__EliminateComponents(ptr noundef %230, ptr noundef %231, i64 noundef %232, ptr noundef %233, float noundef %234)
  %235 = load ptr, ptr %7, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.controldef, ptr %235, i32 0, i32 1
  %237 = load i64, ptr %236, align 8, !tbaa !13
  %238 = and i64 %237, 1
  %239 = icmp ne i64 %238, 0
  br i1 %239, label %240, label %246

240:                                              ; preds = %229
  %241 = call double @gk_CPUSeconds()
  %242 = load ptr, ptr %7, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.controldef, ptr %242, i32 0, i32 23
  %244 = load double, ptr %243, align 8, !tbaa !31
  %245 = fadd double %244, %241
  store double %245, ptr %243, align 8, !tbaa !31
  br label %246

246:                                              ; preds = %240, %229
  %247 = load i64, ptr %15, align 8, !tbaa !9
  %248 = icmp ne i64 %247, 0
  br i1 %248, label %249, label %254

249:                                              ; preds = %246
  %250 = load ptr, ptr %9, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.graphdef, ptr %250, i32 0, i32 3
  %252 = load ptr, ptr %9, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.graphdef, ptr %252, i32 0, i32 6
  call void (ptr, ...) @gk_free(ptr noundef %251, ptr noundef %253, ptr noundef null)
  br label %254

254:                                              ; preds = %249, %246
  %255 = load ptr, ptr %7, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.controldef, ptr %255, i32 0, i32 1
  %257 = load i64, ptr %256, align 8, !tbaa !13
  %258 = and i64 %257, 1
  %259 = icmp ne i64 %258, 0
  br i1 %259, label %260, label %266

260:                                              ; preds = %254
  %261 = call double @gk_CPUSeconds()
  %262 = load ptr, ptr %7, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct.controldef, ptr %262, i32 0, i32 17
  %264 = load double, ptr %263, align 8, !tbaa !17
  %265 = fadd double %264, %261
  store double %265, ptr %263, align 8, !tbaa !17
  br label %266

266:                                              ; preds = %260, %254
  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
  ret void
}

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


; 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 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1

declare double @gk_CPUSeconds() local_unnamed_addr #0

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

declare void @libmetis__EliminateComponents(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @libmetis__IsBalanced(ptr noundef, i64 noundef, ptr noundef, float noundef) local_unnamed_addr #1

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

declare void @libmetis__Greedy_KWayEdgeBalanceMConn(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef, i64 noundef) local_unnamed_addr #0

declare void @libmetis__Greedy_KWayEdgeBalance(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef, i64 noundef) local_unnamed_addr #0

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

declare void @libmetis__Random_KWayEdgeRefine(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

declare void @libmetis__Greedy_KWayEdgeRefine(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef, i64 noundef) local_unnamed_addr #0

declare void @libmetis__Random_KWayEdgeRefineMConn(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

declare ptr @libmetis__idxsmalloc(i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local void @RefineKWayRefinement(ptr noundef %0, ptr noundef readnone %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, float noundef %5) local_unnamed_addr #1 {
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load i64, ptr %7, align 8, !tbaa !5
  %9 = and i64 %8, 1
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %15, label %10

10:                                               ; preds = %6
  %11 = tail call double @gk_CPUSeconds() #2
  %12 = getelementptr inbounds i8, ptr %0, i64 192
  %13 = load double, ptr %12, align 8, !tbaa !14
  %14 = fsub double %13, %11
  store double %14, ptr %12, align 8, !tbaa !14
  br label %15

15:                                               ; preds = %10, %6
  tail call void @libmetis__ComputeKWayPartitionParams(ptr noundef nonnull %0, ptr noundef %2, i64 noundef %3)
  %.not113124 = icmp eq ptr %2, %1
  br i1 %.not113124, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %15
  %.0109.lcssa = phi i64 [ 0, %15 ], [ %24, %.lr.ph ]
  %16 = fpext float %5 to double
  %17 = fmul double %16, 1.040000e+00
  %18 = fptrunc double %17 to float
  %19 = getelementptr inbounds i8, ptr %0, i64 32
  %20 = getelementptr inbounds i8, ptr %0, i64 208
  %21 = getelementptr inbounds i8, ptr %0, i64 216
  br label %25

.lr.ph:                                           ; preds = %15, %.lr.ph
  %.0126 = phi ptr [ %23, %.lr.ph ], [ %2, %15 ]
  %.0109125 = phi i64 [ %24, %.lr.ph ], [ 0, %15 ]
  %22 = getelementptr inbounds i8, ptr %.0126, i64 240
  %23 = load ptr, ptr %22, align 8, !tbaa !15
  %24 = add nuw nsw i64 %.0109125, 1
  %.not113 = icmp eq ptr %23, %1
  br i1 %.not113, label %.preheader, label %.lr.ph, !llvm.loop !18

25:                                               ; preds = %.preheader, %78
  %.0111 = phi ptr [ %53, %78 ], [ %2, %.preheader ]
  %.0110 = phi i64 [ %79, %78 ], [ 0, %.preheader ]
  %.0108 = phi i64 [ %.1, %78 ], [ 0, %.preheader ]
  %26 = shl nuw nsw i64 %.0110, 1
  %.not114 = icmp ult i64 %26, %.0109.lcssa
  br i1 %.not114, label %37, label %27

27:                                               ; preds = %25
  %28 = getelementptr inbounds i8, ptr %.0111, i64 136
  %29 = load ptr, ptr %28, align 8, !tbaa !20
  %30 = tail call i64 @libmetis__IsBalanced(ptr noundef %29, i64 noundef %3, ptr noundef %4, float noundef %18)
  %.not115 = icmp eq i64 %30, 0
  br i1 %.not115, label %31, label %37

31:                                               ; preds = %27
  tail call void @libmetis__ComputeKWayBalanceBoundary(ptr noundef %0, ptr noundef nonnull %.0111, i64 noundef %3)
  %32 = load i64, ptr %19, align 8, !tbaa !21
  %33 = icmp eq i64 %32, 3
  br i1 %33, label %34, label %35

34:                                               ; preds = %31
  tail call void @libmetis__Greedy_KWayEdgeBalanceMConn(ptr noundef nonnull %0, ptr noundef nonnull %.0111, i64 noundef %3, ptr noundef %4, float noundef %5, i64 noundef 1) #2
  br label %36

35:                                               ; preds = %31
  tail call void @libmetis__Greedy_KWayEdgeBalance(ptr noundef nonnull %0, ptr noundef nonnull %.0111, i64 noundef %3, ptr noundef %4, float noundef %5, i64 noundef 1) #2
  br label %36

36:                                               ; preds = %35, %34
  tail call void @libmetis__ComputeKWayBoundary(ptr noundef nonnull %0, ptr noundef nonnull %.0111, i64 noundef %3)
  br label %37

37:                                               ; preds = %36, %27, %25
  %38 = load i64, ptr %19, align 8, !tbaa !21
  switch i64 %38, label %42 [
    i64 1, label %39
    i64 2, label %40
    i64 3, label %41
  ]

39:                                               ; preds = %37
  tail call void @libmetis__Random_KWayEdgeRefine(ptr noundef nonnull %0, ptr noundef %.0111, i64 noundef %3, ptr noundef %4, float noundef %5, i64 noundef 10, i64 noundef 1) #2
  br label %42

40:                                               ; preds = %37
  tail call void @libmetis__Greedy_KWayEdgeRefine(ptr noundef nonnull %0, ptr noundef %.0111, i64 noundef %3, ptr noundef %4, float noundef %5, i64 noundef 10) #2
  br label %42

41:                                               ; preds = %37
  tail call void @libmetis__Random_KWayEdgeRefineMConn(ptr noundef nonnull %0, ptr noundef %.0111, i64 noundef %3, ptr noundef %4, float noundef %5, i64 noundef 10, i64 noundef 1) #2
  br label %42

42:                                               ; preds = %41, %40, %39, %37
  %43 = load i64, ptr %7, align 8, !tbaa !5
  %44 = and i64 %43, 1
  %.not116 = icmp eq i64 %44, 0
  br i1 %.not116, label %49, label %45

45:                                               ; preds = %42
  %46 = tail call double @gk_CPUSeconds() #2
  %47 = load double, ptr %20, align 8, !tbaa !22
  %48 = fadd double %46, %47
  store double %48, ptr %20, align 8, !tbaa !22
  br label %49

49:                                               ; preds = %45, %42
  %50 = icmp eq ptr %.0111, %1
  br i1 %50, label %80, label %51

51:                                               ; preds = %49
  %52 = getelementptr inbounds i8, ptr %.0111, i64 240
  %53 = load ptr, ptr %52, align 8, !tbaa !15
  %54 = load i64, ptr %7, align 8, !tbaa !5
  %55 = and i64 %54, 1
  %.not117 = icmp eq i64 %55, 0
  br i1 %.not117, label %60, label %56

56:                                               ; preds = %51
  %57 = tail call double @gk_CPUSeconds() #2
  %58 = load double, ptr %21, align 8, !tbaa !23
  %59 = fsub double %58, %57
  store double %59, ptr %21, align 8, !tbaa !23
  br label %60

60:                                               ; preds = %56, %51
  %61 = getelementptr inbounds i8, ptr %53, i64 24
  %62 = load ptr, ptr %61, align 8, !tbaa !24
  %63 = icmp eq ptr %62, null
  br i1 %63, label %64, label %71

64:                                               ; preds = %60
  %65 = load i64, ptr %53, align 8, !tbaa !25
  %66 = tail call ptr @libmetis__idxsmalloc(i64 noundef %65, i64 noundef 1, ptr noundef nonnull @.str) #2
  store ptr %66, ptr %61, align 8, !tbaa !24
  %67 = getelementptr inbounds i8, ptr %53, i64 8
  %68 = load i64, ptr %67, align 8, !tbaa !26
  %69 = tail call ptr @libmetis__idxsmalloc(i64 noundef %68, i64 noundef 1, ptr noundef nonnull @.str.1) #2
  %70 = getelementptr inbounds i8, ptr %53, i64 48
  store ptr %69, ptr %70, align 8, !tbaa !27
  br label %71

71:                                               ; preds = %64, %60
  %.1 = phi i64 [ 1, %64 ], [ %.0108, %60 ]
  tail call void @libmetis__ProjectKWayPartition(ptr noundef nonnull %0, ptr noundef nonnull %53, i64 noundef %3)
  %72 = load i64, ptr %7, align 8, !tbaa !5
  %73 = and i64 %72, 1
  %.not118 = icmp eq i64 %73, 0
  br i1 %.not118, label %78, label %74

74:                                               ; preds = %71
  %75 = tail call double @gk_CPUSeconds() #2
  %76 = load double, ptr %21, align 8, !tbaa !23
  %77 = fadd double %75, %76
  store double %77, ptr %21, align 8, !tbaa !23
  br label %78

78:                                               ; preds = %71, %74
  %79 = add nuw nsw i64 %.0110, 1
  br label %25

80:                                               ; preds = %49
  %81 = getelementptr inbounds i8, ptr %.0111, i64 136
  %82 = load ptr, ptr %81, align 8, !tbaa !20
  %83 = tail call i64 @libmetis__IsBalanced(ptr noundef %82, i64 noundef %3, ptr noundef %4, float noundef %5)
  %.not119 = icmp eq i64 %83, 0
  br i1 %.not119, label %84, label %89

84:                                               ; preds = %80
  tail call void @libmetis__ComputeKWayBalanceBoundary(ptr noundef nonnull %0, ptr noundef nonnull %.0111, i64 noundef %3)
  %85 = load i64, ptr %19, align 8, !tbaa !21
  %86 = icmp eq i64 %85, 3
  br i1 %86, label %87, label %88

87:                                               ; preds = %84
  tail call void @libmetis__Greedy_KWayEdgeBalanceMConn(ptr noundef nonnull %0, ptr noundef nonnull %.0111, i64 noundef %3, ptr noundef %4, float noundef %5, i64 noundef 8) #2
  tail call void @libmetis__Random_KWayEdgeRefineMConn(ptr noundef nonnull %0, ptr noundef nonnull %.0111, i64 noundef %3, ptr noundef %4, float noundef %5, i64 noundef 10, i64 noundef 0) #2
  br label %89

88:                                               ; preds = %84
  tail call void @libmetis__Greedy_KWayEdgeBalance(ptr noundef nonnull %0, ptr noundef nonnull %.0111, i64 noundef %3, ptr noundef %4, float noundef %5, i64 noundef 8) #2
  tail call void @libmetis__Random_KWayEdgeRefine(ptr noundef nonnull %0, ptr noundef nonnull %.0111, i64 noundef %3, ptr noundef %4, float noundef %5, i64 noundef 10, i64 noundef 0) #2
  br label %89

89:                                               ; preds = %87, %88, %80
  %90 = load i64, ptr %7, align 8, !tbaa !5
  %91 = and i64 %90, 1
  %.not120 = icmp eq i64 %91, 0
  br i1 %.not120, label %97, label %92

92:                                               ; preds = %89
  %93 = tail call double @gk_CPUSeconds() #2
  %94 = getelementptr inbounds i8, ptr %0, i64 240
  %95 = load double, ptr %94, align 8, !tbaa !28
  %96 = fsub double %95, %93
  store double %96, ptr %94, align 8, !tbaa !28
  br label %97

97:                                               ; preds = %92, %89
  tail call void @libmetis__EliminateComponents(ptr noundef nonnull %0, ptr noundef nonnull %.0111, i64 noundef %3, ptr noundef %4, float noundef %5) #2
  %98 = load i64, ptr %7, align 8, !tbaa !5
  %99 = and i64 %98, 1
  %.not121 = icmp eq i64 %99, 0
  br i1 %.not121, label %105, label %100

100:                                              ; preds = %97
  %101 = tail call double @gk_CPUSeconds() #2
  %102 = getelementptr inbounds i8, ptr %0, i64 240
  %103 = load double, ptr %102, align 8, !tbaa !28
  %104 = fadd double %101, %103
  store double %104, ptr %102, align 8, !tbaa !28
  br label %105

105:                                              ; preds = %100, %97
  %.not122 = icmp eq i64 %.0108, 0
  br i1 %.not122, label %109, label %106

106:                                              ; preds = %105
  %107 = getelementptr inbounds i8, ptr %.0111, i64 24
  %108 = getelementptr inbounds i8, ptr %.0111, i64 48
  tail call void (ptr, ...) @gk_free(ptr noundef nonnull %107, ptr noundef nonnull %108, ptr noundef null) #2
  br label %109

109:                                              ; preds = %106, %105
  %110 = load i64, ptr %7, align 8, !tbaa !5
  %111 = and i64 %110, 1
  %.not123 = icmp eq i64 %111, 0
  br i1 %.not123, label %117, label %112

112:                                              ; preds = %109
  %113 = tail call double @gk_CPUSeconds() #2
  %114 = getelementptr inbounds i8, ptr %0, i64 192
  %115 = load double, ptr %114, align 8, !tbaa !14
  %116 = fadd double %113, %115
  store double %116, ptr %114, align 8, !tbaa !14
  br label %117

117:                                              ; preds = %112, %109
  ret void
}

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


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