; LLVM IR from ekoontz/graphlab :: src/graphlab/extern/metis/libmetis (pmetis)

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

@.str.1 = external hidden unnamed_addr constant [18 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 ptr @gk_fmalloc(i64 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @METIS_WPartGraphRecursive(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) #2 {
  %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
  %29 = alloca ptr, 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #3
  %30 = load ptr, ptr %19, align 8, !tbaa !5
  %31 = load i64, ptr %30, align 8, !tbaa !9
  %32 = icmp eq i64 %31, 1
  br i1 %32, label %33, label %38

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

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

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

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

73:                                               ; preds = %56, %51
  %74 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 7
  store i64 1, ptr %74, align 8, !tbaa !19
  %75 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 0
  store i64 20, ptr %75, align 8, !tbaa !20
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = load i64, ptr %76, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct.graphdef, ptr %27, i32 0, i32 3
  %79 = load ptr, ptr %78, align 8, !tbaa !21
  %80 = call i64 @libmetis__idxsum(i64 noundef %77, ptr noundef %79, i64 noundef 1)
  %81 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 0
  %82 = load i64, ptr %81, align 8, !tbaa !20
  %83 = sdiv i64 %80, %82
  %84 = sitofp i64 %83 to double
  %85 = fmul double 1.500000e+00, %84
  %86 = fptosi double %85 to i64
  %87 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 5
  store i64 %86, ptr %87, align 8, !tbaa !24
  %88 = load ptr, ptr %20, align 8, !tbaa !5
  %89 = load i64, ptr %88, align 8, !tbaa !9
  %90 = call ptr @gk_fmalloc(i64 noundef %89, ptr noundef @.str.1)
  store ptr %90, ptr %29, align 8, !tbaa !5
  store i64 0, ptr %25, align 8, !tbaa !9
  br label %91

91:                                               ; preds = %104, %73
  %92 = load i64, ptr %25, align 8, !tbaa !9
  %93 = load ptr, ptr %20, align 8, !tbaa !5
  %94 = load i64, ptr %93, align 8, !tbaa !9
  %95 = icmp slt i64 %92, %94
  br i1 %95, label %96, label %107

96:                                               ; preds = %91
  %97 = load ptr, ptr %21, align 8, !tbaa !5
  %98 = load i64, ptr %25, align 8, !tbaa !9
  %99 = getelementptr inbounds float, ptr %97, i64 %98
  %100 = load float, ptr %99, align 4, !tbaa !25
  %101 = load ptr, ptr %29, align 8, !tbaa !5
  %102 = load i64, ptr %25, align 8, !tbaa !9
  %103 = getelementptr inbounds float, ptr %101, i64 %102
  store float %100, ptr %103, align 4, !tbaa !25
  br label %104

104:                                              ; preds = %96
  %105 = load i64, ptr %25, align 8, !tbaa !9
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr %25, align 8, !tbaa !9
  br label %91, !llvm.loop !26

107:                                              ; preds = %91
  call void @libmetis__InitRandom(i64 noundef -1)
  %108 = load ptr, ptr %20, align 8, !tbaa !5
  %109 = load i64, ptr %108, align 8, !tbaa !9
  call void @libmetis__AllocateWorkSpace(ptr noundef %28, ptr noundef %27, i64 noundef %109)
  %110 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 1
  %111 = load i64, ptr %110, align 8, !tbaa !18
  %112 = and i64 %111, 1
  %113 = icmp ne i64 %112, 0
  br i1 %113, label %114, label %115

114:                                              ; preds = %107
  call void @libmetis__InitTimers(ptr noundef %28)
  br label %115

115:                                              ; preds = %114, %107
  %116 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 1
  %117 = load i64, ptr %116, align 8, !tbaa !18
  %118 = and i64 %117, 1
  %119 = icmp ne i64 %118, 0
  br i1 %119, label %120, label %125

120:                                              ; preds = %115
  %121 = call double @gk_CPUSeconds()
  %122 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 12
  %123 = load double, ptr %122, align 8, !tbaa !28
  %124 = fsub double %123, %121
  store double %124, ptr %122, align 8, !tbaa !28
  br label %125

125:                                              ; preds = %120, %115
  %126 = load ptr, ptr %20, align 8, !tbaa !5
  %127 = load i64, ptr %126, align 8, !tbaa !9
  %128 = load ptr, ptr %24, align 8, !tbaa !5
  %129 = load ptr, ptr %29, align 8, !tbaa !5
  %130 = call i64 @libmetis__MlevelRecursiveBisection(ptr noundef %28, ptr noundef %27, i64 noundef %127, ptr noundef %128, ptr noundef %129, float noundef 1.000000e+00, i64 noundef 0)
  %131 = load ptr, ptr %23, align 8, !tbaa !5
  store i64 %130, ptr %131, align 8, !tbaa !9
  %132 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 1
  %133 = load i64, ptr %132, align 8, !tbaa !18
  %134 = and i64 %133, 1
  %135 = icmp ne i64 %134, 0
  br i1 %135, label %136, label %141

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

141:                                              ; preds = %136, %125
  %142 = getelementptr inbounds %struct.controldef, ptr %28, i32 0, i32 1
  %143 = load i64, ptr %142, align 8, !tbaa !18
  %144 = and i64 %143, 1
  %145 = icmp ne i64 %144, 0
  br i1 %145, label %146, label %147

146:                                              ; preds = %141
  call void @libmetis__PrintTimers(ptr noundef %28)
  br label %147

147:                                              ; preds = %146, %141
  call void @libmetis__FreeWorkSpace(ptr noundef %28, ptr noundef %27)
  call void (ptr, ...) @gk_free(ptr noundef %29, ptr noundef null)
  %148 = load ptr, ptr %19, align 8, !tbaa !5
  %149 = load i64, ptr %148, align 8, !tbaa !9
  %150 = icmp eq i64 %149, 1
  br i1 %150, label %151, label %157

151:                                              ; preds = %147
  %152 = load ptr, ptr %13, align 8, !tbaa !5
  %153 = load i64, ptr %152, align 8, !tbaa !9
  %154 = load ptr, ptr %14, align 8, !tbaa !5
  %155 = load ptr, ptr %15, align 8, !tbaa !5
  %156 = load ptr, ptr %24, align 8, !tbaa !5
  call void @libmetis__Change2FNumbering(i64 noundef %153, ptr noundef %154, ptr noundef %155, ptr noundef %156)
  br label %157

157:                                              ; preds = %151, %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #3
  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
}

declare void @gk_free(ptr noundef, ...) #1

; 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) #1

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

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

declare void @libmetis__InitRandom(i64 noundef) #1

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

declare void @libmetis__InitTimers(ptr noundef) #1

declare double @gk_CPUSeconds() #1

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

declare void @libmetis__PrintTimers(ptr noundef) #1

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

declare void @libmetis__Change2FNumbering(i64 noundef, 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 = !{!"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 = !{!13, !13, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!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 }

@.str.1 = external hidden unnamed_addr constant [18 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 ptr @gk_fmalloc(i64 noundef, ptr noundef) local_unnamed_addr #1

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

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

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

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

33:                                               ; preds = %21, %26
  %.sink35 = phi i64 [ %30, %26 ], [ 1, %21 ]
  %.sink = phi i64 [ %32, %26 ], [ 0, %21 ]
  %34 = phi <2 x i64> [ %28, %26 ], [ <i64 3, i64 1>, %21 ]
  %35 = getelementptr inbounds i8, ptr %15, i64 16
  store <2 x i64> %34, ptr %35, align 8
  %36 = getelementptr inbounds i8, ptr %15, i64 32
  store i64 %.sink35, ptr %36, align 8
  %37 = getelementptr inbounds i8, ptr %15, i64 8
  store i64 %.sink, ptr %37, align 8
  %38 = getelementptr inbounds i8, ptr %15, i64 56
  store i64 1, ptr %38, align 8, !tbaa !9
  store i64 20, ptr %15, align 8, !tbaa !15
  %39 = load i64, ptr %0, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %14, i64 24
  %41 = load ptr, ptr %40, align 8, !tbaa !16
  %42 = call i64 @libmetis__idxsum(i64 noundef %39, ptr noundef %41, i64 noundef 1) #3
  %43 = sdiv i64 %42, 20
  %44 = sitofp i64 %43 to double
  %45 = fmul double %44, 1.500000e+00
  %46 = fptosi double %45 to i64
  %47 = getelementptr inbounds i8, ptr %15, i64 40
  store i64 %46, ptr %47, align 8, !tbaa !19
  %48 = load i64, ptr %7, align 8, !tbaa !5
  %49 = call ptr @gk_fmalloc(i64 noundef %48, ptr noundef nonnull @.str.1) #3
  store ptr %49, ptr %16, align 8, !tbaa !20
  %50 = load i64, ptr %7, align 8, !tbaa !5
  %51 = icmp sgt i64 %50, 0
  br i1 %51, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %33
  %52 = ptrtoint ptr %49 to i64
  %min.iters.check = icmp ult i64 %50, 8
  %53 = sub i64 %52, %13
  %diff.check = icmp ult i64 %53, 32
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %.lr.ph.preheader46, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %50, 9223372036854775800
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %54 = getelementptr inbounds float, ptr %8, i64 %index
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  %wide.load = load <4 x float>, ptr %54, align 4, !tbaa !21
  %wide.load45 = load <4 x float>, ptr %55, align 4, !tbaa !21
  %56 = getelementptr inbounds float, ptr %49, i64 %index
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  store <4 x float> %wide.load, ptr %56, align 4, !tbaa !21
  store <4 x float> %wide.load45, ptr %57, align 4, !tbaa !21
  %index.next = add nuw i64 %index, 8
  %58 = icmp eq i64 %index.next, %n.vec
  br i1 %58, label %middle.block, label %vector.body, !llvm.loop !22

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %50, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader46

.lr.ph.preheader46:                               ; preds = %middle.block, %.lr.ph.preheader
  %.034.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %50, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader46, %.lr.ph.prol
  %.034.prol = phi i64 [ %62, %.lr.ph.prol ], [ %.034.ph, %.lr.ph.preheader46 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader46 ]
  %59 = getelementptr inbounds float, ptr %8, i64 %.034.prol
  %60 = load float, ptr %59, align 4, !tbaa !21
  %61 = getelementptr inbounds float, ptr %49, i64 %.034.prol
  store float %60, ptr %61, align 4, !tbaa !21
  %62 = add nuw nsw i64 %.034.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !26

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader46
  %.034.unr = phi i64 [ %.034.ph, %.lr.ph.preheader46 ], [ %62, %.lr.ph.prol ]
  %63 = sub nsw i64 %.034.ph, %50
  %64 = icmp ugt i64 %63, -4
  br i1 %64, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %.034 = phi i64 [ %80, %.lr.ph ], [ %.034.unr, %.lr.ph.prol.loopexit ]
  %65 = getelementptr inbounds float, ptr %8, i64 %.034
  %66 = load float, ptr %65, align 4, !tbaa !21
  %67 = getelementptr inbounds float, ptr %49, i64 %.034
  store float %66, ptr %67, align 4, !tbaa !21
  %68 = add nuw nsw i64 %.034, 1
  %69 = getelementptr inbounds float, ptr %8, i64 %68
  %70 = load float, ptr %69, align 4, !tbaa !21
  %71 = getelementptr inbounds float, ptr %49, i64 %68
  store float %70, ptr %71, align 4, !tbaa !21
  %72 = add nuw nsw i64 %.034, 2
  %73 = getelementptr inbounds float, ptr %8, i64 %72
  %74 = load float, ptr %73, align 4, !tbaa !21
  %75 = getelementptr inbounds float, ptr %49, i64 %72
  store float %74, ptr %75, align 4, !tbaa !21
  %76 = add nuw nsw i64 %.034, 3
  %77 = getelementptr inbounds float, ptr %8, i64 %76
  %78 = load float, ptr %77, align 4, !tbaa !21
  %79 = getelementptr inbounds float, ptr %49, i64 %76
  store float %78, ptr %79, align 4, !tbaa !21
  %80 = add nuw nsw i64 %.034, 4
  %exitcond.not.3 = icmp eq i64 %80, %50
  br i1 %exitcond.not.3, label %._crit_edge, label %.lr.ph, !llvm.loop !28

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block, %33
  call void @libmetis__InitRandom(i64 noundef -1) #3
  %81 = load i64, ptr %7, align 8, !tbaa !5
  call void @libmetis__AllocateWorkSpace(ptr noundef nonnull %15, ptr noundef nonnull %14, i64 noundef %81) #3
  %82 = load i64, ptr %37, align 8, !tbaa !29
  %83 = and i64 %82, 1
  %.not = icmp eq i64 %83, 0
  br i1 %.not, label %.thread, label %84

84:                                               ; preds = %._crit_edge
  call void @libmetis__InitTimers(ptr noundef nonnull %15) #3
  %.pre = load i64, ptr %37, align 8, !tbaa !29
  %.pre39 = and i64 %.pre, 1
  %85 = icmp eq i64 %.pre39, 0
  br i1 %85, label %.thread, label %86

86:                                               ; preds = %84
  %87 = call double @gk_CPUSeconds() #3
  %88 = getelementptr inbounds i8, ptr %15, i64 152
  %89 = load double, ptr %88, align 8, !tbaa !30
  %90 = fsub double %89, %87
  store double %90, ptr %88, align 8, !tbaa !30
  br label %.thread

.thread:                                          ; preds = %._crit_edge, %86, %84
  %91 = load i64, ptr %7, align 8, !tbaa !5
  %92 = call i64 @libmetis__MlevelRecursiveBisection(ptr noundef nonnull %15, ptr noundef nonnull %14, i64 noundef %91, ptr noundef %11, ptr noundef %49, float noundef 1.000000e+00, i64 noundef 0)
  store i64 %92, ptr %10, align 8, !tbaa !5
  %93 = load i64, ptr %37, align 8, !tbaa !29
  %94 = and i64 %93, 1
  %.not32 = icmp eq i64 %94, 0
  br i1 %.not32, label %.thread43, label %95

95:                                               ; preds = %.thread
  %96 = call double @gk_CPUSeconds() #3
  %97 = getelementptr inbounds i8, ptr %15, i64 152
  %98 = load double, ptr %97, align 8, !tbaa !30
  %99 = fadd double %96, %98
  store double %99, ptr %97, align 8, !tbaa !30
  %.pre38 = load i64, ptr %37, align 8, !tbaa !29
  %.pre40 = and i64 %.pre38, 1
  %100 = icmp eq i64 %.pre40, 0
  br i1 %100, label %.thread43, label %101

101:                                              ; preds = %95
  call void @libmetis__PrintTimers(ptr noundef nonnull %15) #3
  br label %.thread43

.thread43:                                        ; preds = %.thread, %101, %95
  call void @libmetis__FreeWorkSpace(ptr noundef nonnull %15, ptr noundef nonnull %14) #3
  call void (ptr, ...) @gk_free(ptr noundef nonnull %16, ptr noundef null) #3
  %102 = load i64, ptr %6, align 8, !tbaa !5
  %103 = icmp eq i64 %102, 1
  br i1 %103, label %104, label %106

104:                                              ; preds = %.thread43
  %105 = load i64, ptr %0, align 8, !tbaa !5
  call void @libmetis__Change2FNumbering(i64 noundef %105, ptr noundef %1, ptr noundef %2, ptr noundef %11) #3
  br label %106

106:                                              ; preds = %104, %.thread43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #3
  call void @llvm.lifetime.end.p0(i64 280, ptr nonnull %15) #3
  call void @llvm.lifetime.end.p0(i64 248, ptr nonnull %14) #3
  ret void
}

declare void @gk_free(ptr noundef, ...) local_unnamed_addr #1

; 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 #1

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 #1

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

declare void @libmetis__InitRandom(i64 noundef) local_unnamed_addr #1

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

declare void @libmetis__InitTimers(ptr noundef) local_unnamed_addr #1

declare double @gk_CPUSeconds() local_unnamed_addr #1

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

declare void @libmetis__PrintTimers(ptr noundef) local_unnamed_addr #1

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

declare void @libmetis__Change2FNumbering(i64 noundef, ptr noundef, ptr noundef, ptr 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 = { 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 = !{!13, !13, i64 0}
!21 = !{!11, !11, i64 0}
!22 = distinct !{!22, !23, !24, !25}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!"llvm.loop.isvectorized", i32 1}
!25 = !{!"llvm.loop.unroll.runtime.disable"}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.unroll.disable"}
!28 = distinct !{!28, !23, !24}
!29 = !{!10, !6, i64 8}
!30 = !{!10, !14, i64 152}


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