; LLVM IR from norlab-ulaval/libpointmatcher :: contrib/gtest/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.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.116 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.119 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.120 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.121 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.122 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.124 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.125 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.126 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.127 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.128 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.129 = 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.8)
  br i1 %11, label %12, label %44

12:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %13 = call noundef ptr @_ZN7testing8internal5posix6GetEnvEPKc(ptr noundef @.str.119)
  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.120)
  br i1 %15, label %34, 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.121)
  br i1 %18, label %34, 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.122)
  br i1 %21, label %34, 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.123)
  br i1 %24, label %34, 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.124)
  br i1 %27, label %34, 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.125)
  br i1 %30, label %34, 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.126)
  br label %34

34:                                               ; preds = %31, %28, %25, %22, %19, %16, %12
  %35 = phi i1 [ true, %28 ], [ true, %25 ], [ true, %22 ], [ true, %19 ], [ true, %16 ], [ true, %12 ], [ %33, %31 ]
  %36 = zext i1 %35 to i8
  store i8 %36, ptr %6, align 1, !tbaa !5
  %37 = load i8, ptr %3, align 1, !tbaa !5, !range !11, !noundef !12
  %38 = trunc i8 %37 to i1
  br i1 %38, label %39, label %42

39:                                               ; preds = %34
  %40 = load i8, ptr %6, align 1, !tbaa !5, !range !11, !noundef !12
  %41 = trunc i8 %40 to i1
  br label %42

42:                                               ; preds = %39, %34
  %43 = phi i1 [ false, %34 ], [ %41, %39 ]
  store i1 %43, 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 %58

44:                                               ; preds = %1
  %45 = load ptr, ptr %4, align 8, !tbaa !9
  %46 = call noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef %45, ptr noundef @.str.127)
  br i1 %46, label %56, label %47

47:                                               ; preds = %44
  %48 = load ptr, ptr %4, align 8, !tbaa !9
  %49 = call noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef %48, ptr noundef @.str.128)
  br i1 %49, label %56, label %50

50:                                               ; preds = %47
  %51 = load ptr, ptr %4, align 8, !tbaa !9
  %52 = call noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef %51, ptr noundef @.str.129)
  br i1 %52, label %56, label %53

53:                                               ; preds = %50
  %54 = load ptr, ptr %4, align 8, !tbaa !9
  %55 = call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %54, ptr noundef @.str.116)
  br label %56

56:                                               ; preds = %53, %50, %47, %44
  %57 = phi i1 [ true, %50 ], [ true, %47 ], [ true, %44 ], [ %55, %53 ]
  store i1 %57, ptr %2, align 1
  store i32 1, ptr %7, align 4
  br label %58

58:                                               ; preds = %56, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %59 = load i1, ptr %2, align 1
  ret i1 %59
}

; 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.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.116 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.119 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.120 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.121 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.122 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.124 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.125 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.126 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.127 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.128 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.129 = 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.8)
  br i1 %3, label %4, label %22

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

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

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

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

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

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

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

19:                                               ; preds = %17, %15, %13, %11, %9, %7, %4
  %20 = phi i1 [ true, %15 ], [ true, %13 ], [ true, %11 ], [ true, %9 ], [ true, %7 ], [ true, %4 ], [ %18, %17 ]
  %21 = and i1 %20, %0
  br label %30

22:                                               ; preds = %1
  %23 = tail call noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef %2, ptr noundef nonnull @.str.127)
  br i1 %23, label %30, label %24

24:                                               ; preds = %22
  %25 = tail call noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef %2, ptr noundef nonnull @.str.128)
  br i1 %25, label %30, label %26

26:                                               ; preds = %24
  %27 = tail call noundef zeroext i1 @_ZN7testing8internal6String28CaseInsensitiveCStringEqualsEPKcS3_(ptr noundef %2, ptr noundef nonnull @.str.129)
  br i1 %27, label %30, label %28

28:                                               ; preds = %26
  %29 = tail call noundef zeroext i1 @_ZN7testing8internal6String13CStringEqualsEPKcS3_(ptr noundef %2, ptr noundef nonnull @.str.116)
  br label %30

30:                                               ; preds = %22, %24, %26, %28, %19
  %.0 = phi i1 [ %21, %19 ], [ true, %26 ], [ true, %24 ], [ true, %22 ], [ %29, %28 ]
  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