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

; 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.graph_t = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, ptr, ptr, i32, i32, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%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 }

@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [26 x i8], align 1

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

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

declare void @libmetis__Compute2WayPartitionParams(ptr noundef, ptr noundef) #1

declare void @libmetis__wspacepush(ptr noundef) #1

declare ptr @libmetis__iwspacemalloc(ptr noundef, i32 noundef) #1

declare ptr @libmetis__iset(i64 noundef, i32 noundef, ptr noundef) #1

declare void @libmetis__FM_2WayRefine(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

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

declare void @libmetis__wspacepop(ptr noundef) #1

declare i32 @libmetis__irandInRange(i32 noundef) #1

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

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

declare void @libmetis__Compute2WayNodePartitionParams(ptr noundef, ptr noundef) #1

declare void @libmetis__FM_2WayNodeRefine2Sided(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @GrowBisectionNode2(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, 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 i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = 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 i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  call void @libmetis__wspacepush(ptr noundef %20)
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.graph_t, ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !11
  store i32 %23, ptr %12, align 4, !tbaa !9
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.graph_t, ptr %24, i32 0, i32 3
  %26 = load ptr, ptr %25, align 8, !tbaa !13
  store ptr %26, ptr %16, align 8, !tbaa !5
  %27 = call ptr @libmetis__imalloc(i64 noundef 3, ptr noundef @.str.7)
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.graph_t, ptr %28, i32 0, i32 20
  store ptr %27, ptr %29, align 8, !tbaa !14
  %30 = load i32, ptr %12, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = call ptr @libmetis__imalloc(i64 noundef %31, ptr noundef @.str.8)
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.graph_t, ptr %33, i32 0, i32 19
  store ptr %32, ptr %34, align 8, !tbaa !15
  %35 = load i32, ptr %12, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = call ptr @libmetis__imalloc(i64 noundef %36, ptr noundef @.str.9)
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.graph_t, ptr %38, i32 0, i32 22
  store ptr %37, ptr %39, align 8, !tbaa !16
  %40 = load i32, ptr %12, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = call ptr @libmetis__imalloc(i64 noundef %41, ptr noundef @.str.10)
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.graph_t, ptr %43, i32 0, i32 23
  store ptr %42, ptr %44, align 8, !tbaa !17
  %45 = load i32, ptr %12, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = call ptr @libmetis__imalloc(i64 noundef %46, ptr noundef @.str.11)
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.graph_t, ptr %48, i32 0, i32 24
  store ptr %47, ptr %49, align 8, !tbaa !18
  %50 = load i32, ptr %12, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = call ptr @libmetis__imalloc(i64 noundef %51, ptr noundef @.str.12)
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.graph_t, ptr %53, i32 0, i32 25
  store ptr %52, ptr %54, align 8, !tbaa !19
  %55 = load i32, ptr %12, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = mul i64 %56, 8
  %58 = call ptr @gk_malloc(i64 noundef %57, ptr noundef @.str.13)
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.graph_t, ptr %59, i32 0, i32 28
  store ptr %58, ptr %60, align 8, !tbaa !20
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = load i32, ptr %12, align 4, !tbaa !9
  %63 = call ptr @libmetis__iwspacemalloc(ptr noundef %61, i32 noundef %62)
  store ptr %63, ptr %19, align 8, !tbaa !5
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.graph_t, ptr %64, i32 0, i32 19
  %66 = load ptr, ptr %65, align 8, !tbaa !15
  store ptr %66, ptr %17, align 8, !tbaa !5
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.graph_t, ptr %67, i32 0, i32 23
  %69 = load ptr, ptr %68, align 8, !tbaa !17
  store ptr %69, ptr %18, align 8, !tbaa !5
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %156, %4
  %71 = load i32, ptr %15, align 4, !tbaa !9
  %72 = load i32, ptr %8, align 4, !tbaa !9
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %74, label %159

74:                                               ; preds = %70
  %75 = load i32, ptr %12, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = load ptr, ptr %17, align 8, !tbaa !5
  %78 = call ptr @libmetis__iset(i64 noundef %76, i32 noundef 1, ptr noundef %77)
  %79 = load i32, ptr %15, align 4, !tbaa !9
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %81, label %87

81:                                               ; preds = %74
  %82 = load ptr, ptr %17, align 8, !tbaa !5
  %83 = load i32, ptr %12, align 4, !tbaa !9
  %84 = call i32 @libmetis__irandInRange(i32 noundef %83)
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i32, ptr %82, i64 %85
  store i32 0, ptr %86, align 4, !tbaa !9
  br label %87

87:                                               ; preds = %81, %74
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  call void @libmetis__Compute2WayPartitionParams(ptr noundef %88, ptr noundef %89)
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__General2WayBalance(ptr noundef %90, ptr noundef %91, ptr noundef %92)
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ctrl_t, ptr %96, i32 0, i32 17
  %98 = load i32, ptr %97, align 4, !tbaa !21
  call void @libmetis__FM_2WayRefine(ptr noundef %93, ptr noundef %94, ptr noundef %95, i32 noundef %98)
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %99

99:                                               ; preds = %130, %87
  %100 = load i32, ptr %9, align 4, !tbaa !9
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.graph_t, ptr %101, i32 0, i32 21
  %103 = load i32, ptr %102, align 8, !tbaa !26
  %104 = icmp slt i32 %100, %103
  br i1 %104, label %105, label %133

105:                                              ; preds = %99
  %106 = load ptr, ptr %18, align 8, !tbaa !5
  %107 = load i32, ptr %9, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds i32, ptr %106, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !9
  store i32 %110, ptr %10, align 4, !tbaa !9
  %111 = load ptr, ptr %16, align 8, !tbaa !5
  %112 = load i32, ptr %10, align 4, !tbaa !9
  %113 = add nsw i32 %112, 1
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr %111, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !9
  %117 = load ptr, ptr %16, align 8, !tbaa !5
  %118 = load i32, ptr %10, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i32, ptr %117, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !9
  %122 = sub nsw i32 %116, %121
  %123 = icmp sgt i32 %122, 0
  br i1 %123, label %124, label %129

124:                                              ; preds = %105
  %125 = load ptr, ptr %17, align 8, !tbaa !5
  %126 = load i32, ptr %10, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i32, ptr %125, i64 %127
  store i32 2, ptr %128, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %124, %105
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %9, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %9, align 4, !tbaa !9
  br label %99, !llvm.loop !27

133:                                              ; preds = %99
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  call void @libmetis__Compute2WayNodePartitionParams(ptr noundef %134, ptr noundef %135)
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  call void @libmetis__FM_2WayNodeRefine2Sided(ptr noundef %136, ptr noundef %137, i32 noundef 4)
  %138 = load i32, ptr %15, align 4, !tbaa !9
  %139 = icmp eq i32 %138, 0
  br i1 %139, label %146, label %140

140:                                              ; preds = %133
  %141 = load i32, ptr %13, align 4, !tbaa !9
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.graph_t, ptr %142, i32 0, i32 17
  %144 = load i32, ptr %143, align 8, !tbaa !29
  %145 = icmp sgt i32 %141, %144
  br i1 %145, label %146, label %155

146:                                              ; preds = %140, %133
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.graph_t, ptr %147, i32 0, i32 17
  %149 = load i32, ptr %148, align 8, !tbaa !29
  store i32 %149, ptr %13, align 4, !tbaa !9
  %150 = load i32, ptr %12, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = load ptr, ptr %17, align 8, !tbaa !5
  %153 = load ptr, ptr %19, align 8, !tbaa !5
  %154 = call ptr @libmetis__icopy(i64 noundef %151, ptr noundef %152, ptr noundef %153)
  br label %155

155:                                              ; preds = %146, %140
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %15, align 4, !tbaa !9
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %15, align 4, !tbaa !9
  br label %70, !llvm.loop !30

159:                                              ; preds = %70
  %160 = load i32, ptr %13, align 4, !tbaa !9
  %161 = load ptr, ptr %6, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.graph_t, ptr %161, i32 0, i32 17
  store i32 %160, ptr %162, align 8, !tbaa !29
  %163 = load i32, ptr %12, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = load ptr, ptr %19, align 8, !tbaa !5
  %166 = load ptr, ptr %17, align 8, !tbaa !5
  %167 = call ptr @libmetis__icopy(i64 noundef %164, ptr noundef %165, ptr noundef %166)
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  call void @libmetis__wspacepop(ptr noundef %168)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret void
}

declare void @libmetis__General2WayBalance(ptr noundef, ptr noundef, ptr noundef) #1

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

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

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


; 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.7 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [26 x i8], align 1

declare void @libmetis__Compute2WayPartitionParams(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @libmetis__wspacepush(ptr noundef) local_unnamed_addr #0

declare ptr @libmetis__iwspacemalloc(ptr noundef, i32 noundef) local_unnamed_addr #0

declare ptr @libmetis__iset(i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare void @libmetis__FM_2WayRefine(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

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

declare void @libmetis__wspacepop(ptr noundef) local_unnamed_addr #0

declare i32 @libmetis__irandInRange(i32 noundef) local_unnamed_addr #0

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

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

declare void @libmetis__Compute2WayNodePartitionParams(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @libmetis__FM_2WayNodeRefine2Sided(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @GrowBisectionNode2(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #1 {
  tail call void @libmetis__wspacepush(ptr noundef %0) #2
  %5 = load i32, ptr %1, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !11
  %8 = tail call ptr @libmetis__imalloc(i64 noundef 3, ptr noundef nonnull @.str.7) #2
  %9 = getelementptr inbounds i8, ptr %1, i64 128
  store ptr %8, ptr %9, align 8, !tbaa !12
  %10 = sext i32 %5 to i64
  %11 = tail call ptr @libmetis__imalloc(i64 noundef %10, ptr noundef nonnull @.str.8) #2
  %12 = getelementptr inbounds i8, ptr %1, i64 120
  store ptr %11, ptr %12, align 8, !tbaa !13
  %13 = tail call ptr @libmetis__imalloc(i64 noundef %10, ptr noundef nonnull @.str.9) #2
  %14 = getelementptr inbounds i8, ptr %1, i64 144
  store ptr %13, ptr %14, align 8, !tbaa !14
  %15 = tail call ptr @libmetis__imalloc(i64 noundef %10, ptr noundef nonnull @.str.10) #2
  %16 = getelementptr inbounds i8, ptr %1, i64 152
  store ptr %15, ptr %16, align 8, !tbaa !15
  %17 = tail call ptr @libmetis__imalloc(i64 noundef %10, ptr noundef nonnull @.str.11) #2
  %18 = getelementptr inbounds i8, ptr %1, i64 160
  store ptr %17, ptr %18, align 8, !tbaa !16
  %19 = tail call ptr @libmetis__imalloc(i64 noundef %10, ptr noundef nonnull @.str.12) #2
  %20 = getelementptr inbounds i8, ptr %1, i64 168
  store ptr %19, ptr %20, align 8, !tbaa !17
  %21 = shl nsw i64 %10, 3
  %22 = tail call ptr @gk_malloc(i64 noundef %21, ptr noundef nonnull @.str.13) #2
  %23 = getelementptr inbounds i8, ptr %1, i64 192
  store ptr %22, ptr %23, align 8, !tbaa !18
  %24 = tail call ptr @libmetis__iwspacemalloc(ptr noundef %0, i32 noundef %5) #2
  %25 = load ptr, ptr %12, align 8, !tbaa !13
  %26 = load ptr, ptr %16, align 8, !tbaa !15
  %27 = icmp sgt i32 %3, 0
  br i1 %27, label %.lr.ph70, label %._crit_edge71

.lr.ph70:                                         ; preds = %4
  %28 = getelementptr inbounds i8, ptr %0, i64 68
  %29 = getelementptr inbounds i8, ptr %1, i64 136
  %30 = getelementptr inbounds i8, ptr %1, i64 112
  br label %31

31:                                               ; preds = %.lr.ph70, %59
  %.06468 = phi i32 [ 0, %.lr.ph70 ], [ %.1, %59 ]
  %.06567 = phi i32 [ 0, %.lr.ph70 ], [ %60, %59 ]
  %32 = tail call ptr @libmetis__iset(i64 noundef %10, i32 noundef 1, ptr noundef %25) #2
  %.not = icmp eq i32 %.06567, 0
  br i1 %.not, label %37, label %33

33:                                               ; preds = %31
  %34 = tail call i32 @libmetis__irandInRange(i32 noundef %5) #2
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i32, ptr %25, i64 %35
  store i32 0, ptr %36, align 4, !tbaa !19
  br label %37

37:                                               ; preds = %33, %31
  tail call void @libmetis__Compute2WayPartitionParams(ptr noundef %0, ptr noundef nonnull %1) #2
  tail call void @libmetis__General2WayBalance(ptr noundef %0, ptr noundef nonnull %1, ptr noundef %2) #2
  %38 = load i32, ptr %28, align 4, !tbaa !20
  tail call void @libmetis__FM_2WayRefine(ptr noundef %0, ptr noundef nonnull %1, ptr noundef %2, i32 noundef %38) #2
  %39 = load i32, ptr %29, align 8, !tbaa !25
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %37, %52
  %41 = phi i32 [ %53, %52 ], [ %39, %37 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %52 ], [ 0, %37 ]
  %42 = getelementptr inbounds i32, ptr %26, i64 %indvars.iv
  %43 = load i32, ptr %42, align 4, !tbaa !19
  %44 = sext i32 %43 to i64
  %45 = getelementptr i32, ptr %7, i64 %44
  %46 = getelementptr i8, ptr %45, i64 4
  %47 = load i32, ptr %46, align 4, !tbaa !19
  %48 = load i32, ptr %45, align 4, !tbaa !19
  %49 = icmp sgt i32 %47, %48
  br i1 %49, label %50, label %52

50:                                               ; preds = %.lr.ph
  %51 = getelementptr inbounds i32, ptr %25, i64 %44
  store i32 2, ptr %51, align 4, !tbaa !19
  %.pre = load i32, ptr %29, align 8, !tbaa !25
  br label %52

52:                                               ; preds = %.lr.ph, %50
  %53 = phi i32 [ %41, %.lr.ph ], [ %.pre, %50 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %54 = sext i32 %53 to i64
  %55 = icmp slt i64 %indvars.iv.next, %54
  br i1 %55, label %.lr.ph, label %._crit_edge, !llvm.loop !26

._crit_edge:                                      ; preds = %52, %37
  tail call void @libmetis__Compute2WayNodePartitionParams(ptr noundef %0, ptr noundef nonnull %1) #2
  tail call void @libmetis__FM_2WayNodeRefine2Sided(ptr noundef %0, ptr noundef nonnull %1, i32 noundef 4) #2
  %.pre73 = load i32, ptr %30, align 8, !tbaa !28
  %56 = icmp sgt i32 %.06468, %.pre73
  %or.cond = select i1 %.not, i1 true, i1 %56
  br i1 %or.cond, label %57, label %59

57:                                               ; preds = %._crit_edge
  %58 = tail call ptr @libmetis__icopy(i64 noundef %10, ptr noundef %25, ptr noundef %24) #2
  br label %59

59:                                               ; preds = %._crit_edge, %57
  %.1 = phi i32 [ %.pre73, %57 ], [ %.06468, %._crit_edge ]
  %60 = add nuw nsw i32 %.06567, 1
  %exitcond.not = icmp eq i32 %60, %3
  br i1 %exitcond.not, label %._crit_edge71, label %31, !llvm.loop !29

._crit_edge71:                                    ; preds = %59, %4
  %.064.lcssa = phi i32 [ 0, %4 ], [ %.1, %59 ]
  %61 = getelementptr inbounds i8, ptr %1, i64 112
  store i32 %.064.lcssa, ptr %61, align 8, !tbaa !28
  %62 = tail call ptr @libmetis__icopy(i64 noundef %10, ptr noundef %24, ptr noundef %25) #2
  tail call void @libmetis__wspacepop(ptr noundef %0) #2
  ret void
}

declare void @libmetis__General2WayBalance(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

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

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


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