; LLVM IR from DionysiosB/CodeForces :: 0200-0299 (219C-ColorStripe)

; 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 [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1
@_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 i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str)
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  %21 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_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) %4)
          to label %22 unwind label %31

22:                                               ; preds = %0
  %23 = load i64, ptr %3, align 8, !tbaa !5
  %24 = icmp eq i64 %23, 2
  br i1 %24, label %25, label %100

25:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %56, %25
  %27 = load i64, ptr %9, align 8, !tbaa !5
  %28 = load i64, ptr %2, align 8, !tbaa !5
  %29 = icmp slt i64 %27, %28
  br i1 %29, label %35, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %59

31:                                               ; preds = %0
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %5, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %6, align 4
  br label %266

35:                                               ; preds = %26
  %36 = load i64, ptr %9, align 8, !tbaa !5
  %37 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %36)
          to label %38 unwind label %48

38:                                               ; preds = %35
  %39 = load i8, ptr %37, align 1, !tbaa !9
  %40 = sext i8 %39 to i64
  %41 = load i64, ptr %9, align 8, !tbaa !5
  %42 = srem i64 %41, 2
  %43 = add nsw i64 65, %42
  %44 = icmp eq i64 %40, %43
  br i1 %44, label %45, label %52

45:                                               ; preds = %38
  %46 = load i64, ptr %8, align 8, !tbaa !5
  %47 = add nsw i64 %46, 1
  store i64 %47, ptr %8, align 8, !tbaa !5
  br label %55

48:                                               ; preds = %35
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %5, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %99

52:                                               ; preds = %38
  %53 = load i64, ptr %7, align 8, !tbaa !5
  %54 = add nsw i64 %53, 1
  store i64 %54, ptr %7, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %52, %45
  br label %56

56:                                               ; preds = %55
  %57 = load i64, ptr %9, align 8, !tbaa !5
  %58 = add nsw i64 %57, 1
  store i64 %58, ptr %9, align 8, !tbaa !5
  br label %26, !llvm.loop !10

59:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %60 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %60, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !12
  %61 = load i64, ptr %8, align 8, !tbaa !5
  %62 = load i64, ptr %7, align 8, !tbaa !5
  %63 = icmp slt i64 %61, %62
  br i1 %63, label %64, label %66

64:                                               ; preds = %59
  %65 = load i64, ptr %8, align 8, !tbaa !5
  store i64 %65, ptr %10, align 8, !tbaa !5
  store i32 1, ptr %11, align 4, !tbaa !12
  br label %66

66:                                               ; preds = %64, %59
  %67 = load i64, ptr %10, align 8, !tbaa !5
  %68 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %67)
          to label %69 unwind label %76

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

70:                                               ; preds = %88, %69
  %71 = load i32, ptr %12, align 4, !tbaa !12
  %72 = sext i32 %71 to i64
  %73 = load i64, ptr %2, align 8, !tbaa !5
  %74 = icmp slt i64 %72, %73
  br i1 %74, label %80, label %75

75:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %95

76:                                               ; preds = %95, %66
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %5, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %6, align 4
  br label %98

80:                                               ; preds = %70
  %81 = load i32, ptr %12, align 4, !tbaa !12
  %82 = load i32, ptr %11, align 4, !tbaa !12
  %83 = add nsw i32 %81, %82
  %84 = srem i32 %83, 2
  %85 = add nsw i32 65, %84
  %86 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %85)
          to label %87 unwind label %91

87:                                               ; preds = %80
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %12, align 4, !tbaa !12
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %12, align 4, !tbaa !12
  br label %70, !llvm.loop !14

91:                                               ; preds = %80
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %5, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %98

95:                                               ; preds = %75
  %96 = invoke i32 @puts(ptr noundef @.str.3)
          to label %97 unwind label %76

97:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %264

98:                                               ; preds = %91, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %99

99:                                               ; preds = %98, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %266

100:                                              ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 0, ptr %13, align 8, !tbaa !5
  %101 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef 1)
          to label %102 unwind label %117

102:                                              ; preds = %100
  %103 = load i8, ptr %101, align 1, !tbaa !9
  %104 = sext i8 %103 to i32
  %105 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef 0)
          to label %106 unwind label %117

