; LLVM IR from ekoontz/graphlab :: src/graphlab/extern/metis/libmetis/mkmetis.ll_libmetis (MCMlevelKWayPartitioning)

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

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

@.str = external hidden unnamed_addr constant [37 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

declare double @gk_CPUSeconds() #1

; Function Attrs: nounwind uwtable
define dso_local i64 @libmetis__MCMlevelKWayPartitioning(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca [10 x i64], align 16
  %16 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = call ptr @libmetis__MCCoarsen2Way(ptr noundef %17, ptr noundef %18)
  store ptr %19, ptr %14, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.controldef, ptr %20, i32 0, i32 1
  %22 = load i64, ptr %21, align 8, !tbaa !11
  %23 = and i64 %22, 1
  %24 = icmp ne i64 %23, 0
  br i1 %24, label %25, label %31

25:                                               ; preds = %5
  %26 = call double @gk_CPUSeconds()
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.controldef, ptr %27, i32 0, i32 13
  %29 = load double, ptr %28, align 8, !tbaa !16
  %30 = fsub double %29, %26
  store double %30, ptr %28, align 8, !tbaa !16
  br label %31

31:                                               ; preds = %25, %5
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = load ptr, ptr %14, align 8, !tbaa !5
  %34 = load i64, ptr %8, align 8, !tbaa !9
  call void @libmetis__MocAllocateKWayPartitionMemory(ptr noundef %32, ptr noundef %33, i64 noundef %34)
  %35 = getelementptr inbounds [10 x i64], ptr %15, i64 0, i64 0
  store i64 1, ptr %35, align 16, !tbaa !9
  %36 = getelementptr inbounds [10 x i64], ptr %15, i64 0, i64 1
  store i64 8, ptr %36, align 8, !tbaa !9
  %37 = getelementptr inbounds [10 x i64], ptr %15, i64 0, i64 2
  store i64 2, ptr %37, align 16, !tbaa !9
  %38 = getelementptr inbounds [10 x i64], ptr %15, i64 0, i64 3
  store i64 1, ptr %38, align 8, !tbaa !9
  %39 = getelementptr inbounds [10 x i64], ptr %15, i64 0, i64 4
  store i64 0, ptr %39, align 16, !tbaa !9
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %40

40:                                               ; preds = %55, %31
  %41 = load i64, ptr %11, align 8, !tbaa !9
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.graphdef, ptr %42, i32 0, i32 28
  %44 = load i64, ptr %43, align 8, !tbaa !17
  %45 = icmp slt i64 %41, %44
  br i1 %45, label %46, label %58

46:                                               ; preds = %40
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = load i64, ptr %11, align 8, !tbaa !9
  %49 = getelementptr inbounds float, ptr %47, i64 %48
  %50 = load float, ptr %49, align 4, !tbaa !20
  %51 = fpext float %50 to double
  %52 = fcmp ogt double %51, 1.200000e+00
  br i1 %52, label %53, label %54

53:                                               ; preds = %46
  br label %58

54:                                               ; preds = %46
  br label %55

55:                                               ; preds = %54
  %56 = load i64, ptr %11, align 8, !tbaa !9
  %57 = add nsw i64 %56, 1
  store i64 %57, ptr %11, align 8, !tbaa !9
  br label %40, !llvm.loop !21

58:                                               ; preds = %53, %40
  %59 = load i64, ptr %11, align 8, !tbaa !9
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.graphdef, ptr %60, i32 0, i32 28
  %62 = load i64, ptr %61, align 8, !tbaa !17
  %63 = icmp eq i64 %59, %62
  br i1 %63, label %64, label %85

64:                                               ; preds = %58
  %65 = load ptr, ptr %14, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.graphdef, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.graphdef, ptr %67, i32 0, i32 28
  %69 = load ptr, ptr %14, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.graphdef, ptr %69, i32 0, i32 2
  %71 = load ptr, ptr %70, align 8, !tbaa !23
  %72 = load ptr, ptr %14, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.graphdef, ptr %72, i32 0, i32 5
  %74 = load ptr, ptr %73, align 8, !tbaa !24
  %75 = load ptr, ptr %14, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.graphdef, ptr %75, i32 0, i32 29
  %77 = load ptr, ptr %76, align 8, !tbaa !25
  %78 = load ptr, ptr %14, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.graphdef, ptr %78, i32 0, i32 6
  %80 = load ptr, ptr %79, align 8, !tbaa !26
  %81 = getelementptr inbounds [10 x i64], ptr %15, i64 0, i64 0
  %82 = load ptr, ptr %14, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.graphdef, ptr %82, i32 0, i32 18
  %84 = load ptr, ptr %83, align 8, !tbaa !27
  call void @METIS_mCPartGraphRecursiveInternal(ptr noundef %66, ptr noundef %68, ptr noundef %71, ptr noundef %74, ptr noundef %77, ptr noundef %80, ptr noundef %8, ptr noundef %81, ptr noundef %16, ptr noundef %84)
  br label %107

85:                                               ; preds = %58
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.graphdef, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %14, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.graphdef, ptr %88, i32 0, i32 28
  %90 = load ptr, ptr %14, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.graphdef, ptr %90, i32 0, i32 2
  %92 = load ptr, ptr %91, align 8, !tbaa !23
  %93 = load ptr, ptr %14, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.graphdef, ptr %93, i32 0, i32 5
  %95 = load ptr, ptr %94, align 8, !tbaa !24
  %96 = load ptr, ptr %14, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.graphdef, ptr %96, i32 0, i32 29
  %98 = load ptr, ptr %97, align 8, !tbaa !25
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.graphdef, ptr %99, i32 0, i32 6
  %101 = load ptr, ptr %100, align 8, !tbaa !26
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  %103 = getelementptr inbounds [10 x i64], ptr %15, i64 0, i64 0
  %104 = load ptr, ptr %14, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.graphdef, ptr %104, i32 0, i32 18
  %106 = load ptr, ptr %105, align 8, !tbaa !27
  call void @METIS_mCHPartGraphRecursiveInternal(ptr noundef %87, ptr noundef %89, ptr noundef %92, ptr noundef %95, ptr noundef %98, ptr noundef %101, ptr noundef %8, ptr noundef %102, ptr noundef %103, ptr noundef %16, ptr noundef %106)
  br label %107

107:                                              ; preds = %85, %64
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.controldef, ptr %108, i32 0, i32 1
  %110 = load i64, ptr %109, align 8, !tbaa !11
  %111 = and i64 %110, 1
  %112 = icmp ne i64 %111, 0
  br i1 %112, label %113, label %119

113:                                              ; preds = %107
  %114 = call double @gk_CPUSeconds()
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.controldef, ptr %115, i32 0, i32 13
  %117 = load double, ptr %116, align 8, !tbaa !16
  %118 = fadd double %117, %114
  store double %118, ptr %116, align 8, !tbaa !16
  br label %119

119:                                              ; preds = %113, %107
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.controldef, ptr %120, i32 0, i32 1
  %122 = load i64, ptr %121, align 8, !tbaa !11
  %123 = and i64 %122, 16
  %124 = icmp ne i64 %123, 0
  br i1 %124, label %125, label %129

125:                                              ; preds = %119
  %126 = load i64, ptr %8, align 8, !tbaa !9
  %127 = load i64, ptr %16, align 8, !tbaa !9
  %128 = call i32 (ptr, ...) @mprintf(ptr noundef @.str, i64 noundef %126, i64 noundef %127)
  br label %129

129:                                              ; preds = %125, %119
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.controldef, ptr %130, i32 0, i32 1
  %132 = load i64, ptr %131, align 8, !tbaa !11
  %133 = and i64 %132, 64
  %134 = icmp ne i64 %133, 0
  br i1 %134, label %135, label %141

135:                                              ; preds = %129
  %136 = load ptr, ptr %14, align 8, !tbaa !5
  %137 = load i64, ptr %8, align 8, !tbaa !9
  %138 = load ptr, ptr %14, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.graphdef, ptr %138, i32 0, i32 18
  %140 = load ptr, ptr %139, align 8, !tbaa !27
  call void @libmetis__ComputePartitionInfo(ptr noundef %136, i64 noundef %137, ptr noundef %140)
  br label %141

141:                                              ; preds = %135, %129
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = load ptr, ptr %14, align 8, !tbaa !5
  %145 = load i64, ptr %8, align 8, !tbaa !9
  %146 = load ptr, ptr %10, align 8, !tbaa !5
  call void @libmetis__MocRefineKWayHorizontal(ptr noundef %142, ptr noundef %143, ptr noundef %144, i64 noundef %145, ptr noundef %146)
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.graphdef, ptr %148, i32 0, i32 18
  %150 = load ptr, ptr %149, align 8, !tbaa !27
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.graphdef, ptr %151, i32 0, i32 0
  %153 = load i64, ptr %152, align 8, !tbaa !28
  %154 = mul i64 8, %153
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %147, ptr align 1 %150, i64 %154, i1 false)
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  call void @libmetis__FreeGraph(ptr noundef %155, i32 noundef 0)
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.graphdef, ptr %156, i32 0, i32 16
  %158 = load i64, ptr %157, align 8, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  ret i64 %158
}

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

declare ptr @libmetis__MCCoarsen2Way(ptr noundef, ptr noundef) #1

declare void @libmetis__MocAllocateKWayPartitionMemory(ptr noundef, ptr noundef, i64 noundef) #1

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

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

declare i32 @mprintf(ptr noundef, ...) #1

declare void @libmetis__ComputePartitionInfo(ptr noundef, i64 noundef, ptr noundef) #1

declare void @libmetis__MocRefineKWayHorizontal(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

; 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 @libmetis__FreeGraph(ptr noundef, i32 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 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 8}
!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, !15, i64 160}
!17 = !{!18, !10, i64 208}
!18 = !{!"graphdef", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !19, i64 56, !19, i64 60, !19, i64 64, !19, i64 68, !19, 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}
!19 = !{!"int", !7, i64 0}
!20 = !{!13, !13, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!18, !6, i64 16}
!24 = !{!18, !6, i64 40}
!25 = !{!18, !6, i64 216}
!26 = !{!18, !6, i64 48}
!27 = !{!18, !6, i64 128}
!28 = !{!18, !10, i64 0}
!29 = !{!18, !10, i64 112}


; 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 = external hidden unnamed_addr constant [37 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

declare double @gk_CPUSeconds() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i64 @libmetis__MCMlevelKWayPartitioning(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr nocapture noundef writeonly %3, ptr noundef %4) local_unnamed_addr #2 {
  %6 = alloca i64, align 8
  %7 = alloca [10 x i64], align 16
  %8 = alloca i64, align 8
  store i64 %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %9 = tail call ptr @libmetis__MCCoarsen2Way(ptr noundef %0, ptr noundef %1) #4
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = load i64, ptr %10, align 8, !tbaa !9
  %12 = and i64 %11, 1
  %.not = icmp eq i64 %12, 0
  br i1 %.not, label %18, label %13

13:                                               ; preds = %5
  %14 = tail call double @gk_CPUSeconds() #4
  %15 = getelementptr inbounds i8, ptr %0, i64 160
  %16 = load double, ptr %15, align 8, !tbaa !15
  %17 = fsub double %16, %14
  store double %17, ptr %15, align 8, !tbaa !15
  br label %18

18:                                               ; preds = %13, %5
  tail call void @libmetis__MocAllocateKWayPartitionMemory(ptr noundef nonnull %0, ptr noundef %9, i64 noundef %2) #4
  store i64 1, ptr %7, align 16, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %7, i64 8
  store i64 8, ptr %19, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %7, i64 16
  store i64 2, ptr %20, align 16, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %7, i64 24
  store i64 1, ptr %21, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %7, i64 32
  store i64 0, ptr %22, align 16, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %1, i64 208
  %24 = load i64, ptr %23, align 8, !tbaa !16
  %25 = icmp sgt i64 %24, 0
  br i1 %25, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %18, %30
  %.045 = phi i64 [ %31, %30 ], [ 0, %18 ]
  %26 = getelementptr inbounds float, ptr %4, i64 %.045
  %27 = load float, ptr %26, align 4, !tbaa !19
  %28 = fpext float %27 to double
  %29 = fcmp ogt double %28, 1.200000e+00
  br i1 %29, label %._crit_edge, label %30

30:                                               ; preds = %.lr.ph
  %31 = add nuw nsw i64 %.045, 1
  %exitcond.not = icmp eq i64 %31, %24
  br i1 %exitcond.not, label %._crit_edge.thread, label %.lr.ph, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph, %18
  %.0.lcssa = phi i64 [ 0, %18 ], [ %.045, %.lr.ph ]
  %32 = icmp eq i64 %.0.lcssa, %24
  br i1 %32, label %._crit_edge.thread, label %44

._crit_edge.thread:                               ; preds = %30, %._crit_edge
  %33 = getelementptr inbounds i8, ptr %9, i64 208
  %34 = getelementptr inbounds i8, ptr %9, i64 16
  %35 = load ptr, ptr %34, align 8, !tbaa !22
  %36 = getelementptr inbounds i8, ptr %9, i64 40
  %37 = load ptr, ptr %36, align 8, !tbaa !23
  %38 = getelementptr inbounds i8, ptr %9, i64 216
  %39 = load ptr, ptr %38, align 8, !tbaa !24
  %40 = getelementptr inbounds i8, ptr %9, i64 48
  %41 = load ptr, ptr %40, align 8, !tbaa !25
  %42 = getelementptr inbounds i8, ptr %9, i64 128
  %43 = load ptr, ptr %42, align 8, !tbaa !26
  call void @METIS_mCPartGraphRecursiveInternal(ptr noundef %9, ptr noundef nonnull %33, ptr noundef %35, ptr noundef %37, ptr noundef %39, ptr noundef %41, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef %43) #4
  br label %56

44:                                               ; preds = %._crit_edge
  %45 = getelementptr inbounds i8, ptr %9, i64 208
  %46 = getelementptr inbounds i8, ptr %9, i64 16
  %47 = load ptr, ptr %46, align 8, !tbaa !22
  %48 = getelementptr inbounds i8, ptr %9, i64 40
  %49 = load ptr, ptr %48, align 8, !tbaa !23
  %50 = getelementptr inbounds i8, ptr %9, i64 216
  %51 = load ptr, ptr %50, align 8, !tbaa !24
  %52 = getelementptr inbounds i8, ptr %9, i64 48
  %53 = load ptr, ptr %52, align 8, !tbaa !25
  %54 = getelementptr inbounds i8, ptr %9, i64 128
  %55 = load ptr, ptr %54, align 8, !tbaa !26
  call void @METIS_mCHPartGraphRecursiveInternal(ptr noundef %9, ptr noundef nonnull %45, ptr noundef %47, ptr noundef %49, ptr noundef %51, ptr noundef %53, ptr noundef nonnull %6, ptr noundef %4, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef %55) #4
  br label %56

56:                                               ; preds = %44, %._crit_edge.thread
  %57 = load i64, ptr %10, align 8, !tbaa !9
  %58 = and i64 %57, 1
  %.not42 = icmp eq i64 %58, 0
  br i1 %.not42, label %64, label %59

59:                                               ; preds = %56
  %60 = call double @gk_CPUSeconds() #4
  %61 = getelementptr inbounds i8, ptr %0, i64 160
  %62 = load double, ptr %61, align 8, !tbaa !15
  %63 = fadd double %60, %62
  store double %63, ptr %61, align 8, !tbaa !15
  %.pre = load i64, ptr %10, align 8, !tbaa !9
  br label %64

64:                                               ; preds = %59, %56
  %65 = phi i64 [ %.pre, %59 ], [ %57, %56 ]
  %66 = and i64 %65, 16
  %.not43 = icmp eq i64 %66, 0
  br i1 %.not43, label %71, label %67

67:                                               ; preds = %64
  %68 = load i64, ptr %6, align 8, !tbaa !5
  %69 = load i64, ptr %8, align 8, !tbaa !5
  %70 = call i32 (ptr, ...) @mprintf(ptr noundef nonnull @.str, i64 noundef %68, i64 noundef %69) #4
  %.pre50 = load i64, ptr %10, align 8, !tbaa !9
  br label %71

71:                                               ; preds = %67, %64
  %72 = phi i64 [ %.pre50, %67 ], [ %65, %64 ]
  %73 = and i64 %72, 64
  %.not44 = icmp eq i64 %73, 0
  br i1 %.not44, label %78, label %74

74:                                               ; preds = %71
  %75 = load i64, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds i8, ptr %9, i64 128
  %77 = load ptr, ptr %76, align 8, !tbaa !26
  call void @libmetis__ComputePartitionInfo(ptr noundef nonnull %9, i64 noundef %75, ptr noundef %77) #4
  br label %78

78:                                               ; preds = %74, %71
  %79 = load i64, ptr %6, align 8, !tbaa !5
  call void @libmetis__MocRefineKWayHorizontal(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %9, i64 noundef %79, ptr noundef %4) #4
  %80 = getelementptr inbounds i8, ptr %1, i64 128
  %81 = load ptr, ptr %80, align 8, !tbaa !26
  %82 = load i64, ptr %1, align 8, !tbaa !27
  %83 = shl i64 %82, 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %3, ptr align 1 %81, i64 %83, i1 false)
  call void @libmetis__FreeGraph(ptr noundef nonnull %1, i32 noundef 0) #4
  %84 = getelementptr inbounds i8, ptr %1, i64 112
  %85 = load i64, ptr %84, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #4
  ret i64 %85
}

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

declare ptr @libmetis__MCCoarsen2Way(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @libmetis__MocAllocateKWayPartitionMemory(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @METIS_mCPartGraphRecursiveInternal(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @METIS_mCHPartGraphRecursiveInternal(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @mprintf(ptr noundef, ...) local_unnamed_addr #1

declare void @libmetis__ComputePartitionInfo(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare void @libmetis__MocRefineKWayHorizontal(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

; 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 @libmetis__FreeGraph(ptr noundef, i32 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress 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 = { 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, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!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, !14, i64 160}
!16 = !{!17, !6, i64 208}
!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 = !{!11, !11, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!17, !13, i64 16}
!23 = !{!17, !13, i64 40}
!24 = !{!17, !13, i64 216}
!25 = !{!17, !13, i64 48}
!26 = !{!17, !13, i64 128}
!27 = !{!17, !6, i64 0}
!28 = !{!17, !6, i64 112}


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