; LLVM IR from Ubpa/USTC_CG :: Homeworks/6_MassSpring/documents/tetgen/src/TetGene (tetgen)

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio9load_nodeEPc(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio9load_edgeEPc(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio9load_faceEPc(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio8load_tetEPc(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio8load_volEPc(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio8load_varEPc(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio8load_mtrEPc(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio10load_meditEPci(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN8tetgenio12load_tetmeshEPci(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef %1, i32 noundef %2) #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %8 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #2
  %9 = load i32, ptr %6, align 4, !tbaa !9
  %10 = icmp eq i32 %9, 5
  br i1 %10, label %11, label %15

11:                                               ; preds = %3
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = call noundef zeroext i1 @_ZN8tetgenio10load_meditEPci(ptr noundef nonnull align 8 dereferenceable(424) %8, ptr noundef %12, i32 noundef 1)
  %14 = zext i1 %13 to i8
  store i8 %14, ptr %7, align 1, !tbaa !11
  br label %36

15:                                               ; preds = %3
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = call noundef zeroext i1 @_ZN8tetgenio9load_nodeEPc(ptr noundef nonnull align 8 dereferenceable(424) %8, ptr noundef %16)
  %18 = zext i1 %17 to i8
  store i8 %18, ptr %7, align 1, !tbaa !11
  %19 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %20 = trunc i8 %19 to i1
  br i1 %20, label %21, label %25

21:                                               ; preds = %15
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = call noundef zeroext i1 @_ZN8tetgenio8load_tetEPc(ptr noundef nonnull align 8 dereferenceable(424) %8, ptr noundef %22)
  %24 = zext i1 %23 to i8
  store i8 %24, ptr %7, align 1, !tbaa !11
  br label %25

25:                                               ; preds = %21, %15
  %26 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %27 = trunc i8 %26 to i1
  br i1 %27, label %28, label %35

28:                                               ; preds = %25
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call noundef zeroext i1 @_ZN8tetgenio9load_faceEPc(ptr noundef nonnull align 8 dereferenceable(424) %8, ptr noundef %29)
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = call noundef zeroext i1 @_ZN8tetgenio9load_edgeEPc(ptr noundef nonnull align 8 dereferenceable(424) %8, ptr noundef %31)
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = call noundef zeroext i1 @_ZN8tetgenio8load_volEPc(ptr noundef nonnull align 8 dereferenceable(424) %8, ptr noundef %33)
  br label %35

35:                                               ; preds = %28, %25
  br label %36

36:                                               ; preds = %35, %11
  %37 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %38 = trunc i8 %37 to i1
  br i1 %38, label %39, label %44

39:                                               ; preds = %36
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = call noundef zeroext i1 @_ZN8tetgenio8load_varEPc(ptr noundef nonnull align 8 dereferenceable(424) %8, ptr noundef %40)
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = call noundef zeroext i1 @_ZN8tetgenio8load_mtrEPc(ptr noundef nonnull align 8 dereferenceable(424) %8, ptr noundef %42)
  br label %44

44:                                               ; preds = %39, %36
  %45 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %46 = trunc i8 %45 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #2
  ret i1 %46
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


; 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 uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio9load_nodeEPc(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio9load_edgeEPc(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio9load_faceEPc(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio8load_tetEPc(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio8load_volEPc(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio8load_varEPc(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio8load_mtrEPc(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8tetgenio10load_meditEPci(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN8tetgenio12load_tetmeshEPci(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #0 align 2 {
  %4 = icmp eq i32 %2, 5
  br i1 %4, label %12, label %5

5:                                                ; preds = %3
  %6 = tail call noundef zeroext i1 @_ZN8tetgenio9load_nodeEPc(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef %1)
  br i1 %6, label %7, label %.thread14

7:                                                ; preds = %5
  %8 = tail call noundef zeroext i1 @_ZN8tetgenio8load_tetEPc(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef %1)
  br i1 %8, label %.thread17, label %.thread14

.thread17:                                        ; preds = %7
  %9 = tail call noundef zeroext i1 @_ZN8tetgenio9load_faceEPc(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef %1)
  %10 = tail call noundef zeroext i1 @_ZN8tetgenio9load_edgeEPc(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef %1)
  %11 = tail call noundef zeroext i1 @_ZN8tetgenio8load_volEPc(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef %1)
  br label %14

12:                                               ; preds = %3
  %13 = tail call noundef zeroext i1 @_ZN8tetgenio10load_meditEPci(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef %1, i32 noundef 1)
  br i1 %13, label %14, label %.thread14

14:                                               ; preds = %.thread17, %12
  %15 = tail call noundef zeroext i1 @_ZN8tetgenio8load_varEPc(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef %1)
  %16 = tail call noundef zeroext i1 @_ZN8tetgenio8load_mtrEPc(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef %1)
  br label %.thread14

.thread14:                                        ; preds = %5, %7, %14, %12
  %.1.in16 = phi i1 [ true, %14 ], [ false, %12 ], [ false, %7 ], [ false, %5 ]
  ret i1 %.1.in16
}

attributes #0 = { mustprogress 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: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass