; LLVM IR from eyangch/competitive-programming :: USACOcontests/silver/2017.03 (cownomics)

; 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
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [64 x i8], align 16
  %13 = alloca [100 x i32], align 16
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i8, align 1
  %19 = alloca i32, align 4
  %20 = alloca i8, align 1
  %21 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %22 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %23 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %24 = getelementptr i8, ptr %23, i64 -24
  %25 = load i64, ptr %24, align 8
  %26 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %25
  %27 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %26, ptr noundef null)
  %28 = load ptr, ptr @stdin, align 8, !tbaa !8
  %29 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %28)
  %30 = load ptr, ptr @stdout, align 8, !tbaa !8
  %31 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %34 = load i32, ptr %2, align 4, !tbaa !11
  %35 = zext i32 %34 to i64
  %36 = call ptr @llvm.stacksave.p0()
  store ptr %36, ptr %4, align 8
  %37 = alloca %"class.std::__cxx11::basic_string", i64 %35, align 16
  store i64 %35, ptr %5, align 8
  %38 = icmp eq i64 %35, 0
  br i1 %38, label %45, label %39

39:                                               ; preds = %0
  %40 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %37, i64 %35
  br label %41

41:                                               ; preds = %41, %39
  %42 = phi ptr [ %37, %39 ], [ %43, %41 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %42) #7
  %43 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %42, i64 1
  %44 = icmp eq ptr %43, %40
  br i1 %44, label %45, label %41

45:                                               ; preds = %41, %0
  %46 = load i32, ptr %2, align 4, !tbaa !11
  %47 = zext i32 %46 to i64
  %48 = alloca %"class.std::__cxx11::basic_string", i64 %47, align 16
  store i64 %47, ptr %6, align 8
  %49 = icmp eq i64 %47, 0
  br i1 %49, label %56, label %50

50:                                               ; preds = %45
  %51 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %48, i64 %47
  br label %52

52:                                               ; preds = %52, %50
  %53 = phi ptr [ %48, %50 ], [ %54, %52 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %53) #7
  %54 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %53, i64 1
  %55 = icmp eq ptr %54, %51
  br i1 %55, label %56, label %52

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

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

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

62:                                               ; preds = %57
  %63 = load i32, ptr %7, align 4, !tbaa !11
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %37, i64 %64
  %66 = 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) %65)
          to label %67 unwind label %71

67:                                               ; preds = %62
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %7, align 4, !tbaa !11
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %7, align 4, !tbaa !11
  br label %57, !llvm.loop !13

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

75:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %76

76:                                               ; preds = %87, %75
  %77 = load i32, ptr %10, align 4, !tbaa !11
  %78 = load i32, ptr %2, align 4, !tbaa !11
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %81, label %80

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

81:                                               ; preds = %76
  %82 = load i32, ptr %10, align 4, !tbaa !11
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %48, i64 %83
  %85 = 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) %84)
          to label %86 unwind label %90

86:                                               ; preds = %81
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %10, align 4, !tbaa !11
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %10, align 4, !tbaa !11
  br label %76, !llvm.loop !15

90:                                               ; preds = %81
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %8, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %286

94:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 64, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 400, ptr %13) #7
  %95 = getelementptr inbounds [100 x i32], ptr %13, i64 0, i64 65
  store i32 0, ptr %95, align 4, !tbaa !11
  %96 = getelementptr inbounds [100 x i32], ptr %13, i64 0, i64 67
  store i32 1, ptr %96, align 4, !tbaa !11
  %97 = getelementptr inbounds [100 x i32], ptr %13, i64 0, i64 71
  store i32 2, ptr %97, align 4, !tbaa !11
  %98 = getelementptr inbounds [100 x i32], ptr %13, i64 0, i64 84
  store i32 3, ptr %98, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %99

99:                                               ; preds = %263, %94
  %100 = load i32, ptr %14, align 4, !tbaa !11
  %101 = load i32, ptr %3, align 4, !tbaa !11
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %104, label %103

103:                                              ; preds = %99
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %266

104:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %105 = load i32, ptr %14, align 4, !tbaa !11
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %16, align 4, !tbaa !11
  br label %107

107:                                              ; preds = %259, %104
  %108 = load i32, ptr %16, align 4, !tbaa !11
  %109 = load i32, ptr %3, align 4, !tbaa !11
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 11, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %262

112:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %113 = load i32, ptr %16, align 4, !tbaa !11
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %17, align 4, !tbaa !11
  br label %115

115:                                              ; preds = %254, %112
  %116 = load i32, ptr %17, align 4, !tbaa !11
  %117 = load i32, ptr %3, align 4, !tbaa !11
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  store i32 14, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %258

120:                                              ; preds = %115
  %121 = getelementptr inbounds [64 x i8], ptr %12, i64 0, i64 0
  %122 = getelementptr inbounds [64 x i8], ptr %12, i64 0, i64 0
  %123 = getelementptr inbounds i8, ptr %122, i64 64
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #7
  store i8 0, ptr %18, align 1, !tbaa !16
  invoke void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef %121, ptr noundef %123, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %124 unwind label %130

124:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !11
  br label %125

125:                                              ; preds = %178, %124
  %126 = load i32, ptr %19, align 4, !tbaa !11
  %127 = load i32, ptr %2, align 4, !tbaa !11
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %134, label %129

129:                                              ; preds = %125
  store i32 17, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %185

130:                                              ; preds = %120
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %8, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #7
  br label %257

134:                                              ; preds = %125
  %135 = load i32, ptr %19, align 4, !tbaa !11
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %37, i64 %136
  %138 = load i32, ptr %14, align 4, !tbaa !11
  %139 = sext i32 %138 to i64
  %140 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %137, i64 noundef %139)
          to label %141 unwind label %181

141:                                              ; preds = %134
  %142 = load i8, ptr %140, align 1, !tbaa !18
  %143 = sext i8 %142 to i32
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [100 x i32], ptr %13, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !11
  %147 = mul nsw i32 %146, 16
  %148 = load i32, ptr %19, align 4, !tbaa !11
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %37, i64 %149
  %151 = load i32, ptr %16, align 4, !tbaa !11
  %152 = sext i32 %151 to i64
  %153 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %150, i64 noundef %152)
          to label %154 unwind label %181

154:                                              ; preds = %141
  %155 = load i8, ptr %153, align 1, !tbaa !18
  %156 = sext i8 %155 to i32
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [100 x i32], ptr %13, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !11
  %160 = mul nsw i32 %159, 4
  %161 = add nsw i32 %147, %160
  %162 = load i32, ptr %19, align 4, !tbaa !11
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %37, i64 %163
  %165 = load i32, ptr %17, align 4, !tbaa !11
  %166 = sext i32 %165 to i64
  %167 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %164, i64 noundef %166)
          to label %168 unwind label %181

168:                                              ; preds = %154
  %169 = load i8, ptr %167, align 1, !tbaa !18
  %170 = sext i8 %169 to i32
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [100 x i32], ptr %13, i64 0, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !11
  %174 = mul nsw i32 %173, 1
  %175 = add nsw i32 %161, %174
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [64 x i8], ptr %12, i64 0, i64 %176
  store i8 1, ptr %177, align 1, !tbaa !16
  br label %178

178:                                              ; preds = %168
  %179 = load i32, ptr %19, align 4, !tbaa !11
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %19, align 4, !tbaa !11
  br label %125, !llvm.loop !19

181:                                              ; preds = %154, %141, %134
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %8, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %257

185:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #7
  store i8 1, ptr %20, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %186

186:                                              ; preds = %243, %185
  %187 = load i32, ptr %21, align 4, !tbaa !11
  %188 = load i32, ptr %2, align 4, !tbaa !11
  %189 = icmp slt i32 %187, %188
  br i1 %189, label %191, label %190

190:                                              ; preds = %186
  store i32 20, ptr %15, align 4
  br label %246

191:                                              ; preds = %186
  %192 = load i32, ptr %21, align 4, !tbaa !11
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %48, i64 %193
  %195 = load i32, ptr %14, align 4, !tbaa !11
  %196 = sext i32 %195 to i64
  %197 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %194, i64 noundef %196)
          to label %198 unwind label %238

198:                                              ; preds = %191
  %199 = load i8, ptr %197, align 1, !tbaa !18
  %200 = sext i8 %199 to i32
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [100 x i32], ptr %13, i64 0, i64 %201
  %203 = load i32, ptr %202, align 4, !tbaa !11
  %204 = mul nsw i32 %203, 16
  %205 = load i32, ptr %21, align 4, !tbaa !11
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %48, i64 %206
  %208 = load i32, ptr %16, align 4, !tbaa !11
  %209 = sext i32 %208 to i64
  %210 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %207, i64 noundef %209)
          to label %211 unwind label %238

211:                                              ; preds = %198
  %212 = load i8, ptr %210, align 1, !tbaa !18
  %213 = sext i8 %212 to i32
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [100 x i32], ptr %13, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !11
  %217 = mul nsw i32 %216, 4
  %218 = add nsw i32 %204, %217
  %219 = load i32, ptr %21, align 4, !tbaa !11
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %48, i64 %220
  %222 = load i32, ptr %17, align 4, !tbaa !11
  %223 = sext i32 %222 to i64
  %224 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %221, i64 noundef %223)
          to label %225 unwind label %238

225:                                              ; preds = %211
  %226 = load i8, ptr %224, align 1, !tbaa !18
  %227 = sext i8 %226 to i32
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [100 x i32], ptr %13, i64 0, i64 %228
  %230 = load i32, ptr %229, align 4, !tbaa !11
  %231 = mul nsw i32 %230, 1
  %232 = add nsw i32 %218, %231
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [64 x i8], ptr %12, i64 0, i64 %233
  %235 = load i8, ptr %234, align 1, !tbaa !16, !range !20, !noundef !21
  %236 = trunc i8 %235 to i1
  br i1 %236, label %237, label %242

237:                                              ; preds = %225
  store i8 0, ptr %20, align 1, !tbaa !16
  store i32 20, ptr %15, align 4
  br label %246

238:                                              ; preds = %211, %198, %191
  %239 = landingpad { ptr, i32 }
          cleanup
  %240 = extractvalue { ptr, i32 } %239, 0
  store ptr %240, ptr %8, align 8
  %241 = extractvalue { ptr, i32 } %239, 1
  store i32 %241, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #7
  br label %257

242:                                              ; preds = %225
  br label %243

243:                                              ; preds = %242
  %244 = load i32, ptr %21, align 4, !tbaa !11
  %245 = add nsw i32 %244, 1
  store i32 %245, ptr %21, align 4, !tbaa !11
  br label %186, !llvm.loop !22

246:                                              ; preds = %237, %190
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %247

247:                                              ; preds = %246
  %248 = load i8, ptr %20, align 1, !tbaa !16, !range !20, !noundef !21
  %249 = trunc i8 %248 to i1
  br i1 %249, label %250, label %253

250:                                              ; preds = %247
  %251 = load i32, ptr %11, align 4, !tbaa !11
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %11, align 4, !tbaa !11
  br label %253

253:                                              ; preds = %250, %247
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #7
  br label %254

254:                                              ; preds = %253
  %255 = load i32, ptr %17, align 4, !tbaa !11
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %17, align 4, !tbaa !11
  br label %115, !llvm.loop !23

257:                                              ; preds = %238, %181, %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %278

258:                                              ; preds = %119
  br label %259

259:                                              ; preds = %258
  %260 = load i32, ptr %16, align 4, !tbaa !11
  %261 = add nsw i32 %260, 1
  store i32 %261, ptr %16, align 4, !tbaa !11
  br label %107, !llvm.loop !24

262:                                              ; preds = %111
  br label %263

263:                                              ; preds = %262
  %264 = load i32, ptr %14, align 4, !tbaa !11
  %265 = add nsw i32 %264, 1
  store i32 %265, ptr %14, align 4, !tbaa !11
  br label %99, !llvm.loop !25

266:                                              ; preds = %103
  %267 = load i32, ptr %11, align 4, !tbaa !11
  %268 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %267)
          to label %269 unwind label %274

269:                                              ; preds = %266
  %270 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %268, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %271 unwind label %274

271:                                              ; preds = %269
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 400, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  %272 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %48, i64 %47
  %273 = icmp eq ptr %48, %272
  br i1 %273, label %283, label %279

274:                                              ; preds = %269, %266
  %275 = landingpad { ptr, i32 }
          cleanup
  %276 = extractvalue { ptr, i32 } %275, 0
  store ptr %276, ptr %8, align 8
  %277 = extractvalue { ptr, i32 } %275, 1
  store i32 %277, ptr %9, align 4
  br label %278

278:                                              ; preds = %274, %257
  call void @llvm.lifetime.end.p0(i64 400, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %286

279:                                              ; preds = %279, %271
  %280 = phi ptr [ %272, %271 ], [ %281, %279 ]
  %281 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %280, i64 -1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %281) #7
  %282 = icmp eq ptr %281, %48
  br i1 %282, label %283, label %279

283:                                              ; preds = %279, %271
  %284 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %37, i64 %35
  %285 = icmp eq ptr %37, %284
  br i1 %285, label %300, label %296

286:                                              ; preds = %278, %90, %71
  %287 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %48, i64 %47
  %288 = icmp eq ptr %48, %287
  br i1 %288, label %293, label %289

289:                                              ; preds = %289, %286
  %290 = phi ptr [ %287, %286 ], [ %291, %289 ]
  %291 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %290, i64 -1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %291) #7
  %292 = icmp eq ptr %291, %48
  br i1 %292, label %293, label %289

293:                                              ; preds = %289, %286
  %294 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %37, i64 %35
  %295 = icmp eq ptr %37, %294
  br i1 %295, label %307, label %303

296:                                              ; preds = %296, %283
  %297 = phi ptr [ %284, %283 ], [ %298, %296 ]
  %298 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %297, i64 -1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %298) #7
  %299 = icmp eq ptr %298, %37
  br i1 %299, label %300, label %296

300:                                              ; preds = %296, %283
  %301 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %301)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %302 = load i32, ptr %1, align 4
  ret i32 %302

303:                                              ; preds = %303, %293
  %304 = phi ptr [ %294, %293 ], [ %305, %303 ]
  %305 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %304, i64 -1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %305) #7
  %306 = icmp eq ptr %305, %37
  br i1 %306, label %307, label %303

307:                                              ; preds = %303, %293
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %308

308:                                              ; preds = %307
  %309 = load ptr, ptr %8, align 8
  %310 = load i32, ptr %9, align 4
  %311 = insertvalue { ptr, i32 } poison, ptr %309, 0
  %312 = insertvalue { ptr, i32 } %311, i32 %310, 1
  resume { ptr, i32 } %312
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) #5

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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 = { "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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind willreturn }
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 = { 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 #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!17, !17, i64 0}
!17 = !{!"bool", !10, i64 0}
!18 = !{!10, !10, i64 0}
!19 = distinct !{!19, !14}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}


; 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
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [64 x i8], align 16
  %4 = alloca [100 x i32], align 16
  %5 = alloca i8, align 1
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = load ptr, ptr @stdin, align 8, !tbaa !8
  %13 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %12)
  %14 = load ptr, ptr @stdout, align 8, !tbaa !8
  %15 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %14)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %18 = load i32, ptr %1, align 4, !tbaa !11
  %19 = zext i32 %18 to i64
  %20 = call ptr @llvm.stacksave.p0()
  %21 = alloca %"class.std::__cxx11::basic_string", i64 %19, align 16
  %22 = icmp eq i32 %18, 0
  br i1 %22, label %.loopexit68, label %23

23:                                               ; preds = %0
  %24 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %21, i64 %19
  br label %25

25:                                               ; preds = %25, %23
  %26 = phi ptr [ %21, %23 ], [ %27, %25 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #7
  %27 = getelementptr inbounds i8, ptr %26, i64 32
  %28 = icmp eq ptr %27, %24
  br i1 %28, label %.loopexit68, label %25

.loopexit68:                                      ; preds = %25, %0
  %29 = load i32, ptr %1, align 4, !tbaa !11
  %30 = zext i32 %29 to i64
  %31 = alloca %"class.std::__cxx11::basic_string", i64 %30, align 16
  %32 = icmp eq i32 %29, 0
  br i1 %32, label %._crit_edge, label %33

33:                                               ; preds = %.loopexit68
  %34 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %31, i64 %30
  br label %35

35:                                               ; preds = %35, %33
  %36 = phi ptr [ %31, %33 ], [ %37, %35 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %36) #7
  %37 = getelementptr inbounds i8, ptr %36, i64 32
  %38 = icmp eq ptr %37, %34
  br i1 %38, label %.loopexit67, label %35

.loopexit67:                                      ; preds = %35
  %.pre = load i32, ptr %1, align 4, !tbaa !11
  %39 = icmp sgt i32 %.pre, 0
  br i1 %39, label %.lr.ph, label %._crit_edge

.preheader66:                                     ; preds = %43
  %40 = icmp sgt i32 %44, 0
  br i1 %40, label %.lr.ph74, label %._crit_edge

.lr.ph:                                           ; preds = %.loopexit67, %43
  %indvars.iv = phi i64 [ %indvars.iv.next, %43 ], [ 0, %.loopexit67 ]
  %41 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %21, i64 %indvars.iv
  %42 = 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) %41)
          to label %43 unwind label %47

43:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %44 = load i32, ptr %1, align 4, !tbaa !11
  %45 = sext i32 %44 to i64
  %46 = icmp slt i64 %indvars.iv.next, %45
  br i1 %46, label %.lr.ph, label %.preheader66, !llvm.loop !13

47:                                               ; preds = %.lr.ph
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %150

._crit_edge:                                      ; preds = %58, %.loopexit68, %.loopexit67, %.preheader66
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %4) #7
  %49 = getelementptr inbounds i8, ptr %4, i64 260
  store i32 0, ptr %49, align 4, !tbaa !11
  %50 = getelementptr inbounds i8, ptr %4, i64 268
  store i32 1, ptr %50, align 4, !tbaa !11
  %51 = getelementptr inbounds i8, ptr %4, i64 284
  store i32 2, ptr %51, align 4, !tbaa !11
  %52 = getelementptr inbounds i8, ptr %4, i64 336
  store i32 3, ptr %52, align 16, !tbaa !11
  %53 = load i32, ptr %2, align 4, !tbaa !11
  %54 = icmp sgt i32 %53, 0
  br i1 %54, label %.lr.ph98, label %._crit_edge99

.lr.ph98:                                         ; preds = %._crit_edge
  %55 = getelementptr inbounds i8, ptr %3, i64 64
  br label %67

.lr.ph74:                                         ; preds = %.preheader66, %58
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %58 ], [ 0, %.preheader66 ]
  %56 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %31, i64 %indvars.iv102
  %57 = 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) %56)
          to label %58 unwind label %62

58:                                               ; preds = %.lr.ph74
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %59 = load i32, ptr %1, align 4, !tbaa !11
  %60 = sext i32 %59 to i64
  %61 = icmp slt i64 %indvars.iv.next103, %60
  br i1 %61, label %.lr.ph74, label %._crit_edge, !llvm.loop !15

62:                                               ; preds = %.lr.ph74
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %150

.loopexit65.loopexit:                             ; preds = %.loopexit64
  %.pre125 = sext i32 %71 to i64
  br label %.loopexit65

.loopexit65:                                      ; preds = %.loopexit65.loopexit, %67
  %.pre-phi = phi i64 [ %.pre125, %.loopexit65.loopexit ], [ %69, %67 ]
  %64 = phi i32 [ %71, %.loopexit65.loopexit ], [ %68, %67 ]
  %.1.lcssa = phi i32 [ %.2.lcssa, %.loopexit65.loopexit ], [ %.04195, %67 ]
  %65 = icmp slt i64 %indvars.iv.next123, %.pre-phi
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  br i1 %65, label %67, label %._crit_edge99, !llvm.loop !16

._crit_edge99:                                    ; preds = %.loopexit65, %._crit_edge
  %.041.lcssa = phi i32 [ 0, %._crit_edge ], [ %.1.lcssa, %.loopexit65 ]
  %66 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.041.lcssa)
          to label %139 unwind label %143

67:                                               ; preds = %.lr.ph98, %.loopexit65
  %68 = phi i32 [ %53, %.lr.ph98 ], [ %64, %.loopexit65 ]
  %indvars.iv122 = phi i64 [ 0, %.lr.ph98 ], [ %indvars.iv.next123, %.loopexit65 ]
  %indvars.iv117 = phi i64 [ 1, %.lr.ph98 ], [ %indvars.iv.next118, %.loopexit65 ]
  %indvars.iv110 = phi i64 [ 2, %.lr.ph98 ], [ %indvars.iv.next111, %.loopexit65 ]
  %.04195 = phi i32 [ 0, %.lr.ph98 ], [ %.1.lcssa, %.loopexit65 ]
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %69 = sext i32 %68 to i64
  %70 = icmp slt i64 %indvars.iv.next123, %69
  br i1 %70, label %.lr.ph93, label %.loopexit65

.loopexit64:                                      ; preds = %._crit_edge82, %.lr.ph93
  %71 = phi i32 [ %74, %.lr.ph93 ], [ %136, %._crit_edge82 ]
  %72 = phi i32 [ %75, %.lr.ph93 ], [ %136, %._crit_edge82 ]
  %.2.lcssa = phi i32 [ %.190, %.lr.ph93 ], [ %spec.select, %._crit_edge82 ]
  %73 = icmp sgt i32 %72, %76
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  br i1 %73, label %.lr.ph93, label %.loopexit65.loopexit, !llvm.loop !17

.lr.ph93:                                         ; preds = %67, %.loopexit64
  %74 = phi i32 [ %71, %.loopexit64 ], [ %68, %67 ]
  %75 = phi i32 [ %72, %.loopexit64 ], [ %68, %67 ]
  %indvars.iv119 = phi i64 [ %indvars.iv.next120, %.loopexit64 ], [ %indvars.iv117, %67 ]
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %.loopexit64 ], [ %indvars.iv110, %67 ]
  %.190 = phi i32 [ %.2.lcssa, %.loopexit64 ], [ %.04195, %67 ]
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %76 = trunc nuw i64 %indvars.iv.next120 to i32
  %77 = icmp sgt i32 %75, %76
  br i1 %77, label %.lr.ph88, label %.loopexit64

.lr.ph88:                                         ; preds = %.lr.ph93, %._crit_edge82
  %indvars.iv114 = phi i64 [ %indvars.iv.next115, %._crit_edge82 ], [ %indvars.iv112, %.lr.ph93 ]
  %.285 = phi i32 [ %spec.select, %._crit_edge82 ], [ %.190, %.lr.ph93 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  store i8 0, ptr %5, align 1, !tbaa !18
  invoke void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull %3, ptr noundef nonnull %55, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %78 unwind label %81

78:                                               ; preds = %.lr.ph88
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  %79 = load i32, ptr %1, align 4, !tbaa !11
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %.lr.ph77, label %._crit_edge82

.preheader63:                                     ; preds = %.lr.ph77
  %.not78 = icmp slt i32 %105, 1
  br i1 %.not78, label %._crit_edge82, label %.lr.ph81

81:                                               ; preds = %.lr.ph88
  %82 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  br label %145

.lr.ph77:                                         ; preds = %78, %.lr.ph77
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %.lr.ph77 ], [ 0, %78 ]
  %83 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %21, i64 %indvars.iv105
  %84 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %83, i64 noundef %indvars.iv122)
  %85 = load i8, ptr %84, align 1, !tbaa !20
  %86 = sext i8 %85 to i64
  %87 = getelementptr inbounds [100 x i32], ptr %4, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !11
  %89 = shl nsw i32 %88, 4
  %90 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %83, i64 noundef %indvars.iv119)
  %91 = load i8, ptr %90, align 1, !tbaa !20
  %92 = sext i8 %91 to i64
  %93 = getelementptr inbounds [100 x i32], ptr %4, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !11
  %95 = shl nsw i32 %94, 2
  %96 = add nsw i32 %95, %89
  %97 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %83, i64 noundef %indvars.iv114)
  %98 = load i8, ptr %97, align 1, !tbaa !20
  %99 = sext i8 %98 to i64
  %100 = getelementptr inbounds [100 x i32], ptr %4, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !11
  %102 = add nsw i32 %96, %101
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [64 x i8], ptr %3, i64 0, i64 %103
  store i8 1, ptr %104, align 1, !tbaa !18
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %105 = load i32, ptr %1, align 4, !tbaa !11
  %106 = sext i32 %105 to i64
  %107 = icmp slt i64 %indvars.iv.next106, %106
  br i1 %107, label %.lr.ph77, label %.preheader63, !llvm.loop !21

108:                                              ; preds = %.lr.ph81
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %109 = load i32, ptr %1, align 4, !tbaa !11
  %110 = sext i32 %109 to i64
  %.not.not = icmp slt i64 %indvars.iv.next109, %110
  br i1 %.not.not, label %.lr.ph81, label %._crit_edge82.loopexit, !llvm.loop !22

.lr.ph81:                                         ; preds = %.preheader63, %108
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %108 ], [ 0, %.preheader63 ]
  %111 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %31, i64 %indvars.iv108
  %112 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %111, i64 noundef %indvars.iv122)
  %113 = load i8, ptr %112, align 1, !tbaa !20
  %114 = sext i8 %113 to i64
  %115 = getelementptr inbounds [100 x i32], ptr %4, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !11
  %117 = shl nsw i32 %116, 4
  %118 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %111, i64 noundef %indvars.iv119)
  %119 = load i8, ptr %118, align 1, !tbaa !20
  %120 = sext i8 %119 to i64
  %121 = getelementptr inbounds [100 x i32], ptr %4, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !11
  %123 = shl nsw i32 %122, 2
  %124 = add nsw i32 %123, %117
  %125 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %111, i64 noundef %indvars.iv114)
  %126 = load i8, ptr %125, align 1, !tbaa !20
  %127 = sext i8 %126 to i64
  %128 = getelementptr inbounds [100 x i32], ptr %4, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !11
  %130 = add nsw i32 %124, %129
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [64 x i8], ptr %3, i64 0, i64 %131
  %133 = load i8, ptr %132, align 1, !tbaa !18, !range !23, !noundef !24
  %134 = trunc nuw i8 %133 to i1
  br i1 %134, label %._crit_edge82.loopexit, label %108

._crit_edge82.loopexit:                           ; preds = %.lr.ph81, %108
  %.not.lcssa.ph = xor i1 %134, true
  br label %._crit_edge82

._crit_edge82:                                    ; preds = %78, %._crit_edge82.loopexit, %.preheader63
  %.not.lcssa = phi i1 [ true, %.preheader63 ], [ %.not.lcssa.ph, %._crit_edge82.loopexit ], [ true, %78 ]
  %135 = zext i1 %.not.lcssa to i32
  %spec.select = add nsw i32 %.285, %135
  %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
  %136 = load i32, ptr %2, align 4, !tbaa !11
  %137 = trunc nuw i64 %indvars.iv.next115 to i32
  %138 = icmp sgt i32 %136, %137
  br i1 %138, label %.lr.ph88, label %.loopexit64, !llvm.loop !25

139:                                              ; preds = %._crit_edge99
  %140 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %141 unwind label %143

141:                                              ; preds = %139
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #7
  br i1 %32, label %.loopexit62, label %.preheader61.preheader

.preheader61.preheader:                           ; preds = %141
  %142 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %31, i64 %30
  br label %.preheader61

143:                                              ; preds = %139, %._crit_edge99
  %144 = landingpad { ptr, i32 }
          cleanup
  br label %145

145:                                              ; preds = %143, %81
  %.pn = phi { ptr, i32 } [ %82, %81 ], [ %144, %143 ]
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #7
  br label %150

.preheader61:                                     ; preds = %.preheader61.preheader, %.preheader61
  %146 = phi ptr [ %147, %.preheader61 ], [ %142, %.preheader61.preheader ]
  %147 = getelementptr inbounds i8, ptr %146, i64 -32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %147) #7
  %148 = icmp eq ptr %147, %31
  br i1 %148, label %.loopexit62, label %.preheader61

.loopexit62:                                      ; preds = %.preheader61, %141
  br i1 %22, label %.loopexit60, label %.preheader59.preheader

.preheader59.preheader:                           ; preds = %.loopexit62
  %149 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %21, i64 %19
  br label %.preheader59

150:                                              ; preds = %145, %62, %47
  %.pn55 = phi { ptr, i32 } [ %48, %47 ], [ %63, %62 ], [ %.pn, %145 ]
  br i1 %32, label %.loopexit58, label %.preheader57.preheader

.preheader57.preheader:                           ; preds = %150
  %151 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %31, i64 %30
  br label %.preheader57

.preheader57:                                     ; preds = %.preheader57.preheader, %.preheader57
  %152 = phi ptr [ %153, %.preheader57 ], [ %151, %.preheader57.preheader ]
  %153 = getelementptr inbounds i8, ptr %152, i64 -32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %153) #7
  %154 = icmp eq ptr %153, %31
  br i1 %154, label %.loopexit58, label %.preheader57

.loopexit58:                                      ; preds = %.preheader57, %150
  br i1 %22, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.loopexit58
  %155 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %21, i64 %19
  br label %.preheader

.preheader59:                                     ; preds = %.preheader59.preheader, %.preheader59
  %156 = phi ptr [ %157, %.preheader59 ], [ %149, %.preheader59.preheader ]
  %157 = getelementptr inbounds i8, ptr %156, i64 -32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %157) #7
  %158 = icmp eq ptr %157, %21
  br i1 %158, label %.loopexit60, label %.preheader59

.loopexit60:                                      ; preds = %.preheader59, %.loopexit62
  call void @llvm.stackrestore.p0(ptr %20)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %159 = phi ptr [ %160, %.preheader ], [ %155, %.preheader.preheader ]
  %160 = getelementptr inbounds i8, ptr %159, i64 -32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %160) #7
  %161 = icmp eq ptr %160, %21
  br i1 %161, label %.loopexit, label %.preheader

.loopexit:                                        ; preds = %.preheader, %.loopexit58
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn55
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #5

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

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

; 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 #6 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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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 = { "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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = { 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 #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = !{!19, !19, i64 0}
!19 = !{!"bool", !10, i64 0}
!20 = !{!10, !10, i64 0}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = distinct !{!25, !14}


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