; LLVM IR from MinaFaried3/Assiut-University-Training---Newcomers :: k-sheet8_general_easy/N-Cakeminator.ll (Z9solution1v)

; 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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9solution1v() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %17, i64 32)
  %19 = extractvalue { i64, i1 } %18, 1
  %20 = extractvalue { i64, i1 } %18, 0
  %21 = call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %20, i64 8)
  %22 = extractvalue { i64, i1 } %21, 1
  %23 = or i1 %19, %22
  %24 = extractvalue { i64, i1 } %21, 0
  %25 = select i1 %23, i64 -1, i64 %24
  %26 = call noalias noundef nonnull ptr @_Znam(i64 noundef %25) #7
  store i64 %17, ptr %26, align 16
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = icmp eq i64 %17, 0
  br i1 %28, label %35, label %29

29:                                               ; preds = %0
  %30 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %27, i64 %17
  br label %31

31:                                               ; preds = %31, %29
  %32 = phi ptr [ %27, %29 ], [ %33, %31 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %32) #6
  %33 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %32, i64 1
  %34 = icmp eq ptr %33, %30
  br i1 %34, label %35, label %31

35:                                               ; preds = %31, %0
  store ptr %27, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %47, %35
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = load i32, ptr %1, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %50

41:                                               ; preds = %36
  %42 = load ptr, ptr %3, align 8, !tbaa !9
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %42, i64 %44
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_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) %45)
  br label %47

47:                                               ; preds = %41
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %4, align 4, !tbaa !5
  br label %36, !llvm.loop !11

50:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #6
  store i8 0, ptr %8, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %89, %50
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = load i32, ptr %1, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %92

56:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %75, %56
  %58 = load i32, ptr %11, align 4, !tbaa !5
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 8, ptr %10, align 4
  br label %78

62:                                               ; preds = %57
  %63 = load ptr, ptr %3, align 8, !tbaa !9
  %64 = load i32, ptr %9, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %63, i64 %65
  %67 = load i32, ptr %11, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %66, i64 noundef %68)
  %70 = load i8, ptr %69, align 1, !tbaa !15
  %71 = sext i8 %70 to i32
  %72 = icmp eq i32 %71, 83
  br i1 %72, label %73, label %74

73:                                               ; preds = %62
  store i8 1, ptr %8, align 1, !tbaa !13
  store i32 8, ptr %10, align 4
  br label %78

74:                                               ; preds = %62
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %11, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %11, align 4, !tbaa !5
  br label %57, !llvm.loop !16

78:                                               ; preds = %73, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %79

79:                                               ; preds = %78
  %80 = load i8, ptr %8, align 1, !tbaa !13, !range !17, !noundef !18
  %81 = trunc i8 %80 to i1
  br i1 %81, label %88, label %82

82:                                               ; preds = %79
  %83 = load i32, ptr %2, align 4, !tbaa !5
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = add nsw i32 %84, %83
  store i32 %85, ptr %5, align 4, !tbaa !5
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %7, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %82, %79
  store i8 0, ptr %8, align 1, !tbaa !13
  br label %89

89:                                               ; preds = %88
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %9, align 4, !tbaa !5
  br label %51, !llvm.loop !19

92:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %131, %92
  %94 = load i32, ptr %12, align 4, !tbaa !5
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %134

98:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %117, %98
  %100 = load i32, ptr %13, align 4, !tbaa !5
  %101 = load i32, ptr %1, align 4, !tbaa !5
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %104, label %103

103:                                              ; preds = %99
  store i32 14, ptr %10, align 4
  br label %120

104:                                              ; preds = %99
  %105 = load ptr, ptr %3, align 8, !tbaa !9
  %106 = load i32, ptr %13, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %105, i64 %107
  %109 = load i32, ptr %12, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %108, i64 noundef %110)
  %112 = load i8, ptr %111, align 1, !tbaa !15
  %113 = sext i8 %112 to i32
  %114 = icmp eq i32 %113, 83
  br i1 %114, label %115, label %116

115:                                              ; preds = %104
  store i8 1, ptr %8, align 1, !tbaa !13
  store i32 14, ptr %10, align 4
  br label %120

116:                                              ; preds = %104
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %13, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %13, align 4, !tbaa !5
  br label %99, !llvm.loop !20

120:                                              ; preds = %115, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %121

121:                                              ; preds = %120
  %122 = load i8, ptr %8, align 1, !tbaa !13, !range !17, !noundef !18
  %123 = trunc i8 %122 to i1
  br i1 %123, label %130, label %124

124:                                              ; preds = %121
  %125 = load i32, ptr %1, align 4, !tbaa !5
  %126 = load i32, ptr %5, align 4, !tbaa !5
  %127 = add nsw i32 %126, %125
  store i32 %127, ptr %5, align 4, !tbaa !5
  %128 = load i32, ptr %6, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %6, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %124, %121
  store i8 0, ptr %8, align 1, !tbaa !13
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %12, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %12, align 4, !tbaa !5
  br label %93, !llvm.loop !21

134:                                              ; preds = %97
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %137, label %143

137:                                              ; preds = %134
  %138 = load i32, ptr %6, align 4, !tbaa !5
  %139 = load i32, ptr %7, align 4, !tbaa !5
  %140 = mul nsw i32 %138, %139
  %141 = load i32, ptr %5, align 4, !tbaa !5
  %142 = sub nsw i32 %141, %140
  store i32 %142, ptr %5, align 4, !tbaa !5
  br label %143

143:                                              ; preds = %137, %134
  %144 = load i32, ptr %5, align 4, !tbaa !5
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %144)
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  ret void
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.uadd.with.overflow.i64(i64, i64) #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #4

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #2

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

; 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) #5 align 2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nobuiltin allocsize(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 = { 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }

!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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !12}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !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::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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9solution1v() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %3 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = sext i32 %5 to i64
  %7 = icmp slt i32 %5, 0
  %8 = shl nsw i64 %6, 5
  %9 = or disjoint i64 %8, 8
  %10 = select i1 %7, i64 -1, i64 %9
  %11 = call noalias noundef nonnull ptr @_Znam(i64 noundef %10) #6
  store i64 %6, ptr %11, align 16
  %12 = getelementptr inbounds i8, ptr %11, i64 8
  %13 = icmp eq i32 %5, 0
  br i1 %13, label %.preheader47.thread, label %14

14:                                               ; preds = %0
  %15 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %12, i64 %6
  br label %16

16:                                               ; preds = %16, %14
  %17 = phi ptr [ %12, %14 ], [ %18, %16 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #5
  %18 = getelementptr inbounds i8, ptr %17, i64 32
  %19 = icmp eq ptr %18, %15
  br i1 %19, label %.loopexit48, label %16

.loopexit48:                                      ; preds = %16
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  %20 = icmp sgt i32 %.pre, 0
  br i1 %20, label %.lr.ph, label %.preheader47.thread

.preheader47.thread:                              ; preds = %.loopexit48, %0
  %.ph = phi i32 [ %.pre, %.loopexit48 ], [ 0, %0 ]
  %.pre8889 = load i32, ptr %2, align 4, !tbaa !5
  br label %.preheader44

.preheader47:                                     ; preds = %.lr.ph
  %21 = icmp sgt i32 %26, 0
  %.pre88 = load i32, ptr %2, align 4, !tbaa !5
  br i1 %21, label %.preheader45.lr.ph, label %.preheader44

.preheader45.lr.ph:                               ; preds = %.preheader47
  %22 = icmp sgt i32 %.pre88, 0
  br i1 %22, label %.preheader45, label %.preheader44.thread

.preheader44.thread:                              ; preds = %.preheader45.lr.ph
  %23 = mul i32 %.pre88, %26
  br label %._crit_edge

.lr.ph:                                           ; preds = %.loopexit48, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.loopexit48 ]
  %24 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %12, i64 %indvars.iv
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_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) %24)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = load i32, ptr %1, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = icmp slt i64 %indvars.iv.next, %27
  br i1 %28, label %.lr.ph, label %.preheader47, !llvm.loop !9

.preheader45:                                     ; preds = %.preheader45.lr.ph, %.loopexit46
  %29 = phi i32 [ %.pr, %.loopexit46 ], [ %.pre88, %.preheader45.lr.ph ]
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %.loopexit46 ], [ 0, %.preheader45.lr.ph ]
  %.03253 = phi i32 [ %.133, %.loopexit46 ], [ 0, %.preheader45.lr.ph ]
  %.03652 = phi i32 [ %.137, %.loopexit46 ], [ 0, %.preheader45.lr.ph ]
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph51, label %.critedge

.lr.ph51:                                         ; preds = %.preheader45
  %31 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %12, i64 %indvars.iv77
  br label %42

.preheader44:                                     ; preds = %.loopexit46, %.preheader47.thread, %.preheader47
  %32 = phi i32 [ %26, %.preheader47 ], [ %.ph, %.preheader47.thread ], [ %49, %.loopexit46 ]
  %33 = phi i32 [ %.pre88, %.preheader47 ], [ %.pre8889, %.preheader47.thread ], [ %.pr, %.loopexit46 ]
  %.036.lcssa = phi i32 [ 0, %.preheader47 ], [ 0, %.preheader47.thread ], [ %.137, %.loopexit46 ]
  %.032.lcssa = phi i32 [ 0, %.preheader47 ], [ 0, %.preheader47.thread ], [ %.133, %.loopexit46 ]
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.preheader.lr.ph, label %._crit_edge

.preheader.lr.ph:                                 ; preds = %.preheader44
  %35 = icmp sgt i32 %32, 0
  br i1 %35, label %.preheader, label %.preheader.lr.ph.split.us

.preheader.lr.ph.split.us:                        ; preds = %.preheader.lr.ph
  %36 = mul i32 %32, %33
  %37 = add i32 %.036.lcssa, %36
  br label %._crit_edge

38:                                               ; preds = %42
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next75, %40
  br i1 %41, label %42, label %.critedge, !llvm.loop !11

42:                                               ; preds = %.lr.ph51, %38
  %indvars.iv74 = phi i64 [ 0, %.lr.ph51 ], [ %indvars.iv.next75, %38 ]
  %43 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %31, i64 noundef %indvars.iv74)
  %44 = load i8, ptr %43, align 1, !tbaa !12
  %45 = icmp eq i8 %44, 83
  br i1 %45, label %.loopexit46, label %38

.critedge:                                        ; preds = %38, %.preheader45
  %46 = phi i32 [ %29, %.preheader45 ], [ %39, %38 ]
  %47 = add nsw i32 %46, %.03652
  %48 = add nsw i32 %.03253, 1
  br label %.loopexit46

.loopexit46:                                      ; preds = %42, %.critedge
  %.137 = phi i32 [ %47, %.critedge ], [ %.03652, %42 ]
  %.133 = phi i32 [ %48, %.critedge ], [ %.03253, %42 ]
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %49 = load i32, ptr %1, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next78, %50
  %.pr = load i32, ptr %2, align 4, !tbaa !5
  br i1 %51, label %.preheader45, label %.preheader44, !llvm.loop !13

.preheader:                                       ; preds = %.preheader.lr.ph, %.loopexit
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %.loopexit ], [ 0, %.preheader.lr.ph ]
  %.03461 = phi i32 [ %.135, %.loopexit ], [ 0, %.preheader.lr.ph ]
  %.23860 = phi i32 [ %.339, %.loopexit ], [ %.036.lcssa, %.preheader.lr.ph ]
  %52 = load i32, ptr %1, align 4, !tbaa !5
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %.lr.ph59, label %.critedge43

._crit_edge:                                      ; preds = %.loopexit, %.preheader44.thread, %.preheader.lr.ph.split.us, %.preheader44
  %.032.lcssa92 = phi i32 [ %.032.lcssa, %.preheader44 ], [ %.032.lcssa, %.preheader.lr.ph.split.us ], [ %26, %.preheader44.thread ], [ %.032.lcssa, %.loopexit ]
  %.238.lcssa = phi i32 [ %.036.lcssa, %.preheader44 ], [ %37, %.preheader.lr.ph.split.us ], [ %23, %.preheader44.thread ], [ %.339, %.loopexit ]
  %.034.lcssa = phi i32 [ 0, %.preheader44 ], [ %33, %.preheader.lr.ph.split.us ], [ 0, %.preheader44.thread ], [ %.135, %.loopexit ]
  %54 = mul nsw i32 %.034.lcssa, %.032.lcssa92
  %.4 = sub nsw i32 %.238.lcssa, %54
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret void

56:                                               ; preds = %.lr.ph59
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %57 = load i32, ptr %1, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = icmp slt i64 %indvars.iv.next82, %58
  br i1 %59, label %.lr.ph59, label %.critedge43, !llvm.loop !15

.lr.ph59:                                         ; preds = %.preheader, %56
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %56 ], [ 0, %.preheader ]
  %60 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %12, i64 %indvars.iv81
  %61 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %60, i64 noundef %indvars.iv84)
  %62 = load i8, ptr %61, align 1, !tbaa !12
  %63 = icmp eq i8 %62, 83
  br i1 %63, label %.loopexit, label %56

.critedge43:                                      ; preds = %56, %.preheader
  %64 = phi i32 [ %52, %.preheader ], [ %57, %56 ]
  %65 = add nsw i32 %64, %.23860
  %66 = add i32 %.03461, 1
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph59, %.critedge43
  %.339 = phi i32 [ %65, %.critedge43 ], [ %.23860, %.lr.ph59 ]
  %.135 = phi i32 [ %66, %.critedge43 ], [ %.03461, %.lr.ph59 ]
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next85, %68
  br i1 %69, label %.preheader, label %._crit_edge, !llvm.loop !16
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #3

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_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 #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 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 #4 align 2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { nobuiltin allocsize(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 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 #5 = { nounwind }
attributes #6 = { builtin allocsize(0) }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !10, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !14}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass