; LLVM IR from GGiecold-zz/Cluster_Ensembles :: src/Cluster_Ensembles/Hypergraph_Partitioning/metis-5.1.0/libmetis (kmetis)

; 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.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.ctrl_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, i32, float, ptr, ptr, ptr, float, double, double, double, double, double, double, double, double, double, double, double, double, ptr, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@gk_jbufs = external thread_local global [0 x [1 x %struct.__jmp_buf_tag]], align 8
@gk_cur_jbufs = external thread_local global i32, align 4
@.str = external hidden unnamed_addr constant [84 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @METIS_PartGraphKway(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11, ptr noundef %12) #0 {
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca i32, align 4
  store ptr %0, ptr %15, align 8, !tbaa !5
  store ptr %1, ptr %16, align 8, !tbaa !5
  store ptr %2, ptr %17, align 8, !tbaa !5
  store ptr %3, ptr %18, align 8, !tbaa !5
  store ptr %4, ptr %19, align 8, !tbaa !5
  store ptr %5, ptr %20, align 8, !tbaa !5
  store ptr %6, ptr %21, align 8, !tbaa !5
  store ptr %7, ptr %22, align 8, !tbaa !5
  store ptr %8, ptr %23, align 8, !tbaa !5
  store ptr %9, ptr %24, align 8, !tbaa !5
  store ptr %10, ptr %25, align 8, !tbaa !5
  store ptr %11, ptr %26, align 8, !tbaa !5
  store ptr %12, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 0, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  store i32 0, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %33 = call i32 (...) @gk_malloc_init()
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %36, label %35

35:                                               ; preds = %13
  store i32 -3, ptr %14, align 4
  store i32 1, ptr %32, align 4
  br label %192

36:                                               ; preds = %13
  %37 = call i32 (...) @gk_sigtrap()
  %38 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @gk_jbufs)
  %39 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @gk_cur_jbufs)
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [0 x [1 x %struct.__jmp_buf_tag]], ptr %38, i64 0, i64 %41
  %43 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %42, i64 0, i64 0
  %44 = call i32 @_setjmp(ptr noundef %43) #6
  store i32 %44, ptr %28, align 4, !tbaa !9
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %47

46:                                               ; preds = %36
  br label %179

47:                                               ; preds = %36
  %48 = load ptr, ptr %25, align 8, !tbaa !5
  %49 = load ptr, ptr %16, align 8, !tbaa !5
  %50 = load i32, ptr %49, align 4, !tbaa !9
  %51 = load ptr, ptr %22, align 8, !tbaa !5
  %52 = load i32, ptr %51, align 4, !tbaa !9
  %53 = load ptr, ptr %23, align 8, !tbaa !5
  %54 = load ptr, ptr %24, align 8, !tbaa !5
  %55 = call ptr @libmetis__SetupCtrl(i32 noundef 1, ptr noundef %48, i32 noundef %50, i32 noundef %52, ptr noundef %53, ptr noundef %54)
  store ptr %55, ptr %31, align 8, !tbaa !5
  %56 = load ptr, ptr %31, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %60, label %58

58:                                               ; preds = %47
  %59 = call i32 (...) @gk_siguntrap()
  store i32 -2, ptr %14, align 4
  store i32 1, ptr %32, align 4
  br label %192

60:                                               ; preds = %47
  %61 = load ptr, ptr %31, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.ctrl_t, ptr %61, i32 0, i32 18
  %63 = load i32, ptr %62, align 8, !tbaa !11
  %64 = icmp eq i32 %63, 1
  br i1 %64, label %65, label %70

65:                                               ; preds = %60
  %66 = load ptr, ptr %15, align 8, !tbaa !5
  %67 = load i32, ptr %66, align 4, !tbaa !9
  %68 = load ptr, ptr %17, align 8, !tbaa !5
  %69 = load ptr, ptr %18, align 8, !tbaa !5
  call void @libmetis__Change2CNumbering(i32 noundef %67, ptr noundef %68, ptr noundef %69)
  store i32 1, ptr %29, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %65, %60
  %71 = load ptr, ptr %31, align 8, !tbaa !5
  %72 = load ptr, ptr %15, align 8, !tbaa !5
  %73 = load i32, ptr %72, align 4, !tbaa !9
  %74 = load ptr, ptr %16, align 8, !tbaa !5
  %75 = load i32, ptr %74, align 4, !tbaa !9
  %76 = load ptr, ptr %17, align 8, !tbaa !5
  %77 = load ptr, ptr %18, align 8, !tbaa !5
  %78 = load ptr, ptr %19, align 8, !tbaa !5
  %79 = load ptr, ptr %20, align 8, !tbaa !5
  %80 = load ptr, ptr %21, align 8, !tbaa !5
  %81 = call ptr @libmetis__SetupGraph(ptr noundef %71, i32 noundef %73, i32 noundef %75, ptr noundef %76, ptr noundef %77, ptr noundef %78, ptr noundef %79, ptr noundef %80)
  store ptr %81, ptr %30, align 8, !tbaa !5
  %82 = load ptr, ptr %31, align 8, !tbaa !5
  %83 = load ptr, ptr %30, align 8, !tbaa !5
  call void @libmetis__SetupKWayBalMultipliers(ptr noundef %82, ptr noundef %83)
  %84 = load ptr, ptr %15, align 8, !tbaa !5
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = load ptr, ptr %22, align 8, !tbaa !5
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = call i32 @gk_log2(i32 noundef %87)
  %89 = mul nsw i32 20, %88
  %90 = sdiv i32 %85, %89
  %91 = load ptr, ptr %22, align 8, !tbaa !5
  %92 = load i32, ptr %91, align 4, !tbaa !9
  %93 = mul nsw i32 30, %92
  %94 = icmp sge i32 %90, %93
  br i1 %94, label %95, label %103

95:                                               ; preds = %70
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = load i32, ptr %96, align 4, !tbaa !9
  %98 = load ptr, ptr %22, align 8, !tbaa !5
  %99 = load i32, ptr %98, align 4, !tbaa !9
  %100 = call i32 @gk_log2(i32 noundef %99)
  %101 = mul nsw i32 20, %100
  %102 = sdiv i32 %97, %101
  br label %107

103:                                              ; preds = %70
  %104 = load ptr, ptr %22, align 8, !tbaa !5
  %105 = load i32, ptr %104, align 4, !tbaa !9
  %106 = mul nsw i32 30, %105
  br label %107

107:                                              ; preds = %103, %95
  %108 = phi i32 [ %102, %95 ], [ %106, %103 ]
  %109 = load ptr, ptr %31, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.ctrl_t, ptr %109, i32 0, i32 6
  store i32 %108, ptr %110, align 8, !tbaa !16
  %111 = load ptr, ptr %31, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.ctrl_t, ptr %111, i32 0, i32 6
  %113 = load i32, ptr %112, align 8, !tbaa !16
  %114 = load ptr, ptr %22, align 8, !tbaa !5
  %115 = load i32, ptr %114, align 4, !tbaa !9
  %116 = mul nsw i32 30, %115
  %117 = icmp eq i32 %113, %116
  %118 = zext i1 %117 to i64
  %119 = select i1 %117, i32 4, i32 5
  %120 = load ptr, ptr %31, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.ctrl_t, ptr %120, i32 0, i32 7
  store i32 %119, ptr %121, align 4, !tbaa !17
  %122 = load ptr, ptr %31, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.ctrl_t, ptr %122, i32 0, i32 10
  %124 = load i32, ptr %123, align 8, !tbaa !18
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %131

126:                                              ; preds = %107
  %127 = load ptr, ptr %30, align 8, !tbaa !5
  %128 = call i32 @libmetis__IsConnected(ptr noundef %127, i32 noundef 0)
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %131, label %130

