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

; 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.ContactInfoType = type { i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.DTreeNodeType = type { i64, double, i64, i64, i64, i64, i64, i64 }

@.str.40 = external hidden unnamed_addr constant [30 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 i32 @mprintf(ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
define dso_local void @CheckDTree(i64 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  store i64 %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !9
  store ptr %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
  %16 = load ptr, ptr %8, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct.ContactInfoType, ptr %16, i32 0, i32 3
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  store ptr %18, ptr %13, align 8, !tbaa !9
  %19 = load ptr, ptr %8, align 8, !tbaa !9
  %20 = getelementptr inbounds %struct.ContactInfoType, ptr %19, i32 0, i32 4
  %21 = load ptr, ptr %20, align 8, !tbaa !13
  store ptr %21, ptr %14, align 8, !tbaa !9
  %22 = load ptr, ptr %8, align 8, !tbaa !9
  %23 = getelementptr inbounds %struct.ContactInfoType, ptr %22, i32 0, i32 8
  %24 = load ptr, ptr %23, align 8, !tbaa !14
  store ptr %24, ptr %15, align 8, !tbaa !9
  store i64 0, ptr %9, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %112, %4
  %26 = load i64, ptr %9, align 8, !tbaa !5
  %27 = load i64, ptr %5, align 8, !tbaa !5
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %29, label %115

29:                                               ; preds = %25
  store i64 0, ptr %12, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %67, %29
  %31 = load ptr, ptr %15, align 8, !tbaa !9
  %32 = load i64, ptr %12, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.DTreeNodeType, ptr %31, i64 %32
  %34 = getelementptr inbounds %struct.DTreeNodeType, ptr %33, i32 0, i32 4
  %35 = load i64, ptr %34, align 8, !tbaa !15
  %36 = icmp eq i64 %35, -1
  br i1 %36, label %37, label %69

37:                                               ; preds = %30
  %38 = load ptr, ptr %6, align 8, !tbaa !9
  %39 = load i64, ptr %9, align 8, !tbaa !5
  %40 = mul nsw i64 3, %39
  %41 = load ptr, ptr %15, align 8, !tbaa !9
  %42 = load i64, ptr %12, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.DTreeNodeType, ptr %41, i64 %42
  %44 = getelementptr inbounds %struct.DTreeNodeType, ptr %43, i32 0, i32 0
  %45 = load i64, ptr %44, align 8, !tbaa !18
  %46 = add nsw i64 %40, %45
  %47 = getelementptr inbounds double, ptr %38, i64 %46
  %48 = load double, ptr %47, align 8, !tbaa !19
  %49 = load ptr, ptr %15, align 8, !tbaa !9
  %50 = load i64, ptr %12, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.DTreeNodeType, ptr %49, i64 %50
  %52 = getelementptr inbounds %struct.DTreeNodeType, ptr %51, i32 0, i32 1
  %53 = load double, ptr %52, align 8, !tbaa !20
  %54 = fcmp ole double %48, %53
  br i1 %54, label %55, label %61

55:                                               ; preds = %37
  %56 = load ptr, ptr %15, align 8, !tbaa !9
  %57 = load i64, ptr %12, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.DTreeNodeType, ptr %56, i64 %57
  %59 = getelementptr inbounds %struct.DTreeNodeType, ptr %58, i32 0, i32 6
  %60 = load i64, ptr %59, align 8, !tbaa !21
  br label %67

61:                                               ; preds = %37
  %62 = load ptr, ptr %15, align 8, !tbaa !9
  %63 = load i64, ptr %12, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.DTreeNodeType, ptr %62, i64 %63
  %65 = getelementptr inbounds %struct.DTreeNodeType, ptr %64, i32 0, i32 7
  %66 = load i64, ptr %65, align 8, !tbaa !22
  br label %67

67:                                               ; preds = %61, %55
  %68 = phi i64 [ %60, %55 ], [ %66, %61 ]
  store i64 %68, ptr %12, align 8, !tbaa !5
  br label %30, !llvm.loop !23

69:                                               ; preds = %30
  %70 = load ptr, ptr %8, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct.ContactInfoType, ptr %70, i32 0, i32 7
  %72 = load ptr, ptr %71, align 8, !tbaa !25
  %73 = load i64, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds i64, ptr %72, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !5
  %76 = load ptr, ptr %15, align 8, !tbaa !9
  %77 = load i64, ptr %12, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.DTreeNodeType, ptr %76, i64 %77
  %79 = getelementptr inbounds %struct.DTreeNodeType, ptr %78, i32 0, i32 4
  %80 = load i64, ptr %79, align 8, !tbaa !15
  %81 = icmp ne i64 %75, %80
  br i1 %81, label %82, label %111

82:                                               ; preds = %69
  %83 = load i64, ptr %9, align 8, !tbaa !5
  %84 = load ptr, ptr %8, align 8, !tbaa !9
  %85 = getelementptr inbounds %struct.ContactInfoType, ptr %84, i32 0, i32 7
  %86 = load ptr, ptr %85, align 8, !tbaa !25
  %87 = load i64, ptr %9, align 8, !tbaa !5
  %88 = getelementptr inbounds i64, ptr %86, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !5
  %90 = load ptr, ptr %15, align 8, !tbaa !9
  %91 = load i64, ptr %12, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.DTreeNodeType, ptr %90, i64 %91
  %93 = getelementptr inbounds %struct.DTreeNodeType, ptr %92, i32 0, i32 4
  %94 = load i64, ptr %93, align 8, !tbaa !15
  %95 = load ptr, ptr %7, align 8, !tbaa !9
  %96 = load i64, ptr %9, align 8, !tbaa !5
  %97 = getelementptr inbounds i64, ptr %95, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !5
  %99 = load ptr, ptr %14, align 8, !tbaa !9
  %100 = load ptr, ptr %13, align 8, !tbaa !9
  %101 = load ptr, ptr %15, align 8, !tbaa !9
  %102 = load i64, ptr %12, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.DTreeNodeType, ptr %101, i64 %102
  %104 = getelementptr inbounds %struct.DTreeNodeType, ptr %103, i32 0, i32 4
  %105 = load i64, ptr %104, align 8, !tbaa !15
  %106 = getelementptr inbounds i64, ptr %100, i64 %105
  %107 = load i64, ptr %106, align 8, !tbaa !5
  %108 = getelementptr inbounds i64, ptr %99, i64 %107
  %109 = load i64, ptr %108, align 8, !tbaa !5
  %110 = call i32 (ptr, ...) @mprintf(ptr noundef @.str.40, i64 noundef %83, i64 noundef %89, i64 noundef %94, i64 noundef %98, i64 noundef %109)
  br label %111

111:                                              ; preds = %82, %69
  br label %112

112:                                              ; preds = %111
  %113 = load i64, ptr %9, align 8, !tbaa !5
  %114 = add nsw i64 %113, 1
  store i64 %114, ptr %9, align 8, !tbaa !5
  br label %25, !llvm.loop !26

115:                                              ; preds = %25
  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
}

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

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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 24}
!12 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64}
!13 = !{!12, !10, i64 32}
!14 = !{!12, !10, i64 64}
!15 = !{!16, !6, i64 32}
!16 = !{!"", !6, i64 0, !17, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!17 = !{!"double", !7, i64 0}
!18 = !{!16, !6, i64 0}
!19 = !{!17, !17, i64 0}
!20 = !{!16, !17, i64 8}
!21 = !{!16, !6, i64 48}
!22 = !{!16, !6, i64 56}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!12, !10, i64 56}
!26 = distinct !{!26, !24}


; 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.DTreeNodeType = type { i64, double, i64, i64, i64, i64, i64, i64 }

@.str.40 = external hidden unnamed_addr constant [30 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local void @CheckDTree(i64 noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3) local_unnamed_addr #1 {
  %5 = getelementptr inbounds i8, ptr %3, i64 24
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %3, i64 32
  %8 = load ptr, ptr %7, align 8, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %3, i64 64
  %10 = load ptr, ptr %9, align 8, !tbaa !12
  %11 = icmp sgt i64 %0, 0
  br i1 %11, label %.preheader.lr.ph, label %._crit_edge36

.preheader.lr.ph:                                 ; preds = %4
  %12 = getelementptr inbounds i8, ptr %10, i64 32
  %13 = getelementptr inbounds i8, ptr %3, i64 56
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %41
  %.035 = phi i64 [ 0, %.preheader.lr.ph ], [ %42, %41 ]
  %14 = load i64, ptr %12, align 8, !tbaa !13
  %15 = icmp eq i64 %14, -1
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %.idx = mul i64 %.035, 24
  %16 = getelementptr i8, ptr %1, i64 %.idx
  br label %17

17:                                               ; preds = %.lr.ph, %17
  %18 = phi ptr [ %10, %.lr.ph ], [ %26, %17 ]
  %19 = load i64, ptr %18, align 8, !tbaa !16
  %20 = getelementptr double, ptr %16, i64 %19
  %21 = load double, ptr %20, align 8, !tbaa !17
  %22 = getelementptr inbounds i8, ptr %18, i64 8
  %23 = load double, ptr %22, align 8, !tbaa !18
  %24 = fcmp ugt double %21, %23
  %.in.v = select i1 %24, i64 56, i64 48
  %.in = getelementptr inbounds i8, ptr %18, i64 %.in.v
  %25 = load i64, ptr %.in, align 8, !tbaa !19
  %26 = getelementptr inbounds %struct.DTreeNodeType, ptr %10, i64 %25
  %27 = getelementptr inbounds i8, ptr %26, i64 32
  %28 = load i64, ptr %27, align 8, !tbaa !13
  %29 = icmp eq i64 %28, -1
  br i1 %29, label %17, label %._crit_edge, !llvm.loop !20

._crit_edge:                                      ; preds = %17, %.preheader
  %.lcssa = phi i64 [ %14, %.preheader ], [ %28, %17 ]
  %30 = load ptr, ptr %13, align 8, !tbaa !22
  %31 = getelementptr inbounds i64, ptr %30, i64 %.035
  %32 = load i64, ptr %31, align 8, !tbaa !19
  %.not = icmp eq i64 %32, %.lcssa
  br i1 %.not, label %41, label %33

33:                                               ; preds = %._crit_edge
  %34 = getelementptr inbounds i64, ptr %2, i64 %.035
  %35 = load i64, ptr %34, align 8, !tbaa !19
  %36 = getelementptr inbounds i64, ptr %6, i64 %.lcssa
  %37 = load i64, ptr %36, align 8, !tbaa !19
  %38 = getelementptr inbounds i64, ptr %8, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !19
  %40 = tail call i32 (ptr, ...) @mprintf(ptr noundef nonnull @.str.40, i64 noundef %.035, i64 noundef %32, i64 noundef %.lcssa, i64 noundef %35, i64 noundef %39) #2
  br label %41

41:                                               ; preds = %._crit_edge, %33
  %42 = add nuw nsw i64 %.035, 1
  %exitcond.not = icmp eq i64 %42, %0
  br i1 %exitcond.not, label %._crit_edge36, label %.preheader, !llvm.loop !23

._crit_edge36:                                    ; preds = %41, %4
  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, !10, i64 24}
!6 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 32}
!12 = !{!6, !10, i64 64}
!13 = !{!14, !7, i64 32}
!14 = !{!"", !7, i64 0, !15, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56}
!15 = !{!"double", !8, i64 0}
!16 = !{!14, !7, i64 0}
!17 = !{!15, !15, i64 0}
!18 = !{!14, !15, i64 8}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!6, !10, i64 56}
!23 = distinct !{!23, !21}


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