; LLVM IR from ekoontz/graphlab :: src/graphlab/extern/metis/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.graphdef = type { i64, i64, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i64, i64, ptr, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr, ptr, ptr, ptr }
%struct.controldef = type { i64, i64, i64, i64, i64, i64, float, i64, i64, i64, i64, %struct.workspacedef, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
%struct.workspacedef = type { ptr, i64, i64, ptr, ptr, i64, ptr, ptr }

; 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 @METIS_WPartGraphKway(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) #1 {
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %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 i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca %struct.graphdef, align 8
  %28 = alloca %struct.controldef, align 8
  store ptr %0, ptr %13, align 8, !tbaa !5
  store ptr %1, ptr %14, align 8, !tbaa !5
  store ptr %2, ptr %15, align 8, !tbaa !5
  store ptr %3, ptr %16, align 8, !tbaa !5
  store ptr %4, ptr %17, align 8, !tbaa !5
  store ptr %5, ptr %18, align 8, !tbaa !5
  store ptr %6, ptr %19, align 8, !tbaa !5
  store ptr %7, ptr %20, align 8, !tbaa !5
  store ptr %8, ptr %21, align 8, !tbaa !5
  store ptr %9, ptr %22, align 8, !tbaa !5
  store ptr %10, ptr %23, align 8, !tbaa !5
  store ptr %11, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.start.p0(i64 248, ptr %27) #3
  call void @llvm.lifetime.start.p0(i64 280, ptr %28) #3
  %29 = load ptr, ptr %19, align 8, !tbaa !5
  %30 = load i64, ptr %29, align 8, !tbaa !9
  %31 = icmp eq i64 %30, 1
  br i1 %31, label %32, label %37

32:                                               ; preds = %12
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  %36 = load ptr, ptr %15, align 8, !tbaa !5
  call void @libmetis__Change2CNumbering(i64 noundef %34, ptr noundef %35, ptr noundef %36)
  br label %37

37:                                               ; preds = %32, %12
  %38 = load ptr, ptr %13, align 8, !tbaa !5
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  %41 = load ptr, ptr %15, align 8, !tbaa !5
  %42 = load ptr, ptr %16, align 8, !tbaa !5
  %43 = load ptr, ptr %17, align 8, !tbaa !5
  %44 = load ptr, ptr %18, align 8, !tbaa !5
  %45 = load i64, ptr %44, align 8, !tbaa !9
  call void @libmetis__SetUpGraph(ptr noundef %27, i64 noundef 2, i64 noundef %39, i64 noundef 1, ptr noundef %40, ptr noundef %41, ptr noundef %42, ptr noundef %43, i64 noundef %45)
  %46 = load ptr, ptr %22, align 8, !tbaa !5
  %47 = getelementptr inbounds i64, ptr %46, i64 0
  %48 = load i64, ptr %47, align 8, !tbaa !9
  %49 = icmp eq i64 %48, 0
  br i1 %49, label %50, label %55

50:                                               ; preds = %37
  %51 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 2
  store i64 3, ptr %51, align 8, !tbaa !11
  %52 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 3
  store i64 1, ptr %52, align 8, !tbaa !16
  %53 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 4
  store i64 3, ptr %53, align 8, !tbaa !17
  %54 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 1
  store i64 0, ptr %54, align 8, !tbaa !18
  br label %72

55:                                               ; preds = %37
  %56 = load ptr, ptr %22, align 8, !tbaa !5
  %57 = getelementptr inbounds i64, ptr %56, i64 1
  %58 = load i64, ptr %57, align 8, !tbaa !9
  %59 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 2
  store i64 %58, ptr %59, align 8, !tbaa !11
  %60 = load ptr, ptr %22, align 8, !tbaa !5
  %61 = getelementptr inbounds i64, ptr %60, i64 2
  %62 = load i64, ptr %61, align 8, !tbaa !9
  %63 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 3
  store i64 %62, ptr %63, align 8, !tbaa !16
  %64 = load ptr, ptr %22, align 8, !tbaa !5
  %65 = getelementptr inbounds i64, ptr %64, i64 3
  %66 = load i64, ptr %65, align 8, !tbaa !9
  %67 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 4
  store i64 %66, ptr %67, align 8, !tbaa !17
  %68 = load ptr, ptr %22, align 8, !tbaa !5
  %69 = getelementptr inbounds i64, ptr %68, i64 4
  %70 = load i64, ptr %69, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 1
  store i64 %70, ptr %71, align 8, !tbaa !18
  br label %72

72:                                               ; preds = %55, %50
  %73 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 7
  store i64 2, ptr %73, align 8, !tbaa !19
  %74 = load ptr, ptr %13, align 8, !tbaa !5
  %75 = load i64, ptr %74, align 8, !tbaa !9
  %76 = load ptr, ptr %20, align 8, !tbaa !5
  %77 = load i64, ptr %76, align 8, !tbaa !9
  %78 = trunc i64 %77 to i32
  %79 = call i32 @gk_log2(i32 noundef %78)
  %80 = mul nsw i32 40, %79
  %81 = sext i32 %80 to i64
  %82 = sdiv i64 %75, %81
  %83 = load ptr, ptr %20, align 8, !tbaa !5
  %84 = load i64, ptr %83, align 8, !tbaa !9
  %85 = mul nsw i64 20, %84
  %86 = icmp sge i64 %82, %85
  br i1 %86, label %87, label %97

87:                                               ; preds = %72
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  %89 = load i64, ptr %88, align 8, !tbaa !9
  %90 = load ptr, ptr %20, align 8, !tbaa !5
  %91 = load i64, ptr %90, align 8, !tbaa !9
  %92 = trunc i64 %91 to i32
  %93 = call i32 @gk_log2(i32 noundef %92)
  %94 = mul nsw i32 40, %93
  %95 = sext i32 %94 to i64
  %96 = sdiv i64 %89, %95
  br label %101

97:                                               ; preds = %72
  %98 = load ptr, ptr %20, align 8, !tbaa !5
  %99 = load i64, ptr %98, align 8, !tbaa !9
  %100 = mul nsw i64 20, %99
  br label %101

101:                                              ; preds = %97, %87
  %102 = phi i64 [ %96, %87 ], [ %100, %97 ]
  %103 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 0
  store i64 %102, ptr %103, align 8, !tbaa !20
  %104 = getelementptr inbounds %struct.graphdef, ptr %27, i32 0, i32 3
  %105 = load ptr, ptr %104, align 8, !tbaa !21
  %106 = icmp ne ptr %105, null
  br i1 %106, label %107, label %113

107:                                              ; preds = %101
  %108 = load ptr, ptr %13, align 8, !tbaa !5
  %109 = load i64, ptr %108, align 8, !tbaa !9
  %110 = getelementptr inbounds %struct.graphdef, ptr %27, i32 0, i32 3
  %111 = load ptr, ptr %110, align 8, !tbaa !21
  %112 = call i64 @libmetis__idxsum(i64 noundef %109, ptr noundef %111, i64 noundef 1)
  br label %116

113:                                              ; preds = %101
  %114 = load ptr, ptr %13, align 8, !tbaa !5
  %115 = load i64, ptr %114, align 8, !tbaa !9
  br label %116

116:                                              ; preds = %113, %107
  %117 = phi i64 [ %112, %107 ], [ %115, %113 ]
  %118 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 0
  %119 = load i64, ptr %118, align 8, !tbaa !20
  %120 = sdiv i64 %117, %119
  %121 = sitofp i64 %120 to double
  %122 = fmul double 1.500000e+00, %121
  %123 = fptosi double %122 to i64
  %124 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 5
  store i64 %123, ptr %124, align 8, !tbaa !24
  call void @libmetis__InitRandom(i64 noundef -1)
  %125 = load ptr, ptr %20, align 8, !tbaa !5
  %126 = load i64, ptr %125, align 8, !tbaa !9
  call void @libmetis__AllocateWorkSpace(ptr noundef %28, ptr noundef %27, i64 noundef %126)
  %127 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 1
  %128 = load i64, ptr %127, align 8, !tbaa !18
  %129 = and i64 %128, 1
  %130 = icmp ne i64 %129, 0
  br i1 %130, label %131, label %132

131:                                              ; preds = %116
  call void @libmetis__InitTimers(ptr noundef %28)
  br label %132

132:                                              ; preds = %131, %116
  %133 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 1
  %134 = load i64, ptr %133, align 8, !tbaa !18
  %135 = and i64 %134, 1
  %136 = icmp ne i64 %135, 0
  br i1 %136, label %137, label %142

137:                                              ; preds = %132
  %138 = call double @gk_CPUSeconds()
  %139 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 12
  %140 = load double, ptr %139, align 8, !tbaa !25
  %141 = fsub double %140, %138
  store double %141, ptr %139, align 8, !tbaa !25
  br label %142

142:                                              ; preds = %137, %132
  %143 = load ptr, ptr %20, align 8, !tbaa !5
  %144 = load i64, ptr %143, align 8, !tbaa !9
  %145 = load ptr, ptr %24, align 8, !tbaa !5
  %146 = load ptr, ptr %21, align 8, !tbaa !5
  %147 = call i64 @libmetis__MlevelKWayPartitioning(ptr noundef %28, ptr noundef %27, i64 noundef %144, ptr noundef %145, ptr noundef %146, float noundef 0x3FF07AE140000000)
  %148 = load ptr, ptr %23, align 8, !tbaa !5
  store i64 %147, ptr %148, align 8, !tbaa !9
  %149 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 1
  %150 = load i64, ptr %149, align 8, !tbaa !18
  %151 = and i64 %150, 1
  %152 = icmp ne i64 %151, 0
  br i1 %152, label %153, label %158

153:                                              ; preds = %142
  %154 = call double @gk_CPUSeconds()
  %155 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 12
  %156 = load double, ptr %155, align 8, !tbaa !25
  %157 = fadd double %156, %154
  store double %157, ptr %155, align 8, !tbaa !25
  br label %158

158:                                              ; preds = %153, %142
  %159 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 1
  %160 = load i64, ptr %159, align 8, !tbaa !18
  %161 = and i64 %160, 1
  %162 = icmp ne i64 %161, 0
  br i1 %162, label %163, label %164

163:                                              ; preds = %158
  call void @libmetis__PrintTimers(ptr noundef %28)
  br label %164

164:                                              ; preds = %163, %158
  call void @libmetis__FreeWorkSpace(ptr noundef %28, ptr noundef %27)
  %165 = load ptr, ptr %19, align 8, !tbaa !5
  %166 = load i64, ptr %165, align 8, !tbaa !9
  %167 = icmp eq i64 %166, 1
  br i1 %167, label %168, label %174

168:                                              ; preds = %164
  %169 = load ptr, ptr %13, align 8, !tbaa !5
  %170 = load i64, ptr %169, align 8, !tbaa !9
  %171 = load ptr, ptr %14, align 8, !tbaa !5
  %172 = load ptr, ptr %15, align 8, !tbaa !5
  %173 = load ptr, ptr %24, align 8, !tbaa !5
  call void @libmetis__Change2FNumbering(i64 noundef %170, ptr noundef %171, ptr noundef %172, ptr noundef %173)
  br label %174

174:                                              ; preds = %168, %164
  call void @llvm.lifetime.end.p0(i64 280, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 248, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  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 @libmetis__Change2CNumbering(i64 noundef, ptr noundef, ptr noundef) #2

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

declare i32 @gk_log2(i32 noundef) #2

declare i64 @libmetis__idxsum(i64 noundef, ptr noundef, i64 noundef) #2

declare void @libmetis__InitRandom(i64 noundef) #2

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

declare void @libmetis__InitTimers(ptr noundef) #2

declare double @gk_CPUSeconds() #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @libmetis__MlevelKWayPartitioning(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, float noundef) #1

declare void @libmetis__PrintTimers(ptr noundef) #2

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

declare void @libmetis__Change2FNumbering(i64 noundef, ptr noundef, ptr noundef, ptr 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 = { nounwind }

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

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


; 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.graphdef = type { i64, i64, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i64, i64, ptr, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr, ptr, ptr, ptr }
%struct.controldef = type { i64, i64, i64, i64, i64, i64, float, i64, i64, i64, i64, %struct.workspacedef, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
%struct.workspacedef = type { ptr, i64, i64, ptr, ptr, i64, ptr, ptr }

; 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 @METIS_WPartGraphKway(ptr nocapture noundef readonly %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr nocapture noundef readonly %5, ptr nocapture noundef readonly %6, ptr nocapture noundef readonly %7, ptr noundef %8, ptr nocapture noundef readonly %9, ptr nocapture noundef writeonly %10, ptr noundef %11) local_unnamed_addr #1 {
  %13 = alloca %struct.graphdef, align 8
  %14 = alloca %struct.controldef, align 8
  call void @llvm.lifetime.start.p0(i64 248, ptr nonnull %13) #3
  call void @llvm.lifetime.start.p0(i64 280, ptr nonnull %14) #3
  %15 = load i64, ptr %6, align 8, !tbaa !5
  %16 = icmp eq i64 %15, 1
  br i1 %16, label %17, label %19

17:                                               ; preds = %12
  %18 = load i64, ptr %0, align 8, !tbaa !5
  tail call void @libmetis__Change2CNumbering(i64 noundef %18, ptr noundef %1, ptr noundef %2) #3
  br label %19

19:                                               ; preds = %17, %12
  %20 = load i64, ptr %0, align 8, !tbaa !5
  %21 = load i64, ptr %5, align 8, !tbaa !5
  call void @libmetis__SetUpGraph(ptr noundef nonnull %13, i64 noundef 2, i64 noundef %20, i64 noundef 1, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i64 noundef %21) #3
  %22 = load i64, ptr %9, align 8, !tbaa !5
  %23 = icmp eq i64 %22, 0
  br i1 %23, label %31, label %24

24:                                               ; preds = %19
  %25 = getelementptr inbounds i8, ptr %9, i64 8
  %26 = load <2 x i64>, ptr %25, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %9, i64 24
  %28 = load i64, ptr %27, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %9, i64 32
  %30 = load i64, ptr %29, align 8, !tbaa !5
  br label %31

31:                                               ; preds = %19, %24
  %.sink39 = phi i64 [ %28, %24 ], [ 3, %19 ]
  %.sink = phi i64 [ %30, %24 ], [ 0, %19 ]
  %32 = phi <2 x i64> [ %26, %24 ], [ <i64 3, i64 1>, %19 ]
  %33 = getelementptr inbounds i8, ptr %14, i64 16
  store <2 x i64> %32, ptr %33, align 8
  %34 = getelementptr inbounds i8, ptr %14, i64 32
  store i64 %.sink39, ptr %34, align 8
  %35 = getelementptr inbounds i8, ptr %14, i64 8
  store i64 %.sink, ptr %35, align 8
  %36 = getelementptr inbounds i8, ptr %14, i64 56
  store i64 2, ptr %36, align 8, !tbaa !9
  %37 = load i64, ptr %0, align 8, !tbaa !5
  %38 = load i64, ptr %7, align 8, !tbaa !5
  %39 = trunc i64 %38 to i32
  %40 = call i32 @gk_log2(i32 noundef %39) #3
  %41 = mul nsw i32 %40, 40
  %42 = sext i32 %41 to i64
  %43 = sdiv i64 %37, %42
  %44 = load i64, ptr %7, align 8, !tbaa !5
  %45 = mul nsw i64 %44, 20
  %.not = icmp slt i64 %43, %45
  br i1 %.not, label %53, label %46

46:                                               ; preds = %31
  %47 = load i64, ptr %0, align 8, !tbaa !5
  %48 = trunc i64 %44 to i32
  %49 = call i32 @gk_log2(i32 noundef %48) #3
  %50 = mul nsw i32 %49, 40
  %51 = sext i32 %50 to i64
  %52 = sdiv i64 %47, %51
  br label %53

53:                                               ; preds = %31, %46
  %54 = phi i64 [ %52, %46 ], [ %45, %31 ]
  store i64 %54, ptr %14, align 8, !tbaa !15
  %55 = getelementptr inbounds i8, ptr %13, i64 24
  %56 = load ptr, ptr %55, align 8, !tbaa !16
  %.not34 = icmp eq ptr %56, null
  %57 = load i64, ptr %0, align 8, !tbaa !5
  br i1 %.not34, label %60, label %58

58:                                               ; preds = %53
  %59 = call i64 @libmetis__idxsum(i64 noundef %57, ptr noundef nonnull %56, i64 noundef 1) #3
  br label %60

60:                                               ; preds = %53, %58
  %61 = phi i64 [ %59, %58 ], [ %57, %53 ]
  %62 = sdiv i64 %61, %54
  %63 = sitofp i64 %62 to double
  %64 = fmul double %63, 1.500000e+00
  %65 = fptosi double %64 to i64
  %66 = getelementptr inbounds i8, ptr %14, i64 40
  store i64 %65, ptr %66, align 8, !tbaa !19
  call void @libmetis__InitRandom(i64 noundef -1) #3
  %67 = load i64, ptr %7, align 8, !tbaa !5
  call void @libmetis__AllocateWorkSpace(ptr noundef nonnull %14, ptr noundef nonnull %13, i64 noundef %67) #3
  %68 = load i64, ptr %35, align 8, !tbaa !20
  %69 = and i64 %68, 1
  %.not35 = icmp eq i64 %69, 0
  br i1 %.not35, label %.thread, label %70

70:                                               ; preds = %60
  call void @libmetis__InitTimers(ptr noundef nonnull %14) #3
  %.pre = load i64, ptr %35, align 8, !tbaa !20
  %.pre43 = and i64 %.pre, 1
  %71 = icmp eq i64 %.pre43, 0
  br i1 %71, label %.thread, label %72

72:                                               ; preds = %70
  %73 = call double @gk_CPUSeconds() #3
  %74 = getelementptr inbounds i8, ptr %14, i64 152
  %75 = load double, ptr %74, align 8, !tbaa !21
  %76 = fsub double %75, %73
  store double %76, ptr %74, align 8, !tbaa !21
  br label %.thread

.thread:                                          ; preds = %60, %72, %70
  %77 = load i64, ptr %7, align 8, !tbaa !5
  %78 = call i64 @libmetis__MlevelKWayPartitioning(ptr noundef nonnull %14, ptr noundef nonnull %13, i64 noundef %77, ptr noundef %11, ptr noundef %8, float noundef 0x3FF07AE140000000)
  store i64 %78, ptr %10, align 8, !tbaa !5
  %79 = load i64, ptr %35, align 8, !tbaa !20
  %80 = and i64 %79, 1
  %.not37 = icmp eq i64 %80, 0
  br i1 %.not37, label %.thread47, label %81

81:                                               ; preds = %.thread
  %82 = call double @gk_CPUSeconds() #3
  %83 = getelementptr inbounds i8, ptr %14, i64 152
  %84 = load double, ptr %83, align 8, !tbaa !21
  %85 = fadd double %82, %84
  store double %85, ptr %83, align 8, !tbaa !21
  %.pre42 = load i64, ptr %35, align 8, !tbaa !20
  %.pre44 = and i64 %.pre42, 1
  %86 = icmp eq i64 %.pre44, 0
  br i1 %86, label %.thread47, label %87

87:                                               ; preds = %81
  call void @libmetis__PrintTimers(ptr noundef nonnull %14) #3
  br label %.thread47

.thread47:                                        ; preds = %.thread, %87, %81
  call void @libmetis__FreeWorkSpace(ptr noundef nonnull %14, ptr noundef nonnull %13) #3
  %88 = load i64, ptr %6, align 8, !tbaa !5
  %89 = icmp eq i64 %88, 1
  br i1 %89, label %90, label %92

90:                                               ; preds = %.thread47
  %91 = load i64, ptr %0, align 8, !tbaa !5
  call void @libmetis__Change2FNumbering(i64 noundef %91, ptr noundef %1, ptr noundef %2, ptr noundef %11) #3
  br label %92

92:                                               ; preds = %90, %.thread47
  call void @llvm.lifetime.end.p0(i64 280, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 248, ptr nonnull %13) #3
  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 @libmetis__Change2CNumbering(i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @libmetis__SetUpGraph(ptr noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @gk_log2(i32 noundef) local_unnamed_addr #2

declare i64 @libmetis__idxsum(i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @libmetis__InitRandom(i64 noundef) local_unnamed_addr #2

declare void @libmetis__AllocateWorkSpace(ptr noundef, ptr noundef, i64 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 i64 @libmetis__MlevelKWayPartitioning(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, float noundef) local_unnamed_addr #1

declare void @libmetis__PrintTimers(ptr noundef) local_unnamed_addr #2

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

declare void @libmetis__Change2FNumbering(i64 noundef, ptr noundef, ptr noundef, ptr 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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 56}
!10 = !{!"controldef", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !11, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !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, !14, i64 232, !14, i64 240, !14, i64 248, !14, i64 256, !14, i64 264, !14, i64 272}
!11 = !{!"float", !7, i64 0}
!12 = !{!"workspacedef", !13, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !13, i64 32, !6, i64 40, !13, i64 48, !13, i64 56}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!10, !6, i64 0}
!16 = !{!17, !13, i64 24}
!17 = !{!"graphdef", !6, i64 0, !6, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !18, i64 56, !18, i64 60, !18, i64 64, !18, i64 68, !18, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !6, i64 112, !6, i64 120, !13, i64 128, !13, i64 136, !6, i64 144, !13, i64 152, !13, i64 160, !13, i64 168, !13, i64 176, !13, i64 184, !13, i64 192, !13, i64 200, !6, i64 208, !13, i64 216, !13, i64 224, !13, i64 232, !13, i64 240}
!18 = !{!"int", !7, i64 0}
!19 = !{!10, !6, i64 40}
!20 = !{!10, !6, i64 8}
!21 = !{!10, !14, i64 152}


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