130:                                              ; preds = %126
  call void (i32, ptr, ...) @gk_errexit(i32 noundef 15, ptr noundef @.str)
  br label %131

131:                                              ; preds = %130, %126, %107
  %132 = load ptr, ptr %31, align 8, !tbaa !5
  %133 = load ptr, ptr %30, align 8, !tbaa !5
  call void @libmetis__AllocateWorkSpace(ptr noundef %132, ptr noundef %133)
  %134 = load ptr, ptr %31, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.ctrl_t, ptr %134, i32 0, i32 2
  %136 = load i32, ptr %135, align 8, !tbaa !19
  %137 = and i32 %136, 2
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %141

139:                                              ; preds = %131
  %140 = load ptr, ptr %31, align 8, !tbaa !5
  call void @libmetis__InitTimers(ptr noundef %140)
  br label %141

141:                                              ; preds = %139, %131
  %142 = load ptr, ptr %31, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.ctrl_t, ptr %142, i32 0, i32 2
  %144 = load i32, ptr %143, align 8, !tbaa !19
  %145 = and i32 %144, 2
  %146 = icmp ne i32 %145, 0
  br i1 %146, label %147, label %153

147:                                              ; preds = %141
  %148 = call double @gk_CPUSeconds()
  %149 = load ptr, ptr %31, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.ctrl_t, ptr %149, i32 0, i32 27
  %151 = load double, ptr %150, align 8, !tbaa !20
  %152 = fsub double %151, %148
  store double %152, ptr %150, align 8, !tbaa !20
  br label %153

153:                                              ; preds = %147, %141
  %154 = load ptr, ptr %31, align 8, !tbaa !5
  %155 = load ptr, ptr %30, align 8, !tbaa !5
  %156 = load ptr, ptr %27, align 8, !tbaa !5
  %157 = call i32 @libmetis__MlevelKWayPartitioning(ptr noundef %154, ptr noundef %155, ptr noundef %156)
  %158 = load ptr, ptr %26, align 8, !tbaa !5
  store i32 %157, ptr %158, align 4, !tbaa !9
  %159 = load ptr, ptr %31, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.ctrl_t, ptr %159, i32 0, i32 2
  %161 = load i32, ptr %160, align 8, !tbaa !19
  %162 = and i32 %161, 2
  %163 = icmp ne i32 %162, 0
  br i1 %163, label %164, label %170

164:                                              ; preds = %153
  %165 = call double @gk_CPUSeconds()
  %166 = load ptr, ptr %31, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.ctrl_t, ptr %166, i32 0, i32 27
  %168 = load double, ptr %167, align 8, !tbaa !20
  %169 = fadd double %168, %165
  store double %169, ptr %167, align 8, !tbaa !20
  br label %170

170:                                              ; preds = %164, %153
  %171 = load ptr, ptr %31, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.ctrl_t, ptr %171, i32 0, i32 2
  %173 = load i32, ptr %172, align 8, !tbaa !19
  %174 = and i32 %173, 2
  %175 = icmp ne i32 %174, 0
  br i1 %175, label %176, label %178

176:                                              ; preds = %170
  %177 = load ptr, ptr %31, align 8, !tbaa !5
  call void @libmetis__PrintTimers(ptr noundef %177)
  br label %178

178:                                              ; preds = %176, %170
  call void @libmetis__FreeCtrl(ptr noundef %31)
  br label %179

179:                                              ; preds = %178, %46
  %180 = load i32, ptr %29, align 4, !tbaa !9
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %182, label %188

182:                                              ; preds = %179
  %183 = load ptr, ptr %15, align 8, !tbaa !5
  %184 = load i32, ptr %183, align 4, !tbaa !9
  %185 = load ptr, ptr %17, align 8, !tbaa !5
  %186 = load ptr, ptr %18, align 8, !tbaa !5
  %187 = load ptr, ptr %27, align 8, !tbaa !5
  call void @libmetis__Change2FNumbering(i32 noundef %184, ptr noundef %185, ptr noundef %186, ptr noundef %187)
  br label %188

188:                                              ; preds = %182, %179
  %189 = call i32 (...) @gk_siguntrap()
  call void @gk_malloc_cleanup(i32 noundef 0)
  %190 = load i32, ptr %28, align 4, !tbaa !9
  %191 = call i32 @libmetis__metis_rcode(i32 noundef %190)
  store i32 %191, ptr %14, align 4
  store i32 1, ptr %32, align 4
  br label %192

192:                                              ; preds = %188, %58, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  %193 = load i32, ptr %14, align 4
  ret i32 %193
}

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

declare i32 @gk_malloc_init(...) #2

declare i32 @gk_sigtrap(...) #2

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #4

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

declare i32 @gk_siguntrap(...) #2

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

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

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

declare i32 @gk_log2(i32 noundef) #2

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

declare void @gk_errexit(i32 noundef, ptr noundef, ...) #2

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

declare void @libmetis__InitTimers(ptr noundef) #2

declare double @gk_CPUSeconds() #2

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

declare void @libmetis__PrintTimers(ptr noundef) #2

declare void @libmetis__FreeCtrl(ptr noundef) #2

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

declare void @gk_malloc_cleanup(i32 noundef) #2

declare i32 @libmetis__metis_rcode(i32 noundef) #2

; 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 returns_twice "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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind returns_twice }

!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, !10, i64 72}
!12 = !{!"ctrl_t", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !6, i64 80, !10, i64 88, !10, i64 92, !13, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !13, i64 128, !14, i64 136, !14, i64 144, !14, i64 152, !14, i64 160, !14, i64 168, !14, i64 176, !14, i64 184, !14, i64 192, !14, i64 200, !14, i64 208, !14, i64 216, !14, i64 224, !6, i64 232, !15, i64 240, !15, i64 248, !15, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320}
!13 = !{!"float", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!12, !10, i64 24}
!17 = !{!12, !10, i64 28}
!18 = !{!12, !10, i64 40}
!19 = !{!12, !10, i64 8}
!20 = !{!12, !14, i64 136}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }

@gk_jbufs = external thread_local global [0 x [1 x %struct.__jmp_buf_tag]], align 8
@gk_cur_jbufs = external thread_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [84 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @METIS_PartGraphKway(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr nocapture noundef readonly %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr nocapture noundef writeonly %11, ptr noundef %12) local_unnamed_addr #0 {
  %14 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %15 = call i32 (...) @gk_malloc_init() #5
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %89, label %16

16:                                               ; preds = %13
  %17 = call i32 (...) @gk_sigtrap() #5
  %18 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @gk_jbufs)
  %19 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @gk_cur_jbufs)
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [0 x [1 x %struct.__jmp_buf_tag]], ptr %18, i64 0, i64 %21
  %23 = call i32 @_setjmp(ptr noundef nonnull %22) #6
  %.not37 = icmp eq i32 %23, 0
  br i1 %.not37, label %24, label %.critedge

24:                                               ; preds = %16
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = load i32, ptr %7, align 4, !tbaa !5
  %27 = call ptr @libmetis__SetupCtrl(i32 noundef 1, ptr noundef %10, i32 noundef %25, i32 noundef %26, ptr noundef %8, ptr noundef %9) #5
  store ptr %27, ptr %14, align 8, !tbaa !9
  %.not38 = icmp eq ptr %27, null
  br i1 %.not38, label %28, label %30

28:                                               ; preds = %24
  %29 = call i32 (...) @gk_siguntrap() #5
  br label %89

