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

; 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 }

; 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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @libmetis__MCMatch_HEM(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, 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
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.controldef, ptr %22, i32 0, i32 1
  %24 = load i64, ptr %23, align 8, !tbaa !9
  %25 = and i64 %24, 1
  %26 = icmp ne i64 %25, 0
  br i1 %26, label %27, label %33

27:                                               ; preds = %2
  %28 = call double @gk_CPUSeconds()
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.controldef, ptr %29, i32 0, i32 14
  %31 = load double, ptr %30, align 8, !tbaa !15
  %32 = fsub double %31, %28
  store double %32, ptr %30, align 8, !tbaa !15
  br label %33

33:                                               ; preds = %27, %2
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.graphdef, ptr %34, i32 0, i32 0
  %36 = load i64, ptr %35, align 8, !tbaa !16
  store i64 %36, ptr %10, align 8, !tbaa !19
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.graphdef, ptr %37, i32 0, i32 28
  %39 = load i64, ptr %38, align 8, !tbaa !20
  store i64 %39, ptr %12, align 8, !tbaa !19
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.graphdef, ptr %40, i32 0, i32 2
  %42 = load ptr, ptr %41, align 8, !tbaa !21
  store ptr %42, ptr %15, align 8, !tbaa !5
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.graphdef, ptr %43, i32 0, i32 29
  %45 = load ptr, ptr %44, align 8, !tbaa !22
  store ptr %45, ptr %21, align 8, !tbaa !5
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.graphdef, ptr %46, i32 0, i32 5
  %48 = load ptr, ptr %47, align 8, !tbaa !23
  store ptr %48, ptr %16, align 8, !tbaa !5
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.graphdef, ptr %49, i32 0, i32 6
  %51 = load ptr, ptr %50, align 8, !tbaa !24
  store ptr %51, ptr %17, align 8, !tbaa !5
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.graphdef, ptr %52, i32 0, i32 15
  %54 = load ptr, ptr %53, align 8, !tbaa !25
  store ptr %54, ptr %19, align 8, !tbaa !5
  %55 = load i64, ptr %10, align 8, !tbaa !19
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = load i64, ptr %10, align 8, !tbaa !19
  %58 = call ptr @libmetis__idxwspacemalloc(ptr noundef %56, i64 noundef %57)
  %59 = call ptr @libmetis__idxset(i64 noundef %55, i64 noundef -1, ptr noundef %58)
  store ptr %59, ptr %18, align 8, !tbaa !5
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = load i64, ptr %10, align 8, !tbaa !19
  %62 = call ptr @libmetis__idxwspacemalloc(ptr noundef %60, i64 noundef %61)
  store ptr %62, ptr %20, align 8, !tbaa !5
  %63 = load i64, ptr %10, align 8, !tbaa !19
  %64 = load ptr, ptr %20, align 8, !tbaa !5
  call void @libmetis__RandomPermute(i64 noundef %63, ptr noundef %64, i64 noundef 1)
  store i64 0, ptr %11, align 8, !tbaa !19
  store i64 0, ptr %6, align 8, !tbaa !19
  br label %65

65:                                               ; preds = %158, %33
  %66 = load i64, ptr %6, align 8, !tbaa !19
  %67 = load i64, ptr %10, align 8, !tbaa !19
  %68 = icmp slt i64 %66, %67
  br i1 %68, label %69, label %161

69:                                               ; preds = %65
  %70 = load ptr, ptr %20, align 8, !tbaa !5
  %71 = load i64, ptr %6, align 8, !tbaa !19
  %72 = getelementptr inbounds i64, ptr %70, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !19
  store i64 %73, ptr %5, align 8, !tbaa !19
  %74 = load ptr, ptr %18, align 8, !tbaa !5
  %75 = load i64, ptr %5, align 8, !tbaa !19
  %76 = getelementptr inbounds i64, ptr %74, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !19
  %78 = icmp eq i64 %77, -1
  br i1 %78, label %79, label %157

79:                                               ; preds = %69
  %80 = load i64, ptr %5, align 8, !tbaa !19
  store i64 %80, ptr %13, align 8, !tbaa !19
  store i64 0, ptr %14, align 8, !tbaa !19
  %81 = load ptr, ptr %15, align 8, !tbaa !5
  %82 = load i64, ptr %5, align 8, !tbaa !19
  %83 = getelementptr inbounds i64, ptr %81, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !19
  store i64 %84, ptr %7, align 8, !tbaa !19
  br label %85

85:                                               ; preds = %137, %79
  %86 = load i64, ptr %7, align 8, !tbaa !19
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  %88 = load i64, ptr %5, align 8, !tbaa !19
  %89 = add nsw i64 %88, 1
  %90 = getelementptr inbounds i64, ptr %87, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !19
  %92 = icmp slt i64 %86, %91
  br i1 %92, label %93, label %140

93:                                               ; preds = %85
  %94 = load ptr, ptr %16, align 8, !tbaa !5
  %95 = load i64, ptr %7, align 8, !tbaa !19
  %96 = getelementptr inbounds i64, ptr %94, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !19
  store i64 %97, ptr %8, align 8, !tbaa !19
  %98 = load ptr, ptr %18, align 8, !tbaa !5
  %99 = load i64, ptr %8, align 8, !tbaa !19
  %100 = getelementptr inbounds i64, ptr %98, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !19
  %102 = icmp eq i64 %101, -1
  br i1 %102, label %103, label %136

103:                                              ; preds = %93
  %104 = load i64, ptr %14, align 8, !tbaa !19
  %105 = load ptr, ptr %17, align 8, !tbaa !5
  %106 = load i64, ptr %7, align 8, !tbaa !19
  %107 = getelementptr inbounds i64, ptr %105, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !19
  %109 = icmp sle i64 %104, %108
  br i1 %109, label %110, label %136

110:                                              ; preds = %103
  %111 = load i64, ptr %12, align 8, !tbaa !19
  %112 = load ptr, ptr %21, align 8, !tbaa !5
  %113 = load i64, ptr %5, align 8, !tbaa !19
  %114 = load i64, ptr %12, align 8, !tbaa !19
  %115 = mul nsw i64 %113, %114
  %116 = getelementptr inbounds float, ptr %112, i64 %115
  %117 = load ptr, ptr %21, align 8, !tbaa !5
  %118 = load i64, ptr %8, align 8, !tbaa !19
  %119 = load i64, ptr %12, align 8, !tbaa !19
  %120 = mul nsw i64 %118, %119
  %121 = getelementptr inbounds float, ptr %117, i64 %120
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.controldef, ptr %122, i32 0, i32 6
  %124 = load float, ptr %123, align 8, !tbaa !26
  %125 = call i64 @libmetis__AreAllVwgtsBelowFast(i64 noundef %111, ptr noundef %116, ptr noundef %121, float noundef %124)
  %126 = icmp ne i64 %125, 0
  br i1 %126, label %127, label %136

127:                                              ; preds = %110
  %128 = load ptr, ptr %17, align 8, !tbaa !5
  %129 = load i64, ptr %7, align 8, !tbaa !19
  %130 = getelementptr inbounds i64, ptr %128, i64 %129
  %131 = load i64, ptr %130, align 8, !tbaa !19
  store i64 %131, ptr %14, align 8, !tbaa !19
  %132 = load ptr, ptr %16, align 8, !tbaa !5
  %133 = load i64, ptr %7, align 8, !tbaa !19
  %134 = getelementptr inbounds i64, ptr %132, i64 %133
  %135 = load i64, ptr %134, align 8, !tbaa !19
  store i64 %135, ptr %13, align 8, !tbaa !19
  br label %136

136:                                              ; preds = %127, %110, %103, %93
  br label %137

137:                                              ; preds = %136
  %138 = load i64, ptr %7, align 8, !tbaa !19
  %139 = add nsw i64 %138, 1
  store i64 %139, ptr %7, align 8, !tbaa !19
  br label %85, !llvm.loop !27

140:                                              ; preds = %85
  %141 = load i64, ptr %11, align 8, !tbaa !19
  %142 = add nsw i64 %141, 1
  store i64 %142, ptr %11, align 8, !tbaa !19
  %143 = load ptr, ptr %19, align 8, !tbaa !5
  %144 = load i64, ptr %13, align 8, !tbaa !19
  %145 = getelementptr inbounds i64, ptr %143, i64 %144
  store i64 %141, ptr %145, align 8, !tbaa !19
  %146 = load ptr, ptr %19, align 8, !tbaa !5
  %147 = load i64, ptr %5, align 8, !tbaa !19
  %148 = getelementptr inbounds i64, ptr %146, i64 %147
  store i64 %141, ptr %148, align 8, !tbaa !19
  %149 = load i64, ptr %13, align 8, !tbaa !19
  %150 = load ptr, ptr %18, align 8, !tbaa !5
  %151 = load i64, ptr %5, align 8, !tbaa !19
  %152 = getelementptr inbounds i64, ptr %150, i64 %151
  store i64 %149, ptr %152, align 8, !tbaa !19
  %153 = load i64, ptr %5, align 8, !tbaa !19
  %154 = load ptr, ptr %18, align 8, !tbaa !5
  %155 = load i64, ptr %13, align 8, !tbaa !19
  %156 = getelementptr inbounds i64, ptr %154, i64 %155
  store i64 %153, ptr %156, align 8, !tbaa !19
  br label %157

157:                                              ; preds = %140, %69
  br label %158

158:                                              ; preds = %157
  %159 = load i64, ptr %6, align 8, !tbaa !19
  %160 = add nsw i64 %159, 1
  store i64 %160, ptr %6, align 8, !tbaa !19
  br label %65, !llvm.loop !29

161:                                              ; preds = %65
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.controldef, ptr %162, i32 0, i32 1
  %164 = load i64, ptr %163, align 8, !tbaa !9
  %165 = and i64 %164, 1
  %166 = icmp ne i64 %165, 0
  br i1 %166, label %167, label %173

167:                                              ; preds = %161
  %168 = call double @gk_CPUSeconds()
  %169 = load ptr, ptr %3, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.controldef, ptr %169, i32 0, i32 14
  %171 = load double, ptr %170, align 8, !tbaa !15
  %172 = fadd double %171, %168
  store double %172, ptr %170, align 8, !tbaa !15
  br label %173

173:                                              ; preds = %167, %161
  %174 = load ptr, ptr %3, align 8, !tbaa !5
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  %176 = load i64, ptr %11, align 8, !tbaa !19
  %177 = load ptr, ptr %18, align 8, !tbaa !5
  %178 = load ptr, ptr %20, align 8, !tbaa !5
  call void @libmetis__CreateCoarseGraph(ptr noundef %174, ptr noundef %175, i64 noundef %176, ptr noundef %177, ptr noundef %178)
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = load i64, ptr %10, align 8, !tbaa !19
  call void @libmetis__idxwspacefree(ptr noundef %179, i64 noundef %180)
  %181 = load ptr, ptr %3, align 8, !tbaa !5
  %182 = load i64, ptr %10, align 8, !tbaa !19
  call void @libmetis__idxwspacefree(ptr noundef %181, i64 noundef %182)
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  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 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void
}

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, !11, i64 8}
!10 = !{!"controldef", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !12, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !13, 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 = !{!"long", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"workspacedef", !6, i64 0, !11, i64 8, !11, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !6, i64 48, !6, i64 56}
!14 = !{!"double", !7, i64 0}
!15 = !{!10, !14, i64 168}
!16 = !{!17, !11, i64 0}
!17 = !{!"graphdef", !11, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !18, i64 56, !18, i64 60, !18, i64 64, !18, i64 68, !18, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 120, !6, i64 128, !6, i64 136, !11, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !11, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240}
!18 = !{!"int", !7, i64 0}
!19 = !{!11, !11, i64 0}
!20 = !{!17, !11, i64 208}
!21 = !{!17, !6, i64 16}
!22 = !{!17, !6, i64 216}
!23 = !{!17, !6, i64 40}
!24 = !{!17, !6, i64 48}
!25 = !{!17, !6, i64 104}
!26 = !{!10, !12, i64 48}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !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"

declare double @gk_CPUSeconds() local_unnamed_addr #0

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

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

declare void @libmetis__RandomPermute(i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

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

declare void @libmetis__CreateCoarseGraph(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @libmetis__idxwspacefree(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @libmetis__MCMatch_HEM(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load i64, ptr %3, align 8, !tbaa !5
  %5 = and i64 %4, 1
  %.not = icmp eq i64 %5, 0
  br i1 %.not, label %11, label %6

6:                                                ; preds = %2
  %7 = tail call double @gk_CPUSeconds() #2
  %8 = getelementptr inbounds i8, ptr %0, i64 168
  %9 = load double, ptr %8, align 8, !tbaa !14
  %10 = fsub double %9, %7
  store double %10, ptr %8, align 8, !tbaa !14
  br label %11

11:                                               ; preds = %6, %2
  %12 = load i64, ptr %1, align 8, !tbaa !15
  %13 = getelementptr inbounds i8, ptr %1, i64 208
  %14 = load i64, ptr %13, align 8, !tbaa !18
  %15 = getelementptr inbounds i8, ptr %1, i64 16
  %16 = load ptr, ptr %15, align 8, !tbaa !19
  %17 = getelementptr inbounds i8, ptr %1, i64 216
  %18 = load ptr, ptr %17, align 8, !tbaa !20
  %19 = getelementptr inbounds i8, ptr %1, i64 40
  %20 = load ptr, ptr %19, align 8, !tbaa !21
  %21 = getelementptr inbounds i8, ptr %1, i64 48
  %22 = load ptr, ptr %21, align 8, !tbaa !22
  %23 = getelementptr inbounds i8, ptr %1, i64 104
  %24 = load ptr, ptr %23, align 8, !tbaa !23
  %25 = tail call ptr @libmetis__idxwspacemalloc(ptr noundef nonnull %0, i64 noundef %12) #2
  %26 = tail call ptr @libmetis__idxset(i64 noundef %12, i64 noundef -1, ptr noundef %25) #2
  %27 = tail call ptr @libmetis__idxwspacemalloc(ptr noundef nonnull %0, i64 noundef %12) #2
  tail call void @libmetis__RandomPermute(i64 noundef %12, ptr noundef %27, i64 noundef 1) #2
  %28 = icmp sgt i64 %12, 0
  br i1 %28, label %.lr.ph86, label %._crit_edge87

.lr.ph86:                                         ; preds = %11
  %29 = getelementptr inbounds i8, ptr %0, i64 48
  br label %30

30:                                               ; preds = %.lr.ph86, %69
  %.084 = phi i64 [ 0, %.lr.ph86 ], [ %70, %69 ]
  %.07183 = phi i64 [ 0, %.lr.ph86 ], [ %.1, %69 ]
  %31 = getelementptr inbounds i64, ptr %27, i64 %.084
  %32 = load i64, ptr %31, align 8, !tbaa !24
  %33 = getelementptr inbounds i64, ptr %26, i64 %32
  %34 = load i64, ptr %33, align 8, !tbaa !24
  %35 = icmp eq i64 %34, -1
  br i1 %35, label %36, label %69

36:                                               ; preds = %30
  %37 = getelementptr inbounds i64, ptr %16, i64 %32
  %38 = load i64, ptr %37, align 8, !tbaa !24
  %39 = getelementptr i8, ptr %37, i64 8
  %40 = load i64, ptr %39, align 8, !tbaa !24
  %41 = icmp slt i64 %38, %40
  br i1 %41, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %36
  %42 = mul nsw i64 %32, %14
  %43 = getelementptr inbounds float, ptr %18, i64 %42
  br label %44

44:                                               ; preds = %.lr.ph, %61
  %.07082 = phi i64 [ %38, %.lr.ph ], [ %62, %61 ]
  %.07281 = phi i64 [ %32, %.lr.ph ], [ %.173, %61 ]
  %.07480 = phi i64 [ 0, %.lr.ph ], [ %.175, %61 ]
  %45 = getelementptr inbounds i64, ptr %20, i64 %.07082
  %46 = load i64, ptr %45, align 8, !tbaa !24
  %47 = getelementptr inbounds i64, ptr %26, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !24
  %49 = icmp eq i64 %48, -1
  br i1 %49, label %50, label %61

50:                                               ; preds = %44
  %51 = getelementptr inbounds i64, ptr %22, i64 %.07082
  %52 = load i64, ptr %51, align 8, !tbaa !24
  %.not78 = icmp sgt i64 %.07480, %52
  br i1 %.not78, label %61, label %53

53:                                               ; preds = %50
  %54 = mul nsw i64 %46, %14
  %55 = getelementptr inbounds float, ptr %18, i64 %54
  %56 = load float, ptr %29, align 8, !tbaa !25
  %57 = tail call i64 @libmetis__AreAllVwgtsBelowFast(i64 noundef %14, ptr noundef %43, ptr noundef %55, float noundef %56)
  %.not79 = icmp eq i64 %57, 0
  br i1 %.not79, label %61, label %58

58:                                               ; preds = %53
  %59 = load i64, ptr %51, align 8, !tbaa !24
  %60 = load i64, ptr %45, align 8, !tbaa !24
  br label %61

61:                                               ; preds = %44, %50, %53, %58
  %.175 = phi i64 [ %59, %58 ], [ %.07480, %53 ], [ %.07480, %50 ], [ %.07480, %44 ]
  %.173 = phi i64 [ %60, %58 ], [ %.07281, %53 ], [ %.07281, %50 ], [ %.07281, %44 ]
  %62 = add nsw i64 %.07082, 1
  %63 = load i64, ptr %39, align 8, !tbaa !24
  %64 = icmp slt i64 %62, %63
  br i1 %64, label %44, label %._crit_edge, !llvm.loop !26

._crit_edge:                                      ; preds = %61, %36
  %.072.lcssa = phi i64 [ %32, %36 ], [ %.173, %61 ]
  %65 = add nsw i64 %.07183, 1
  %66 = getelementptr inbounds i64, ptr %24, i64 %.072.lcssa
  store i64 %.07183, ptr %66, align 8, !tbaa !24
  %67 = getelementptr inbounds i64, ptr %24, i64 %32
  store i64 %.07183, ptr %67, align 8, !tbaa !24
  store i64 %.072.lcssa, ptr %33, align 8, !tbaa !24
  %68 = getelementptr inbounds i64, ptr %26, i64 %.072.lcssa
  store i64 %32, ptr %68, align 8, !tbaa !24
  br label %69

69:                                               ; preds = %30, %._crit_edge
  %.1 = phi i64 [ %65, %._crit_edge ], [ %.07183, %30 ]
  %70 = add nuw nsw i64 %.084, 1
  %exitcond.not = icmp eq i64 %70, %12
  br i1 %exitcond.not, label %._crit_edge87, label %30, !llvm.loop !28

._crit_edge87:                                    ; preds = %69, %11
  %.071.lcssa = phi i64 [ 0, %11 ], [ %.1, %69 ]
  %71 = load i64, ptr %3, align 8, !tbaa !5
  %72 = and i64 %71, 1
  %.not77 = icmp eq i64 %72, 0
  br i1 %.not77, label %78, label %73

73:                                               ; preds = %._crit_edge87
  %74 = tail call double @gk_CPUSeconds() #2
  %75 = getelementptr inbounds i8, ptr %0, i64 168
  %76 = load double, ptr %75, align 8, !tbaa !14
  %77 = fadd double %74, %76
  store double %77, ptr %75, align 8, !tbaa !14
  br label %78

78:                                               ; preds = %73, %._crit_edge87
  tail call void @libmetis__CreateCoarseGraph(ptr noundef nonnull %0, ptr noundef nonnull %1, i64 noundef %.071.lcssa, ptr noundef %26, ptr noundef %27) #2
  tail call void @libmetis__idxwspacefree(ptr noundef nonnull %0, i64 noundef %12) #2
  tail call void @libmetis__idxwspacefree(ptr noundef nonnull %0, i64 noundef %12) #2
  ret void
}

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


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