; LLVM IR from hao14293/2021-Postgraduate-408 :: PAT/PAT-B/CPP/1042.字符统计 (main)

; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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] }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca [26 x i32], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %2) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  %11 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %12 unwind label %19

12:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 104, ptr %5) #7
  call void @llvm.memset.p0.i64(ptr align 16 %5, i8 0, i64 104, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %36, %12
  %14 = load i32, ptr %6, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  %17 = icmp ult i64 %15, %16
  br i1 %17, label %23, label %18

18:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %43

19:                                               ; preds = %0
  %20 = landingpad { ptr, i32 }
          cleanup
  %21 = extractvalue { ptr, i32 } %20, 0
  store ptr %21, ptr %3, align 8
  %22 = extractvalue { ptr, i32 } %20, 1
  store i32 %22, ptr %4, align 4
  br label %120

23:                                               ; preds = %13
  %24 = load i32, ptr %6, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %25)
          to label %27 unwind label %39

27:                                               ; preds = %23
  %28 = load i8, ptr %26, align 1, !tbaa !9
  %29 = sext i8 %28 to i32
  %30 = call i32 @tolower(i32 noundef %29) #8
  %31 = trunc i32 %30 to i8
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %33)
          to label %35 unwind label %39

35:                                               ; preds = %27
  store i8 %31, ptr %34, align 1, !tbaa !9
  br label %36

36:                                               ; preds = %35
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %6, align 4, !tbaa !5
  br label %13, !llvm.loop !10

39:                                               ; preds = %27, %23
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %3, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %119

43:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %76, %43
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  %48 = icmp ult i64 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %79

50:                                               ; preds = %44
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %52)
          to label %54 unwind label %71

54:                                               ; preds = %50
  %55 = load i8, ptr %53, align 1, !tbaa !9
  %56 = sext i8 %55 to i32
  %57 = call i32 @islower(i32 noundef %56) #8
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %75

59:                                               ; preds = %54
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %61)
          to label %63 unwind label %71

63:                                               ; preds = %59
  %64 = load i8, ptr %62, align 1, !tbaa !9
  %65 = sext i8 %64 to i32
  %66 = sub nsw i32 %65, 97
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [26 x i32], ptr %5, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %68, align 4, !tbaa !5
  br label %75

71:                                               ; preds = %59, %50
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %3, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %119

75:                                               ; preds = %63, %54
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %7, align 4, !tbaa !5
  br label %44, !llvm.loop !12

79:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %80 = getelementptr inbounds [26 x i32], ptr %5, i64 0, i64 0
  %81 = load i32, ptr %80, align 16, !tbaa !5
  store i32 %81, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %100, %79
  %83 = load i32, ptr %10, align 4, !tbaa !5
  %84 = icmp slt i32 %83, 26
  br i1 %84, label %86, label %85

85:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %103

86:                                               ; preds = %82
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [26 x i32], ptr %5, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = icmp sgt i32 %90, %91
  br i1 %92, label %93, label %99

93:                                               ; preds = %86
  %94 = load i32, ptr %10, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [26 x i32], ptr %5, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  store i32 %97, ptr %8, align 4, !tbaa !5
  %98 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %98, ptr %9, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %93, %86
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %10, align 4, !tbaa !5
  br label %82, !llvm.loop !13

103:                                              ; preds = %85
  %104 = load i32, ptr %9, align 4, !tbaa !5
  %105 = add nsw i32 %104, 97
  %106 = trunc i32 %105 to i8
  %107 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %106)
          to label %108 unwind label %115

108:                                              ; preds = %103
  %109 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %107, ptr noundef @.str)
          to label %110 unwind label %115

110:                                              ; preds = %108
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %109, i32 noundef %111)
          to label %113 unwind label %115

113:                                              ; preds = %110
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 104, ptr %5) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #7
  %114 = load i32, ptr %1, align 4
  ret i32 %114

115:                                              ; preds = %110, %108, %103
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %3, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %119

119:                                              ; preds = %115, %71, %39
  call void @llvm.lifetime.end.p0(i64 104, ptr %5) #7
  br label %120

120:                                              ; preds = %119, %19
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #7
  br label %121

121:                                              ; preds = %120
  %122 = load ptr, ptr %3, align 8
  %123 = load i32, ptr %4, align 4
  %124 = insertvalue { ptr, i32 } poison, ptr %122, 0
  %125 = insertvalue { ptr, i32 } %124, i32 %123, 1
  resume { ptr, i32 } %125
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @tolower(i32 noundef) #5

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @islower(i32 noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #6

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

attributes #0 = { mustprogress norecurse 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 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind willreturn memory(read) "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 #6 = { "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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}


; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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] }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca [26 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %3 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %4 unwind label %7

4:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %2) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %2, i8 0, i64 104, i1 false)
  %5 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %.not36 = icmp eq i64 %5, 0
  br i1 %.not36, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %4
  %6 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %.not37 = icmp eq i64 %6, 0
  br i1 %.not37, label %._crit_edge, label %.lr.ph32

7:                                                ; preds = %0
  %8 = landingpad { ptr, i32 }
          cleanup
  br label %121

.lr.ph:                                           ; preds = %4, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %4 ]
  %9 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %10 = load i8, ptr %9, align 1, !tbaa !5
  %11 = sext i8 %10 to i32
  %12 = call i32 @tolower(i32 noundef %11) #9
  %13 = trunc i32 %12 to i8
  %14 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  store i8 %13, ptr %14, align 1, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %16 = icmp ugt i64 %15, %indvars.iv.next
  br i1 %16, label %.lr.ph, label %.preheader, !llvm.loop !8

._crit_edge.loopexit:                             ; preds = %111
  %.pre = load i32, ptr %2, align 16, !tbaa !10
  %.phi.trans.insert = getelementptr inbounds i8, ptr %2, i64 4
  %.pre45 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !10
  %.phi.trans.insert46 = getelementptr inbounds i8, ptr %2, i64 8
  %.pre47 = load i32, ptr %.phi.trans.insert46, align 8, !tbaa !10
  %.phi.trans.insert48 = getelementptr inbounds i8, ptr %2, i64 12
  %.pre49 = load i32, ptr %.phi.trans.insert48, align 4, !tbaa !10
  %.phi.trans.insert50 = getelementptr inbounds i8, ptr %2, i64 16
  %.pre51 = load i32, ptr %.phi.trans.insert50, align 16, !tbaa !10
  %.phi.trans.insert52 = getelementptr inbounds i8, ptr %2, i64 20
  %.pre53 = load i32, ptr %.phi.trans.insert52, align 4, !tbaa !10
  %.phi.trans.insert54 = getelementptr inbounds i8, ptr %2, i64 24
  %.pre55 = load i32, ptr %.phi.trans.insert54, align 8, !tbaa !10
  %.phi.trans.insert56 = getelementptr inbounds i8, ptr %2, i64 28
  %.pre57 = load i32, ptr %.phi.trans.insert56, align 4, !tbaa !10
  %.phi.trans.insert58 = getelementptr inbounds i8, ptr %2, i64 32
  %.pre59 = load i32, ptr %.phi.trans.insert58, align 16, !tbaa !10
  %.phi.trans.insert60 = getelementptr inbounds i8, ptr %2, i64 36
  %.pre61 = load i32, ptr %.phi.trans.insert60, align 4, !tbaa !10
  %.phi.trans.insert62 = getelementptr inbounds i8, ptr %2, i64 40
  %.pre63 = load i32, ptr %.phi.trans.insert62, align 8, !tbaa !10
  %.phi.trans.insert64 = getelementptr inbounds i8, ptr %2, i64 44
  %.pre65 = load i32, ptr %.phi.trans.insert64, align 4, !tbaa !10
  %.phi.trans.insert66 = getelementptr inbounds i8, ptr %2, i64 48
  %.pre67 = load i32, ptr %.phi.trans.insert66, align 16, !tbaa !10
  %.phi.trans.insert68 = getelementptr inbounds i8, ptr %2, i64 52
  %.pre69 = load i32, ptr %.phi.trans.insert68, align 4, !tbaa !10
  %.phi.trans.insert70 = getelementptr inbounds i8, ptr %2, i64 56
  %.pre71 = load i32, ptr %.phi.trans.insert70, align 8, !tbaa !10
  %.phi.trans.insert72 = getelementptr inbounds i8, ptr %2, i64 60
  %.pre73 = load i32, ptr %.phi.trans.insert72, align 4, !tbaa !10
  %.phi.trans.insert74 = getelementptr inbounds i8, ptr %2, i64 64
  %.pre75 = load i32, ptr %.phi.trans.insert74, align 16, !tbaa !10
  %.phi.trans.insert76 = getelementptr inbounds i8, ptr %2, i64 68
  %.pre77 = load i32, ptr %.phi.trans.insert76, align 4, !tbaa !10
  %.phi.trans.insert78 = getelementptr inbounds i8, ptr %2, i64 72
  %.pre79 = load i32, ptr %.phi.trans.insert78, align 8, !tbaa !10
  %.phi.trans.insert80 = getelementptr inbounds i8, ptr %2, i64 76
  %.pre81 = load i32, ptr %.phi.trans.insert80, align 4, !tbaa !10
  %.phi.trans.insert82 = getelementptr inbounds i8, ptr %2, i64 80
  %.pre83 = load i32, ptr %.phi.trans.insert82, align 16, !tbaa !10
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %17 = phi i32 [ %.pre83, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %18 = phi i32 [ %.pre81, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %19 = phi i32 [ %.pre79, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %20 = phi i32 [ %.pre77, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %21 = phi i32 [ %.pre75, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %22 = phi i32 [ %.pre73, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %23 = phi i32 [ %.pre71, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %24 = phi i32 [ %.pre69, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %25 = phi i32 [ %.pre67, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %26 = phi i32 [ %.pre65, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %27 = phi i32 [ %.pre63, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %28 = phi i32 [ %.pre61, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %29 = phi i32 [ %.pre59, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %30 = phi i32 [ %.pre57, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %31 = phi i32 [ %.pre55, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %32 = phi i32 [ %.pre53, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %33 = phi i32 [ %.pre51, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %34 = phi i32 [ %.pre49, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %35 = phi i32 [ %.pre47, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %36 = phi i32 [ %.pre45, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %37 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %38 = icmp sgt i32 %36, %37
  %spec.select = call i32 @llvm.smax.i32(i32 %36, i32 %37)
  %39 = icmp sgt i32 %35, %spec.select
  %spec.select.1 = call i32 @llvm.smax.i32(i32 %35, i32 %spec.select)
  %40 = icmp sgt i32 %34, %spec.select.1
  %spec.select.2 = call i32 @llvm.smax.i32(i32 %34, i32 %spec.select.1)
  %41 = select i1 %38, i8 98, i8 97
  %42 = icmp sgt i32 %33, %spec.select.2
  %spec.select.3 = call i32 @llvm.smax.i32(i32 %33, i32 %spec.select.2)
  %43 = select i1 %39, i8 99, i8 %41
  %44 = icmp sgt i32 %32, %spec.select.3
  %spec.select.4 = call i32 @llvm.smax.i32(i32 %32, i32 %spec.select.3)
  %45 = select i1 %40, i8 100, i8 %43
  %46 = icmp sgt i32 %31, %spec.select.4
  %spec.select.5 = call i32 @llvm.smax.i32(i32 %31, i32 %spec.select.4)
  %47 = select i1 %42, i8 101, i8 %45
  %48 = icmp sgt i32 %30, %spec.select.5
  %spec.select.6 = call i32 @llvm.smax.i32(i32 %30, i32 %spec.select.5)
  %49 = select i1 %44, i8 102, i8 %47
  %50 = icmp sgt i32 %29, %spec.select.6
  %spec.select.7 = call i32 @llvm.smax.i32(i32 %29, i32 %spec.select.6)
  %51 = select i1 %46, i8 103, i8 %49
  %52 = icmp sgt i32 %28, %spec.select.7
  %spec.select.8 = call i32 @llvm.smax.i32(i32 %28, i32 %spec.select.7)
  %53 = select i1 %48, i8 104, i8 %51
  %54 = icmp sgt i32 %27, %spec.select.8
  %spec.select.9 = call i32 @llvm.smax.i32(i32 %27, i32 %spec.select.8)
  %55 = select i1 %50, i8 105, i8 %53
  %56 = icmp sgt i32 %26, %spec.select.9
  %spec.select.10 = call i32 @llvm.smax.i32(i32 %26, i32 %spec.select.9)
  %57 = select i1 %52, i8 106, i8 %55
  %58 = icmp sgt i32 %25, %spec.select.10
  %spec.select.11 = call i32 @llvm.smax.i32(i32 %25, i32 %spec.select.10)
  %59 = select i1 %54, i8 107, i8 %57
  %60 = icmp sgt i32 %24, %spec.select.11
  %spec.select.12 = call i32 @llvm.smax.i32(i32 %24, i32 %spec.select.11)
  %61 = select i1 %56, i8 108, i8 %59
  %62 = icmp sgt i32 %23, %spec.select.12
  %spec.select.13 = call i32 @llvm.smax.i32(i32 %23, i32 %spec.select.12)
  %63 = select i1 %58, i8 109, i8 %61
  %64 = icmp sgt i32 %22, %spec.select.13
  %spec.select.14 = call i32 @llvm.smax.i32(i32 %22, i32 %spec.select.13)
  %65 = select i1 %60, i8 110, i8 %63
  %66 = icmp sgt i32 %21, %spec.select.14
  %spec.select.15 = call i32 @llvm.smax.i32(i32 %21, i32 %spec.select.14)
  %67 = select i1 %62, i8 111, i8 %65
  %68 = icmp sgt i32 %20, %spec.select.15
  %spec.select.16 = call i32 @llvm.smax.i32(i32 %20, i32 %spec.select.15)
  %69 = select i1 %64, i8 112, i8 %67
  %70 = icmp sgt i32 %19, %spec.select.16
  %spec.select.17 = call i32 @llvm.smax.i32(i32 %19, i32 %spec.select.16)
  %71 = select i1 %66, i8 113, i8 %69
  %72 = icmp sgt i32 %18, %spec.select.17
  %spec.select.18 = call i32 @llvm.smax.i32(i32 %18, i32 %spec.select.17)
  %73 = select i1 %68, i8 114, i8 %71
  %74 = icmp sgt i32 %17, %spec.select.18
  %spec.select.19 = call i32 @llvm.smax.i32(i32 %17, i32 %spec.select.18)
  %75 = select i1 %70, i8 115, i8 %73
  %76 = getelementptr inbounds i8, ptr %2, i64 84
  %77 = load i32, ptr %76, align 4, !tbaa !10
  %78 = icmp sgt i32 %77, %spec.select.19
  %spec.select.20 = call i32 @llvm.smax.i32(i32 %77, i32 %spec.select.19)
  %79 = select i1 %72, i8 116, i8 %75
  %80 = getelementptr inbounds i8, ptr %2, i64 88
  %81 = load i32, ptr %80, align 8, !tbaa !10
  %82 = icmp sgt i32 %81, %spec.select.20
  %spec.select.21 = call i32 @llvm.smax.i32(i32 %81, i32 %spec.select.20)
  %83 = select i1 %74, i8 117, i8 %79
  %84 = getelementptr inbounds i8, ptr %2, i64 92
  %85 = load i32, ptr %84, align 4, !tbaa !10
  %86 = icmp sgt i32 %85, %spec.select.21
  %spec.select.22 = call i32 @llvm.smax.i32(i32 %85, i32 %spec.select.21)
  %87 = select i1 %78, i8 118, i8 %83
  %88 = getelementptr inbounds i8, ptr %2, i64 96
  %89 = load i32, ptr %88, align 16, !tbaa !10
  %90 = icmp sgt i32 %89, %spec.select.22
  %spec.select.23 = call i32 @llvm.smax.i32(i32 %89, i32 %spec.select.22)
  %91 = select i1 %82, i8 119, i8 %87
  %92 = getelementptr inbounds i8, ptr %2, i64 100
  %93 = load i32, ptr %92, align 4, !tbaa !10
  %94 = icmp sgt i32 %93, %spec.select.23
  %spec.select.24 = call i32 @llvm.smax.i32(i32 %93, i32 %spec.select.23)
  %95 = select i1 %86, i8 120, i8 %91
  %96 = select i1 %90, i8 121, i8 %95
  %97 = select i1 %94, i8 122, i8 %96
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %97)
          to label %114 unwind label %119

.lr.ph32:                                         ; preds = %.preheader, %111
  %indvars.iv39 = phi i64 [ %indvars.iv.next40, %111 ], [ 0, %.preheader ]
  %99 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv39)
  %100 = load i8, ptr %99, align 1, !tbaa !5
  %101 = sext i8 %100 to i32
  %102 = call i32 @islower(i32 noundef %101) #9
  %.not = icmp eq i32 %102, 0
  br i1 %.not, label %111, label %103

103:                                              ; preds = %.lr.ph32
  %104 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv39)
  %105 = load i8, ptr %104, align 1, !tbaa !5
  %106 = sext i8 %105 to i64
  %107 = add nsw i64 %106, -97
  %108 = getelementptr inbounds [26 x i32], ptr %2, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !10
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %108, align 4, !tbaa !10
  br label %111

111:                                              ; preds = %.lr.ph32, %103
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %112 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  %113 = icmp ugt i64 %112, %indvars.iv.next40
  br i1 %113, label %.lr.ph32, label %._crit_edge.loopexit, !llvm.loop !12

114:                                              ; preds = %._crit_edge
  %115 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef nonnull @.str)
          to label %116 unwind label %119

116:                                              ; preds = %114
  %117 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %115, i32 noundef %spec.select.24)
          to label %118 unwind label %119

118:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %2) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #8
  ret i32 0

119:                                              ; preds = %116, %114, %._crit_edge
  %120 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %2) #8
  br label %121

121:                                              ; preds = %119, %7
  %.pn = phi { ptr, i32 } [ %120, %119 ], [ %8, %7 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @tolower(i32 noundef) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @islower(i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #6

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7

attributes #0 = { mustprogress norecurse 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress nofree nounwind willreturn memory(read) "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 #6 = { "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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }

!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"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = distinct !{!12, !9}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass