; LLVM IR from DionysiosB/CodeForces :: 0700-0799 (727B-BillTotalValue)

; 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::__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
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 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 i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %2) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  %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 %21

13:                                               ; preds = %0
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %14 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  %15 = sub i64 0, %14
  store i64 %15, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %16

16:                                               ; preds = %94, %13
  %17 = load i64, ptr %8, align 8, !tbaa !9
  %18 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  %19 = icmp ult i64 %17, %18
  br i1 %19, label %25, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %97

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

25:                                               ; preds = %16
  %26 = load i64, ptr %8, align 8, !tbaa !9
  %27 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %26)
          to label %28 unwind label %47

28:                                               ; preds = %25
  %29 = load i8, ptr %27, align 1, !tbaa !11
  %30 = sext i8 %29 to i32
  %31 = icmp sle i32 97, %30
  br i1 %31, label %32, label %57

32:                                               ; preds = %28
  %33 = load i64, ptr %8, align 8, !tbaa !9
  %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 %47

35:                                               ; preds = %32
  %36 = load i8, ptr %34, align 1, !tbaa !11
  %37 = sext i8 %36 to i32
  %38 = icmp sle i32 %37, 122
  br i1 %38, label %39, label %57

39:                                               ; preds = %35
  %40 = load i64, ptr %8, align 8, !tbaa !9
  %41 = load i64, ptr %7, align 8, !tbaa !9
  %42 = sub nsw i64 %40, %41
  %43 = icmp sgt i64 %42, 3
  br i1 %43, label %44, label %51

44:                                               ; preds = %39
  %45 = load i64, ptr %6, align 8, !tbaa !5
  %46 = mul nsw i64 %45, 100
  store i64 %46, ptr %6, align 8, !tbaa !5
  br label %51

47:                                               ; preds = %80, %73, %66, %57, %32, %25
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %3, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %234

51:                                               ; preds = %44, %39
  %52 = load i64, ptr %6, align 8, !tbaa !5
  %53 = load i64, ptr %5, align 8, !tbaa !5
  %54 = add nsw i64 %53, %52
  store i64 %54, ptr %5, align 8, !tbaa !5
  store i64 0, ptr %6, align 8, !tbaa !5
  %55 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  %56 = sub i64 0, %55
  store i64 %56, ptr %7, align 8, !tbaa !9
  br label %93

57:                                               ; preds = %35, %28
  %58 = load i64, ptr %8, align 8, !tbaa !9
  %59 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %58)
          to label %60 unwind label %47

60:                                               ; preds = %57
  %61 = load i8, ptr %59, align 1, !tbaa !11
  %62 = sext i8 %61 to i32
  %63 = icmp eq i32 %62, 46
  br i1 %63, label %64, label %66

64:                                               ; preds = %60
  %65 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %65, ptr %7, align 8, !tbaa !9
  br label %92

66:                                               ; preds = %60
  %67 = load i64, ptr %8, align 8, !tbaa !9
  %68 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %67)
          to label %69 unwind label %47

69:                                               ; preds = %66
  %70 = load i8, ptr %68, align 1, !tbaa !11
  %71 = sext i8 %70 to i32
  %72 = icmp sle i32 48, %71
  br i1 %72, label %73, label %91

73:                                               ; preds = %69
  %74 = load i64, ptr %8, align 8, !tbaa !9
  %75 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %74)
          to label %76 unwind label %47

76:                                               ; preds = %73
  %77 = load i8, ptr %75, align 1, !tbaa !11
  %78 = sext i8 %77 to i32
  %79 = icmp sle i32 %78, 57
  br i1 %79, label %80, label %91

80:                                               ; preds = %76
  %81 = load i64, ptr %6, align 8, !tbaa !5
  %82 = mul nsw i64 10, %81
  %83 = load i64, ptr %8, align 8, !tbaa !9
  %84 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %83)
          to label %85 unwind label %47

85:                                               ; preds = %80
  %86 = load i8, ptr %84, align 1, !tbaa !11
  %87 = sext i8 %86 to i32
  %88 = sub nsw i32 %87, 48
  %89 = sext i32 %88 to i64
  %90 = add nsw i64 %82, %89
  store i64 %90, ptr %6, align 8, !tbaa !5
  br label %91

91:                                               ; preds = %85, %76, %69
  br label %92

92:                                               ; preds = %91, %64
  br label %93

93:                                               ; preds = %92, %51
  br label %94

94:                                               ; preds = %93
  %95 = load i64, ptr %8, align 8, !tbaa !9
  %96 = add nsw i64 %95, 1
  store i64 %96, ptr %8, align 8, !tbaa !9
  br label %16, !llvm.loop !12

97:                                               ; preds = %20
  %98 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  %99 = load i64, ptr %7, align 8, !tbaa !9
  %100 = sub i64 %98, %99
  %101 = icmp ugt i64 %100, 3
  br i1 %101, label %102, label %105

102:                                              ; preds = %97
  %103 = load i64, ptr %6, align 8, !tbaa !5
  %104 = mul nsw i64 %103, 100
  store i64 %104, ptr %6, align 8, !tbaa !5
  br label %105

105:                                              ; preds = %102, %97
  %106 = load i64, ptr %6, align 8, !tbaa !5
  %107 = load i64, ptr %5, align 8, !tbaa !5
  %108 = add nsw i64 %107, %106
  store i64 %108, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %109 = load i64, ptr %5, align 8, !tbaa !5
  %110 = sdiv i64 %109, 100
  store i64 %110, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %111 = load i64, ptr %5, align 8, !tbaa !5
  %112 = srem i64 %111, 100
  %113 = trunc i64 %112 to i32
  store i32 %113, ptr %10, align 4, !tbaa !14
  %114 = load i64, ptr %9, align 8, !tbaa !5
  %115 = icmp eq i64 %114, 1000
  br i1 %115, label %116, label %123

116:                                              ; preds = %105
  %117 = invoke i32 (ptr, ...) @printf(ptr noundef @.str)
          to label %118 unwind label %119

118:                                              ; preds = %116
  br label %216

119:                                              ; preds = %227, %224, %219, %208, %204, %201, %195, %186, %138, %132, %126, %116
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %3, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %4, align 4
  br label %233

123:                                              ; preds = %105
  %124 = load i64, ptr %9, align 8, !tbaa !5
  %125 = icmp eq i64 %124, 1000000
  br i1 %125, label %126, label %129

126:                                              ; preds = %123
  %127 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1)
          to label %128 unwind label %119

128:                                              ; preds = %126
  br label %215

129:                                              ; preds = %123
  %130 = load i64, ptr %9, align 8, !tbaa !5
  %131 = icmp eq i64 %130, 1000000000
  br i1 %131, label %132, label %135

132:                                              ; preds = %129
  %133 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2)
          to label %134 unwind label %119

134:                                              ; preds = %132
  br label %214

135:                                              ; preds = %129
  %136 = load i64, ptr %9, align 8, !tbaa !5
  %137 = icmp sgt i64 %136, 1000000
  br i1 %137, label %138, label %183

138:                                              ; preds = %135
  %139 = load i64, ptr %9, align 8, !tbaa !5
  %140 = sdiv i64 %139, 1000000
  %141 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %140)
          to label %142 unwind label %119

142:                                              ; preds = %138
  %143 = load i64, ptr %9, align 8, !tbaa !5
  %144 = srem i64 %143, 1000000
  store i64 %144, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %145 = load i64, ptr %9, align 8, !tbaa !5
  %146 = sdiv i64 %145, 1000
  store i64 %146, ptr %11, align 8, !tbaa !5
  %147 = load i64, ptr %11, align 8, !tbaa !5
  %148 = icmp slt i64 %147, 100
  br i1 %148, label %149, label %156

149:                                              ; preds = %142
  %150 = invoke i32 @putchar(i32 noundef 48)
          to label %151 unwind label %152

151:                                              ; preds = %149
  br label %156

152:                                              ; preds = %179, %176, %170, %162, %159, %149
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %3, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %233

156:                                              ; preds = %151, %142
  %157 = load i64, ptr %11, align 8, !tbaa !5
  %158 = icmp slt i64 %157, 10
  br i1 %158, label %159, label %162

159:                                              ; preds = %156
  %160 = invoke i32 @putchar(i32 noundef 48)
          to label %161 unwind label %152

161:                                              ; preds = %159
  br label %162

162:                                              ; preds = %161, %156
  %163 = load i64, ptr %11, align 8, !tbaa !5
  %164 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %163)
          to label %165 unwind label %152

165:                                              ; preds = %162
  %166 = load i64, ptr %9, align 8, !tbaa !5
  %167 = srem i64 %166, 1000
  store i64 %167, ptr %9, align 8, !tbaa !5
  %168 = load i64, ptr %9, align 8, !tbaa !5
  %169 = icmp slt i64 %168, 100
  br i1 %169, label %170, label %173

170:                                              ; preds = %165
  %171 = invoke i32 @putchar(i32 noundef 48)
          to label %172 unwind label %152

172:                                              ; preds = %170
  br label %173

173:                                              ; preds = %172, %165
  %174 = load i64, ptr %9, align 8, !tbaa !5
  %175 = icmp slt i64 %174, 10
  br i1 %175, label %176, label %179

176:                                              ; preds = %173
  %177 = invoke i32 @putchar(i32 noundef 48)
          to label %178 unwind label %152

178:                                              ; preds = %176
  br label %179

179:                                              ; preds = %178, %173
  %180 = load i64, ptr %9, align 8, !tbaa !5
  %181 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %180)
          to label %182 unwind label %152

182:                                              ; preds = %179
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %213

183:                                              ; preds = %135
  %184 = load i64, ptr %9, align 8, !tbaa !5
  %185 = icmp sgt i64 %184, 1000
  br i1 %185, label %186, label %208

186:                                              ; preds = %183
  %187 = load i64, ptr %9, align 8, !tbaa !5
  %188 = sdiv i64 %187, 1000
  %189 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %188)
          to label %190 unwind label %119

190:                                              ; preds = %186
  %191 = load i64, ptr %9, align 8, !tbaa !5
  %192 = srem i64 %191, 1000
  store i64 %192, ptr %9, align 8, !tbaa !5
  %193 = load i64, ptr %9, align 8, !tbaa !5
  %194 = icmp slt i64 %193, 100
  br i1 %194, label %195, label %198

195:                                              ; preds = %190
  %196 = invoke i32 @putchar(i32 noundef 48)
          to label %197 unwind label %119

197:                                              ; preds = %195
  br label %198

198:                                              ; preds = %197, %190
  %199 = load i64, ptr %9, align 8, !tbaa !5
  %200 = icmp slt i64 %199, 10
  br i1 %200, label %201, label %204

201:                                              ; preds = %198
  %202 = invoke i32 @putchar(i32 noundef 48)
          to label %203 unwind label %119

203:                                              ; preds = %201
  br label %204

204:                                              ; preds = %203, %198
  %205 = load i64, ptr %9, align 8, !tbaa !5
  %206 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %205)
          to label %207 unwind label %119

207:                                              ; preds = %204
  br label %212

208:                                              ; preds = %183
  %209 = load i64, ptr %9, align 8, !tbaa !5
  %210 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %209)
          to label %211 unwind label %119

211:                                              ; preds = %208
  br label %212

212:                                              ; preds = %211, %207
  br label %213

213:                                              ; preds = %212, %182
  br label %214

214:                                              ; preds = %213, %134
  br label %215

215:                                              ; preds = %214, %128
  br label %216

216:                                              ; preds = %215, %118
  %217 = load i32, ptr %10, align 4, !tbaa !14
  %218 = icmp sgt i32 %217, 0
  br i1 %218, label %219, label %231

219:                                              ; preds = %216
  %220 = invoke i32 @putchar(i32 noundef 46)
          to label %221 unwind label %119

221:                                              ; preds = %219
  %222 = load i32, ptr %10, align 4, !tbaa !14
  %223 = icmp slt i32 %222, 10
  br i1 %223, label %224, label %227

224:                                              ; preds = %221
  %225 = invoke i32 @putchar(i32 noundef 48)
          to label %226 unwind label %119

226:                                              ; preds = %224
  br label %227

227:                                              ; preds = %226, %221
  %228 = load i32, ptr %10, align 4, !tbaa !14
  %229 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %228)
          to label %230 unwind label %119

230:                                              ; preds = %227
  br label %231

231:                                              ; preds = %230, %216
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #5
  %232 = load i32, ptr %1, align 4
  ret i32 %232

233:                                              ; preds = %152, %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %234

234:                                              ; preds = %233, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %235

235:                                              ; preds = %234, %21
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #5
  br label %236

236:                                              ; preds = %235
  %237 = load ptr, ptr %3, align 8
  %238 = load i32, ptr %4, align 4
  %239 = insertvalue { ptr, i32 } poison, ptr %237, 0
  %240 = insertvalue { ptr, i32 } %239, i32 %238, 1
  resume { ptr, i32 } %240
}

; 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

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 i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #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) #2 align 2

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

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @putchar(i32 noundef) #4

; 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 = { "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 long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, 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::__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
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 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
  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 %16

3:                                                ; preds = %0
  %4 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %5 = sub i64 0, %4
  %6 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %51, %3
  %.050.lcssa = phi i64 [ 0, %3 ], [ %.2, %51 ]
  %.048.lcssa = phi i64 [ %5, %3 ], [ %.149, %51 ]
  %.0.lcssa = phi i64 [ 0, %3 ], [ %.1, %51 ]
  %7 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %8 = sub i64 %7, %.048.lcssa
  %9 = icmp ugt i64 %8, 3
  %10 = mul nsw i64 %.050.lcssa, 100
  %spec.select = select i1 %9, i64 %10, i64 %.050.lcssa
  %11 = add nsw i64 %spec.select, %.0.lcssa
  %12 = sdiv i64 %11, 100
  %13 = srem i64 %11, 100
  %14 = trunc nsw i64 %13 to i32
  %.off = add i64 %11, -100000
  %15 = icmp ult i64 %.off, 100
  br i1 %15, label %55, label %57

16:                                               ; preds = %0
  %17 = landingpad { ptr, i32 }
          cleanup
  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 } %17

.lr.ph:                                           ; preds = %3, %51
  %.064 = phi i64 [ %.1, %51 ], [ 0, %3 ]
  %.04763 = phi i64 [ %52, %51 ], [ 0, %3 ]
  %.04862 = phi i64 [ %.149, %51 ], [ %5, %3 ]
  %.05061 = phi i64 [ %.2, %51 ], [ 0, %3 ]
  %18 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.04763)
  %19 = load i8, ptr %18, align 1, !tbaa !5
  %20 = icmp sgt i8 %19, 96
  br i1 %20, label %21, label %32

21:                                               ; preds = %.lr.ph
  %22 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.04763)
  %23 = load i8, ptr %22, align 1, !tbaa !5
  %24 = icmp slt i8 %23, 123
  br i1 %24, label %25, label %32

25:                                               ; preds = %21
  %26 = sub nsw i64 %.04763, %.04862
  %27 = icmp sgt i64 %26, 3
  %28 = mul nsw i64 %.05061, 100
  %spec.select56 = select i1 %27, i64 %28, i64 %.05061
  %29 = add nsw i64 %spec.select56, %.064
  %30 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %31 = sub i64 0, %30
  br label %51

32:                                               ; preds = %21, %.lr.ph
  %33 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.04763)
  %34 = load i8, ptr %33, align 1, !tbaa !5
  %35 = icmp eq i8 %34, 46
  br i1 %35, label %51, label %36

36:                                               ; preds = %32
  %37 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.04763)
  %38 = load i8, ptr %37, align 1, !tbaa !5
  %39 = icmp sgt i8 %38, 47
  br i1 %39, label %40, label %51

40:                                               ; preds = %36
  %41 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.04763)
  %42 = load i8, ptr %41, align 1, !tbaa !5
  %43 = icmp slt i8 %42, 58
  br i1 %43, label %44, label %51

44:                                               ; preds = %40
  %45 = mul nsw i64 %.05061, 10
  %46 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %.04763)
  %47 = load i8, ptr %46, align 1, !tbaa !5
  %48 = sext i8 %47 to i64
  %49 = add i64 %45, -48
  %50 = add i64 %49, %48
  br label %51

51:                                               ; preds = %32, %25, %36, %40, %44
  %.2 = phi i64 [ 0, %25 ], [ %50, %44 ], [ %.05061, %40 ], [ %.05061, %36 ], [ %.05061, %32 ]
  %.149 = phi i64 [ %31, %25 ], [ %.04862, %44 ], [ %.04862, %40 ], [ %.04862, %36 ], [ %.04763, %32 ]
  %.1 = phi i64 [ %29, %25 ], [ %.064, %44 ], [ %.064, %40 ], [ %.064, %36 ], [ %.064, %32 ]
  %52 = add nuw nsw i64 %.04763, 1
  %53 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %54 = icmp ult i64 %52, %53
  br i1 %54, label %.lr.ph, label %._crit_edge, !llvm.loop !8

55:                                               ; preds = %._crit_edge
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %102

57:                                               ; preds = %._crit_edge
  %.off54 = add i64 %11, -100000000
  %58 = icmp ult i64 %.off54, 100
  br i1 %58, label %59, label %61

59:                                               ; preds = %57
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %102

61:                                               ; preds = %57
  %.off55 = add i64 %11, -100000000000
  %62 = icmp ult i64 %.off55, 100
  br i1 %62, label %63, label %65

63:                                               ; preds = %61
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %102

65:                                               ; preds = %61
  %66 = icmp sgt i64 %11, 100000099
  br i1 %66, label %67, label %87

67:                                               ; preds = %65
  %68 = udiv i64 %12, 1000000
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %68)
  %70 = urem i64 %12, 1000000
  %.lhs.trunc = trunc nuw nsw i64 %70 to i32
  %71 = udiv i32 %.lhs.trunc, 1000
  %72 = urem i32 %.lhs.trunc, 1000
  %.zext = zext nneg i32 %71 to i64
  %73 = icmp ult i64 %70, 100000
  br i1 %73, label %74, label %.thread

74:                                               ; preds = %67
  %75 = call i32 @putchar(i32 noundef 48)
  %76 = icmp ult i64 %70, 10000
  br i1 %76, label %77, label %.thread

77:                                               ; preds = %74
  %78 = call i32 @putchar(i32 noundef 48)
  br label %.thread

.thread:                                          ; preds = %67, %77, %74
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %.zext)
  %.zext60 = zext nneg i32 %72 to i64
  %80 = icmp ult i32 %72, 100
  br i1 %80, label %81, label %.thread57

81:                                               ; preds = %.thread
  %82 = call i32 @putchar(i32 noundef 48)
  %83 = icmp ult i32 %72, 10
  br i1 %83, label %84, label %.thread57

84:                                               ; preds = %81
  %85 = call i32 @putchar(i32 noundef 48)
  br label %.thread57

.thread57:                                        ; preds = %.thread, %84, %81
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %.zext60)
  br label %102

87:                                               ; preds = %65
  %88 = icmp sgt i64 %11, 100099
  br i1 %88, label %89, label %100

89:                                               ; preds = %87
  %90 = udiv i64 %12, 1000
  %91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %90)
  %92 = urem i64 %12, 1000
  %93 = icmp ult i64 %92, 100
  br i1 %93, label %94, label %.thread58

94:                                               ; preds = %89
  %95 = call i32 @putchar(i32 noundef 48)
  %96 = icmp ult i64 %92, 10
  br i1 %96, label %97, label %.thread58

97:                                               ; preds = %94
  %98 = call i32 @putchar(i32 noundef 48)
  br label %.thread58

.thread58:                                        ; preds = %89, %97, %94
  %99 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %92)
  br label %102

100:                                              ; preds = %87
  %101 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %12)
  br label %102

102:                                              ; preds = %59, %.thread57, %100, %.thread58, %63, %55
  %103 = icmp sgt i64 %13, 0
  br i1 %103, label %104, label %111

104:                                              ; preds = %102
  %105 = call i32 @putchar(i32 noundef 46)
  %106 = icmp ult i64 %13, 10
  br i1 %106, label %107, label %109

107:                                              ; preds = %104
  %108 = call i32 @putchar(i32 noundef 48)
  br label %109

109:                                              ; preds = %107, %104
  %110 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %14)
  br label %111

111:                                              ; preds = %109, %102
  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
}

; 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

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 i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) 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 #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5

; 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 = { 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 = { "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 = { nofree nounwind "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 nofree 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 }

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

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


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