; LLVM IR from QAQdev/mini-sql-engine :: thirdparty/googletest/src/gtest-all.ll (ZN7testing8internal14ShouldUseColorEb)

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZN7testing17FLAGS_gtest_colorB5cxx11E = external dso_local global %"class.std::__cxx11::basic_string", align 8
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.128 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.129 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.130 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.131 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.132 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.133 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.134 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.135 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.136 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.137 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.138 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.139 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.140 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.141 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.142 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.143 = external hidden unnamed_addr constant [2 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

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef, ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7testing8internal14ShouldUseColorEb(i1 noundef zeroext %0) #2 {
  %2 = alloca i1, align 1
  %3 = alloca i8, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = zext i1 %0 to i8
  store i8 %8, ptr %3, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %9 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) @_ZN7testing17FLAGS_gtest_colorB5cxx11E) #4
  store ptr %9, ptr %4, align 8, !tbaa !9
  %10 = load ptr, ptr %4, align 8, !tbaa !9
  %11 = call noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef %10, ptr noundef @.str.10)
  br i1 %11, label %12, label %56

12:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %13 = call noundef ptr @_ZN7testing8internal5posix6GetEnvEPKc(ptr noundef @.str.128)
  store ptr %13, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #4
  %14 = load ptr, ptr %5, align 8, !tbaa !9
  %15 = call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %14, ptr noundef @.str.129)
  br i1 %15, label %46, label %16

16:                                               ; preds = %12
  %17 = load ptr, ptr %5, align 8, !tbaa !9
  %18 = call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %17, ptr noundef @.str.130)
  br i1 %18, label %46, label %19

19:                                               ; preds = %16
  %20 = load ptr, ptr %5, align 8, !tbaa !9
  %21 = call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %20, ptr noundef @.str.131)
  br i1 %21, label %46, label %22

22:                                               ; preds = %19
  %23 = load ptr, ptr %5, align 8, !tbaa !9
  %24 = call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %23, ptr noundef @.str.132)
  br i1 %24, label %46, label %25

25:                                               ; preds = %22
  %26 = load ptr, ptr %5, align 8, !tbaa !9
  %27 = call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %26, ptr noundef @.str.133)
  br i1 %27, label %46, label %28

28:                                               ; preds = %25
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  %30 = call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %29, ptr noundef @.str.134)
  br i1 %30, label %46, label %31

31:                                               ; preds = %28
  %32 = load ptr, ptr %5, align 8, !tbaa !9
  %33 = call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %32, ptr noundef @.str.135)
  br i1 %33, label %46, label %34

34:                                               ; preds = %31
  %35 = load ptr, ptr %5, align 8, !tbaa !9
  %36 = call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %35, ptr noundef @.str.136)
  br i1 %36, label %46, label %37

37:                                               ; preds = %34
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %38, ptr noundef @.str.137)
  br i1 %39, label %46, label %40

40:                                               ; preds = %37
  %41 = load ptr, ptr %5, align 8, !tbaa !9
  %42 = call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %41, ptr noundef @.str.138)
  br i1 %42, label %46, label %43

43:                                               ; preds = %40
  %44 = load ptr, ptr %5, align 8, !tbaa !9
  %45 = call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %44, ptr noundef @.str.139)
  br label %46

46:                                               ; preds = %43, %40, %37, %34, %31, %28, %25, %22, %19, %16, %12
  %47 = phi i1 [ true, %40 ], [ true, %37 ], [ true, %34 ], [ true, %31 ], [ true, %28 ], [ true, %25 ], [ true, %22 ], [ true, %19 ], [ true, %16 ], [ true, %12 ], [ %45, %43 ]
  %48 = zext i1 %47 to i8
  store i8 %48, ptr %6, align 1, !tbaa !5
  %49 = load i8, ptr %3, align 1, !tbaa !5, !range !11, !noundef !12
  %50 = trunc i8 %49 to i1
  br i1 %50, label %51, label %54

51:                                               ; preds = %46
  %52 = load i8, ptr %6, align 1, !tbaa !5, !range !11, !noundef !12
  %53 = trunc i8 %52 to i1
  br label %54

54:                                               ; preds = %51, %46
  %55 = phi i1 [ false, %46 ], [ %53, %51 ]
  store i1 %55, ptr %2, align 1
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %70

56:                                               ; preds = %1
  %57 = load ptr, ptr %4, align 8, !tbaa !9
  %58 = call noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef %57, ptr noundef @.str.140)
  br i1 %58, label %68, label %59

59:                                               ; preds = %56
  %60 = load ptr, ptr %4, align 8, !tbaa !9
  %61 = call noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef %60, ptr noundef @.str.141)
  br i1 %61, label %68, label %62

62:                                               ; preds = %59
  %63 = load ptr, ptr %4, align 8, !tbaa !9
  %64 = call noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef %63, ptr noundef @.str.142)
  br i1 %64, label %68, label %65

65:                                               ; preds = %62
  %66 = load ptr, ptr %4, align 8, !tbaa !9
  %67 = call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %66, ptr noundef @.str.143)
  br label %68

68:                                               ; preds = %65, %62, %59, %56
  %69 = phi i1 [ true, %62 ], [ true, %59 ], [ true, %56 ], [ %67, %65 ]
  store i1 %69, ptr %2, align 1
  store i32 1, ptr %7, align 4
  br label %70

70:                                               ; preds = %68, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %71 = load i1, ptr %2, align 1
  ret i1 %71
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7testing8internal5posix6GetEnvEPKc(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { inlinehint 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 #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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZN7testing17FLAGS_gtest_colorB5cxx11E = external dso_local global %"class.std::__cxx11::basic_string", align 8
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.128 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.129 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.130 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.131 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.132 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.133 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.134 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.135 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.136 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.137 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.138 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.139 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.140 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.141 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.142 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.143 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef, ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7testing8internal14ShouldUseColorEb(i1 noundef zeroext %0) local_unnamed_addr #1 {
  %2 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) @_ZN7testing17FLAGS_gtest_colorB5cxx11E) #3
  %3 = tail call noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef %2, ptr noundef nonnull @.str.10)
  br i1 %3, label %4, label %30

4:                                                ; preds = %1
  %5 = tail call noundef ptr @_ZN7testing8internal5posix6GetEnvEPKc(ptr noundef nonnull @.str.128)
  %6 = tail call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %5, ptr noundef nonnull @.str.129)
  br i1 %6, label %27, label %7

7:                                                ; preds = %4
  %8 = tail call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %5, ptr noundef nonnull @.str.130)
  br i1 %8, label %27, label %9

9:                                                ; preds = %7
  %10 = tail call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %5, ptr noundef nonnull @.str.131)
  br i1 %10, label %27, label %11

11:                                               ; preds = %9
  %12 = tail call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %5, ptr noundef nonnull @.str.132)
  br i1 %12, label %27, label %13

13:                                               ; preds = %11
  %14 = tail call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %5, ptr noundef nonnull @.str.133)
  br i1 %14, label %27, label %15

15:                                               ; preds = %13
  %16 = tail call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %5, ptr noundef nonnull @.str.134)
  br i1 %16, label %27, label %17

17:                                               ; preds = %15
  %18 = tail call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %5, ptr noundef nonnull @.str.135)
  br i1 %18, label %27, label %19

19:                                               ; preds = %17
  %20 = tail call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %5, ptr noundef nonnull @.str.136)
  br i1 %20, label %27, label %21

21:                                               ; preds = %19
  %22 = tail call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %5, ptr noundef nonnull @.str.137)
  br i1 %22, label %27, label %23

23:                                               ; preds = %21
  %24 = tail call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %5, ptr noundef nonnull @.str.138)
  br i1 %24, label %27, label %25

25:                                               ; preds = %23
  %26 = tail call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %5, ptr noundef nonnull @.str.139)
  br label %27

27:                                               ; preds = %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %4
  %28 = phi i1 [ true, %23 ], [ true, %21 ], [ true, %19 ], [ true, %17 ], [ true, %15 ], [ true, %13 ], [ true, %11 ], [ true, %9 ], [ true, %7 ], [ true, %4 ], [ %26, %25 ]
  %29 = and i1 %28, %0
  br label %38

30:                                               ; preds = %1
  %31 = tail call noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef %2, ptr noundef nonnull @.str.140)
  br i1 %31, label %38, label %32

32:                                               ; preds = %30
  %33 = tail call noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef %2, ptr noundef nonnull @.str.141)
  br i1 %33, label %38, label %34

34:                                               ; preds = %32
  %35 = tail call noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef %2, ptr noundef nonnull @.str.142)
  br i1 %35, label %38, label %36

36:                                               ; preds = %34
  %37 = tail call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %2, ptr noundef nonnull @.str.143)
  br label %38

38:                                               ; preds = %30, %32, %34, %36, %27
  %.0 = phi i1 [ %29, %27 ], [ true, %34 ], [ true, %32 ], [ true, %30 ], [ %37, %36 ]
  ret i1 %.0
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7testing8internal5posix6GetEnvEPKc(ptr noundef) local_unnamed_addr #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 = { 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 = { inlinehint 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 #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)"}


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