; LLVM IR from siconos/siconos :: externals/lbl/metis4/kwayvolrefine.ll_ (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 { i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, %struct.workspacedef, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
%struct.workspacedef = type { ptr, i32, i32, ptr, ptr, i32, ptr, ptr }
%struct.graphdef = type { ptr, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr }

; Function Attrs: nounwind uwtable
define dso_local void @__RefineVolKWay(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 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 i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca float, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %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 i32 %3, ptr %10, align 4, !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 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, 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 i32, ptr %17, align 4, !tbaa !13
  %19 = and i32 %18, 1
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %27

21:                                               ; preds = %6
  %22 = call double @__seconds()
  %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 i32, ptr %29, align 8, !tbaa !18
  %31 = icmp eq i32 %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 i32, ptr %10, align 4, !tbaa !9
  call void @__ComputeVolKWayPartitionParams(ptr noundef %33, ptr noundef %34, i32 noundef %35)
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  call void @EliminateVolComponents(ptr noundef %36, ptr noundef %37, i32 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 i32, ptr %10, align 4, !tbaa !9
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  call void @__EliminateVolSubDomainEdges(ptr noundef %40, ptr noundef %41, i32 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 i32, ptr %10, align 4, !tbaa !9
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  call void @EliminateVolComponents(ptr noundef %44, ptr noundef %45, i32 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 i32 0, ptr %14, align 4, !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 28
  %58 = load ptr, ptr %57, align 8, !tbaa !19
  store ptr %58, ptr %15, align 8, !tbaa !5
  %59 = load i32, ptr %14, align 4, !tbaa !9
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %14, align 4, !tbaa !9
  br label %50, !llvm.loop !21

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

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

71:                                               ; preds = %65
  %72 = call double @__seconds()
  %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 !23
  %76 = fsub double %75, %72
  store double %76, ptr %74, align 8, !tbaa !23
  br label %77

77:                                               ; preds = %71, %65
  %78 = load i32, ptr %13, align 4, !tbaa !9
  %79 = mul nsw i32 2, %78
  %80 = load i32, ptr %14, align 4, !tbaa !9
  %81 = icmp sge i32 %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 15
  %85 = load ptr, ptr %84, align 8, !tbaa !24
  %86 = load i32, ptr %10, align 4, !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 i32 @__IsBalanced(ptr noundef %85, i32 noundef %86, ptr noundef %87, float noundef %91)
  %93 = icmp ne i32 %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 i32, ptr %10, align 4, !tbaa !9
  call void @__ComputeVolKWayBalanceBoundary(ptr noundef %95, ptr noundef %96, i32 noundef %97)
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.controldef, ptr %98, i32 0, i32 4
  %100 = load i32, ptr %99, align 8, !tbaa !18
  switch i32 %100, label %113 [
    i32 1, label %101
    i32 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 i32, ptr %10, align 4, !tbaa !9
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = load float, ptr %12, align 4, !tbaa !11
  call void @__Greedy_KWayVolBalance(ptr noundef %102, ptr noundef %103, i32 noundef %104, ptr noundef %105, float noundef %106, i32 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 i32, ptr %10, align 4, !tbaa !9
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = load float, ptr %12, align 4, !tbaa !11
  call void @__Greedy_KWayVolBalanceMConn(ptr noundef %108, ptr noundef %109, i32 noundef %110, ptr noundef %111, float noundef %112, i32 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 i32, ptr %10, align 4, !tbaa !9
  call void @__ComputeVolKWayBoundary(ptr noundef %114, ptr noundef %115, i32 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 i32, ptr %119, align 8, !tbaa !18
  switch i32 %120, label %133 [
    i32 1, label %121
    i32 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 i32, ptr %10, align 4, !tbaa !9
  %125 = load ptr, ptr %11, align 8, !tbaa !5
  %126 = load float, ptr %12, align 4, !tbaa !11
  call void @__Random_KWayVolRefine(ptr noundef %122, ptr noundef %123, i32 noundef %124, ptr noundef %125, float noundef %126, i32 noundef 10, i32 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 i32, ptr %10, align 4, !tbaa !9
  %131 = load ptr, ptr %11, align 8, !tbaa !5
  %132 = load float, ptr %12, align 4, !tbaa !11
  call void @__Random_KWayVolRefineMConn(ptr noundef %128, ptr noundef %129, i32 noundef %130, ptr noundef %131, float noundef %132, i32 noundef 10, i32 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 i32, ptr %135, align 4, !tbaa !13
  %137 = and i32 %136, 1
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %145

139:                                              ; preds = %133
  %140 = call double @__seconds()
  %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 !23
  %144 = fadd double %143, %140
  store double %144, ptr %142, align 8, !tbaa !23
  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 %186

150:                                              ; preds = %145
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.graphdef, ptr %151, i32 0, i32 0
  call void (ptr, ...) @GKfree(ptr noundef %152, ptr noundef null)
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.graphdef, ptr %153, i32 0, i32 28
  %155 = load ptr, ptr %154, align 8, !tbaa !19
  store ptr %155, ptr %9, align 8, !tbaa !5
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.controldef, ptr %156, i32 0, i32 1
  %158 = load i32, ptr %157, align 4, !tbaa !13
  %159 = and i32 %158, 1
  %160 = icmp ne i32 %159, 0
  br i1 %160, label %161, label %167

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

167:                                              ; preds = %161, %150
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  %169 = load ptr, ptr %9, align 8, !tbaa !5
  %170 = load i32, ptr %10, align 4, !tbaa !9
  call void @__ProjectVolKWayPartition(ptr noundef %168, ptr noundef %169, i32 noundef %170)
  %171 = load ptr, ptr %7, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.controldef, ptr %171, i32 0, i32 1
  %173 = load i32, ptr %172, align 4, !tbaa !13
  %174 = and i32 %173, 1
  %175 = icmp ne i32 %174, 0
  br i1 %175, label %176, label %182

176:                                              ; preds = %167
  %177 = call double @__seconds()
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.controldef, ptr %178, i32 0, i32 20
  %180 = load double, ptr %179, align 8, !tbaa !25
  %181 = fadd double %180, %177
  store double %181, ptr %179, align 8, !tbaa !25
  br label %182

182:                                              ; preds = %176, %167
  br label %183

183:                                              ; preds = %182
  %184 = load i32, ptr %13, align 4, !tbaa !9
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %13, align 4, !tbaa !9
  br label %65

186:                                              ; preds = %149
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.graphdef, ptr %187, i32 0, i32 15
  %189 = load ptr, ptr %188, align 8, !tbaa !24
  %190 = load i32, ptr %10, align 4, !tbaa !9
  %191 = load ptr, ptr %11, align 8, !tbaa !5
  %192 = load float, ptr %12, align 4, !tbaa !11
  %193 = call i32 @__IsBalanced(ptr noundef %189, i32 noundef %190, ptr noundef %191, float noundef %192)
  %194 = icmp ne i32 %193, 0
  br i1 %194, label %225, label %195

195:                                              ; preds = %186
  %196 = load ptr, ptr %7, align 8, !tbaa !5
  %197 = load ptr, ptr %9, align 8, !tbaa !5
  %198 = load i32, ptr %10, align 4, !tbaa !9
  call void @__ComputeVolKWayBalanceBoundary(ptr noundef %196, ptr noundef %197, i32 noundef %198)
  %199 = load ptr, ptr %7, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.controldef, ptr %199, i32 0, i32 4
  %201 = load i32, ptr %200, align 8, !tbaa !18
  switch i32 %201, label %224 [
    i32 1, label %202
    i32 3, label %213
  ]

202:                                              ; preds = %195
  %203 = load ptr, ptr %7, align 8, !tbaa !5
  %204 = load ptr, ptr %9, align 8, !tbaa !5
  %205 = load i32, ptr %10, align 4, !tbaa !9
  %206 = load ptr, ptr %11, align 8, !tbaa !5
  %207 = load float, ptr %12, align 4, !tbaa !11
  call void @__Greedy_KWayVolBalance(ptr noundef %203, ptr noundef %204, i32 noundef %205, ptr noundef %206, float noundef %207, i32 noundef 8)
  %208 = load ptr, ptr %7, align 8, !tbaa !5
  %209 = load ptr, ptr %9, align 8, !tbaa !5
  %210 = load i32, ptr %10, align 4, !tbaa !9
  %211 = load ptr, ptr %11, align 8, !tbaa !5
  %212 = load float, ptr %12, align 4, !tbaa !11
  call void @__Random_KWayVolRefine(ptr noundef %208, ptr noundef %209, i32 noundef %210, ptr noundef %211, float noundef %212, i32 noundef 10, i32 noundef 0)
  br label %224

213:                                              ; preds = %195
  %214 = load ptr, ptr %7, align 8, !tbaa !5
  %215 = load ptr, ptr %9, align 8, !tbaa !5
  %216 = load i32, ptr %10, align 4, !tbaa !9
  %217 = load ptr, ptr %11, align 8, !tbaa !5
  %218 = load float, ptr %12, align 4, !tbaa !11
  call void @__Greedy_KWayVolBalanceMConn(ptr noundef %214, ptr noundef %215, i32 noundef %216, ptr noundef %217, float noundef %218, i32 noundef 8)
  %219 = load ptr, ptr %7, align 8, !tbaa !5
  %220 = load ptr, ptr %9, align 8, !tbaa !5
  %221 = load i32, ptr %10, align 4, !tbaa !9
  %222 = load ptr, ptr %11, align 8, !tbaa !5
  %223 = load float, ptr %12, align 4, !tbaa !11
  call void @__Random_KWayVolRefineMConn(ptr noundef %219, ptr noundef %220, i32 noundef %221, ptr noundef %222, float noundef %223, i32 noundef 10, i32 noundef 0)
  br label %224

224:                                              ; preds = %213, %202, %195
  br label %225

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

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

242:                                              ; preds = %236, %225
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, 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 @__seconds() #2

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

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

declare void @__EliminateVolSubDomainEdges(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

declare i32 @__IsBalanced(ptr noundef, i32 noundef, ptr noundef, float noundef) #2

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

declare void @__Greedy_KWayVolBalance(ptr noundef, ptr noundef, i32 noundef, ptr noundef, float noundef, i32 noundef) #2

declare void @__Greedy_KWayVolBalanceMConn(ptr noundef, ptr noundef, i32 noundef, ptr noundef, float noundef, i32 noundef) #2

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

declare void @__Random_KWayVolRefine(ptr noundef, ptr noundef, i32 noundef, ptr noundef, float noundef, i32 noundef, i32 noundef) #2

declare void @__Random_KWayVolRefineMConn(ptr noundef, ptr noundef, i32 noundef, ptr noundef, float noundef, i32 noundef, i32 noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @__ProjectVolKWayPartition(ptr noundef, ptr noundef, i32 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !10, i64 4}
!14 = !{!"controldef", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !12, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !15, i64 48, !16, i64 104, !16, i64 112, !16, i64 120, !16, i64 128, !16, i64 136, !16, i64 144, !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}
!15 = !{!"workspacedef", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !10, i64 32, !6, i64 40, !6, i64 48}
!16 = !{!"double", !7, i64 0}
!17 = !{!14, !16, i64 144}
!18 = !{!14, !10, i64 16}
!19 = !{!20, !6, i64 208}
!20 = !{!"graphdef", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !10, i64 92, !6, i64 96, !6, i64 104, !10, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !10, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!14, !16, i64 160}
!24 = !{!20, !6, i64 104}
!25 = !{!14, !16, i64 168}


; 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 @__RefineVolKWay(ptr noundef %0, ptr noundef readnone %1, ptr noundef %2, i32 noundef %3, ptr noundef %4, float noundef %5) local_unnamed_addr #0 {
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = and i32 %8, 1
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %15, label %10

10:                                               ; preds = %6
  %11 = tail call double @__seconds() #2
  %12 = getelementptr inbounds i8, ptr %0, i64 144
  %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 16
  %17 = load i32, ptr %16, align 8, !tbaa !15
  %18 = icmp eq i32 %17, 3
  br i1 %18, label %19, label %20

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

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

.lr.ph:                                           ; preds = %20, %.lr.ph
  %.0125 = phi ptr [ %22, %.lr.ph ], [ %2, %20 ]
  %.0110124 = phi i32 [ %23, %.lr.ph ], [ 0, %20 ]
  %21 = getelementptr inbounds i8, ptr %.0125, i64 208
  %22 = load ptr, ptr %21, align 8, !tbaa !16
  %23 = add nuw nsw i32 %.0110124, 1
  %.not114 = icmp eq ptr %22, %1
  br i1 %.not114, label %._crit_edge, label %.lr.ph, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph, %20
  %.0110.lcssa = phi i32 [ 0, %20 ], [ %23, %.lr.ph ]
  tail call void @__ComputeVolKWayPartitionParams(ptr noundef %0, ptr noundef %2, i32 noundef %3)
  %24 = getelementptr inbounds i8, ptr %0, i64 160
  %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 168
  br label %29

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

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

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

38:                                               ; preds = %36
  %39 = getelementptr inbounds i8, ptr %.0112, i64 104
  %40 = load ptr, ptr %39, align 8, !tbaa !21
  %41 = tail call i32 @__IsBalanced(ptr noundef %40, i32 noundef %3, ptr noundef %4, float noundef %27) #2
  %.not117 = icmp eq i32 %41, 0
  br i1 %.not117, label %42, label %47

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

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

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

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

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

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

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

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

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

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

60:                                               ; preds = %58
  tail call void (ptr, ...) @GKfree(ptr noundef %.0112, ptr noundef null) #2
  %61 = getelementptr inbounds i8, ptr %.0112, i64 208
  %62 = load ptr, ptr %61, align 8, !tbaa !16
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = and i32 %63, 1
  %.not119 = icmp eq i32 %64, 0
  br i1 %.not119, label %69, label %65

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

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

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

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

78:                                               ; preds = %58
  %79 = getelementptr inbounds i8, ptr %.0112, i64 104
  %80 = load ptr, ptr %79, align 8, !tbaa !21
  %81 = tail call i32 @__IsBalanced(ptr noundef %80, i32 noundef %3, ptr noundef %4, float noundef %5) #2
  %.not121 = icmp eq i32 %81, 0
  br i1 %.not121, label %82, label %86

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

84:                                               ; preds = %82
  tail call void @__Greedy_KWayVolBalance(ptr noundef nonnull %0, ptr noundef nonnull %.0112, i32 noundef %3, ptr noundef %4, float noundef %5, i32 noundef 8) #2
  tail call void @__Random_KWayVolRefine(ptr noundef nonnull %0, ptr noundef nonnull %.0112, i32 noundef %3, ptr noundef %4, float noundef %5, i32 noundef 10, i32 noundef 0) #2
  br label %86

85:                                               ; preds = %82
  tail call void @__Greedy_KWayVolBalanceMConn(ptr noundef nonnull %0, ptr noundef nonnull %.0112, i32 noundef %3, ptr noundef %4, float noundef %5, i32 noundef 8) #2
  tail call void @__Random_KWayVolRefineMConn(ptr noundef nonnull %0, ptr noundef nonnull %.0112, i32 noundef %3, ptr noundef %4, float noundef %5, i32 noundef 10, i32 noundef 0) #2
  br label %86

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

89:                                               ; preds = %86
  %90 = tail call double @__seconds() #2
  %91 = getelementptr inbounds i8, ptr %0, i64 144
  %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 @__seconds() local_unnamed_addr #1

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

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

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

declare i32 @__IsBalanced(ptr noundef, i32 noundef, ptr noundef, float noundef) local_unnamed_addr #1

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

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

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

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

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

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

declare void @GKfree(ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @__ProjectVolKWayPartition(ptr noundef, ptr noundef, i32 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 4}
!6 = !{!"controldef", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !10, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !11, i64 48, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !13, i64 136, !13, i64 144, !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}
!7 = !{!"int", !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 12, !12, i64 16, !12, i64 24, !7, i64 32, !12, i64 40, !12, i64 48}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!6, !13, i64 144}
!15 = !{!6, !7, i64 16}
!16 = !{!17, !12, i64 208}
!17 = !{!"graphdef", !12, i64 0, !12, i64 8, !7, i64 16, !7, i64 20, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !7, i64 88, !7, i64 92, !12, i64 96, !12, i64 104, !7, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !7, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!6, !13, i64 160}
!21 = !{!17, !12, i64 104}
!22 = !{!6, !13, i64 168}


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