106:                                              ; preds = %102
  %107 = load i8, ptr %105, align 1, !tbaa !9
  %108 = sext i8 %107 to i32
  %109 = icmp eq i32 %104, %108
  br i1 %109, label %110, label %159

110:                                              ; preds = %106
  %111 = load i64, ptr %13, align 8, !tbaa !5
  %112 = add nsw i64 %111, 1
  store i64 %112, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !12
  br label %113

113:                                              ; preds = %154, %110
  %114 = load i32, ptr %14, align 4, !tbaa !12
  %115 = icmp slt i32 %114, 3
  br i1 %115, label %121, label %116

116:                                              ; preds = %113
  store i32 8, ptr %15, align 4
  br label %157

117:                                              ; preds = %260, %258, %255, %102, %100
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %5, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %6, align 4
  br label %263

121:                                              ; preds = %113
  %122 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef 0)
          to label %123 unwind label %149

123:                                              ; preds = %121
  %124 = load i8, ptr %122, align 1, !tbaa !9
  %125 = sext i8 %124 to i32
  %126 = load i32, ptr %14, align 4, !tbaa !12
  %127 = add nsw i32 65, %126
  %128 = icmp ne i32 %125, %127
  br i1 %128, label %129, label %153

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

132:                                              ; preds = %129
  %133 = load i64, ptr %2, align 8, !tbaa !5
  %134 = icmp sgt i64 %133, 2
  br i1 %134, label %135, label %153

135:                                              ; preds = %132
  %136 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef 2)
          to label %137 unwind label %149

137:                                              ; preds = %135
  %138 = load i8, ptr %136, align 1, !tbaa !9
  %139 = sext i8 %138 to i32
  %140 = load i32, ptr %14, align 4, !tbaa !12
  %141 = add nsw i32 65, %140
  %142 = icmp ne i32 %139, %141
  br i1 %142, label %143, label %153

143:                                              ; preds = %137, %129
  %144 = load i32, ptr %14, align 4, !tbaa !12
  %145 = add nsw i32 65, %144
  %146 = trunc i32 %145 to i8
  %147 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef 1)
          to label %148 unwind label %149

148:                                              ; preds = %143
  store i8 %146, ptr %147, align 1, !tbaa !9
  store i32 8, ptr %15, align 4
  br label %157

149:                                              ; preds = %143, %135, %121
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %5, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %263

153:                                              ; preds = %137, %132, %123
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %14, align 4, !tbaa !12
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %14, align 4, !tbaa !12
  br label %113, !llvm.loop !15

157:                                              ; preds = %148, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %158

158:                                              ; preds = %157
  br label %159

159:                                              ; preds = %158, %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 1, ptr %16, align 8, !tbaa !5
  br label %160

160:                                              ; preds = %251, %159
  %161 = load i64, ptr %16, align 8, !tbaa !5
  %162 = load i64, ptr %2, align 8, !tbaa !5
  %163 = icmp slt i64 %161, %162
  br i1 %163, label %165, label %164

164:                                              ; preds = %160
  store i32 11, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %255

165:                                              ; preds = %160
  %166 = load i64, ptr %16, align 8, !tbaa !5
  %167 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %166)
          to label %168 unwind label %179

168:                                              ; preds = %165
  %169 = load i8, ptr %167, align 1, !tbaa !9
  %170 = sext i8 %169 to i32
  %171 = load i64, ptr %16, align 8, !tbaa !5
  %172 = sub nsw i64 %171, 1
  %173 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %172)
          to label %174 unwind label %179

174:                                              ; preds = %168
  %175 = load i8, ptr %173, align 1, !tbaa !9
  %176 = sext i8 %175 to i32
  %177 = icmp ne i32 %170, %176
  br i1 %177, label %178, label %183

178:                                              ; preds = %174
  br label %251

179:                                              ; preds = %203, %199, %189, %183, %168, %165
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %5, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %6, align 4
  br label %254

183:                                              ; preds = %174
  %184 = load i64, ptr %13, align 8, !tbaa !5
  %185 = add nsw i64 %184, 1
  store i64 %185, ptr %13, align 8, !tbaa !5
  %186 = load i64, ptr %16, align 8, !tbaa !5
  %187 = sub nsw i64 %186, 2
  %188 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %187)
          to label %189 unwind label %179

189:                                              ; preds = %183
  %190 = load i8, ptr %188, align 1, !tbaa !9
  %191 = sext i8 %190 to i32
  %192 = load i64, ptr %16, align 8, !tbaa !5
  %193 = add nsw i64 %192, 1
  %194 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %193)
          to label %195 unwind label %179

195:                                              ; preds = %189
  %196 = load i8, ptr %194, align 1, !tbaa !9
  %197 = sext i8 %196 to i32
  %198 = icmp ne i32 %191, %197
  br i1 %198, label %199, label %208

199:                                              ; preds = %195
  %200 = load i64, ptr %16, align 8, !tbaa !5
  %201 = sub nsw i64 %200, 2
  %202 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %201)
          to label %203 unwind label %179

203:                                              ; preds = %199
  %204 = load i8, ptr %202, align 1, !tbaa !9
  %205 = load i64, ptr %16, align 8, !tbaa !5
  %206 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %205)
          to label %207 unwind label %179

207:                                              ; preds = %203
  store i8 %204, ptr %206, align 1, !tbaa !9
  br label %250

208:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !12
  br label %209

209:                                              ; preds = %245, %208
  %210 = load i32, ptr %17, align 4, !tbaa !12
  %211 = icmp slt i32 %210, 3
  br i1 %211, label %213, label %212

212:                                              ; preds = %209
  store i32 14, ptr %15, align 4
  br label %248

213:                                              ; preds = %209
  %214 = load i64, ptr %16, align 8, !tbaa !5
  %215 = sub nsw i64 %214, 1
  %216 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %215)
          to label %217 unwind label %240

217:                                              ; preds = %213
  %218 = load i8, ptr %216, align 1, !tbaa !9
  %219 = sext i8 %218 to i32
  %220 = load i32, ptr %17, align 4, !tbaa !12
  %221 = add nsw i32 65, %220
  %222 = icmp ne i32 %219, %221
  br i1 %222, label %223, label %244

223:                                              ; preds = %217
  %224 = load i64, ptr %16, align 8, !tbaa !5
  %225 = add nsw i64 %224, 1
  %226 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %225)
          to label %227 unwind label %240

227:                                              ; preds = %223
  %228 = load i8, ptr %226, align 1, !tbaa !9
  %229 = sext i8 %228 to i32
  %230 = load i32, ptr %17, align 4, !tbaa !12
  %231 = add nsw i32 65, %230
  %232 = icmp ne i32 %229, %231
  br i1 %232, label %233, label %244

233:                                              ; preds = %227
  %234 = load i32, ptr %17, align 4, !tbaa !12
  %235 = add nsw i32 65, %234
  %236 = trunc i32 %235 to i8
  %237 = load i64, ptr %16, align 8, !tbaa !5
  %238 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %237)
          to label %239 unwind label %240

239:                                              ; preds = %233
  store i8 %236, ptr %238, align 1, !tbaa !9
  store i32 14, ptr %15, align 4
  br label %248

240:                                              ; preds = %233, %223, %213
  %241 = landingpad { ptr, i32 }
          cleanup
  %242 = extractvalue { ptr, i32 } %241, 0
  store ptr %242, ptr %5, align 8
  %243 = extractvalue { ptr, i32 } %241, 1
  store i32 %243, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %254

244:                                              ; preds = %227, %217
  br label %245

245:                                              ; preds = %244
  %246 = load i32, ptr %17, align 4, !tbaa !12
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr %17, align 4, !tbaa !12
  br label %209, !llvm.loop !16

248:                                              ; preds = %239, %212
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %249

249:                                              ; preds = %248
  br label %250

250:                                              ; preds = %249, %207
  br label %251

251:                                              ; preds = %250, %178
  %252 = load i64, ptr %16, align 8, !tbaa !5
  %253 = add nsw i64 %252, 1
  store i64 %253, ptr %16, align 8, !tbaa !5
  br label %160, !llvm.loop !17

254:                                              ; preds = %240, %179
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %263

255:                                              ; preds = %164
  %256 = load i64, ptr %13, align 8, !tbaa !5
  %257 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %256)
          to label %258 unwind label %117

258:                                              ; preds = %255
  %259 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %260 unwind label %117

260:                                              ; preds = %258
  %261 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %259, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %262 unwind label %117

262:                                              ; preds = %260
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %264

263:                                              ; preds = %254, %149, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %266

264:                                              ; preds = %262, %97
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %265 = load i32, ptr %1, align 4
  ret i32 %265

266:                                              ; preds = %263, %99, %31
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %267

267:                                              ; preds = %266
  %268 = load ptr, ptr %5, align 8
  %269 = load i32, ptr %6, align 4
  %270 = insertvalue { ptr, i32 } poison, ptr %268, 0
  %271 = insertvalue { ptr, i32 } %270, i32 %269, 1
  resume { ptr, i32 } %271
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #5

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #4 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

declare i32 @puts(ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 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 #4 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 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1
@_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 i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  %7 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_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) %3)
          to label %8 unwind label %17

8:                                                ; preds = %0
  %9 = load i64, ptr %2, align 8, !tbaa !5
  %10 = icmp eq i64 %9, 2
  br i1 %10, label %.preheader, label %35

.preheader:                                       ; preds = %8
  %11 = load i64, ptr %1, align 8, !tbaa !5
  %12 = icmp sgt i64 %11, 0
  br i1 %12, label %.lr.ph75, label %._crit_edge76

._crit_edge76:                                    ; preds = %.lr.ph75, %.preheader
  %.050.lcssa = phi i64 [ 0, %.preheader ], [ %.151, %.lr.ph75 ]
  %.048.lcssa = phi i64 [ 0, %.preheader ], [ %.149, %.lr.ph75 ]
  %13 = icmp slt i64 %.048.lcssa, %.050.lcssa
  %spec.select = call i64 @llvm.smin.i64(i64 %.048.lcssa, i64 %.050.lcssa)
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %spec.select)
  %15 = load i64, ptr %1, align 8, !tbaa !5
  %16 = icmp sgt i64 %15, 0
  br i1 %16, label %.lr.ph81, label %._crit_edge82

17:                                               ; preds = %0
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %117

.lr.ph75:                                         ; preds = %.preheader, %.lr.ph75
  %.04774 = phi i64 [ %27, %.lr.ph75 ], [ 0, %.preheader ]
  %.04873 = phi i64 [ %.149, %.lr.ph75 ], [ 0, %.preheader ]
  %.05072 = phi i64 [ %.151, %.lr.ph75 ], [ 0, %.preheader ]
  %19 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %.04774)
  %20 = load i8, ptr %19, align 1, !tbaa !9
  %21 = sext i8 %20 to i64
  %22 = and i64 %.04774, 1
  %23 = add nuw nsw i64 %22, 65
  %24 = icmp ne i64 %23, %21
  %25 = zext i1 %24 to i64
  %.151 = add nuw nsw i64 %.05072, %25
  %not. = xor i1 %24, true
  %26 = zext i1 %not. to i64
  %.149 = add nuw nsw i64 %.04873, %26
  %27 = add nuw nsw i64 %.04774, 1
  %28 = load i64, ptr %1, align 8, !tbaa !5
  %29 = icmp slt i64 %27, %28
  br i1 %29, label %.lr.ph75, label %._crit_edge76, !llvm.loop !10

._crit_edge82:                                    ; preds = %.lr.ph81, %._crit_edge76
  %30 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %116

.lr.ph81:                                         ; preds = %._crit_edge76, %.lr.ph81
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph81 ], [ 0, %._crit_edge76 ]
  %.044.tr = trunc i64 %indvars.iv to i1
  %.narrow = xor i1 %13, %.044.tr
  %31 = select i1 %.narrow, i32 66, i32 65
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = load i64, ptr %1, align 8, !tbaa !5
  %34 = icmp sgt i64 %33, %indvars.iv.next
  br i1 %34, label %.lr.ph81, label %._crit_edge82, !llvm.loop !12

35:                                               ; preds = %8
  %36 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 1)
  %37 = load i8, ptr %36, align 1, !tbaa !9
  %38 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 0)
  %39 = load i8, ptr %38, align 1, !tbaa !9
  %40 = icmp eq i8 %37, %39
  br i1 %40, label %.preheader65.preheader, label %.loopexit66

.preheader65.preheader:                           ; preds = %35
  %41 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 0)
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %.not = icmp eq i8 %42, 65
  br i1 %.not, label %.preheader65.1, label %45

43:                                               ; preds = %114, %._crit_edge
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %117

45:                                               ; preds = %.preheader65.preheader
  %46 = load i64, ptr %1, align 8, !tbaa !5
  %47 = icmp eq i64 %46, 2
  br i1 %47, label %53, label %48

48:                                               ; preds = %45
  %49 = icmp sgt i64 %46, 2
  br i1 %49, label %50, label %.preheader65.1

50:                                               ; preds = %48
  %51 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 2)
  %52 = load i8, ptr %51, align 1, !tbaa !9
  %.not57 = icmp eq i8 %52, 65
  br i1 %.not57, label %.preheader65.1, label %53

53:                                               ; preds = %72, %67, %62, %57, %50, %45
  %.lcssa84 = phi i8 [ 65, %50 ], [ 65, %45 ], [ 66, %57 ], [ 66, %62 ], [ 67, %67 ], [ 67, %72 ]
  %54 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 1)
  store i8 %.lcssa84, ptr %54, align 1, !tbaa !9
  br label %.loopexit66

.preheader65.1:                                   ; preds = %.preheader65.preheader, %48, %50
  %55 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 0)
  %56 = load i8, ptr %55, align 1, !tbaa !9
  %.not.1 = icmp eq i8 %56, 66
  br i1 %.not.1, label %.preheader65.2, label %57

57:                                               ; preds = %.preheader65.1
  %58 = load i64, ptr %1, align 8, !tbaa !5
  %59 = icmp eq i64 %58, 2
  br i1 %59, label %53, label %60

60:                                               ; preds = %57
  %61 = icmp sgt i64 %58, 2
  br i1 %61, label %62, label %.preheader65.2

62:                                               ; preds = %60
  %63 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 2)
  %64 = load i8, ptr %63, align 1, !tbaa !9
  %.not57.1 = icmp eq i8 %64, 66
  br i1 %.not57.1, label %.preheader65.2, label %53

.preheader65.2:                                   ; preds = %62, %60, %.preheader65.1
  %65 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 0)
  %66 = load i8, ptr %65, align 1, !tbaa !9
  %.not.2 = icmp eq i8 %66, 67
  br i1 %.not.2, label %.loopexit66, label %67

67:                                               ; preds = %.preheader65.2
  %68 = load i64, ptr %1, align 8, !tbaa !5
  %69 = icmp eq i64 %68, 2
  br i1 %69, label %53, label %70

70:                                               ; preds = %67
  %71 = icmp sgt i64 %68, 2
  br i1 %71, label %72, label %._crit_edge

72:                                               ; preds = %70
  %73 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 2)
  %74 = load i8, ptr %73, align 1, !tbaa !9
  %.not57.2 = icmp eq i8 %74, 67
  br i1 %.not57.2, label %.loopexit66, label %53

.loopexit66:                                      ; preds = %.preheader65.2, %72, %53, %35
  %.043.ph = phi i64 [ 1, %.preheader65.2 ], [ 1, %72 ], [ 1, %53 ], [ 0, %35 ]
  %.pr = load i64, ptr %1, align 8, !tbaa !5
  %75 = icmp sgt i64 %.pr, 1
  br i1 %75, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.loopexit, %70, %.loopexit66
  %.1.lcssa = phi i64 [ %.043.ph, %.loopexit66 ], [ 1, %70 ], [ %.2, %.loopexit ]
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.1.lcssa)
  %77 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %114 unwind label %43

.lr.ph:                                           ; preds = %.loopexit66, %.loopexit
  %.04171 = phi i64 [ %.pre-phi, %.loopexit ], [ 1, %.loopexit66 ]
  %.170 = phi i64 [ %.2, %.loopexit ], [ %.043.ph, %.loopexit66 ]
  %78 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %.04171)
  %79 = load i8, ptr %78, align 1, !tbaa !9
  %80 = add nsw i64 %.04171, -1
  %81 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %80)
  %82 = load i8, ptr %81, align 1, !tbaa !9
  %.not59 = icmp eq i8 %79, %82
  br i1 %.not59, label %83, label %.lr.ph..loopexit_crit_edge

.lr.ph..loopexit_crit_edge:                       ; preds = %.lr.ph
  %.pre = add nuw nsw i64 %.04171, 1
  br label %.loopexit

83:                                               ; preds = %.lr.ph
  %84 = add nsw i64 %.170, 1
  %85 = add nsw i64 %.04171, -2
  %86 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %85)
  %87 = load i8, ptr %86, align 1, !tbaa !9
  %88 = add nuw nsw i64 %.04171, 1
  %89 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %88)
  %90 = load i8, ptr %89, align 1, !tbaa !9
  %.not60 = icmp eq i8 %87, %90
  br i1 %.not60, label %.preheader64.preheader, label %93

.preheader64.preheader:                           ; preds = %83
  %91 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %80)
  %92 = load i8, ptr %91, align 1, !tbaa !9
  %.not61 = icmp eq i8 %92, 65
  br i1 %.not61, label %.preheader64.1, label %97

93:                                               ; preds = %83
  %94 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %85)
  %95 = load i8, ptr %94, align 1, !tbaa !9
  %96 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %.04171)
  store i8 %95, ptr %96, align 1, !tbaa !9
  br label %.loopexit

97:                                               ; preds = %.preheader64.preheader
  %98 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %88)
  %99 = load i8, ptr %98, align 1, !tbaa !9
  %.not62 = icmp eq i8 %99, 65
  br i1 %.not62, label %.preheader64.1, label %100

100:                                              ; preds = %109, %104, %97
  %.lcssa = phi i8 [ 65, %97 ], [ 66, %104 ], [ 67, %109 ]
  %101 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %.04171)
  store i8 %.lcssa, ptr %101, align 1, !tbaa !9
  br label %.loopexit

.preheader64.1:                                   ; preds = %.preheader64.preheader, %97
  %102 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %80)
  %103 = load i8, ptr %102, align 1, !tbaa !9
  %.not61.1 = icmp eq i8 %103, 66
  br i1 %.not61.1, label %.preheader64.2, label %104

104:                                              ; preds = %.preheader64.1
  %105 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %88)
  %106 = load i8, ptr %105, align 1, !tbaa !9
  %.not62.1 = icmp eq i8 %106, 66
  br i1 %.not62.1, label %.preheader64.2, label %100

.preheader64.2:                                   ; preds = %104, %.preheader64.1
  %107 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %80)
  %108 = load i8, ptr %107, align 1, !tbaa !9
  %.not61.2 = icmp eq i8 %108, 67
  br i1 %.not61.2, label %.loopexit, label %109

109:                                              ; preds = %.preheader64.2
  %110 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %88)
  %111 = load i8, ptr %110, align 1, !tbaa !9
  %.not62.2 = icmp eq i8 %111, 67
  br i1 %.not62.2, label %.loopexit, label %100

.loopexit:                                        ; preds = %.preheader64.2, %109, %.lr.ph..loopexit_crit_edge, %100, %93
  %.pre-phi = phi i64 [ %.pre, %.lr.ph..loopexit_crit_edge ], [ %88, %100 ], [ %88, %93 ], [ %88, %109 ], [ %88, %.preheader64.2 ]
  %.2 = phi i64 [ %.170, %.lr.ph..loopexit_crit_edge ], [ %84, %100 ], [ %84, %93 ], [ %84, %109 ], [ %84, %.preheader64.2 ]
  %112 = load i64, ptr %1, align 8, !tbaa !5
  %113 = icmp slt i64 %.pre-phi, %112
  br i1 %113, label %.lr.ph, label %._crit_edge, !llvm.loop !13

114:                                              ; preds = %._crit_edge
  %115 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %116 unwind label %43

116:                                              ; preds = %114, %._crit_edge82
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

117:                                              ; preds = %43, %17
  %.pn = phi { ptr, i32 } [ %44, %43 ], [ %18, %17 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn
}

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_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 #5

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #4 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 #3

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #6

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 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 = { 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 #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}


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