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

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

; 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

; Function Attrs: nounwind uwtable
define dso_local i64 @libmetis__CheckBnd2(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #2
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.graphdef, ptr %14, i32 0, i32 0
  %16 = load i64, ptr %15, align 8, !tbaa !9
  store i64 %16, ptr %5, align 8, !tbaa !13
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.graphdef, ptr %17, i32 0, i32 2
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  store ptr %19, ptr %9, align 8, !tbaa !5
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.graphdef, ptr %20, i32 0, i32 5
  %22 = load ptr, ptr %21, align 8, !tbaa !15
  store ptr %22, ptr %10, align 8, !tbaa !5
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.graphdef, ptr %23, i32 0, i32 18
  %25 = load ptr, ptr %24, align 8, !tbaa !16
  store ptr %25, ptr %11, align 8, !tbaa !5
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.graphdef, ptr %26, i32 0, i32 21
  %28 = load ptr, ptr %27, align 8, !tbaa !17
  store ptr %28, ptr %12, align 8, !tbaa !5
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.graphdef, ptr %29, i32 0, i32 22
  %31 = load ptr, ptr %30, align 8, !tbaa !18
  store ptr %31, ptr %13, align 8, !tbaa !5
  store i64 0, ptr %6, align 8, !tbaa !13
  store i64 0, ptr %3, align 8, !tbaa !13
  br label %32

32:                                               ; preds = %104, %1
  %33 = load i64, ptr %3, align 8, !tbaa !13
  %34 = load i64, ptr %5, align 8, !tbaa !13
  %35 = icmp slt i64 %33, %34
  br i1 %35, label %36, label %107

36:                                               ; preds = %32
  store i64 0, ptr %8, align 8, !tbaa !13
  store i64 0, ptr %7, align 8, !tbaa !13
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = load i64, ptr %3, align 8, !tbaa !13
  %39 = getelementptr inbounds i64, ptr %37, i64 %38
  %40 = load i64, ptr %39, align 8, !tbaa !13
  store i64 %40, ptr %4, align 8, !tbaa !13
  br label %41

41:                                               ; preds = %81, %36
  %42 = load i64, ptr %4, align 8, !tbaa !13
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = load i64, ptr %3, align 8, !tbaa !13
  %45 = add nsw i64 %44, 1
  %46 = getelementptr inbounds i64, ptr %43, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !13
  %48 = icmp slt i64 %42, %47
  br i1 %48, label %49, label %84

49:                                               ; preds = %41
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = load i64, ptr %3, align 8, !tbaa !13
  %52 = getelementptr inbounds i64, ptr %50, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !13
  %54 = load ptr, ptr %11, align 8, !tbaa !5
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = load i64, ptr %4, align 8, !tbaa !13
  %57 = getelementptr inbounds i64, ptr %55, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !13
  %59 = getelementptr inbounds i64, ptr %54, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !13
  %61 = icmp ne i64 %53, %60
  br i1 %61, label %62, label %71

62:                                               ; preds = %49
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.graphdef, ptr %63, i32 0, i32 6
  %65 = load ptr, ptr %64, align 8, !tbaa !19
  %66 = load i64, ptr %4, align 8, !tbaa !13
  %67 = getelementptr inbounds i64, ptr %65, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !13
  %69 = load i64, ptr %8, align 8, !tbaa !13
  %70 = add nsw i64 %69, %68
  store i64 %70, ptr %8, align 8, !tbaa !13
  br label %80

71:                                               ; preds = %49
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.graphdef, ptr %72, i32 0, i32 6
  %74 = load ptr, ptr %73, align 8, !tbaa !19
  %75 = load i64, ptr %4, align 8, !tbaa !13
  %76 = getelementptr inbounds i64, ptr %74, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !13
  %78 = load i64, ptr %7, align 8, !tbaa !13
  %79 = add nsw i64 %78, %77
  store i64 %79, ptr %7, align 8, !tbaa !13
  br label %80

80:                                               ; preds = %71, %62
  br label %81

81:                                               ; preds = %80
  %82 = load i64, ptr %4, align 8, !tbaa !13
  %83 = add nsw i64 %82, 1
  store i64 %83, ptr %4, align 8, !tbaa !13
  br label %41, !llvm.loop !20

84:                                               ; preds = %41
  %85 = load i64, ptr %8, align 8, !tbaa !13
  %86 = load i64, ptr %7, align 8, !tbaa !13
  %87 = sub nsw i64 %85, %86
  %88 = icmp sge i64 %87, 0
  br i1 %88, label %89, label %103

89:                                               ; preds = %84
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = load i64, ptr %3, align 8, !tbaa !13
  %92 = getelementptr inbounds i64, ptr %90, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !13
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = load i64, ptr %3, align 8, !tbaa !13
  %96 = add nsw i64 %95, 1
  %97 = getelementptr inbounds i64, ptr %94, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !13
  %99 = icmp slt i64 %93, %98
  br i1 %99, label %100, label %103

100:                                              ; preds = %89
  %101 = load i64, ptr %6, align 8, !tbaa !13
  %102 = add nsw i64 %101, 1
  store i64 %102, ptr %6, align 8, !tbaa !13
  br label %103

103:                                              ; preds = %100, %89, %84
  br label %104

104:                                              ; preds = %103
  %105 = load i64, ptr %3, align 8, !tbaa !13
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr %3, align 8, !tbaa !13
  br label %32, !llvm.loop !22

107:                                              ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #2
  ret i64 1
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"graphdef", !11, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !12, 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}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!10, !6, i64 40}
!16 = !{!10, !6, i64 128}
!17 = !{!10, !6, i64 152}
!18 = !{!10, !6, i64 160}
!19 = !{!10, !6, i64 48}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


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

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local noundef i64 @libmetis__CheckBnd2(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
._crit_edge:
  ret i64 1
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) 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" }

!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)"}


; Effective O3 passes: ADCEPass,BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass