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

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

; Function Attrs: nounwind uwtable
define dso_local void @libmetis__RefineVolKWay(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, float noundef %5) #0 {
  %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 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
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.controldef, ptr %16, i32 0, i32 1
  %18 = load i64, ptr %17, align 8, !tbaa !13
  %19 = and i64 %18, 1
  %20 = icmp ne i64 %19, 0
  br i1 %20, label %21, label %27

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

27:                                               ; preds = %21, %6
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 4
  %30 = load i64, ptr %29, align 8, !tbaa !18
  %31 = icmp eq i64 %30, 3
  br i1 %31, label %32, label %48

32:                                               ; preds = %27
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = load i64, ptr %10, align 8, !tbaa !9
  call void @libmetis__ComputeVolKWayPartitionParams(ptr noundef %33, ptr noundef %34, i64 noundef %35)
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = load i64, ptr %10, align 8, !tbaa !9
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  call void @EliminateVolComponents(ptr noundef %36, ptr noundef %37, i64 noundef %38, ptr noundef %39, float noundef 1.250000e+00)
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = load i64, ptr %10, align 8, !tbaa !9
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  call void @libmetis__EliminateVolSubDomainEdges(ptr noundef %40, ptr noundef %41, i64 noundef %42, ptr noundef %43)
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = load i64, ptr %10, align 8, !tbaa !9
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  call void @EliminateVolComponents(ptr noundef %44, ptr noundef %45, i64 noundef %46, ptr noundef %47, float noundef 1.250000e+00)
  br label %48

48:                                               ; preds = %32, %27
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %49, ptr %15, align 8, !tbaa !5
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %50

50:                                               ; preds = %55, %48
  %51 = load ptr, ptr %15, align 8, !tbaa !5
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = icmp ne ptr %51, %52
  br i1 %53, label %54, label %61

54:                                               ; preds = %50
  br label %55

55:                                               ; preds = %54
  %56 = load ptr, ptr %15, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.graphdef, ptr %56, i32 0, i32 32
  %58 = load ptr, ptr %57, align 8, !tbaa !19
  store ptr %58, ptr %15, align 8, !tbaa !5
  %59 = load i64, ptr %14, align 8, !tbaa !9
  %60 = add nsw i64 %59, 1
  store i64 %60, ptr %14, align 8, !tbaa !9
  br label %50, !llvm.loop !22

61:                                               ; preds = %50
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = load i64, ptr %10, align 8, !tbaa !9
  call void @libmetis__ComputeVolKWayPartitionParams(ptr noundef %62, ptr noundef %63, i64 noundef %64)
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %65

65:                                               ; preds = %181, %61
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.controldef, ptr %66, i32 0, i32 1
  %68 = load i64, ptr %67, align 8, !tbaa !13
  %69 = and i64 %68, 1
  %70 = icmp ne i64 %69, 0
  br i1 %70, label %71, label %77

71:                                               ; preds = %65
  %72 = call double @gk_CPUSeconds()
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.controldef, ptr %73, i32 0, i32 19
  %75 = load double, ptr %74, align 8, !tbaa !24
  %76 = fsub double %75, %72
  store double %76, ptr %74, align 8, !tbaa !24
  br label %77

77:                                               ; preds = %71, %65
  %78 = load i64, ptr %13, align 8, !tbaa !9
  %79 = mul nsw i64 2, %78
  %80 = load i64, ptr %14, align 8, !tbaa !9
  %81 = icmp sge i64 %79, %80
  br i1 %81, label %82, label %117

82:                                               ; preds = %77
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.graphdef, ptr %83, i32 0, i32 19
  %85 = load ptr, ptr %84, align 8, !tbaa !25
  %86 = load i64, ptr %10, align 8, !tbaa !9
  %87 = load ptr, ptr %11, align 8, !tbaa !5
  %88 = load float, ptr %12, align 4, !tbaa !11
  %89 = fpext float %88 to double
  %90 = fmul double 1.040000e+00, %89
  %91 = fptrunc double %90 to float
  %92 = call i64 @libmetis__IsBalanced(ptr noundef %85, i64 noundef %86, ptr noundef %87, float noundef %91)
  %93 = icmp ne i64 %92, 0
  br i1 %93, label %117, label %94

94:                                               ; preds = %82
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = load i64, ptr %10, align 8, !tbaa !9
  call void @libmetis__ComputeVolKWayBalanceBoundary(ptr noundef %95, ptr noundef %96, i64 noundef %97)
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.controldef, ptr %98, i32 0, i32 4
  %100 = load i64, ptr %99, align 8, !tbaa !18
  switch i64 %100, label %113 [
    i64 1, label %101
    i64 3, label %107
  ]

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

107:                                              ; preds = %94
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = load i64, ptr %10, align 8, !tbaa !9
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Greedy_KWayVolBalanceMConn(ptr noundef %108, ptr noundef %109, i64 noundef %110, ptr noundef %111, float noundef %112, i64 noundef 1)
  br label %113

113:                                              ; preds = %107, %101, %94
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = load i64, ptr %10, align 8, !tbaa !9
  call void @libmetis__ComputeVolKWayBoundary(ptr noundef %114, ptr noundef %115, i64 noundef %116)
  br label %117

117:                                              ; preds = %113, %82, %77
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.controldef, ptr %118, i32 0, i32 4
  %120 = load i64, ptr %119, align 8, !tbaa !18
  switch i64 %120, label %133 [
    i64 1, label %121
    i64 3, label %127
  ]

121:                                              ; preds = %117
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = load i64, ptr %10, align 8, !tbaa !9
  %125 = load ptr, ptr %11, align 8, !tbaa !5
  %126 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Random_KWayVolRefine(ptr noundef %122, ptr noundef %123, i64 noundef %124, ptr noundef %125, float noundef %126, i64 noundef 10, i64 noundef 0)
  br label %133

127:                                              ; preds = %117
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = load i64, ptr %10, align 8, !tbaa !9
  %131 = load ptr, ptr %11, align 8, !tbaa !5
  %132 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Random_KWayVolRefineMConn(ptr noundef %128, ptr noundef %129, i64 noundef %130, ptr noundef %131, float noundef %132, i64 noundef 10, i64 noundef 0)
  br label %133

133:                                              ; preds = %127, %121, %117
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.controldef, ptr %134, i32 0, i32 1
  %136 = load i64, ptr %135, align 8, !tbaa !13
  %137 = and i64 %136, 1
  %138 = icmp ne i64 %137, 0
  br i1 %138, label %139, label %145

139:                                              ; preds = %133
  %140 = call double @gk_CPUSeconds()
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.controldef, ptr %141, i32 0, i32 19
  %143 = load double, ptr %142, align 8, !tbaa !24
  %144 = fadd double %143, %140
  store double %144, ptr %142, align 8, !tbaa !24
  br label %145

145:                                              ; preds = %139, %133
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = icmp eq ptr %146, %147
  br i1 %148, label %149, label %150

149:                                              ; preds = %145
  br label %184

150:                                              ; preds = %145
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.graphdef, ptr %151, i32 0, i32 32
  %153 = load ptr, ptr %152, align 8, !tbaa !19
  store ptr %153, ptr %9, align 8, !tbaa !5
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.controldef, ptr %154, i32 0, i32 1
  %156 = load i64, ptr %155, align 8, !tbaa !13
  %157 = and i64 %156, 1
  %158 = icmp ne i64 %157, 0
  br i1 %158, label %159, label %165

159:                                              ; preds = %150
  %160 = call double @gk_CPUSeconds()
  %161 = load ptr, ptr %7, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.controldef, ptr %161, i32 0, i32 20
  %163 = load double, ptr %162, align 8, !tbaa !26
  %164 = fsub double %163, %160
  store double %164, ptr %162, align 8, !tbaa !26
  br label %165

165:                                              ; preds = %159, %150
  %166 = load ptr, ptr %7, align 8, !tbaa !5
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  %168 = load i64, ptr %10, align 8, !tbaa !9
  call void @libmetis__ProjectVolKWayPartition(ptr noundef %166, ptr noundef %167, i64 noundef %168)
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.controldef, ptr %169, i32 0, i32 1
  %171 = load i64, ptr %170, align 8, !tbaa !13
  %172 = and i64 %171, 1
  %173 = icmp ne i64 %172, 0
  br i1 %173, label %174, label %180

174:                                              ; preds = %165
  %175 = call double @gk_CPUSeconds()
  %176 = load ptr, ptr %7, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.controldef, ptr %176, i32 0, i32 20
  %178 = load double, ptr %177, align 8, !tbaa !26
  %179 = fadd double %178, %175
  store double %179, ptr %177, align 8, !tbaa !26
  br label %180

180:                                              ; preds = %174, %165
  br label %181

181:                                              ; preds = %180
  %182 = load i64, ptr %13, align 8, !tbaa !9
  %183 = add nsw i64 %182, 1
  store i64 %183, ptr %13, align 8, !tbaa !9
  br label %65

184:                                              ; preds = %149
  %185 = load ptr, ptr %9, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.graphdef, ptr %185, i32 0, i32 19
  %187 = load ptr, ptr %186, align 8, !tbaa !25
  %188 = load i64, ptr %10, align 8, !tbaa !9
  %189 = load ptr, ptr %11, align 8, !tbaa !5
  %190 = load float, ptr %12, align 4, !tbaa !11
  %191 = call i64 @libmetis__IsBalanced(ptr noundef %187, i64 noundef %188, ptr noundef %189, float noundef %190)
  %192 = icmp ne i64 %191, 0
  br i1 %192, label %223, label %193

193:                                              ; preds = %184
  %194 = load ptr, ptr %7, align 8, !tbaa !5
  %195 = load ptr, ptr %9, align 8, !tbaa !5
  %196 = load i64, ptr %10, align 8, !tbaa !9
  call void @libmetis__ComputeVolKWayBalanceBoundary(ptr noundef %194, ptr noundef %195, i64 noundef %196)
  %197 = load ptr, ptr %7, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.controldef, ptr %197, i32 0, i32 4
  %199 = load i64, ptr %198, align 8, !tbaa !18
  switch i64 %199, label %222 [
    i64 1, label %200
    i64 3, label %211
  ]

200:                                              ; preds = %193
  %201 = load ptr, ptr %7, align 8, !tbaa !5
  %202 = load ptr, ptr %9, align 8, !tbaa !5
  %203 = load i64, ptr %10, align 8, !tbaa !9
  %204 = load ptr, ptr %11, align 8, !tbaa !5
  %205 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Greedy_KWayVolBalance(ptr noundef %201, ptr noundef %202, i64 noundef %203, ptr noundef %204, float noundef %205, i64 noundef 8)
  %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__Random_KWayVolRefine(ptr noundef %206, ptr noundef %207, i64 noundef %208, ptr noundef %209, float noundef %210, i64 noundef 10, i64 noundef 0)
  br label %222

211:                                              ; preds = %193
  %212 = load ptr, ptr %7, align 8, !tbaa !5
  %213 = load ptr, ptr %9, align 8, !tbaa !5
  %214 = load i64, ptr %10, align 8, !tbaa !9
  %215 = load ptr, ptr %11, align 8, !tbaa !5
  %216 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Greedy_KWayVolBalanceMConn(ptr noundef %212, ptr noundef %213, i64 noundef %214, ptr noundef %215, float noundef %216, i64 noundef 8)
  %217 = load ptr, ptr %7, align 8, !tbaa !5
  %218 = load ptr, ptr %9, align 8, !tbaa !5
  %219 = load i64, ptr %10, align 8, !tbaa !9
  %220 = load ptr, ptr %11, align 8, !tbaa !5
  %221 = load float, ptr %12, align 4, !tbaa !11
  call void @libmetis__Random_KWayVolRefineMConn(ptr noundef %217, ptr noundef %218, i64 noundef %219, ptr noundef %220, float noundef %221, i64 noundef 10, i64 noundef 0)
  br label %222

222:                                              ; preds = %211, %200, %193
  br label %223

223:                                              ; preds = %222, %184
  %224 = load ptr, ptr %7, align 8, !tbaa !5
  %225 = load ptr, ptr %9, align 8, !tbaa !5
  %226 = load i64, ptr %10, align 8, !tbaa !9
  %227 = load ptr, ptr %11, align 8, !tbaa !5
  %228 = load float, ptr %12, align 4, !tbaa !11
  call void @EliminateVolComponents(ptr noundef %224, ptr noundef %225, i64 noundef %226, ptr noundef %227, float noundef %228)
  %229 = load ptr, ptr %7, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.controldef, ptr %229, i32 0, i32 1
  %231 = load i64, ptr %230, align 8, !tbaa !13
  %232 = and i64 %231, 1
  %233 = icmp ne i64 %232, 0
  br i1 %233, label %234, label %240

234:                                              ; preds = %223
  %235 = call double @gk_CPUSeconds()
  %236 = load ptr, ptr %7, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.controldef, ptr %236, i32 0, i32 17
  %238 = load double, ptr %237, align 8, !tbaa !17
  %239 = fadd double %238, %235
  store double %239, ptr %237, align 8, !tbaa !17
  br label %240

240:                                              ; preds = %234, %223
  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
}

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

declare double @gk_CPUSeconds() #2

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

declare void @EliminateVolComponents(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef) #2

declare void @libmetis__EliminateVolSubDomainEdges(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #2

declare i64 @libmetis__IsBalanced(ptr noundef, i64 noundef, ptr noundef, float noundef) #2

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

declare void @libmetis__Greedy_KWayVolBalance(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef, i64 noundef) #2

declare void @libmetis__Greedy_KWayVolBalanceMConn(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef, i64 noundef) #2

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

declare void @libmetis__Random_KWayVolRefine(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef, i64 noundef, i64 noundef) #2

declare void @libmetis__Random_KWayVolRefineMConn(ptr noundef, ptr noundef, i64 noundef, ptr noundef, float noundef, i64 noundef, i64 noundef) #2

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !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 = !{!14, !10, i64 32}
!19 = !{!20, !6, i64 240}
!20 = !{!"graphdef", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !21, i64 56, !21, i64 60, !21, i64 64, !21, i64 68, !21, 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}
!21 = !{!"int", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!14, !16, i64 208}
!25 = !{!20, !6, i64 136}
!26 = !{!14, !16, i64 216}


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

; Function Attrs: nounwind uwtable
define dso_local void @libmetis__RefineVolKWay(ptr noundef %0, ptr noundef readnone %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, float noundef %5) local_unnamed_addr #0 {
  %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
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  %17 = load i64, ptr %16, align 8, !tbaa !15
  %18 = icmp eq i64 %17, 3
  br i1 %18, label %19, label %20

19:                                               ; preds = %15
  tail call void @libmetis__ComputeVolKWayPartitionParams(ptr noundef nonnull %0, ptr noundef %2, i64 noundef %3)
  tail call void @EliminateVolComponents(ptr noundef nonnull %0, ptr noundef %2, i64 noundef %3, ptr noundef %4, float noundef 1.250000e+00) #2
  tail call void @libmetis__EliminateVolSubDomainEdges(ptr noundef nonnull %0, ptr noundef %2, i64 noundef %3, ptr noundef %4) #2
  tail call void @EliminateVolComponents(ptr noundef nonnull %0, ptr noundef %2, i64 noundef %3, ptr noundef %4, float noundef 1.250000e+00) #2
  br label %20

20:                                               ; preds = %19, %15
  %.not113122 = icmp eq ptr %2, %1
  br i1 %.not113122, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %20, %.lr.ph
  %.0124 = phi ptr [ %22, %.lr.ph ], [ %2, %20 ]
  %.0109123 = phi i64 [ %23, %.lr.ph ], [ 0, %20 ]
  %21 = getelementptr inbounds i8, ptr %.0124, i64 240
  %22 = load ptr, ptr %21, align 8, !tbaa !16
  %23 = add nuw nsw i64 %.0109123, 1
  %.not113 = icmp eq ptr %22, %1
  br i1 %.not113, label %._crit_edge, label %.lr.ph, !llvm.loop !19

._crit_edge:                                      ; preds = %.lr.ph, %20
  %.0109.lcssa = phi i64 [ 0, %20 ], [ %23, %.lr.ph ]
  tail call void @libmetis__ComputeVolKWayPartitionParams(ptr noundef %0, ptr noundef %2, i64 noundef %3)
  %24 = getelementptr inbounds i8, ptr %0, i64 208
  %25 = fpext float %5 to double
  %26 = fmul double %25, 1.040000e+00
  %27 = fptrunc double %26 to float
  %28 = getelementptr inbounds i8, ptr %0, i64 216
  br label %29

29:                                               ; preds = %76, %._crit_edge
  %.0111 = phi ptr [ %2, %._crit_edge ], [ %62, %76 ]
  %.0110 = phi i64 [ 0, %._crit_edge ], [ %77, %76 ]
  %30 = load i64, ptr %7, align 8, !tbaa !5
  %31 = and i64 %30, 1
  %.not114 = icmp eq i64 %31, 0
  br i1 %.not114, label %36, label %32

32:                                               ; preds = %29
  %33 = tail call double @gk_CPUSeconds() #2
  %34 = load double, ptr %24, align 8, !tbaa !21
  %35 = fsub double %34, %33
  store double %35, ptr %24, align 8, !tbaa !21
  br label %36

36:                                               ; preds = %32, %29
  %37 = shl nuw nsw i64 %.0110, 1
  %.not115 = icmp ult i64 %37, %.0109.lcssa
  br i1 %.not115, label %47, label %38

38:                                               ; preds = %36
  %39 = getelementptr inbounds i8, ptr %.0111, i64 136
  %40 = load ptr, ptr %39, align 8, !tbaa !22
  %41 = tail call i64 @libmetis__IsBalanced(ptr noundef %40, i64 noundef %3, ptr noundef %4, float noundef %27) #2
  %.not116 = icmp eq i64 %41, 0
  br i1 %.not116, label %42, label %47

42:                                               ; preds = %38
  tail call void @libmetis__ComputeVolKWayBalanceBoundary(ptr noundef nonnull %0, ptr noundef nonnull %.0111, i64 noundef %3)
  %43 = load i64, ptr %16, align 8, !tbaa !15
  switch i64 %43, label %46 [
    i64 1, label %44
    i64 3, label %45
  ]

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

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

46:                                               ; preds = %45, %44, %42
  tail call void @libmetis__ComputeVolKWayBoundary(ptr noundef nonnull %0, ptr noundef nonnull %.0111, i64 noundef %3)
  br label %47

47:                                               ; preds = %46, %38, %36
  %48 = load i64, ptr %16, align 8, !tbaa !15
  switch i64 %48, label %51 [
    i64 1, label %49
    i64 3, label %50
  ]

49:                                               ; preds = %47
  tail call void @libmetis__Random_KWayVolRefine(ptr noundef nonnull %0, ptr noundef %.0111, i64 noundef %3, ptr noundef %4, float noundef %5, i64 noundef 10, i64 noundef 0) #2
  br label %51

50:                                               ; preds = %47
  tail call void @libmetis__Random_KWayVolRefineMConn(ptr noundef nonnull %0, ptr noundef %.0111, i64 noundef %3, ptr noundef %4, float noundef %5, i64 noundef 10, i64 noundef 0) #2
  br label %51

51:                                               ; preds = %50, %49, %47
  %52 = load i64, ptr %7, align 8, !tbaa !5
  %53 = and i64 %52, 1
  %.not117 = icmp eq i64 %53, 0
  br i1 %.not117, label %58, label %54

54:                                               ; preds = %51
  %55 = tail call double @gk_CPUSeconds() #2
  %56 = load double, ptr %24, align 8, !tbaa !21
  %57 = fadd double %55, %56
  store double %57, ptr %24, align 8, !tbaa !21
  br label %58

58:                                               ; preds = %54, %51
  %59 = icmp eq ptr %.0111, %1
  br i1 %59, label %78, label %60

60:                                               ; preds = %58
  %61 = getelementptr inbounds i8, ptr %.0111, i64 240
  %62 = load ptr, ptr %61, align 8, !tbaa !16
  %63 = load i64, ptr %7, align 8, !tbaa !5
  %64 = and i64 %63, 1
  %.not118 = icmp eq i64 %64, 0
  br i1 %.not118, label %69, label %65

65:                                               ; preds = %60
  %66 = tail call double @gk_CPUSeconds() #2
  %67 = load double, ptr %28, align 8, !tbaa !23
  %68 = fsub double %67, %66
  store double %68, ptr %28, align 8, !tbaa !23
  br label %69

69:                                               ; preds = %65, %60
  tail call void @libmetis__ProjectVolKWayPartition(ptr noundef nonnull %0, ptr noundef %62, i64 noundef %3)
  %70 = load i64, ptr %7, align 8, !tbaa !5
  %71 = and i64 %70, 1
  %.not119 = icmp eq i64 %71, 0
  br i1 %.not119, label %76, label %72

72:                                               ; preds = %69
  %73 = tail call double @gk_CPUSeconds() #2
  %74 = load double, ptr %28, align 8, !tbaa !23
  %75 = fadd double %73, %74
  store double %75, ptr %28, align 8, !tbaa !23
  br label %76

76:                                               ; preds = %69, %72
  %77 = add nuw nsw i64 %.0110, 1
  br label %29

78:                                               ; preds = %58
  %79 = getelementptr inbounds i8, ptr %.0111, i64 136
  %80 = load ptr, ptr %79, align 8, !tbaa !22
  %81 = tail call i64 @libmetis__IsBalanced(ptr noundef %80, i64 noundef %3, ptr noundef %4, float noundef %5) #2
  %.not120 = icmp eq i64 %81, 0
  br i1 %.not120, label %82, label %86

82:                                               ; preds = %78
  tail call void @libmetis__ComputeVolKWayBalanceBoundary(ptr noundef nonnull %0, ptr noundef nonnull %.0111, i64 noundef %3)
  %83 = load i64, ptr %16, align 8, !tbaa !15
  switch i64 %83, label %86 [
    i64 1, label %84
    i64 3, label %85
  ]

84:                                               ; preds = %82
  tail call void @libmetis__Greedy_KWayVolBalance(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_KWayVolRefine(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 %86

85:                                               ; preds = %82
  tail call void @libmetis__Greedy_KWayVolBalanceMConn(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_KWayVolRefineMConn(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 %86

86:                                               ; preds = %82, %84, %85, %78
  tail call void @EliminateVolComponents(ptr noundef nonnull %0, ptr noundef nonnull %.0111, i64 noundef %3, ptr noundef %4, float noundef %5) #2
  %87 = load i64, ptr %7, align 8, !tbaa !5
  %88 = and i64 %87, 1
  %.not121 = icmp eq i64 %88, 0
  br i1 %.not121, label %94, label %89

89:                                               ; preds = %86
  %90 = tail call double @gk_CPUSeconds() #2
  %91 = getelementptr inbounds i8, ptr %0, i64 192
  %92 = load double, ptr %91, align 8, !tbaa !14
  %93 = fadd double %90, %92
  store double %93, ptr %91, align 8, !tbaa !14
  br label %94

94:                                               ; preds = %89, %86
  ret void
}

declare double @gk_CPUSeconds() local_unnamed_addr #1

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

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

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

declare i64 @libmetis__IsBalanced(ptr noundef, i64 noundef, ptr noundef, float noundef) local_unnamed_addr #1

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

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

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

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

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

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

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

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 = { 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 = !{!6, !7, i64 32}
!16 = !{!17, !12, i64 240}
!17 = !{!"graphdef", !7, i64 0, !7, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !18, i64 56, !18, i64 60, !18, i64 64, !18, i64 68, !18, 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}
!18 = !{!"int", !8, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!6, !13, i64 208}
!22 = !{!17, !12, i64 136}
!23 = !{!6, !13, i64 216}


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