30:                                               ; preds = %24
  %31 = getelementptr inbounds i8, ptr %27, i64 72
  %32 = load i32, ptr %31, align 8, !tbaa !11
  %.not47 = icmp eq i32 %32, 1
  br i1 %.not47, label %33, label %35

33:                                               ; preds = %30
  %34 = load i32, ptr %0, align 4, !tbaa !5
  call void @libmetis__Change2CNumbering(i32 noundef %34, ptr noundef %2, ptr noundef %3) #5
  br label %35

35:                                               ; preds = %33, %30
  %36 = load i32, ptr %0, align 4, !tbaa !5
  %37 = load i32, ptr %1, align 4, !tbaa !5
  %38 = call ptr @libmetis__SetupGraph(ptr noundef nonnull %27, i32 noundef %36, i32 noundef %37, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #5
  call void @libmetis__SetupKWayBalMultipliers(ptr noundef nonnull %27, ptr noundef %38) #5
  %39 = load i32, ptr %0, align 4, !tbaa !5
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = call i32 @gk_log2(i32 noundef %40) #5
  %42 = mul nsw i32 %41, 20
  %43 = sdiv i32 %39, %42
  %44 = load i32, ptr %7, align 4, !tbaa !5
  %45 = mul nsw i32 %44, 30
  %.not39 = icmp slt i32 %43, %45
  br i1 %.not39, label %51, label %46

46:                                               ; preds = %35
  %47 = load i32, ptr %0, align 4, !tbaa !5
  %48 = call i32 @gk_log2(i32 noundef %44) #5
  %49 = mul nsw i32 %48, 20
  %50 = sdiv i32 %47, %49
  br label %51

51:                                               ; preds = %35, %46
  %52 = phi i32 [ %50, %46 ], [ %45, %35 ]
  %53 = getelementptr inbounds i8, ptr %27, i64 24
  store i32 %52, ptr %53, align 8, !tbaa !16
  %54 = load i32, ptr %7, align 4, !tbaa !5
  %55 = mul nsw i32 %54, 30
  %56 = icmp eq i32 %52, %55
  %57 = select i1 %56, i32 4, i32 5
  %58 = getelementptr inbounds i8, ptr %27, i64 28
  store i32 %57, ptr %58, align 4, !tbaa !17
  %59 = getelementptr inbounds i8, ptr %27, i64 40
  %60 = load i32, ptr %59, align 8, !tbaa !18
  %.not40 = icmp eq i32 %60, 0
  br i1 %.not40, label %64, label %61

61:                                               ; preds = %51
  %62 = call i32 @libmetis__IsConnected(ptr noundef %38, i32 noundef 0) #5
  %.not41 = icmp eq i32 %62, 0
  br i1 %.not41, label %63, label %64

63:                                               ; preds = %61
  call void (i32, ptr, ...) @gk_errexit(i32 noundef 15, ptr noundef nonnull @.str) #5
  br label %64

64:                                               ; preds = %63, %61, %51
  call void @libmetis__AllocateWorkSpace(ptr noundef nonnull %27, ptr noundef %38) #5
  %65 = getelementptr inbounds i8, ptr %27, i64 8
  %66 = load i32, ptr %65, align 8, !tbaa !19
  %67 = and i32 %66, 2
  %.not42 = icmp eq i32 %67, 0
  br i1 %.not42, label %.thread, label %68

68:                                               ; preds = %64
  call void @libmetis__InitTimers(ptr noundef nonnull %27) #5
  %.pre = load i32, ptr %65, align 8, !tbaa !19
  %.pre49 = and i32 %.pre, 2
  %69 = icmp eq i32 %.pre49, 0
  br i1 %69, label %.thread, label %70

70:                                               ; preds = %68
  %71 = call double @gk_CPUSeconds() #5
  %72 = getelementptr inbounds i8, ptr %27, i64 136
  %73 = load double, ptr %72, align 8, !tbaa !20
  %74 = fsub double %73, %71
  store double %74, ptr %72, align 8, !tbaa !20
  br label %.thread

.thread:                                          ; preds = %64, %70, %68
  %75 = call i32 @libmetis__MlevelKWayPartitioning(ptr noundef nonnull %27, ptr noundef %38, ptr noundef %12)
  store i32 %75, ptr %11, align 4, !tbaa !5
  %76 = load i32, ptr %65, align 8, !tbaa !19
  %77 = and i32 %76, 2
  %.not44 = icmp eq i32 %77, 0
  br i1 %.not44, label %.thread53, label %78

78:                                               ; preds = %.thread
  %79 = call double @gk_CPUSeconds() #5
  %80 = getelementptr inbounds i8, ptr %27, i64 136
  %81 = load double, ptr %80, align 8, !tbaa !20
  %82 = fadd double %79, %81
  store double %82, ptr %80, align 8, !tbaa !20
  %.pre48 = load i32, ptr %65, align 8, !tbaa !19
  %.pre50 = and i32 %.pre48, 2
  %83 = icmp eq i32 %.pre50, 0
  br i1 %83, label %.thread53, label %84

84:                                               ; preds = %78
  call void @libmetis__PrintTimers(ptr noundef nonnull %27) #5
  br label %.thread53

.thread53:                                        ; preds = %.thread, %84, %78
  call void @libmetis__FreeCtrl(ptr noundef nonnull %14) #5
  br i1 %.not47, label %85, label %.critedge

85:                                               ; preds = %.thread53
  %86 = load i32, ptr %0, align 4, !tbaa !5
  call void @libmetis__Change2FNumbering(i32 noundef %86, ptr noundef %2, ptr noundef %3, ptr noundef %12) #5
  br label %.critedge

.critedge:                                        ; preds = %16, %85, %.thread53
  %87 = call i32 (...) @gk_siguntrap() #5
  call void @gk_malloc_cleanup(i32 noundef 0) #5
  %88 = call i32 @libmetis__metis_rcode(i32 noundef %23) #5
  br label %89

89:                                               ; preds = %13, %.critedge, %28
  %.0 = phi i32 [ %88, %.critedge ], [ -2, %28 ], [ -3, %13 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  ret i32 %.0
}

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

declare i32 @gk_malloc_init(...) local_unnamed_addr #2

declare i32 @gk_sigtrap(...) local_unnamed_addr #2

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #4

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

declare i32 @gk_siguntrap(...) local_unnamed_addr #2

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

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

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

declare i32 @gk_log2(i32 noundef) local_unnamed_addr #2

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

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

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

declare void @libmetis__InitTimers(ptr noundef) local_unnamed_addr #2

declare double @gk_CPUSeconds() local_unnamed_addr #2

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

declare void @libmetis__PrintTimers(ptr noundef) local_unnamed_addr #2

declare void @libmetis__FreeCtrl(ptr noundef) local_unnamed_addr #2

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

declare void @gk_malloc_cleanup(i32 noundef) local_unnamed_addr #2

declare i32 @libmetis__metis_rcode(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress 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 = { mustprogress 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 returns_twice "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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind returns_twice }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 72}
!12 = !{!"ctrl_t", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !6, i64 64, !6, i64 68, !6, i64 72, !10, i64 80, !6, i64 88, !6, i64 92, !13, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !13, i64 128, !14, i64 136, !14, i64 144, !14, i64 152, !14, i64 160, !14, i64 168, !14, i64 176, !14, i64 184, !14, i64 192, !14, i64 200, !14, i64 208, !14, i64 216, !14, i64 224, !10, i64 232, !15, i64 240, !15, i64 248, !15, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !10, i64 320}
!13 = !{!"float", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!12, !6, i64 24}
!17 = !{!12, !6, i64 28}
!18 = !{!12, !6, i64 40}
!19 = !{!12, !6, i64 8}
!20 = !{!12, !14, i64 136}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass