; LLVM IR from imteekay/algorithms :: competitive-programming/codeforces/div2 (karen_and_morning)

; 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 nounwind uwtable
declare dso_local noundef i32 @_Z8to_digitc(i8 noundef signext) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 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 i32, align 4
  %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
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %2) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  %12 = 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) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %13 unwind label %49

13:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %14 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
          to label %15 unwind label %53

15:                                               ; preds = %13
  %16 = load i8, ptr %14, align 1, !tbaa !5
  %17 = call noundef i32 @_Z8to_digitc(i8 noundef signext %16)
  store i32 %17, ptr %5, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %18 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 1)
          to label %19 unwind label %57

19:                                               ; preds = %15
  %20 = load i8, ptr %18, align 1, !tbaa !5
  %21 = call noundef i32 @_Z8to_digitc(i8 noundef signext %20)
  store i32 %21, ptr %6, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %22 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 3)
          to label %23 unwind label %61

23:                                               ; preds = %19
  %24 = load i8, ptr %22, align 1, !tbaa !5
  %25 = call noundef i32 @_Z8to_digitc(i8 noundef signext %24)
  store i32 %25, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %26 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 4)
          to label %27 unwind label %65

27:                                               ; preds = %23
  %28 = load i8, ptr %26, align 1, !tbaa !5
  %29 = call noundef i32 @_Z8to_digitc(i8 noundef signext %28)
  store i32 %29, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %30 = load i32, ptr %5, align 4, !tbaa !8
  %31 = mul nsw i32 %30, 10
  %32 = load i32, ptr %6, align 4, !tbaa !8
  %33 = add nsw i32 %31, %32
  store i32 %33, ptr %9, align 4, !tbaa !8
  %34 = load i32, ptr %7, align 4, !tbaa !8
  %35 = mul nsw i32 %34, 10
  %36 = load i32, ptr %8, align 4, !tbaa !8
  %37 = add nsw i32 %35, %36
  store i32 %37, ptr %10, align 4, !tbaa !8
  %38 = load i32, ptr %9, align 4, !tbaa !8
  %39 = load i32, ptr %8, align 4, !tbaa !8
  %40 = mul nsw i32 %39, 10
  %41 = load i32, ptr %7, align 4, !tbaa !8
  %42 = add nsw i32 %40, %41
  %43 = icmp eq i32 %38, %42
  br i1 %43, label %44, label %73

44:                                               ; preds = %27
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
          to label %46 unwind label %69

46:                                               ; preds = %44
  %47 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %48 unwind label %69

48:                                               ; preds = %46
  br label %193

49:                                               ; preds = %0
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %3, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %4, align 4
  br label %202

53:                                               ; preds = %13
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %3, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %4, align 4
  br label %201

57:                                               ; preds = %15
  %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 %200

61:                                               ; preds = %19
  %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 %199

65:                                               ; preds = %23
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %3, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %4, align 4
  br label %198

69:                                               ; preds = %141, %137, %83, %79, %46, %44
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %3, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %198

73:                                               ; preds = %27
  %74 = load i32, ptr %9, align 4, !tbaa !8
  %75 = icmp eq i32 %74, 1
  br i1 %75, label %76, label %86

76:                                               ; preds = %73
  %77 = load i32, ptr %10, align 4, !tbaa !8
  %78 = icmp slt i32 %77, 10
  br i1 %78, label %79, label %86

79:                                               ; preds = %76
  %80 = load i32, ptr %10, align 4, !tbaa !8
  %81 = sub nsw i32 10, %80
  %82 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %81)
          to label %83 unwind label %69

83:                                               ; preds = %79
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %85 unwind label %69

85:                                               ; preds = %83
  br label %192

86:                                               ; preds = %76, %73
  %87 = load i32, ptr %9, align 4, !tbaa !8
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %134, label %89

89:                                               ; preds = %86
  %90 = load i32, ptr %9, align 4, !tbaa !8
  %91 = icmp eq i32 %90, 1
  br i1 %91, label %134, label %92

92:                                               ; preds = %89
  %93 = load i32, ptr %9, align 4, !tbaa !8
  %94 = icmp eq i32 %93, 2
  br i1 %94, label %134, label %95

95:                                               ; preds = %92
  %96 = load i32, ptr %9, align 4, !tbaa !8
  %97 = icmp eq i32 %96, 3
  br i1 %97, label %134, label %98

98:                                               ; preds = %95
  %99 = load i32, ptr %9, align 4, !tbaa !8
  %100 = icmp eq i32 %99, 4
  br i1 %100, label %134, label %101

101:                                              ; preds = %98
  %102 = load i32, ptr %9, align 4, !tbaa !8
  %103 = icmp eq i32 %102, 5
  br i1 %103, label %134, label %104

104:                                              ; preds = %101
  %105 = load i32, ptr %9, align 4, !tbaa !8
  %106 = icmp eq i32 %105, 10
  br i1 %106, label %134, label %107

107:                                              ; preds = %104
  %108 = load i32, ptr %9, align 4, !tbaa !8
  %109 = icmp eq i32 %108, 11
  br i1 %109, label %134, label %110

110:                                              ; preds = %107
  %111 = load i32, ptr %9, align 4, !tbaa !8
  %112 = icmp eq i32 %111, 12
  br i1 %112, label %134, label %113

113:                                              ; preds = %110
  %114 = load i32, ptr %9, align 4, !tbaa !8
  %115 = icmp eq i32 %114, 13
  br i1 %115, label %134, label %116

116:                                              ; preds = %113
  %117 = load i32, ptr %9, align 4, !tbaa !8
  %118 = icmp eq i32 %117, 14
  br i1 %118, label %134, label %119

119:                                              ; preds = %116
  %120 = load i32, ptr %9, align 4, !tbaa !8
  %121 = icmp eq i32 %120, 15
  br i1 %121, label %134, label %122

122:                                              ; preds = %119
  %123 = load i32, ptr %9, align 4, !tbaa !8
  %124 = icmp eq i32 %123, 20
  br i1 %124, label %134, label %125

125:                                              ; preds = %122
  %126 = load i32, ptr %9, align 4, !tbaa !8
  %127 = icmp eq i32 %126, 21
  br i1 %127, label %134, label %128

128:                                              ; preds = %125
  %129 = load i32, ptr %9, align 4, !tbaa !8
  %130 = icmp eq i32 %129, 22
  br i1 %130, label %134, label %131

131:                                              ; preds = %128
  %132 = load i32, ptr %9, align 4, !tbaa !8
  %133 = icmp eq i32 %132, 23
  br i1 %133, label %134, label %144

134:                                              ; preds = %131, %128, %125, %122, %119, %116, %113, %110, %107, %104, %101, %98, %95, %92, %89, %86
  %135 = load i32, ptr %10, align 4, !tbaa !8
  %136 = icmp sgt i32 %135, 10
  br i1 %136, label %137, label %144

137:                                              ; preds = %134
  %138 = load i32, ptr %10, align 4, !tbaa !8
  %139 = sub nsw i32 70, %138
  %140 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %139)
          to label %141 unwind label %69

141:                                              ; preds = %137
  %142 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %143 unwind label %69

143:                                              ; preds = %141
  br label %191

144:                                              ; preds = %134, %131
  %145 = load i32, ptr %9, align 4, !tbaa !8
  %146 = icmp eq i32 %145, 0
  br i1 %146, label %186, label %147

147:                                              ; preds = %144
  %148 = load i32, ptr %9, align 4, !tbaa !8
  %149 = icmp eq i32 %148, 1
  br i1 %149, label %186, label %150

150:                                              ; preds = %147
  %151 = load i32, ptr %9, align 4, !tbaa !8
  %152 = icmp eq i32 %151, 2
  br i1 %152, label %186, label %153

153:                                              ; preds = %150
  %154 = load i32, ptr %9, align 4, !tbaa !8
  %155 = icmp eq i32 %154, 3
  br i1 %155, label %186, label %156

156:                                              ; preds = %153
  %157 = load i32, ptr %9, align 4, !tbaa !8
  %158 = icmp eq i32 %157, 4
  br i1 %158, label %186, label %159

159:                                              ; preds = %156
  %160 = load i32, ptr %9, align 4, !tbaa !8
  %161 = icmp eq i32 %160, 10
  br i1 %161, label %186, label %162

162:                                              ; preds = %159
  %163 = load i32, ptr %9, align 4, !tbaa !8
  %164 = icmp eq i32 %163, 11
  br i1 %164, label %186, label %165

165:                                              ; preds = %162
  %166 = load i32, ptr %9, align 4, !tbaa !8
  %167 = icmp eq i32 %166, 12
  br i1 %167, label %186, label %168

168:                                              ; preds = %165
  %169 = load i32, ptr %9, align 4, !tbaa !8
  %170 = icmp eq i32 %169, 13
  br i1 %170, label %186, label %171

171:                                              ; preds = %168
  %172 = load i32, ptr %9, align 4, !tbaa !8
  %173 = icmp eq i32 %172, 14
  br i1 %173, label %186, label %174

174:                                              ; preds = %171
  %175 = load i32, ptr %9, align 4, !tbaa !8
  %176 = icmp eq i32 %175, 20
  br i1 %176, label %186, label %177

177:                                              ; preds = %174
  %178 = load i32, ptr %9, align 4, !tbaa !8
  %179 = icmp eq i32 %178, 21
  br i1 %179, label %186, label %180

180:                                              ; preds = %177
  %181 = load i32, ptr %9, align 4, !tbaa !8
  %182 = icmp eq i32 %181, 22
  br i1 %182, label %186, label %183

183:                                              ; preds = %180
  %184 = load i32, ptr %9, align 4, !tbaa !8
  %185 = icmp eq i32 %184, 23
  br i1 %185, label %186, label %190

186:                                              ; preds = %183, %180, %177, %174, %171, %168, %165, %162, %159, %156, %153, %150, %147, %144
  %187 = load i32, ptr %10, align 4, !tbaa !8
  %188 = icmp sgt i32 %187, 10
  br i1 %188, label %189, label %190

189:                                              ; preds = %186
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  br label %194

190:                                              ; preds = %186, %183
  br label %191

191:                                              ; preds = %190, %143
  br label %192

192:                                              ; preds = %191, %85
  br label %193

193:                                              ; preds = %192, %48
  store i32 0, ptr %11, align 4
  br label %194

194:                                              ; preds = %193, %189
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, 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 @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #6
  %195 = load i32, ptr %11, align 4
  switch i32 %195, label %208 [
    i32 0, label %196
    i32 1, label %196
  ]

196:                                              ; preds = %194, %194
  %197 = load i32, ptr %1, align 4
  ret i32 %197

198:                                              ; preds = %69, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %199

199:                                              ; preds = %198, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %200

200:                                              ; preds = %199, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %201

201:                                              ; preds = %200, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %202

202:                                              ; preds = %201, %49
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #6
  br label %203

203:                                              ; preds = %202
  %204 = load ptr, ptr %3, align 8
  %205 = load i32, ptr %4, align 4
  %206 = insertvalue { ptr, i32 } poison, ptr %204, 0
  %207 = insertvalue { ptr, i32 } %206, i32 %205, 1
  resume { ptr, i32 } %207

208:                                              ; preds = %194
  unreachable
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}


; 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 nounwind uwtable
declare dso_local noundef i32 @_Z8to_digitc(i8 noundef signext) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %2 = 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) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %3 unwind label %23

3:                                                ; preds = %0
  %4 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 0)
  %5 = load i8, ptr %4, align 1, !tbaa !5
  %6 = call noundef i32 @_Z8to_digitc(i8 noundef signext %5)
  %7 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 1)
  %8 = load i8, ptr %7, align 1, !tbaa !5
  %9 = call noundef i32 @_Z8to_digitc(i8 noundef signext %8)
  %10 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 3)
  %11 = load i8, ptr %10, align 1, !tbaa !5
  %12 = call noundef i32 @_Z8to_digitc(i8 noundef signext %11)
  %13 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 4)
  %14 = load i8, ptr %13, align 1, !tbaa !5
  %15 = call noundef i32 @_Z8to_digitc(i8 noundef signext %14)
  %16 = mul nsw i32 %6, 10
  %17 = add nsw i32 %9, %16
  %18 = mul nsw i32 %12, 10
  %19 = add nsw i32 %15, %18
  %20 = mul nsw i32 %15, 10
  %21 = add nsw i32 %20, %12
  %22 = icmp eq i32 %17, %21
  br i1 %22, label %.invoke110, label %27

23:                                               ; preds = %0
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %45

25:                                               ; preds = %.invoke110, %.invoke
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %45

27:                                               ; preds = %3
  %28 = icmp eq i32 %17, 1
  %29 = icmp slt i32 %19, 10
  %or.cond = select i1 %28, i1 %29, i1 false
  br i1 %or.cond, label %30, label %32

30:                                               ; preds = %27
  %31 = sub nsw i32 10, %19
  br label %.invoke110

32:                                               ; preds = %27
  %or.cond11 = icmp ult i32 %17, 6
  %33 = and i32 %17, -2
  %34 = icmp eq i32 %33, 10
  %or.cond15 = or i1 %or.cond11, %34
  %35 = and i32 %17, -4
  %36 = icmp eq i32 %35, 12
  %or.cond23 = or i1 %36, %or.cond15
  %37 = icmp eq i32 %35, 20
  %or.cond31 = or i1 %37, %or.cond23
  %38 = icmp sgt i32 %19, 10
  %or.cond33 = select i1 %or.cond31, i1 %38, i1 false
  br i1 %or.cond33, label %39, label %44

39:                                               ; preds = %32
  %40 = sub nsw i32 70, %19
  br label %.invoke110

.invoke110:                                       ; preds = %3, %30, %39
  %41 = phi i32 [ %40, %39 ], [ %31, %30 ], [ 0, %3 ]
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %41)
          to label %.invoke unwind label %25

.invoke:                                          ; preds = %.invoke110
  %43 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %44 unwind label %25

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

45:                                               ; preds = %25, %23
  %.pn = phi { ptr, i32 } [ %26, %25 ], [ %24, %23 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #6
  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) #2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass