; LLVM IR from junhyeokahn/PyPnC :: external_source/yaml/src/emitter.ll (ZNK4YAML7Emitter19ComputeFullBoolNameEb)

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

%"class.YAML::Emitter" = type { %"class.std::unique_ptr", %"class.YAML::ostream_wrapper" }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.YAML::ostream_wrapper" = type <{ %"class.std::vector", ptr, i64, i64, i64, i8, [7 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt10unique_ptrIN4YAML12EmitterStateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZNK4YAML7Emitter19ComputeFullBoolNameEb(ptr noundef nonnull align 8 dereferenceable(72) %0, i1 noundef zeroext %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  %9 = zext i1 %1 to i8
  store i8 %9, ptr %5, align 1, !tbaa !9
  %10 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %11 = getelementptr inbounds %"class.YAML::Emitter", ptr %10, i32 0, i32 0
  %12 = call noundef ptr @_ZNKSt10unique_ptrIN4YAML12EmitterStateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #3
  %13 = call noundef i32 @_ZNK4YAML12EmitterState19GetBoolLengthFormatEv(ptr noundef nonnull align 8 dereferenceable(216) %12)
  %14 = icmp eq i32 %13, 15
  br i1 %14, label %15, label %16

15:                                               ; preds = %2
  br label %20

16:                                               ; preds = %2
  %17 = getelementptr inbounds %"class.YAML::Emitter", ptr %10, i32 0, i32 0
  %18 = call noundef ptr @_ZNKSt10unique_ptrIN4YAML12EmitterStateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #3
  %19 = call noundef i32 @_ZNK4YAML12EmitterState13GetBoolFormatEv(ptr noundef nonnull align 8 dereferenceable(216) %18)
  br label %20

20:                                               ; preds = %16, %15
  %21 = phi i32 [ 8, %15 ], [ %19, %16 ]
  store i32 %21, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %22 = getelementptr inbounds %"class.YAML::Emitter", ptr %10, i32 0, i32 0
  %23 = call noundef ptr @_ZNKSt10unique_ptrIN4YAML12EmitterStateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #3
  %24 = call noundef i32 @_ZNK4YAML12EmitterState17GetBoolCaseFormatEv(ptr noundef nonnull align 8 dereferenceable(216) %23)
  store i32 %24, ptr %7, align 4, !tbaa !11
  %25 = load i32, ptr %6, align 4, !tbaa !11
  switch i32 %25, label %83 [
    i32 8, label %26
    i32 10, label %45
    i32 9, label %64
  ]

26:                                               ; preds = %20
  %27 = load i32, ptr %7, align 4, !tbaa !11
  switch i32 %27, label %43 [
    i32 11, label %28
    i32 13, label %33
    i32 12, label %38
  ]

28:                                               ; preds = %26
  %29 = load i8, ptr %5, align 1, !tbaa !9, !range !13, !noundef !14
  %30 = trunc i8 %29 to i1
  %31 = zext i1 %30 to i64
  %32 = select i1 %30, ptr @.str.19, ptr @.str.20
  store ptr %32, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %92

33:                                               ; preds = %26
  %34 = load i8, ptr %5, align 1, !tbaa !9, !range !13, !noundef !14
  %35 = trunc i8 %34 to i1
  %36 = zext i1 %35 to i64
  %37 = select i1 %35, ptr @.str.21, ptr @.str.22
  store ptr %37, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %92

38:                                               ; preds = %26
  %39 = load i8, ptr %5, align 1, !tbaa !9, !range !13, !noundef !14
  %40 = trunc i8 %39 to i1
  %41 = zext i1 %40 to i64
  %42 = select i1 %40, ptr @.str.23, ptr @.str.24
  store ptr %42, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %92

43:                                               ; preds = %26
  br label %44

44:                                               ; preds = %43
  br label %84

45:                                               ; preds = %20
  %46 = load i32, ptr %7, align 4, !tbaa !11
  switch i32 %46, label %62 [
    i32 11, label %47
    i32 13, label %52
    i32 12, label %57
  ]

47:                                               ; preds = %45
  %48 = load i8, ptr %5, align 1, !tbaa !9, !range !13, !noundef !14
  %49 = trunc i8 %48 to i1
  %50 = zext i1 %49 to i64
  %51 = select i1 %49, ptr @.str.25, ptr @.str.26
  store ptr %51, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %92

52:                                               ; preds = %45
  %53 = load i8, ptr %5, align 1, !tbaa !9, !range !13, !noundef !14
  %54 = trunc i8 %53 to i1
  %55 = zext i1 %54 to i64
  %56 = select i1 %54, ptr @.str.27, ptr @.str.28
  store ptr %56, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %92

57:                                               ; preds = %45
  %58 = load i8, ptr %5, align 1, !tbaa !9, !range !13, !noundef !14
  %59 = trunc i8 %58 to i1
  %60 = zext i1 %59 to i64
  %61 = select i1 %59, ptr @.str.29, ptr @.str.30
  store ptr %61, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %92

62:                                               ; preds = %45
  br label %63

63:                                               ; preds = %62
  br label %84

64:                                               ; preds = %20
  %65 = load i32, ptr %7, align 4, !tbaa !11
  switch i32 %65, label %81 [
    i32 11, label %66
    i32 13, label %71
    i32 12, label %76
  ]

66:                                               ; preds = %64
  %67 = load i8, ptr %5, align 1, !tbaa !9, !range !13, !noundef !14
  %68 = trunc i8 %67 to i1
  %69 = zext i1 %68 to i64
  %70 = select i1 %68, ptr @.str.31, ptr @.str.32
  store ptr %70, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %92

71:                                               ; preds = %64
  %72 = load i8, ptr %5, align 1, !tbaa !9, !range !13, !noundef !14
  %73 = trunc i8 %72 to i1
  %74 = zext i1 %73 to i64
  %75 = select i1 %73, ptr @.str.33, ptr @.str.34
  store ptr %75, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %92

76:                                               ; preds = %64
  %77 = load i8, ptr %5, align 1, !tbaa !9, !range !13, !noundef !14
  %78 = trunc i8 %77 to i1
  %79 = zext i1 %78 to i64
  %80 = select i1 %78, ptr @.str.35, ptr @.str.8
  store ptr %80, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %92

81:                                               ; preds = %64
  br label %82

82:                                               ; preds = %81
  br label %84

83:                                               ; preds = %20
  br label %84

84:                                               ; preds = %83, %82, %63, %44
  %85 = load i8, ptr %5, align 1, !tbaa !9, !range !13, !noundef !14
  %86 = trunc i8 %85 to i1
  br i1 %86, label %87, label %88

87:                                               ; preds = %84
  br label %89

88:                                               ; preds = %84
  br label %89

89:                                               ; preds = %88, %87
  %90 = phi ptr [ @.str.36, %87 ], [ @.str.37, %88 ]
  %91 = getelementptr inbounds [2 x i8], ptr %90, i64 0, i64 0
  store ptr %91, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %92

92:                                               ; preds = %89, %76, %71, %66, %57, %52, %47, %38, %33, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  %93 = load ptr, ptr %3, align 8
  ret ptr %93
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4YAML12EmitterState19GetBoolLengthFormatEv(ptr noundef nonnull align 8 dereferenceable(216)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4YAML12EmitterState13GetBoolFormatEv(ptr noundef nonnull align 8 dereferenceable(216)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4YAML12EmitterState17GetBoolCaseFormatEv(ptr noundef nonnull align 8 dereferenceable(216)) #0 align 2

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

@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt10unique_ptrIN4YAML12EmitterStateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef nonnull ptr @_ZNK4YAML7Emitter19ComputeFullBoolNameEb(ptr noundef nonnull align 8 dereferenceable(72) %0, i1 noundef zeroext %1) local_unnamed_addr #0 align 2 {
  %3 = tail call noundef ptr @_ZNKSt10unique_ptrIN4YAML12EmitterStateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #1
  %4 = tail call noundef i32 @_ZNK4YAML12EmitterState19GetBoolLengthFormatEv(ptr noundef nonnull align 8 dereferenceable(216) %3)
  %5 = icmp eq i32 %4, 15
  %6 = tail call noundef ptr @_ZNKSt10unique_ptrIN4YAML12EmitterStateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #1
  br i1 %5, label %.thread, label %8

.thread:                                          ; preds = %2
  %7 = tail call noundef i32 @_ZNK4YAML12EmitterState17GetBoolCaseFormatEv(ptr noundef nonnull align 8 dereferenceable(216) %6)
  br label %12

8:                                                ; preds = %2
  %9 = tail call noundef i32 @_ZNK4YAML12EmitterState13GetBoolFormatEv(ptr noundef nonnull align 8 dereferenceable(216) %6)
  %10 = tail call noundef ptr @_ZNKSt10unique_ptrIN4YAML12EmitterStateESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #1
  %11 = tail call noundef i32 @_ZNK4YAML12EmitterState17GetBoolCaseFormatEv(ptr noundef nonnull align 8 dereferenceable(216) %10)
  switch i32 %9, label %34 [
    i32 8, label %12
    i32 10, label %20
    i32 9, label %27
  ]

12:                                               ; preds = %.thread, %8
  %13 = phi i32 [ %7, %.thread ], [ %11, %8 ]
  switch i32 %13, label %34 [
    i32 11, label %14
    i32 13, label %16
    i32 12, label %18
  ]

14:                                               ; preds = %12
  %15 = select i1 %1, ptr @.str.19, ptr @.str.20
  br label %35

16:                                               ; preds = %12
  %17 = select i1 %1, ptr @.str.21, ptr @.str.22
  br label %35

18:                                               ; preds = %12
  %19 = select i1 %1, ptr @.str.23, ptr @.str.24
  br label %35

20:                                               ; preds = %8
  switch i32 %11, label %34 [
    i32 11, label %21
    i32 13, label %23
    i32 12, label %25
  ]

21:                                               ; preds = %20
  %22 = select i1 %1, ptr @.str.25, ptr @.str.26
  br label %35

23:                                               ; preds = %20
  %24 = select i1 %1, ptr @.str.27, ptr @.str.28
  br label %35

25:                                               ; preds = %20
  %26 = select i1 %1, ptr @.str.29, ptr @.str.30
  br label %35

27:                                               ; preds = %8
  switch i32 %11, label %34 [
    i32 11, label %28
    i32 13, label %30
    i32 12, label %32
  ]

28:                                               ; preds = %27
  %29 = select i1 %1, ptr @.str.31, ptr @.str.32
  br label %35

30:                                               ; preds = %27
  %31 = select i1 %1, ptr @.str.33, ptr @.str.34
  br label %35

32:                                               ; preds = %27
  %33 = select i1 %1, ptr @.str.35, ptr @.str.8
  br label %35

34:                                               ; preds = %8, %27, %20, %12
  %.str.36..str.37 = select i1 %1, ptr @.str.36, ptr @.str.37
  br label %35

35:                                               ; preds = %34, %32, %30, %28, %25, %23, %21, %18, %16, %14
  %.0 = phi ptr [ %.str.36..str.37, %34 ], [ %33, %32 ], [ %31, %30 ], [ %29, %28 ], [ %26, %25 ], [ %24, %23 ], [ %22, %21 ], [ %19, %18 ], [ %17, %16 ], [ %15, %14 ]
  ret ptr %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4YAML12EmitterState19GetBoolLengthFormatEv(ptr noundef nonnull align 8 dereferenceable(216)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4YAML12EmitterState13GetBoolFormatEv(ptr noundef nonnull align 8 dereferenceable(216)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4YAML12EmitterState17GetBoolCaseFormatEv(ptr noundef nonnull align 8 dereferenceable(216)) local_unnamed_addr #0 align 2

attributes #0 = { mustprogress 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 #1 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass