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

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

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

declare void @libmetis__ChangeMesh2CNumbering(i64 noundef, ptr noundef) #2

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

declare void @libmetis__ChangeMesh2FNumbering(i64 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @METIS_MeshToNodal(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #3 {
  %8 = alloca ptr, 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
  %14 = alloca ptr, align 8
  %15 = alloca [6 x i64], align 16
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %15) #4
  call void @llvm.memset.p0.i64(ptr align 16 %15, i8 0, i64 48, i1 false)
  %16 = getelementptr inbounds [6 x i64], ptr %15, i32 0, i32 0
  store i64 -1, ptr %16, align 16
  %17 = getelementptr inbounds [6 x i64], ptr %15, i32 0, i32 1
  store i64 3, ptr %17, align 8
  %18 = getelementptr inbounds [6 x i64], ptr %15, i32 0, i32 2
  store i64 4, ptr %18, align 16
  %19 = getelementptr inbounds [6 x i64], ptr %15, i32 0, i32 3
  store i64 8, ptr %19, align 8
  %20 = getelementptr inbounds [6 x i64], ptr %15, i32 0, i32 4
  store i64 4, ptr %20, align 16
  %21 = getelementptr inbounds [6 x i64], ptr %15, i32 0, i32 5
  store i64 2, ptr %21, align 8
  %22 = load ptr, ptr %12, align 8, !tbaa !5
  %23 = load i64, ptr %22, align 8, !tbaa !9
  %24 = icmp eq i64 %23, 1
  br i1 %24, label %25, label %34

25:                                               ; preds = %7
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = load i64, ptr %26, align 8, !tbaa !9
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  %29 = load i64, ptr %28, align 8, !tbaa !9
  %30 = getelementptr inbounds [6 x i64], ptr %15, i64 0, i64 %29
  %31 = load i64, ptr %30, align 8, !tbaa !9
  %32 = mul nsw i64 %27, %31
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  call void @libmetis__ChangeMesh2CNumbering(i64 noundef %32, ptr noundef %33)
  br label %34

34:                                               ; preds = %25, %7
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = load i64, ptr %35, align 8, !tbaa !9
  switch i64 %36, label %77 [
    i64 1, label %37
    i64 2, label %45
    i64 3, label %53
    i64 4, label %61
    i64 5, label %69
  ]

37:                                               ; preds = %34
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = load ptr, ptr %9, align 8, !tbaa !5
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = load ptr, ptr %13, align 8, !tbaa !5
  %44 = load ptr, ptr %14, align 8, !tbaa !5
  call void @libmetis__TRINODALMETIS(i64 noundef %39, i64 noundef %41, ptr noundef %42, ptr noundef %43, ptr noundef %44)
  br label %77

45:                                               ; preds = %34
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = load i64, ptr %46, align 8, !tbaa !9
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = load i64, ptr %48, align 8, !tbaa !9
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = load ptr, ptr %13, align 8, !tbaa !5
  %52 = load ptr, ptr %14, align 8, !tbaa !5
  call void @libmetis__TETNODALMETIS(i64 noundef %47, i64 noundef %49, ptr noundef %50, ptr noundef %51, ptr noundef %52)
  br label %77

53:                                               ; preds = %34
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = load i64, ptr %54, align 8, !tbaa !9
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = load i64, ptr %56, align 8, !tbaa !9
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  %60 = load ptr, ptr %14, align 8, !tbaa !5
  call void @libmetis__HEXNODALMETIS(i64 noundef %55, i64 noundef %57, ptr noundef %58, ptr noundef %59, ptr noundef %60)
  br label %77

61:                                               ; preds = %34
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = load i64, ptr %62, align 8, !tbaa !9
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = load i64, ptr %64, align 8, !tbaa !9
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  %67 = load ptr, ptr %13, align 8, !tbaa !5
  %68 = load ptr, ptr %14, align 8, !tbaa !5
  call void @QUADNODALMETIS(i64 noundef %63, i64 noundef %65, ptr noundef %66, ptr noundef %67, ptr noundef %68)
  br label %77

69:                                               ; preds = %34
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = load i64, ptr %70, align 8, !tbaa !9
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = load i64, ptr %72, align 8, !tbaa !9
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = load ptr, ptr %13, align 8, !tbaa !5
  %76 = load ptr, ptr %14, align 8, !tbaa !5
  call void @LINENODALMETIS(i64 noundef %71, i64 noundef %73, ptr noundef %74, ptr noundef %75, ptr noundef %76)
  br label %77

77:                                               ; preds = %69, %61, %53, %45, %37, %34
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = load i64, ptr %78, align 8, !tbaa !9
  %80 = icmp eq i64 %79, 1
  br i1 %80, label %81, label %94

81:                                               ; preds = %77
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = load i64, ptr %82, align 8, !tbaa !9
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = load i64, ptr %84, align 8, !tbaa !9
  %86 = getelementptr inbounds [6 x i64], ptr %15, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !9
  %88 = mul nsw i64 %83, %87
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = load i64, ptr %90, align 8, !tbaa !9
  %92 = load ptr, ptr %13, align 8, !tbaa !5
  %93 = load ptr, ptr %14, align 8, !tbaa !5
  call void @libmetis__ChangeMesh2FNumbering(i64 noundef %88, ptr noundef %89, i64 noundef %91, ptr noundef %92, ptr noundef %93)
  br label %94

94:                                               ; preds = %81, %77
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #4
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @libmetis__TRINODALMETIS(i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @libmetis__TETNODALMETIS(i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @libmetis__HEXNODALMETIS(i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @QUADNODALMETIS(i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @LINENODALMETIS(i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { "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 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 #4 = { 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}


; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare void @libmetis__ChangeMesh2CNumbering(i64 noundef, 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__ChangeMesh2FNumbering(i64 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @METIS_MeshToNodal(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr noundef %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #2 {
  %8 = alloca [6 x i64], align 16
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %8) #3
  store i64 -1, ptr %8, align 16
  %9 = getelementptr inbounds i8, ptr %8, i64 8
  store i64 3, ptr %9, align 8
  %10 = getelementptr inbounds i8, ptr %8, i64 16
  store i64 4, ptr %10, align 16
  %11 = getelementptr inbounds i8, ptr %8, i64 24
  store i64 8, ptr %11, align 8
  %12 = getelementptr inbounds i8, ptr %8, i64 32
  store i64 4, ptr %12, align 16
  %13 = getelementptr inbounds i8, ptr %8, i64 40
  store i64 2, ptr %13, align 8
  %14 = load i64, ptr %4, align 8, !tbaa !5
  %15 = icmp eq i64 %14, 1
  br i1 %15, label %16, label %22

16:                                               ; preds = %7
  %17 = load i64, ptr %0, align 8, !tbaa !5
  %18 = load i64, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds [6 x i64], ptr %8, i64 0, i64 %18
  %20 = load i64, ptr %19, align 8, !tbaa !5
  %21 = mul nsw i64 %20, %17
  tail call void @libmetis__ChangeMesh2CNumbering(i64 noundef %21, ptr noundef %2) #3
  br label %22

22:                                               ; preds = %16, %7
  %23 = load i64, ptr %3, align 8, !tbaa !5
  switch i64 %23, label %39 [
    i64 1, label %24
    i64 2, label %27
    i64 3, label %30
    i64 4, label %33
    i64 5, label %36
  ]

24:                                               ; preds = %22
  %25 = load i64, ptr %0, align 8, !tbaa !5
  %26 = load i64, ptr %1, align 8, !tbaa !5
  tail call void @libmetis__TRINODALMETIS(i64 noundef %25, i64 noundef %26, ptr noundef %2, ptr noundef %5, ptr noundef %6)
  br label %39

27:                                               ; preds = %22
  %28 = load i64, ptr %0, align 8, !tbaa !5
  %29 = load i64, ptr %1, align 8, !tbaa !5
  tail call void @libmetis__TETNODALMETIS(i64 noundef %28, i64 noundef %29, ptr noundef %2, ptr noundef %5, ptr noundef %6)
  br label %39

30:                                               ; preds = %22
  %31 = load i64, ptr %0, align 8, !tbaa !5
  %32 = load i64, ptr %1, align 8, !tbaa !5
  tail call void @libmetis__HEXNODALMETIS(i64 noundef %31, i64 noundef %32, ptr noundef %2, ptr noundef %5, ptr noundef %6)
  br label %39

33:                                               ; preds = %22
  %34 = load i64, ptr %0, align 8, !tbaa !5
  %35 = load i64, ptr %1, align 8, !tbaa !5
  tail call void @QUADNODALMETIS(i64 noundef %34, i64 noundef %35, ptr noundef %2, ptr noundef %5, ptr noundef %6)
  br label %39

36:                                               ; preds = %22
  %37 = load i64, ptr %0, align 8, !tbaa !5
  %38 = load i64, ptr %1, align 8, !tbaa !5
  tail call void @LINENODALMETIS(i64 noundef %37, i64 noundef %38, ptr noundef %2, ptr noundef %5, ptr noundef %6)
  br label %39

39:                                               ; preds = %36, %33, %30, %27, %24, %22
  %40 = load i64, ptr %4, align 8, !tbaa !5
  %41 = icmp eq i64 %40, 1
  br i1 %41, label %42, label %49

42:                                               ; preds = %39
  %43 = load i64, ptr %0, align 8, !tbaa !5
  %44 = load i64, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds [6 x i64], ptr %8, i64 0, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !5
  %47 = mul nsw i64 %46, %43
  %48 = load i64, ptr %1, align 8, !tbaa !5
  tail call void @libmetis__ChangeMesh2FNumbering(i64 noundef %47, ptr noundef %2, i64 noundef %48, ptr noundef %5, ptr noundef %6) #3
  br label %49

49:                                               ; preds = %42, %39
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #3
  ret void
}

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

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

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

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

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

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


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,TailCallElimPass