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

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

@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @libmetis__MMDOrder(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, 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
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i64 %3, ptr %8, align 8, !tbaa !9
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.graphdef, ptr %24, i32 0, i32 0
  %26 = load i64, ptr %25, align 8, !tbaa !11
  store i64 %26, ptr %12, align 8, !tbaa !9
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.graphdef, ptr %27, i32 0, i32 2
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  store ptr %29, ptr %15, align 8, !tbaa !5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.graphdef, ptr %30, i32 0, i32 5
  %32 = load ptr, ptr %31, align 8, !tbaa !15
  store ptr %32, ptr %16, align 8, !tbaa !5
  %33 = load ptr, ptr %15, align 8, !tbaa !5
  %34 = load i64, ptr %12, align 8, !tbaa !9
  %35 = getelementptr inbounds i64, ptr %33, i64 %34
  %36 = load i64, ptr %35, align 8, !tbaa !9
  store i64 %36, ptr %11, align 8, !tbaa !9
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %37

37:                                               ; preds = %47, %4
  %38 = load i64, ptr %9, align 8, !tbaa !9
  %39 = load i64, ptr %11, align 8, !tbaa !9
  %40 = icmp slt i64 %38, %39
  br i1 %40, label %41, label %50

41:                                               ; preds = %37
  %42 = load ptr, ptr %16, align 8, !tbaa !5
  %43 = load i64, ptr %9, align 8, !tbaa !9
  %44 = getelementptr inbounds i64, ptr %42, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !9
  %46 = add nsw i64 %45, 1
  store i64 %46, ptr %44, align 8, !tbaa !9
  br label %47

47:                                               ; preds = %41
  %48 = load i64, ptr %9, align 8, !tbaa !9
  %49 = add nsw i64 %48, 1
  store i64 %49, ptr %9, align 8, !tbaa !9
  br label %37, !llvm.loop !16

50:                                               ; preds = %37
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %51

51:                                               ; preds = %62, %50
  %52 = load i64, ptr %9, align 8, !tbaa !9
  %53 = load i64, ptr %12, align 8, !tbaa !9
  %54 = add nsw i64 %53, 1
  %55 = icmp slt i64 %52, %54
  br i1 %55, label %56, label %65

56:                                               ; preds = %51
  %57 = load ptr, ptr %15, align 8, !tbaa !5
  %58 = load i64, ptr %9, align 8, !tbaa !9
  %59 = getelementptr inbounds i64, ptr %57, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !9
  %61 = add nsw i64 %60, 1
  store i64 %61, ptr %59, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %56
  %63 = load i64, ptr %9, align 8, !tbaa !9
  %64 = add nsw i64 %63, 1
  store i64 %64, ptr %9, align 8, !tbaa !9
  br label %51, !llvm.loop !18

65:                                               ; preds = %51
  %66 = load i64, ptr %12, align 8, !tbaa !9
  %67 = add nsw i64 %66, 5
  %68 = mul nsw i64 6, %67
  %69 = call ptr @libmetis__idxmalloc(i64 noundef %68, ptr noundef @.str.8)
  store ptr %69, ptr %18, align 8, !tbaa !5
  %70 = load ptr, ptr %18, align 8, !tbaa !5
  %71 = load i64, ptr %12, align 8, !tbaa !9
  %72 = getelementptr inbounds i64, ptr %70, i64 %71
  %73 = getelementptr inbounds i64, ptr %72, i64 5
  store ptr %73, ptr %19, align 8, !tbaa !5
  %74 = load ptr, ptr %19, align 8, !tbaa !5
  %75 = load i64, ptr %12, align 8, !tbaa !9
  %76 = getelementptr inbounds i64, ptr %74, i64 %75
  %77 = getelementptr inbounds i64, ptr %76, i64 5
  store ptr %77, ptr %20, align 8, !tbaa !5
  %78 = load ptr, ptr %20, align 8, !tbaa !5
  %79 = load i64, ptr %12, align 8, !tbaa !9
  %80 = getelementptr inbounds i64, ptr %78, i64 %79
  %81 = getelementptr inbounds i64, ptr %80, i64 5
  store ptr %81, ptr %21, align 8, !tbaa !5
  %82 = load ptr, ptr %21, align 8, !tbaa !5
  %83 = load i64, ptr %12, align 8, !tbaa !9
  %84 = getelementptr inbounds i64, ptr %82, i64 %83
  %85 = getelementptr inbounds i64, ptr %84, i64 5
  store ptr %85, ptr %22, align 8, !tbaa !5
  %86 = load ptr, ptr %22, align 8, !tbaa !5
  %87 = load i64, ptr %12, align 8, !tbaa !9
  %88 = getelementptr inbounds i64, ptr %86, i64 %87
  %89 = getelementptr inbounds i64, ptr %88, i64 5
  store ptr %89, ptr %23, align 8, !tbaa !5
  %90 = load i64, ptr %12, align 8, !tbaa !9
  %91 = load ptr, ptr %15, align 8, !tbaa !5
  %92 = load ptr, ptr %16, align 8, !tbaa !5
  %93 = load ptr, ptr %19, align 8, !tbaa !5
  %94 = load ptr, ptr %18, align 8, !tbaa !5
  %95 = load ptr, ptr %20, align 8, !tbaa !5
  %96 = load ptr, ptr %21, align 8, !tbaa !5
  %97 = load ptr, ptr %22, align 8, !tbaa !5
  %98 = load ptr, ptr %23, align 8, !tbaa !5
  call void @libmetis__genmmd(i64 noundef %90, ptr noundef %91, ptr noundef %92, ptr noundef %93, ptr noundef %94, i64 noundef 1, ptr noundef %95, ptr noundef %96, ptr noundef %97, ptr noundef %98, i64 noundef 4611686018427387904, ptr noundef %13)
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.graphdef, ptr %99, i32 0, i32 14
  %101 = load ptr, ptr %100, align 8, !tbaa !19
  store ptr %101, ptr %17, align 8, !tbaa !5
  %102 = load i64, ptr %8, align 8, !tbaa !9
  %103 = load i64, ptr %12, align 8, !tbaa !9
  %104 = sub nsw i64 %102, %103
  store i64 %104, ptr %14, align 8, !tbaa !9
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %105

105:                                              ; preds = %123, %65
  %106 = load i64, ptr %9, align 8, !tbaa !9
  %107 = load i64, ptr %12, align 8, !tbaa !9
  %108 = icmp slt i64 %106, %107
  br i1 %108, label %109, label %126

109:                                              ; preds = %105
  %110 = load i64, ptr %14, align 8, !tbaa !9
  %111 = load ptr, ptr %19, align 8, !tbaa !5
  %112 = load i64, ptr %9, align 8, !tbaa !9
  %113 = getelementptr inbounds i64, ptr %111, i64 %112
  %114 = load i64, ptr %113, align 8, !tbaa !9
  %115 = add nsw i64 %110, %114
  %116 = sub nsw i64 %115, 1
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = load ptr, ptr %17, align 8, !tbaa !5
  %119 = load i64, ptr %9, align 8, !tbaa !9
  %120 = getelementptr inbounds i64, ptr %118, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !9
  %122 = getelementptr inbounds i64, ptr %117, i64 %121
  store i64 %116, ptr %122, align 8, !tbaa !9
  br label %123

123:                                              ; preds = %109
  %124 = load i64, ptr %9, align 8, !tbaa !9
  %125 = add nsw i64 %124, 1
  store i64 %125, ptr %9, align 8, !tbaa !9
  br label %105, !llvm.loop !20

126:                                              ; preds = %105
  call void (ptr, ...) @gk_free(ptr noundef %18, ptr noundef null)
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %127

127:                                              ; preds = %138, %126
  %128 = load i64, ptr %9, align 8, !tbaa !9
  %129 = load i64, ptr %12, align 8, !tbaa !9
  %130 = add nsw i64 %129, 1
  %131 = icmp slt i64 %128, %130
  br i1 %131, label %132, label %141

132:                                              ; preds = %127
  %133 = load ptr, ptr %15, align 8, !tbaa !5
  %134 = load i64, ptr %9, align 8, !tbaa !9
  %135 = getelementptr inbounds i64, ptr %133, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !9
  %137 = add nsw i64 %136, -1
  store i64 %137, ptr %135, align 8, !tbaa !9
  br label %138

138:                                              ; preds = %132
  %139 = load i64, ptr %9, align 8, !tbaa !9
  %140 = add nsw i64 %139, 1
  store i64 %140, ptr %9, align 8, !tbaa !9
  br label %127, !llvm.loop !21

141:                                              ; preds = %127
  %142 = load ptr, ptr %15, align 8, !tbaa !5
  %143 = load i64, ptr %12, align 8, !tbaa !9
  %144 = getelementptr inbounds i64, ptr %142, i64 %143
  %145 = load i64, ptr %144, align 8, !tbaa !9
  store i64 %145, ptr %11, align 8, !tbaa !9
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %146

146:                                              ; preds = %156, %141
  %147 = load i64, ptr %9, align 8, !tbaa !9
  %148 = load i64, ptr %11, align 8, !tbaa !9
  %149 = icmp slt i64 %147, %148
  br i1 %149, label %150, label %159

150:                                              ; preds = %146
  %151 = load ptr, ptr %16, align 8, !tbaa !5
  %152 = load i64, ptr %9, align 8, !tbaa !9
  %153 = getelementptr inbounds i64, ptr %151, i64 %152
  %154 = load i64, ptr %153, align 8, !tbaa !9
  %155 = add nsw i64 %154, -1
  store i64 %155, ptr %153, align 8, !tbaa !9
  br label %156

156:                                              ; preds = %150
  %157 = load i64, ptr %9, align 8, !tbaa !9
  %158 = add nsw i64 %157, 1
  store i64 %158, ptr %9, align 8, !tbaa !9
  br label %146, !llvm.loop !22

159:                                              ; preds = %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  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
  ret void
}

declare void @libmetis__genmmd(i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 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 0}
!12 = !{!"graphdef", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !13, 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}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !6, i64 16}
!15 = !{!12, !6, i64 40}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!12, !6, i64 96}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17}


; 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.8 = external hidden unnamed_addr constant [15 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

; 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__idxmalloc(i64 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @libmetis__MMDOrder(ptr nocapture noundef readnone %0, ptr nocapture noundef readonly %1, ptr nocapture noundef writeonly %2, i64 noundef %3) local_unnamed_addr #2 {
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %7 = load i64, ptr %1, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %1, i64 16
  %9 = load ptr, ptr %8, align 8, !tbaa !12
  %10 = getelementptr inbounds i8, ptr %1, i64 40
  %11 = load ptr, ptr %10, align 8, !tbaa !13
  %12 = getelementptr inbounds i64, ptr %9, i64 %7
  %13 = load i64, ptr %12, align 8, !tbaa !14
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph.preheader, label %.preheader

.lr.ph.preheader:                                 ; preds = %4
  %min.iters.check = icmp ult i64 %13, 4
  br i1 %min.iters.check, label %.lr.ph.preheader122, label %vector.ph

.lr.ph.preheader122:                              ; preds = %middle.block, %.lr.ph.preheader
  %.058.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %15 = getelementptr inbounds i64, ptr %11, i64 %index
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  %wide.load = load <2 x i64>, ptr %15, align 8, !tbaa !14
  %wide.load79 = load <2 x i64>, ptr %16, align 8, !tbaa !14
  %17 = add nsw <2 x i64> %wide.load, <i64 1, i64 1>
  %18 = add nsw <2 x i64> %wide.load79, <i64 1, i64 1>
  store <2 x i64> %17, ptr %15, align 8, !tbaa !14
  store <2 x i64> %18, ptr %16, align 8, !tbaa !14
  %index.next = add nuw i64 %index, 4
  %19 = icmp eq i64 %index.next, %n.vec
  br i1 %19, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %13, %n.vec
  br i1 %cmp.n, label %.preheader, label %.lr.ph.preheader122

.preheader:                                       ; preds = %.lr.ph, %middle.block, %4
  %.not59 = icmp slt i64 %7, 0
  br i1 %.not59, label %._crit_edge, label %.lr.ph61.preheader

.lr.ph61.preheader:                               ; preds = %.preheader
  %20 = add nuw i64 %7, 1
  %min.iters.check82 = icmp ult i64 %7, 3
  br i1 %min.iters.check82, label %.lr.ph61.preheader121, label %vector.ph83

.lr.ph61.preheader121:                            ; preds = %middle.block80, %.lr.ph61.preheader
  %.160.ph = phi i64 [ 0, %.lr.ph61.preheader ], [ %n.vec85, %middle.block80 ]
  br label %.lr.ph61

vector.ph83:                                      ; preds = %.lr.ph61.preheader
  %n.vec85 = and i64 %20, -4
  br label %vector.body87

vector.body87:                                    ; preds = %vector.body87, %vector.ph83
  %index88 = phi i64 [ 0, %vector.ph83 ], [ %index.next91, %vector.body87 ]
  %21 = getelementptr inbounds i64, ptr %9, i64 %index88
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  %wide.load89 = load <2 x i64>, ptr %21, align 8, !tbaa !14
  %wide.load90 = load <2 x i64>, ptr %22, align 8, !tbaa !14
  %23 = add nsw <2 x i64> %wide.load89, <i64 1, i64 1>
  %24 = add nsw <2 x i64> %wide.load90, <i64 1, i64 1>
  store <2 x i64> %23, ptr %21, align 8, !tbaa !14
  store <2 x i64> %24, ptr %22, align 8, !tbaa !14
  %index.next91 = add nuw i64 %index88, 4
  %25 = icmp eq i64 %index.next91, %n.vec85
  br i1 %25, label %middle.block80, label %vector.body87, !llvm.loop !19

middle.block80:                                   ; preds = %vector.body87
  %cmp.n92 = icmp eq i64 %20, %n.vec85
  br i1 %cmp.n92, label %._crit_edge, label %.lr.ph61.preheader121

.lr.ph:                                           ; preds = %.lr.ph.preheader122, %.lr.ph
  %.058 = phi i64 [ %29, %.lr.ph ], [ %.058.ph, %.lr.ph.preheader122 ]
  %26 = getelementptr inbounds i64, ptr %11, i64 %.058
  %27 = load i64, ptr %26, align 8, !tbaa !14
  %28 = add nsw i64 %27, 1
  store i64 %28, ptr %26, align 8, !tbaa !14
  %29 = add nuw nsw i64 %.058, 1
  %exitcond.not = icmp eq i64 %29, %13
  br i1 %exitcond.not, label %.preheader, label %.lr.ph, !llvm.loop !20

.lr.ph61:                                         ; preds = %.lr.ph61.preheader121, %.lr.ph61
  %.160 = phi i64 [ %33, %.lr.ph61 ], [ %.160.ph, %.lr.ph61.preheader121 ]
  %30 = getelementptr inbounds i64, ptr %9, i64 %.160
  %31 = load i64, ptr %30, align 8, !tbaa !14
  %32 = add nsw i64 %31, 1
  store i64 %32, ptr %30, align 8, !tbaa !14
  %33 = add nuw i64 %.160, 1
  %exitcond75.not = icmp eq i64 %.160, %7
  br i1 %exitcond75.not, label %._crit_edge, label %.lr.ph61, !llvm.loop !21

._crit_edge:                                      ; preds = %.lr.ph61, %middle.block80, %.preheader
  %34 = mul i64 %7, 6
  %35 = add i64 %34, 30
  %36 = tail call ptr @libmetis__idxmalloc(i64 noundef %35, ptr noundef nonnull @.str.8) #3
  store ptr %36, ptr %6, align 8, !tbaa !22
  %37 = getelementptr inbounds i64, ptr %36, i64 %7
  %38 = getelementptr inbounds i8, ptr %37, i64 40
  %39 = getelementptr inbounds i64, ptr %38, i64 %7
  %40 = getelementptr inbounds i8, ptr %39, i64 40
  %41 = getelementptr inbounds i64, ptr %40, i64 %7
  %42 = getelementptr inbounds i8, ptr %41, i64 40
  %43 = getelementptr inbounds i64, ptr %42, i64 %7
  %44 = getelementptr inbounds i8, ptr %43, i64 40
  %45 = getelementptr inbounds i64, ptr %44, i64 %7
  %46 = getelementptr inbounds i8, ptr %45, i64 40
  call void @libmetis__genmmd(i64 noundef %7, ptr noundef %9, ptr noundef %11, ptr noundef nonnull %38, ptr noundef %36, i64 noundef 1, ptr noundef nonnull %40, ptr noundef nonnull %42, ptr noundef nonnull %44, ptr noundef nonnull %46, i64 noundef 4611686018427387904, ptr noundef nonnull %5) #3
  %47 = getelementptr inbounds i8, ptr %1, i64 96
  %48 = load ptr, ptr %47, align 8, !tbaa !23
  %49 = icmp sgt i64 %7, 0
  br i1 %49, label %.lr.ph64, label %._crit_edge65

.lr.ph64:                                         ; preds = %._crit_edge
  %50 = xor i64 %7, -1
  %51 = add i64 %50, %3
  %xtraiter = and i64 %7, 3
  %52 = icmp ult i64 %7, 4
  br i1 %52, label %._crit_edge65.loopexit.unr-lcssa, label %.lr.ph64.new

.lr.ph64.new:                                     ; preds = %.lr.ph64
  %unroll_iter = and i64 %7, 9223372036854775804
  br label %53

53:                                               ; preds = %53, %.lr.ph64.new
  %.262 = phi i64 [ 0, %.lr.ph64.new ], [ %81, %53 ]
  %niter = phi i64 [ 0, %.lr.ph64.new ], [ %niter.next.3, %53 ]
  %54 = getelementptr inbounds i64, ptr %38, i64 %.262
  %55 = load i64, ptr %54, align 8, !tbaa !14
  %56 = add i64 %51, %55
  %57 = getelementptr inbounds i64, ptr %48, i64 %.262
  %58 = load i64, ptr %57, align 8, !tbaa !14
  %59 = getelementptr inbounds i64, ptr %2, i64 %58
  store i64 %56, ptr %59, align 8, !tbaa !14
  %60 = or disjoint i64 %.262, 1
  %61 = getelementptr inbounds i64, ptr %38, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !14
  %63 = add i64 %51, %62
  %64 = getelementptr inbounds i64, ptr %48, i64 %60
  %65 = load i64, ptr %64, align 8, !tbaa !14
  %66 = getelementptr inbounds i64, ptr %2, i64 %65
  store i64 %63, ptr %66, align 8, !tbaa !14
  %67 = or disjoint i64 %.262, 2
  %68 = getelementptr inbounds i64, ptr %38, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !14
  %70 = add i64 %51, %69
  %71 = getelementptr inbounds i64, ptr %48, i64 %67
  %72 = load i64, ptr %71, align 8, !tbaa !14
  %73 = getelementptr inbounds i64, ptr %2, i64 %72
  store i64 %70, ptr %73, align 8, !tbaa !14
  %74 = or disjoint i64 %.262, 3
  %75 = getelementptr inbounds i64, ptr %38, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !14
  %77 = add i64 %51, %76
  %78 = getelementptr inbounds i64, ptr %48, i64 %74
  %79 = load i64, ptr %78, align 8, !tbaa !14
  %80 = getelementptr inbounds i64, ptr %2, i64 %79
  store i64 %77, ptr %80, align 8, !tbaa !14
  %81 = add nuw nsw i64 %.262, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge65.loopexit.unr-lcssa, label %53, !llvm.loop !24

._crit_edge65.loopexit.unr-lcssa:                 ; preds = %53, %.lr.ph64
  %.262.unr = phi i64 [ 0, %.lr.ph64 ], [ %81, %53 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge65, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge65.loopexit.unr-lcssa, %.epil.preheader
  %.262.epil = phi i64 [ %88, %.epil.preheader ], [ %.262.unr, %._crit_edge65.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge65.loopexit.unr-lcssa ]
  %82 = getelementptr inbounds i64, ptr %38, i64 %.262.epil
  %83 = load i64, ptr %82, align 8, !tbaa !14
  %84 = add i64 %51, %83
  %85 = getelementptr inbounds i64, ptr %48, i64 %.262.epil
  %86 = load i64, ptr %85, align 8, !tbaa !14
  %87 = getelementptr inbounds i64, ptr %2, i64 %86
  store i64 %84, ptr %87, align 8, !tbaa !14
  %88 = add nuw nsw i64 %.262.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge65, label %.epil.preheader, !llvm.loop !25

._crit_edge65:                                    ; preds = %._crit_edge65.loopexit.unr-lcssa, %.epil.preheader, %._crit_edge
  call void (ptr, ...) @gk_free(ptr noundef nonnull %6, ptr noundef null) #3
  br i1 %.not59, label %._crit_edge70, label %.lr.ph69.preheader

.lr.ph69.preheader:                               ; preds = %._crit_edge65
  %89 = add nuw i64 %7, 1
  %min.iters.check95 = icmp ult i64 %7, 3
  br i1 %min.iters.check95, label %.lr.ph69.preheader120, label %vector.ph96

vector.ph96:                                      ; preds = %.lr.ph69.preheader
  %n.vec98 = and i64 %89, -4
  br label %vector.body100

vector.body100:                                   ; preds = %vector.body100, %vector.ph96
  %index101 = phi i64 [ 0, %vector.ph96 ], [ %index.next104, %vector.body100 ]
  %90 = getelementptr inbounds i64, ptr %9, i64 %index101
  %91 = getelementptr inbounds i8, ptr %90, i64 16
  %wide.load102 = load <2 x i64>, ptr %90, align 8, !tbaa !14
  %wide.load103 = load <2 x i64>, ptr %91, align 8, !tbaa !14
  %92 = add nsw <2 x i64> %wide.load102, <i64 -1, i64 -1>
  %93 = add nsw <2 x i64> %wide.load103, <i64 -1, i64 -1>
  store <2 x i64> %92, ptr %90, align 8, !tbaa !14
  store <2 x i64> %93, ptr %91, align 8, !tbaa !14
  %index.next104 = add nuw i64 %index101, 4
  %94 = icmp eq i64 %index.next104, %n.vec98
  br i1 %94, label %middle.block93, label %vector.body100, !llvm.loop !27

middle.block93:                                   ; preds = %vector.body100
  %cmp.n105 = icmp eq i64 %89, %n.vec98
  br i1 %cmp.n105, label %._crit_edge70, label %.lr.ph69.preheader120

.lr.ph69.preheader120:                            ; preds = %middle.block93, %.lr.ph69.preheader
  %.367.ph = phi i64 [ 0, %.lr.ph69.preheader ], [ %n.vec98, %middle.block93 ]
  br label %.lr.ph69

.lr.ph69:                                         ; preds = %.lr.ph69.preheader120, %.lr.ph69
  %.367 = phi i64 [ %98, %.lr.ph69 ], [ %.367.ph, %.lr.ph69.preheader120 ]
  %95 = getelementptr inbounds i64, ptr %9, i64 %.367
  %96 = load i64, ptr %95, align 8, !tbaa !14
  %97 = add nsw i64 %96, -1
  store i64 %97, ptr %95, align 8, !tbaa !14
  %98 = add nuw i64 %.367, 1
  %exitcond77.not = icmp eq i64 %.367, %7
  br i1 %exitcond77.not, label %._crit_edge70, label %.lr.ph69, !llvm.loop !28

._crit_edge70:                                    ; preds = %.lr.ph69, %middle.block93, %._crit_edge65
  %99 = load i64, ptr %12, align 8, !tbaa !14
  %100 = icmp sgt i64 %99, 0
  br i1 %100, label %.lr.ph73.preheader, label %._crit_edge74

.lr.ph73.preheader:                               ; preds = %._crit_edge70
  %min.iters.check108 = icmp ult i64 %99, 4
  br i1 %min.iters.check108, label %.lr.ph73.preheader119, label %vector.ph109

vector.ph109:                                     ; preds = %.lr.ph73.preheader
  %n.vec111 = and i64 %99, 9223372036854775804
  br label %vector.body113

vector.body113:                                   ; preds = %vector.body113, %vector.ph109
  %index114 = phi i64 [ 0, %vector.ph109 ], [ %index.next117, %vector.body113 ]
  %101 = getelementptr inbounds i64, ptr %11, i64 %index114
  %102 = getelementptr inbounds i8, ptr %101, i64 16
  %wide.load115 = load <2 x i64>, ptr %101, align 8, !tbaa !14
  %wide.load116 = load <2 x i64>, ptr %102, align 8, !tbaa !14
  %103 = add nsw <2 x i64> %wide.load115, <i64 -1, i64 -1>
  %104 = add nsw <2 x i64> %wide.load116, <i64 -1, i64 -1>
  store <2 x i64> %103, ptr %101, align 8, !tbaa !14
  store <2 x i64> %104, ptr %102, align 8, !tbaa !14
  %index.next117 = add nuw i64 %index114, 4
  %105 = icmp eq i64 %index.next117, %n.vec111
  br i1 %105, label %middle.block106, label %vector.body113, !llvm.loop !29

middle.block106:                                  ; preds = %vector.body113
  %cmp.n118 = icmp eq i64 %99, %n.vec111
  br i1 %cmp.n118, label %._crit_edge74, label %.lr.ph73.preheader119

.lr.ph73.preheader119:                            ; preds = %middle.block106, %.lr.ph73.preheader
  %.471.ph = phi i64 [ 0, %.lr.ph73.preheader ], [ %n.vec111, %middle.block106 ]
  br label %.lr.ph73

.lr.ph73:                                         ; preds = %.lr.ph73.preheader119, %.lr.ph73
  %.471 = phi i64 [ %109, %.lr.ph73 ], [ %.471.ph, %.lr.ph73.preheader119 ]
  %106 = getelementptr inbounds i64, ptr %11, i64 %.471
  %107 = load i64, ptr %106, align 8, !tbaa !14
  %108 = add nsw i64 %107, -1
  store i64 %108, ptr %106, align 8, !tbaa !14
  %109 = add nuw nsw i64 %.471, 1
  %exitcond78.not = icmp eq i64 %109, %99
  br i1 %exitcond78.not, label %._crit_edge74, label %.lr.ph73, !llvm.loop !30

._crit_edge74:                                    ; preds = %.lr.ph73, %middle.block106, %._crit_edge70
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  ret void
}

declare void @libmetis__genmmd(i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 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, !7, i64 0}
!6 = !{!"graphdef", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !7, i64 112, !7, i64 120, !10, i64 128, !10, i64 136, !7, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !7, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !10, i64 16}
!13 = !{!6, !10, i64 40}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16, !17, !18}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !16, !17, !18}
!20 = distinct !{!20, !16, !18, !17}
!21 = distinct !{!21, !16, !18, !17}
!22 = !{!10, !10, i64 0}
!23 = !{!6, !10, i64 96}
!24 = distinct !{!24, !16}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.unroll.disable"}
!27 = distinct !{!27, !16, !17, !18}
!28 = distinct !{!28, !16, !18, !17}
!29 = distinct !{!29, !16, !17, !18}
!30 = distinct !{!30, !16, !18, !17}


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