; LLVM IR from chensoft/libsocket :: lib/libchen/test/lib/googletest/googlemock/src (gmock-all)

; 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] }

@.str.2 = external hidden unnamed_addr constant [1 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

declare i32 @__gxx_personality_v0(...)

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

; 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
define dso_local void @_ZN7testing8internal28ConvertIdentifierNameToWordsB5cxx11EPKc(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef %1) #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  store i1 false, ptr %5, align 1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  store i8 0, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %11, ptr %7, align 8, !tbaa !5
  br label %12

12:                                               ; preds = %71, %2
  %13 = load ptr, ptr %7, align 8, !tbaa !5
  %14 = load i8, ptr %13, align 1, !tbaa !9
  %15 = sext i8 %14 to i32
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %18, label %17

17:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %75

18:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = load i8, ptr %19, align 1, !tbaa !9
  %21 = invoke noundef zeroext i1 @_ZN7testing8internal7IsUpperEc(i8 noundef signext %20)
          to label %22 unwind label %59

22:                                               ; preds = %18
  br i1 %21, label %43, label %23

23:                                               ; preds = %22
  %24 = load i8, ptr %6, align 1, !tbaa !9
  %25 = invoke noundef zeroext i1 @_ZN7testing8internal7IsAlphaEc(i8 noundef signext %24)
          to label %26 unwind label %59

26:                                               ; preds = %23
  br i1 %25, label %32, label %27

27:                                               ; preds = %26
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = load i8, ptr %28, align 1, !tbaa !9
  %30 = invoke noundef zeroext i1 @_ZN7testing8internal7IsLowerEc(i8 noundef signext %29)
          to label %31 unwind label %59

31:                                               ; preds = %27
  br i1 %30, label %43, label %32

32:                                               ; preds = %31, %26
  %33 = load i8, ptr %6, align 1, !tbaa !9
  %34 = invoke noundef zeroext i1 @_ZN7testing8internal7IsDigitEc(i8 noundef signext %33)
          to label %35 unwind label %59

35:                                               ; preds = %32
  br i1 %34, label %41, label %36

36:                                               ; preds = %35
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load i8, ptr %37, align 1, !tbaa !9
  %39 = invoke noundef zeroext i1 @_ZN7testing8internal7IsDigitEc(i8 noundef signext %38)
          to label %40 unwind label %59

40:                                               ; preds = %36
  br label %41

41:                                               ; preds = %40, %35
  %42 = phi i1 [ false, %35 ], [ %39, %40 ]
  br label %43

43:                                               ; preds = %41, %31, %22
  %44 = phi i1 [ true, %31 ], [ true, %22 ], [ %42, %41 ]
  %45 = zext i1 %44 to i8
  store i8 %45, ptr %8, align 1, !tbaa !10
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load i8, ptr %46, align 1, !tbaa !9
  %48 = invoke noundef zeroext i1 @_ZN7testing8internal7IsAlNumEc(i8 noundef signext %47)
          to label %49 unwind label %59

49:                                               ; preds = %43
  br i1 %48, label %50, label %70

50:                                               ; preds = %49
  %51 = load i8, ptr %8, align 1, !tbaa !10, !range !12, !noundef !13
  %52 = trunc i8 %51 to i1
  br i1 %52, label %53, label %63

53:                                               ; preds = %50
  %54 = invoke noundef zeroext i1 @_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef @.str.2)
          to label %55 unwind label %59

55:                                               ; preds = %53
  br i1 %54, label %56, label %63

56:                                               ; preds = %55
  %57 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext 32)
          to label %58 unwind label %59

58:                                               ; preds = %56
  br label %63

59:                                               ; preds = %67, %63, %56, %53, %43, %36, %32, %27, %23, %18
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %9, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %79

63:                                               ; preds = %58, %55, %50
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = load i8, ptr %64, align 1, !tbaa !9
  %66 = invoke noundef signext i8 @_ZN7testing8internal7ToLowerEc(i8 noundef signext %65)
          to label %67 unwind label %59

67:                                               ; preds = %63
  %68 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %66)
          to label %69 unwind label %59

69:                                               ; preds = %67
  br label %70

70:                                               ; preds = %69, %49
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  br label %71

71:                                               ; preds = %70
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %72, i32 1
  store ptr %73, ptr %7, align 8, !tbaa !5
  %74 = load i8, ptr %72, align 1, !tbaa !9
  store i8 %74, ptr %6, align 1, !tbaa !9
  br label %12, !llvm.loop !14

75:                                               ; preds = %17
  store i1 true, ptr %5, align 1
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  %76 = load i1, ptr %5, align 1
  br i1 %76, label %78, label %77

77:                                               ; preds = %75
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %78

78:                                               ; preds = %77, %75
  ret void

79:                                               ; preds = %59
  %80 = load ptr, ptr %9, align 8
  %81 = load i32, ptr %10, align 4
  %82 = insertvalue { ptr, i32 } poison, ptr %80, 0
  %83 = insertvalue { ptr, i32 } %82, i32 %81, 1
  resume { ptr, i32 } %83
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal7IsUpperEc(i8 noundef signext) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal7IsAlphaEc(i8 noundef signext) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal7IsLowerEc(i8 noundef signext) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal7IsDigitEc(i8 noundef signext) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal7IsAlNumEc(i8 noundef signext) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_ZN7testing8internal7ToLowerEc(i8 noundef signext) #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 = { inlinehint 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 #5 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"bool", !7, i64 0}
!12 = !{i8 0, i8 2}
!13 = !{}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; 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] }

@.str.2 = external hidden unnamed_addr constant [1 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7testing8internal28ConvertIdentifierNameToWordsB5cxx11EPKc(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  %3 = load i8, ptr %1, align 1, !tbaa !5
  %.not15 = icmp eq i8 %3, 0
  br i1 %.not15, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2, %32
  %4 = phi i8 [ %35, %32 ], [ %3, %2 ]
  %.019 = phi i8 [ %34, %32 ], [ 0, %2 ]
  %.01316 = phi ptr [ %33, %32 ], [ %1, %2 ]
  %5 = tail call noundef zeroext i1 @_ZN7testing8internal7IsUpperEc(i8 noundef signext %4)
  br i1 %5, label %16, label %6

6:                                                ; preds = %.lr.ph
  %7 = tail call noundef zeroext i1 @_ZN7testing8internal7IsAlphaEc(i8 noundef signext %.019)
  br i1 %7, label %11, label %8

8:                                                ; preds = %6
  %9 = load i8, ptr %.01316, align 1, !tbaa !5
  %10 = tail call noundef zeroext i1 @_ZN7testing8internal7IsLowerEc(i8 noundef signext %9)
  br i1 %10, label %16, label %11

11:                                               ; preds = %8, %6
  %12 = tail call noundef zeroext i1 @_ZN7testing8internal7IsDigitEc(i8 noundef signext %.019)
  %13 = load i8, ptr %.01316, align 1, !tbaa !5
  br i1 %12, label %.thread, label %14

14:                                               ; preds = %11
  %15 = tail call noundef zeroext i1 @_ZN7testing8internal7IsDigitEc(i8 noundef signext %13)
  br label %16

16:                                               ; preds = %14, %8, %.lr.ph
  %17 = phi i1 [ true, %8 ], [ true, %.lr.ph ], [ %15, %14 ]
  %18 = load i8, ptr %.01316, align 1, !tbaa !5
  %19 = tail call noundef zeroext i1 @_ZN7testing8internal7IsAlNumEc(i8 noundef signext %18)
  br i1 %19, label %21, label %32

.thread:                                          ; preds = %11
  %20 = tail call noundef zeroext i1 @_ZN7testing8internal7IsAlNumEc(i8 noundef signext %13)
  br i1 %20, label %.thread14, label %32

21:                                               ; preds = %16
  br i1 %17, label %22, label %.thread14

22:                                               ; preds = %21
  %23 = invoke noundef zeroext i1 @_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.2)
          to label %24 unwind label %27

24:                                               ; preds = %22
  br i1 %23, label %25, label %.thread14

25:                                               ; preds = %24
  %26 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext 32)
          to label %.thread14 unwind label %27

27:                                               ; preds = %.thread14, %25, %22
  %28 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  resume { ptr, i32 } %28

.thread14:                                        ; preds = %.thread, %25, %24, %21
  %29 = load i8, ptr %.01316, align 1, !tbaa !5
  %30 = tail call noundef signext i8 @_ZN7testing8internal7ToLowerEc(i8 noundef signext %29)
  %31 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %30)
          to label %32 unwind label %27

32:                                               ; preds = %.thread, %.thread14, %16
  %33 = getelementptr inbounds i8, ptr %.01316, i64 1
  %34 = load i8, ptr %.01316, align 1, !tbaa !5
  %35 = load i8, ptr %33, align 1, !tbaa !5
  %.not = icmp eq i8 %35, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !8

._crit_edge:                                      ; preds = %32, %2
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal7IsUpperEc(i8 noundef signext) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal7IsAlphaEc(i8 noundef signext) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal7IsLowerEc(i8 noundef signext) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal7IsDigitEc(i8 noundef signext) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7testing8internal7IsAlNumEc(i8 noundef signext) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_ZN7testing8internal7ToLowerEc(i8 noundef signext) 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 = { inlinehint 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 #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass