; LLVM IR from AdarshGaur/Competitive-Programming :: Codeforces/Codeforces Round #780 (Div. 3)/F1. Promising String (easy version).ll (Z5solvev)

; 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: 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 @_Z5solvev() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i8, align 1
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %1) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %14 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %15 unwind label %23

15:                                               ; preds = %0
  %16 = invoke 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) %14, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %17 unwind label %23

17:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 0, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 0, ptr %6, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %150, %17
  %19 = load i64, ptr %6, align 8, !tbaa !5
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = icmp slt i64 %19, %20
  br i1 %21, label %27, label %22

22:                                               ; preds = %18
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %155

23:                                               ; preds = %15, %0
  %24 = landingpad { ptr, i32 }
          cleanup
  %25 = extractvalue { ptr, i32 } %24, 0
  store ptr %25, ptr %3, align 8
  %26 = extractvalue { ptr, i32 } %24, 1
  store i32 %26, ptr %4, align 4
  br label %166

27:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !5
  %28 = load i64, ptr %6, align 8, !tbaa !5
  %29 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %28)
          to label %30 unwind label %57

30:                                               ; preds = %27
  %31 = load i8, ptr %29, align 1, !tbaa !9
  %32 = sext i8 %31 to i32
  %33 = icmp eq i32 %32, 43
  %34 = zext i1 %33 to i64
  %35 = load i64, ptr %8, align 8, !tbaa !5
  %36 = add nsw i64 %35, %34
  store i64 %36, ptr %8, align 8, !tbaa !5
  %37 = load i64, ptr %6, align 8, !tbaa !5
  %38 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %37)
          to label %39 unwind label %57

39:                                               ; preds = %30
  %40 = load i8, ptr %38, align 1, !tbaa !9
  %41 = sext i8 %40 to i32
  %42 = icmp eq i32 %41, 45
  %43 = zext i1 %42 to i64
  %44 = load i64, ptr %9, align 8, !tbaa !5
  %45 = add nsw i64 %44, %43
  store i64 %45, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  %46 = load i64, ptr %6, align 8, !tbaa !5
  %47 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %46)
          to label %48 unwind label %61

48:                                               ; preds = %39
  %49 = load i8, ptr %47, align 1, !tbaa !9
  store i8 %49, ptr %11, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %50 = load i64, ptr %6, align 8, !tbaa !5
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %12, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %146, %48
  %53 = load i64, ptr %12, align 8, !tbaa !5
  %54 = load i64, ptr %2, align 8, !tbaa !5
  %55 = icmp slt i64 %53, %54
  br i1 %55, label %65, label %56

56:                                               ; preds = %52
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %149

57:                                               ; preds = %30, %27
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %3, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %4, align 4
  br label %154

61:                                               ; preds = %39
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %3, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %4, align 4
  br label %153

65:                                               ; preds = %52
  %66 = load i64, ptr %12, align 8, !tbaa !5
  %67 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %66)
          to label %68 unwind label %75

68:                                               ; preds = %65
  %69 = load i8, ptr %67, align 1, !tbaa !9
  %70 = sext i8 %69 to i32
  %71 = icmp eq i32 %70, 43
  br i1 %71, label %72, label %79

72:                                               ; preds = %68
  %73 = load i64, ptr %8, align 8, !tbaa !5
  %74 = add nsw i64 %73, 1
  store i64 %74, ptr %8, align 8, !tbaa !5
  br label %82

75:                                               ; preds = %96, %82, %65
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %3, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %153

79:                                               ; preds = %68
  %80 = load i64, ptr %9, align 8, !tbaa !5
  %81 = add nsw i64 %80, 1
  store i64 %81, ptr %9, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %79, %72
  %83 = load i64, ptr %12, align 8, !tbaa !5
  %84 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %83)
          to label %85 unwind label %75

85:                                               ; preds = %82
  %86 = load i8, ptr %84, align 1, !tbaa !9
  %87 = sext i8 %86 to i32
  %88 = icmp eq i32 %87, 45
  br i1 %88, label %89, label %96

89:                                               ; preds = %85
  %90 = load i8, ptr %11, align 1, !tbaa !9
  %91 = sext i8 %90 to i32
  %92 = icmp eq i32 %91, 45
  br i1 %92, label %93, label %96

93:                                               ; preds = %89
  store i8 46, ptr %11, align 1, !tbaa !9
  %94 = load i64, ptr %10, align 8, !tbaa !5
  %95 = add nsw i64 %94, 1
  store i64 %95, ptr %10, align 8, !tbaa !5
  br label %101

96:                                               ; preds = %89, %85
  %97 = load i64, ptr %12, align 8, !tbaa !5
  %98 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %97)
          to label %99 unwind label %75

99:                                               ; preds = %96
  %100 = load i8, ptr %98, align 1, !tbaa !9
  store i8 %100, ptr %11, align 1, !tbaa !9
  br label %101

101:                                              ; preds = %99, %93
  %102 = load i64, ptr %8, align 8, !tbaa !5
  %103 = load i64, ptr %10, align 8, !tbaa !5
  %104 = add nsw i64 %102, %103
  %105 = load i64, ptr %9, align 8, !tbaa !5
  %106 = load i64, ptr %10, align 8, !tbaa !5
  %107 = mul nsw i64 %106, 2
  %108 = sub nsw i64 %105, %107
  %109 = icmp eq i64 %104, %108
  br i1 %109, label %114, label %110

110:                                              ; preds = %101
  %111 = load i64, ptr %8, align 8, !tbaa !5
  %112 = load i64, ptr %9, align 8, !tbaa !5
  %113 = icmp eq i64 %111, %112
  br i1 %113, label %114, label %117

114:                                              ; preds = %110, %101
  %115 = load i64, ptr %5, align 8, !tbaa !5
  %116 = add nsw i64 %115, 1
  store i64 %116, ptr %5, align 8, !tbaa !5
  br label %145

117:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %118 = load i64, ptr %9, align 8, !tbaa !5
  %119 = load i64, ptr %8, align 8, !tbaa !5
  %120 = sub nsw i64 %118, %119
  store i64 %120, ptr %13, align 8, !tbaa !5
  %121 = load i64, ptr %13, align 8, !tbaa !5
  %122 = icmp sgt i64 %121, 0
  br i1 %122, label %123, label %144

123:                                              ; preds = %117
  %124 = load i64, ptr %8, align 8, !tbaa !5
  %125 = load i64, ptr %13, align 8, !tbaa !5
  %126 = sdiv i64 %125, 3
  %127 = add nsw i64 %124, %126
  %128 = load i64, ptr %9, align 8, !tbaa !5
  %129 = load i64, ptr %13, align 8, !tbaa !5
  %130 = sdiv i64 %129, 3
  %131 = mul nsw i64 %130, 2
  %132 = sub nsw i64 %128, %131
  %133 = icmp eq i64 %127, %132
  br i1 %133, label %134, label %144

134:                                              ; preds = %123
  %135 = load i64, ptr %13, align 8, !tbaa !5
  %136 = sdiv i64 %135, 3
  %137 = load i64, ptr %10, align 8, !tbaa !5
  %138 = icmp sle i64 %136, %137
  %139 = zext i1 %138 to i64
  %140 = select i1 %138, i32 1, i32 0
  %141 = sext i32 %140 to i64
  %142 = load i64, ptr %5, align 8, !tbaa !5
  %143 = add nsw i64 %142, %141
  store i64 %143, ptr %5, align 8, !tbaa !5
  br label %144

144:                                              ; preds = %134, %123, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %145

145:                                              ; preds = %144, %114
  br label %146

146:                                              ; preds = %145
  %147 = load i64, ptr %12, align 8, !tbaa !5
  %148 = add nsw i64 %147, 1
  store i64 %148, ptr %12, align 8, !tbaa !5
  br label %52, !llvm.loop !10

149:                                              ; preds = %56
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %150

150:                                              ; preds = %149
  %151 = load i64, ptr %6, align 8, !tbaa !5
  %152 = add nsw i64 %151, 1
  store i64 %152, ptr %6, align 8, !tbaa !5
  br label %18, !llvm.loop !12

153:                                              ; preds = %75, %61
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  br label %154

154:                                              ; preds = %153, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %165

155:                                              ; preds = %22
  %156 = load i64, ptr %5, align 8, !tbaa !5
  %157 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %156)
          to label %158 unwind label %161

158:                                              ; preds = %155
  %159 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %157, ptr noundef @.str)
          to label %160 unwind label %161

160:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %1) #5
  ret void

161:                                              ; preds = %158, %155
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %3, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %4, align 4
  br label %165

165:                                              ; preds = %161, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %166

166:                                              ; preds = %165, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %1) #5
  br label %167

167:                                              ; preds = %166
  %168 = load ptr, ptr %3, align 8
  %169 = load i32, ptr %4, align 4
  %170 = insertvalue { ptr, i32 } poison, ptr %168, 0
  %171 = insertvalue { ptr, i32 } %170, i32 %169, 1
  resume { ptr, i32 } %171
}

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 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)) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

; 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) #4

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

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 = { "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 = !{!"long", !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}


; 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 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: mustprogress 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 @_Z5solvev() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %3 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %4 unwind label %11

4:                                                ; preds = %0
  %5 = invoke 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) %3, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %.preheader unwind label %11

.preheader:                                       ; preds = %4
  %6 = load i64, ptr %2, align 8, !tbaa !5
  %7 = icmp sgt i64 %6, 0
  br i1 %7, label %.lr.ph61, label %._crit_edge

.loopexit:                                        ; preds = %60, %.lr.ph61
  %8 = phi i64 [ %19, %.lr.ph61 ], [ %62, %60 ]
  %.148.lcssa = phi i64 [ %.04759, %.lr.ph61 ], [ %.3, %60 ]
  %9 = icmp slt i64 %18, %8
  br i1 %9, label %.lr.ph61, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.loopexit, %.preheader
  %.047.lcssa = phi i64 [ 0, %.preheader ], [ %.148.lcssa, %.loopexit ]
  %10 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.047.lcssa)
          to label %64 unwind label %67

11:                                               ; preds = %4, %0
  %12 = landingpad { ptr, i32 }
          cleanup
  br label %69

.lr.ph61:                                         ; preds = %.preheader, %.loopexit
  %.04660 = phi i64 [ %18, %.loopexit ], [ 0, %.preheader ]
  %.04759 = phi i64 [ %.148.lcssa, %.loopexit ], [ 0, %.preheader ]
  %13 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.04660)
  %14 = load i8, ptr %13, align 1, !tbaa !11
  %15 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.04660)
  %16 = load i8, ptr %15, align 1, !tbaa !11
  %17 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.04660)
  %18 = add nuw nsw i64 %.04660, 1
  %19 = load i64, ptr %2, align 8, !tbaa !5
  %20 = icmp slt i64 %18, %19
  br i1 %20, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %.lr.ph61
  %21 = load i8, ptr %17, align 1, !tbaa !11
  %22 = icmp eq i8 %16, 45
  %23 = zext i1 %22 to i64
  %24 = icmp eq i8 %14, 43
  %25 = zext i1 %24 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %60
  %.03858 = phi i64 [ %61, %60 ], [ %18, %.lr.ph.preheader ]
  %.03957 = phi i8 [ %.1, %60 ], [ %21, %.lr.ph.preheader ]
  %.04056 = phi i64 [ %.141, %60 ], [ 0, %.lr.ph.preheader ]
  %.04255 = phi i64 [ %.143, %60 ], [ %23, %.lr.ph.preheader ]
  %.04454 = phi i64 [ %.145, %60 ], [ %25, %.lr.ph.preheader ]
  %.14853 = phi i64 [ %.3, %60 ], [ %.04759, %.lr.ph.preheader ]
  %26 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.03858)
  %27 = load i8, ptr %26, align 1, !tbaa !11
  %28 = icmp eq i8 %27, 43
  %29 = zext i1 %28 to i64
  %.145 = add nuw nsw i64 %.04454, %29
  %not. = xor i1 %28, true
  %30 = zext i1 %not. to i64
  %.143 = add nuw nsw i64 %.04255, %30
  %31 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.03858)
  %32 = load i8, ptr %31, align 1, !tbaa !11
  %33 = icmp eq i8 %32, 45
  %34 = icmp eq i8 %.03957, 45
  %or.cond = select i1 %33, i1 %34, i1 false
  br i1 %or.cond, label %35, label %37

35:                                               ; preds = %.lr.ph
  %36 = add nsw i64 %.04056, 1
  br label %40

37:                                               ; preds = %.lr.ph
  %38 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.03858)
  %39 = load i8, ptr %38, align 1, !tbaa !11
  br label %40

40:                                               ; preds = %37, %35
  %.141 = phi i64 [ %36, %35 ], [ %.04056, %37 ]
  %.1 = phi i8 [ 46, %35 ], [ %39, %37 ]
  %41 = add nsw i64 %.141, %.145
  %42 = shl nsw i64 %.141, 1
  %43 = sub nsw i64 %.143, %42
  %44 = icmp eq i64 %41, %43
  %45 = icmp eq i64 %.145, %.143
  %or.cond52 = or i1 %45, %44
  br i1 %or.cond52, label %46, label %48

46:                                               ; preds = %40
  %47 = add nsw i64 %.14853, 1
  br label %60

48:                                               ; preds = %40
  %49 = sub nsw i64 %.143, %.145
  %50 = icmp sgt i64 %49, 0
  br i1 %50, label %51, label %60

51:                                               ; preds = %48
  %52 = udiv i64 %49, 3
  %53 = add nuw nsw i64 %52, %.145
  %54 = shl nuw nsw i64 %52, 1
  %55 = sub nsw i64 %.143, %54
  %56 = icmp eq i64 %53, %55
  br i1 %56, label %57, label %60

57:                                               ; preds = %51
  %.not = icmp sle i64 %52, %.141
  %58 = zext i1 %.not to i64
  %59 = add nsw i64 %.14853, %58
  br label %60

60:                                               ; preds = %48, %51, %57, %46
  %.3 = phi i64 [ %47, %46 ], [ %59, %57 ], [ %.14853, %51 ], [ %.14853, %48 ]
  %61 = add nuw nsw i64 %.03858, 1
  %62 = load i64, ptr %2, align 8, !tbaa !5
  %63 = icmp slt i64 %61, %62
  br i1 %63, label %.lr.ph, label %.loopexit, !llvm.loop !12

64:                                               ; preds = %._crit_edge
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull @.str)
          to label %66 unwind label %67

66:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #5
  ret void

67:                                               ; preds = %64, %._crit_edge
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %69

69:                                               ; preds = %67, %11
  %.pn = phi { ptr, i32 } [ %68, %67 ], [ %12, %11 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 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 #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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

; 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 #4

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass