; LLVM IR from siconos/siconos :: externals/lbl/metis4/initpart.ll_ (RandomBisection)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.graphdef = type { 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 }
%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 }

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

; Function Attrs: nounwind uwtable
define dso_local void @__RandomBisection(ptr noundef %0, ptr noundef %1, ptr noundef %2, float noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca float, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca [2 x i32], align 4
  %15 = alloca [2 x i32], align 4
  %16 = alloca [2 x i32], align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store float %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.graphdef, ptr %31, i32 0, i32 2
  %33 = load i32, ptr %32, align 8, !tbaa !11
  store i32 %33, ptr %13, align 4, !tbaa !14
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.graphdef, ptr %34, i32 0, i32 4
  %36 = load ptr, ptr %35, align 8, !tbaa !15
  store ptr %36, ptr %24, align 8, !tbaa !5
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.graphdef, ptr %37, i32 0, i32 5
  %39 = load ptr, ptr %38, align 8, !tbaa !16
  store ptr %39, ptr %25, align 8, !tbaa !5
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.graphdef, ptr %40, i32 0, i32 7
  %42 = load ptr, ptr %41, align 8, !tbaa !17
  store ptr %42, ptr %26, align 8, !tbaa !5
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.graphdef, ptr %43, i32 0, i32 8
  %45 = load ptr, ptr %44, align 8, !tbaa !18
  store ptr %45, ptr %27, align 8, !tbaa !5
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  call void @__Allocate2WayPartitionMemory(ptr noundef %46, ptr noundef %47)
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.graphdef, ptr %48, i32 0, i32 14
  %50 = load ptr, ptr %49, align 8, !tbaa !19
  store ptr %50, ptr %28, align 8, !tbaa !5
  %51 = load i32, ptr %13, align 4, !tbaa !14
  %52 = call ptr @__idxmalloc(i32 noundef %51, ptr noundef @.str.3)
  store ptr %52, ptr %30, align 8, !tbaa !5
  %53 = load i32, ptr %13, align 4, !tbaa !14
  %54 = call ptr @__idxmalloc(i32 noundef %53, ptr noundef @.str.4)
  store ptr %54, ptr %29, align 8, !tbaa !5
  %55 = load float, ptr %8, align 4, !tbaa !9
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds i32, ptr %56, i64 0
  %58 = load i32, ptr %57, align 4, !tbaa !14
  %59 = sitofp i32 %58 to float
  %60 = fmul float %55, %59
  %61 = fptosi float %60 to i32
  %62 = getelementptr inbounds [2 x i32], ptr %16, i64 0, i64 0
  store i32 %61, ptr %62, align 4, !tbaa !14
  %63 = load float, ptr %8, align 4, !tbaa !9
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds i32, ptr %64, i64 1
  %66 = load i32, ptr %65, align 4, !tbaa !14
  %67 = sitofp i32 %66 to float
  %68 = fmul float %63, %67
  %69 = fptosi float %68 to i32
  %70 = getelementptr inbounds [2 x i32], ptr %16, i64 0, i64 1
  store i32 %69, ptr %70, align 4, !tbaa !14
  %71 = load float, ptr %8, align 4, !tbaa !9
  %72 = fpext float %71 to double
  %73 = fdiv double 1.000000e+00, %72
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds i32, ptr %74, i64 0
  %76 = load i32, ptr %75, align 4, !tbaa !14
  %77 = sitofp i32 %76 to double
  %78 = fmul double %73, %77
  %79 = fptosi double %78 to i32
  %80 = getelementptr inbounds [2 x i32], ptr %15, i64 0, i64 0
  store i32 %79, ptr %80, align 4, !tbaa !14
  %81 = load float, ptr %8, align 4, !tbaa !9
  %82 = fpext float %81 to double
  %83 = fdiv double 1.000000e+00, %82
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = getelementptr inbounds i32, ptr %84, i64 1
  %86 = load i32, ptr %85, align 4, !tbaa !14
  %87 = sitofp i32 %86 to double
  %88 = fmul double %83, %87
  %89 = fptosi double %88 to i32
  %90 = getelementptr inbounds [2 x i32], ptr %15, i64 0, i64 1
  store i32 %89, ptr %90, align 4, !tbaa !14
  %91 = load i32, ptr %13, align 4, !tbaa !14
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.controldef, ptr %92, i32 0, i32 0
  %94 = load i32, ptr %93, align 8, !tbaa !20
  %95 = icmp sle i32 %91, %94
  %96 = zext i1 %95 to i64
  %97 = select i1 %95, i32 3, i32 8
  store i32 %97, ptr %23, align 4, !tbaa !14
  %98 = load i32, ptr %13, align 4, !tbaa !14
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.graphdef, ptr %99, i32 0, i32 9
  %101 = load ptr, ptr %100, align 8, !tbaa !24
  %102 = call i32 @__idxsum(i32 noundef %98, ptr noundef %101)
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %18, align 4, !tbaa !14
  br label %104

104:                                              ; preds = %208, %4
  %105 = load i32, ptr %23, align 4, !tbaa !14
  %106 = icmp sgt i32 %105, 0
  br i1 %106, label %107, label %211

107:                                              ; preds = %104
  %108 = load i32, ptr %13, align 4, !tbaa !14
  %109 = load ptr, ptr %29, align 8, !tbaa !5
  call void @__RandomPermute(i32 noundef %108, ptr noundef %109, i32 noundef 1)
  %110 = load i32, ptr %13, align 4, !tbaa !14
  %111 = load ptr, ptr %28, align 8, !tbaa !5
  %112 = call ptr @__idxset(i32 noundef %110, i32 noundef 1, ptr noundef %111)
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds i32, ptr %113, i64 0
  %115 = load i32, ptr %114, align 4, !tbaa !14
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds i32, ptr %116, i64 1
  %118 = load i32, ptr %117, align 4, !tbaa !14
  %119 = add nsw i32 %115, %118
  %120 = getelementptr inbounds [2 x i32], ptr %14, i64 0, i64 1
  store i32 %119, ptr %120, align 4, !tbaa !14
  %121 = getelementptr inbounds [2 x i32], ptr %14, i64 0, i64 0
  store i32 0, ptr %121, align 4, !tbaa !14
  %122 = load i32, ptr %23, align 4, !tbaa !14
  %123 = icmp ne i32 %122, 1
  br i1 %123, label %124, label %179

124:                                              ; preds = %107
  store i32 0, ptr %10, align 4, !tbaa !14
  br label %125

125:                                              ; preds = %175, %124
  %126 = load i32, ptr %10, align 4, !tbaa !14
  %127 = load i32, ptr %13, align 4, !tbaa !14
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %129, label %178

129:                                              ; preds = %125
  %130 = load ptr, ptr %29, align 8, !tbaa !5
  %131 = load i32, ptr %10, align 4, !tbaa !14
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds i32, ptr %130, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !14
  store i32 %134, ptr %9, align 4, !tbaa !14
  %135 = getelementptr inbounds [2 x i32], ptr %14, i64 0, i64 0
  %136 = load i32, ptr %135, align 4, !tbaa !14
  %137 = load ptr, ptr %25, align 8, !tbaa !5
  %138 = load i32, ptr %9, align 4, !tbaa !14
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds i32, ptr %137, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !14
  %142 = add nsw i32 %136, %141
  %143 = getelementptr inbounds [2 x i32], ptr %16, i64 0, i64 0
  %144 = load i32, ptr %143, align 4, !tbaa !14
  %145 = icmp slt i32 %142, %144
  br i1 %145, label %146, label %174

146:                                              ; preds = %129
  %147 = load ptr, ptr %28, align 8, !tbaa !5
  %148 = load i32, ptr %9, align 4, !tbaa !14
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds i32, ptr %147, i64 %149
  store i32 0, ptr %150, align 4, !tbaa !14
  %151 = load ptr, ptr %25, align 8, !tbaa !5
  %152 = load i32, ptr %9, align 4, !tbaa !14
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds i32, ptr %151, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !14
  %156 = getelementptr inbounds [2 x i32], ptr %14, i64 0, i64 0
  %157 = load i32, ptr %156, align 4, !tbaa !14
  %158 = add nsw i32 %157, %155
  store i32 %158, ptr %156, align 4, !tbaa !14
  %159 = load ptr, ptr %25, align 8, !tbaa !5
  %160 = load i32, ptr %9, align 4, !tbaa !14
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds i32, ptr %159, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !14
  %164 = getelementptr inbounds [2 x i32], ptr %14, i64 0, i64 1
  %165 = load i32, ptr %164, align 4, !tbaa !14
  %166 = sub nsw i32 %165, %163
  store i32 %166, ptr %164, align 4, !tbaa !14
  %167 = getelementptr inbounds [2 x i32], ptr %14, i64 0, i64 0
  %168 = load i32, ptr %167, align 4, !tbaa !14
  %169 = getelementptr inbounds [2 x i32], ptr %15, i64 0, i64 0
  %170 = load i32, ptr %169, align 4, !tbaa !14
  %171 = icmp sgt i32 %168, %170
  br i1 %171, label %172, label %173

172:                                              ; preds = %146
  br label %178

173:                                              ; preds = %146
  br label %174

174:                                              ; preds = %173, %129
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %10, align 4, !tbaa !14
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %10, align 4, !tbaa !14
  br label %125, !llvm.loop !25

178:                                              ; preds = %172, %125
  br label %179

179:                                              ; preds = %178, %107
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  call void @__Compute2WayPartitionParams(ptr noundef %180, ptr noundef %181)
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = load ptr, ptr %6, align 8, !tbaa !5
  %184 = load ptr, ptr %7, align 8, !tbaa !5
  %185 = load float, ptr %8, align 4, !tbaa !9
  call void @__Balance2Way(ptr noundef %182, ptr noundef %183, ptr noundef %184, float noundef %185)
  %186 = load ptr, ptr %5, align 8, !tbaa !5
  %187 = load ptr, ptr %6, align 8, !tbaa !5
  %188 = load ptr, ptr %7, align 8, !tbaa !5
  call void @__FM_2WayEdgeRefine(ptr noundef %186, ptr noundef %187, ptr noundef %188, i32 noundef 4)
  %189 = load i32, ptr %18, align 4, !tbaa !14
  %190 = load ptr, ptr %6, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.graphdef, ptr %190, i32 0, i32 12
  %192 = load i32, ptr %191, align 8, !tbaa !27
  %193 = icmp sgt i32 %189, %192
  br i1 %193, label %194, label %207

194:                                              ; preds = %179
  %195 = load ptr, ptr %6, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.graphdef, ptr %195, i32 0, i32 12
  %197 = load i32, ptr %196, align 8, !tbaa !27
  store i32 %197, ptr %18, align 4, !tbaa !14
  %198 = load ptr, ptr %30, align 8, !tbaa !5
  %199 = load ptr, ptr %28, align 8, !tbaa !5
  %200 = load i32, ptr %13, align 4, !tbaa !14
  %201 = sext i32 %200 to i64
  %202 = mul i64 4, %201
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %198, ptr align 1 %199, i64 %202, i1 false)
  %203 = load i32, ptr %18, align 4, !tbaa !14
  %204 = icmp eq i32 %203, 0
  br i1 %204, label %205, label %206

205:                                              ; preds = %194
  br label %211

206:                                              ; preds = %194
  br label %207

207:                                              ; preds = %206, %179
  br label %208

208:                                              ; preds = %207
  %209 = load i32, ptr %23, align 4, !tbaa !14
  %210 = add nsw i32 %209, -1
  store i32 %210, ptr %23, align 4, !tbaa !14
  br label %104, !llvm.loop !28

211:                                              ; preds = %205, %104
  %212 = load i32, ptr %18, align 4, !tbaa !14
  %213 = load ptr, ptr %6, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.graphdef, ptr %213, i32 0, i32 12
  store i32 %212, ptr %214, align 8, !tbaa !27
  %215 = load ptr, ptr %28, align 8, !tbaa !5
  %216 = load ptr, ptr %30, align 8, !tbaa !5
  %217 = load i32, ptr %13, align 4, !tbaa !14
  %218 = sext i32 %217 to i64
  %219 = mul i64 4, %218
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %215, ptr align 1 %216, i64 %219, i1 false)
  call void (ptr, ...) @GKfree(ptr noundef %30, ptr noundef %29, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret void
}

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

declare void @__Allocate2WayPartitionMemory(ptr noundef, ptr noundef) #2

declare ptr @__idxmalloc(i32 noundef, ptr noundef) #2

declare i32 @__idxsum(i32 noundef, ptr noundef) #2

declare ptr @__idxset(i32 noundef, i32 noundef, ptr noundef) #2

declare void @__Compute2WayPartitionParams(ptr noundef, ptr noundef) #2

declare void @__Balance2Way(ptr noundef, ptr noundef, ptr noundef, float noundef) #2

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !13, i64 16}
!12 = !{!"graphdef", !6, i64 0, !6, i64 8, !13, i64 16, !13, 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, !13, i64 88, !13, i64 92, !6, i64 96, !6, i64 104, !13, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !13, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !6, i64 24}
!16 = !{!12, !6, i64 32}
!17 = !{!12, !6, i64 48}
!18 = !{!12, !6, i64 56}
!19 = !{!12, !6, i64 96}
!20 = !{!21, !13, i64 0}
!21 = !{!"controldef", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !10, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !22, i64 48, !23, i64 104, !23, i64 112, !23, i64 120, !23, i64 128, !23, i64 136, !23, i64 144, !23, i64 152, !23, i64 160, !23, i64 168, !23, i64 176, !23, i64 184, !23, i64 192, !23, i64 200, !23, i64 208, !23, i64 216, !23, i64 224}
!22 = !{!"workspacedef", !6, i64 0, !13, i64 8, !13, i64 12, !6, i64 16, !6, i64 24, !13, i64 32, !6, i64 40, !6, i64 48}
!23 = !{!"double", !7, i64 0}
!24 = !{!12, !6, i64 64}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!12, !13, i64 88}
!28 = distinct !{!28, !26}


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

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

; Function Attrs: nounwind uwtable
define dso_local void @__RandomBisection(ptr noundef %0, ptr noundef %1, ptr noundef %2, float noundef %3) local_unnamed_addr #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %7 = getelementptr inbounds i8, ptr %1, i64 16
  %8 = load i32, ptr %7, align 8, !tbaa !5
  %.fr78 = freeze i32 %8
  %9 = getelementptr inbounds i8, ptr %1, i64 32
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  tail call void @__Allocate2WayPartitionMemory(ptr noundef %0, ptr noundef %1) #4
  %11 = getelementptr inbounds i8, ptr %1, i64 96
  %12 = load ptr, ptr %11, align 8, !tbaa !12
  %13 = tail call ptr @__idxmalloc(i32 noundef %.fr78, ptr noundef nonnull @.str.3) #4
  store ptr %13, ptr %6, align 8, !tbaa !13
  %14 = tail call ptr @__idxmalloc(i32 noundef %.fr78, ptr noundef nonnull @.str.4) #4
  store ptr %14, ptr %5, align 8, !tbaa !13
  %15 = load i32, ptr %2, align 4, !tbaa !14
  %16 = sitofp i32 %15 to float
  %17 = fmul float %16, %3
  %18 = fptosi float %17 to i32
  %19 = fpext float %3 to double
  %20 = fdiv double 1.000000e+00, %19
  %21 = sitofp i32 %15 to double
  %22 = fmul double %20, %21
  %23 = fptosi double %22 to i32
  %24 = load i32, ptr %0, align 8, !tbaa !15
  %.not = icmp sgt i32 %.fr78, %24
  %25 = select i1 %.not, i32 8, i32 3
  %26 = getelementptr inbounds i8, ptr %1, i64 64
  %27 = load ptr, ptr %26, align 8, !tbaa !20
  %28 = tail call i32 @__idxsum(i32 noundef %.fr78, ptr noundef %27) #4
  %29 = add nsw i32 %28, 1
  %30 = icmp sgt i32 %.fr78, 0
  %31 = getelementptr inbounds i8, ptr %1, i64 88
  %32 = sext i32 %.fr78 to i64
  %33 = shl nsw i64 %32, 2
  br i1 %30, label %.split.us.preheader, label %.split

.split.us.preheader:                              ; preds = %4
  %wide.trip.count = zext nneg i32 %.fr78 to i64
  br label %.split.us

.split.us:                                        ; preds = %.split.us.preheader, %52
  %.06575.us = phi i32 [ %.1.us, %52 ], [ %29, %.split.us.preheader ]
  %.06674.us = phi i32 [ %53, %52 ], [ %25, %.split.us.preheader ]
  tail call void @__RandomPermute(i32 noundef %.fr78, ptr noundef %14, i32 noundef 1) #4
  %34 = tail call ptr @__idxset(i32 noundef %.fr78, i32 noundef 1, ptr noundef %12) #4
  %.not69.us = icmp eq i32 %.06674.us, 1
  br i1 %.not69.us, label %.loopexit.us, label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.split.us, %47
  %indvars.iv = phi i64 [ %indvars.iv.next, %47 ], [ 0, %.split.us ]
  %.sroa.014.070.us = phi i32 [ %.sroa.014.1.us, %47 ], [ 0, %.split.us ]
  %35 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv
  %36 = load i32, ptr %35, align 4, !tbaa !14
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i32, ptr %10, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !14
  %40 = add nsw i32 %39, %.sroa.014.070.us
  %41 = icmp slt i32 %40, %18
  br i1 %41, label %42, label %47

42:                                               ; preds = %.lr.ph.us
  %43 = getelementptr inbounds i32, ptr %12, i64 %37
  store i32 0, ptr %43, align 4, !tbaa !14
  %44 = load i32, ptr %38, align 4, !tbaa !14
  %45 = add nsw i32 %44, %.sroa.014.070.us
  %46 = icmp sgt i32 %45, %23
  br i1 %46, label %.loopexit.us, label %47

47:                                               ; preds = %42, %.lr.ph.us
  %.sroa.014.1.us = phi i32 [ %45, %42 ], [ %.sroa.014.070.us, %.lr.ph.us ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit.us, label %.lr.ph.us, !llvm.loop !21

.loopexit.us:                                     ; preds = %47, %42, %.split.us
  tail call void @__Compute2WayPartitionParams(ptr noundef nonnull %0, ptr noundef %1) #4
  tail call void @__Balance2Way(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %2, float noundef %3) #4
  tail call void @__FM_2WayEdgeRefine(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %2, i32 noundef 4) #4
  %48 = load i32, ptr %31, align 8, !tbaa !23
  %49 = icmp sgt i32 %.06575.us, %48
  br i1 %49, label %50, label %52

50:                                               ; preds = %.loopexit.us
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %13, ptr align 1 %12, i64 %33, i1 false)
  %51 = icmp eq i32 %48, 0
  br i1 %51, label %.split77.us, label %52

52:                                               ; preds = %50, %.loopexit.us
  %.1.us = phi i32 [ %48, %50 ], [ %.06575.us, %.loopexit.us ]
  %53 = add nsw i32 %.06674.us, -1
  %54 = icmp sgt i32 %.06674.us, 1
  br i1 %54, label %.split.us, label %.split77.us, !llvm.loop !24

.split:                                           ; preds = %4, %60
  %.06575 = phi i32 [ %.1, %60 ], [ %29, %4 ]
  %.06674 = phi i32 [ %61, %60 ], [ %25, %4 ]
  tail call void @__RandomPermute(i32 noundef %.fr78, ptr noundef %14, i32 noundef 1) #4
  %55 = tail call ptr @__idxset(i32 noundef %.fr78, i32 noundef 1, ptr noundef %12) #4
  tail call void @__Compute2WayPartitionParams(ptr noundef nonnull %0, ptr noundef nonnull %1) #4
  tail call void @__Balance2Way(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, float noundef %3) #4
  tail call void @__FM_2WayEdgeRefine(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, i32 noundef 4) #4
  %56 = load i32, ptr %31, align 8, !tbaa !23
  %57 = icmp sgt i32 %.06575, %56
  br i1 %57, label %58, label %60

58:                                               ; preds = %.split
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %13, ptr align 1 %12, i64 %33, i1 false)
  %59 = icmp eq i32 %56, 0
  br i1 %59, label %.split77.us, label %60

60:                                               ; preds = %.split, %58
  %.1 = phi i32 [ %56, %58 ], [ %.06575, %.split ]
  %61 = add nsw i32 %.06674, -1
  %62 = icmp sgt i32 %.06674, 1
  br i1 %62, label %.split, label %.split77.us, !llvm.loop !24

.split77.us:                                      ; preds = %60, %58, %50, %52
  %.us-phi = phi i32 [ 0, %50 ], [ %.1.us, %52 ], [ 0, %58 ], [ %.1, %60 ]
  store i32 %.us-phi, ptr %31, align 8, !tbaa !23
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %12, ptr align 1 %13, i64 %33, i1 false)
  call void (ptr, ...) @GKfree(ptr noundef nonnull %6, ptr noundef nonnull %5, ptr noundef null) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  ret void
}

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

declare void @__Allocate2WayPartitionMemory(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @__idxmalloc(i32 noundef, ptr noundef) local_unnamed_addr #2

declare i32 @__idxsum(i32 noundef, ptr noundef) local_unnamed_addr #2

declare ptr @__idxset(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @__Compute2WayPartitionParams(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @__Balance2Way(ptr noundef, ptr noundef, ptr noundef, float noundef) local_unnamed_addr #2

declare void @__FM_2WayEdgeRefine(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

declare void @__RandomPermute(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 16}
!6 = !{!"graphdef", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !10, i64 88, !10, i64 92, !7, i64 96, !7, i64 104, !10, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !10, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 32}
!12 = !{!6, !7, i64 96}
!13 = !{!7, !7, i64 0}
!14 = !{!10, !10, i64 0}
!15 = !{!16, !10, i64 0}
!16 = !{!"controldef", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !17, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !18, i64 48, !19, i64 104, !19, i64 112, !19, i64 120, !19, i64 128, !19, i64 136, !19, i64 144, !19, i64 152, !19, i64 160, !19, i64 168, !19, i64 176, !19, i64 184, !19, i64 192, !19, i64 200, !19, i64 208, !19, i64 216, !19, i64 224}
!17 = !{!"float", !8, i64 0}
!18 = !{!"workspacedef", !7, i64 0, !10, i64 8, !10, i64 12, !7, i64 16, !7, i64 24, !10, i64 32, !7, i64 40, !7, i64 48}
!19 = !{!"double", !8, i64 0}
!20 = !{!6, !7, i64 64}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!6, !10, i64 88}
!24 = distinct !{!24, !22}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass