; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/104 Division 1/Problem B (B)

; 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::__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] }
%"class.std::allocator" = type { i8 }

@_Z3resB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@a1 = external dso_local global i32, align 4
@a2 = external dso_local global i32, align 4
@a3 = external dso_local global i32, align 4
@a4 = external dso_local global i32, align 4
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4failv() #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::allocator", align 1
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::__cxx11::basic_string", align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @a1, ptr noundef @a2)
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @a3, ptr noundef @a4)
  %26 = load i32, ptr @a3, align 4, !tbaa !5
  %27 = load i32, ptr @a4, align 4, !tbaa !5
  %28 = sub nsw i32 %26, %27
  %29 = call i32 @llvm.abs.i32(i32 %28, i1 true)
  %30 = icmp sgt i32 %29, 1
  br i1 %30, label %31, label %32

31:                                               ; preds = %0
  call void @_Z4failv()
  store i32 0, ptr %1, align 4
  br label %348

32:                                               ; preds = %0
  %33 = load i32, ptr @a1, align 4, !tbaa !5
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @a3, ptr noundef nonnull align 4 dereferenceable(4) @a4)
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = icmp slt i32 %33, %35
  br i1 %36, label %42, label %37

37:                                               ; preds = %32
  %38 = load i32, ptr @a2, align 4, !tbaa !5
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @a3, ptr noundef nonnull align 4 dereferenceable(4) @a4)
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = icmp slt i32 %38, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %37, %32
  call void @_Z4failv()
  store i32 0, ptr %1, align 4
  br label %348

43:                                               ; preds = %37
  %44 = load i32, ptr @a3, align 4, !tbaa !5
  %45 = load i32, ptr @a1, align 4, !tbaa !5
  %46 = sub nsw i32 %45, %44
  store i32 %46, ptr @a1, align 4, !tbaa !5
  %47 = load i32, ptr @a3, align 4, !tbaa !5
  %48 = load i32, ptr @a2, align 4, !tbaa !5
  %49 = sub nsw i32 %48, %47
  store i32 %49, ptr @a2, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %58, %50
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = load i32, ptr @a3, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

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

56:                                               ; preds = %51
  %57 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef @.str.3)
  br label %58

58:                                               ; preds = %56
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %2, align 4, !tbaa !5
  br label %51, !llvm.loop !9

61:                                               ; preds = %55
  %62 = load i32, ptr @a4, align 4, !tbaa !5
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %64, label %87

64:                                               ; preds = %61
  %65 = load i32, ptr @a4, align 4, !tbaa !5
  %66 = load i32, ptr @a3, align 4, !tbaa !5
  %67 = icmp sge i32 %65, %66
  br i1 %67, label %68, label %87

68:                                               ; preds = %64
  %69 = load i32, ptr @a1, align 4, !tbaa !5
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %75

71:                                               ; preds = %68
  %72 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef @.str.4)
  %73 = load i32, ptr @a1, align 4, !tbaa !5
  %74 = add nsw i32 %73, -1
  store i32 %74, ptr @a1, align 4, !tbaa !5
  br label %86

75:                                               ; preds = %68
  %76 = load i32, ptr @a2, align 4, !tbaa !5
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %84

78:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #7
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %3, ptr noundef @.str.5, ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11)
  %79 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #7
  %80 = load i32, ptr @a2, align 4, !tbaa !5
  %81 = add nsw i32 %80, -1
  store i32 %81, ptr @a2, align 4, !tbaa !5
  %82 = load i32, ptr @a4, align 4, !tbaa !5
  %83 = add nsw i32 %82, -1
  store i32 %83, ptr @a4, align 4, !tbaa !5
  br label %85

84:                                               ; preds = %75
  store i32 -1, ptr @a1, align 4, !tbaa !5
  store i32 -1, ptr @a2, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %84, %78
  br label %86

86:                                               ; preds = %85, %71
  br label %87

87:                                               ; preds = %86, %64, %61
  %88 = load i32, ptr @a4, align 4, !tbaa !5
  %89 = load i32, ptr @a3, align 4, !tbaa !5
  %90 = icmp sgt i32 %88, %89
  br i1 %90, label %91, label %95

91:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #7
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef @.str.5, ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11)
  %92 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #7
  %93 = load i32, ptr @a2, align 4, !tbaa !5
  %94 = add nsw i32 %93, -1
  store i32 %94, ptr @a2, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %91, %87
  %96 = load i32, ptr @a1, align 4, !tbaa !5
  %97 = icmp slt i32 %96, 0
  br i1 %97, label %101, label %98

98:                                               ; preds = %95
  %99 = load i32, ptr @a2, align 4, !tbaa !5
  %100 = icmp slt i32 %99, 0
  br i1 %100, label %101, label %102

101:                                              ; preds = %98, %95
  call void @_Z4failv()
  store i32 0, ptr %1, align 4
  br label %348

102:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %103 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11) #7
  %104 = trunc i64 %103 to i32
  store i32 %104, ptr %5, align 4, !tbaa !5
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = icmp sgt i32 %105, 0
  br i1 %106, label %107, label %321

107:                                              ; preds = %102
  %108 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef 0)
  %109 = load i8, ptr %108, align 1, !tbaa !11
  %110 = sext i8 %109 to i32
  %111 = icmp eq i32 %110, 52
  br i1 %111, label %112, label %160

112:                                              ; preds = %107
  %113 = load i32, ptr %5, align 4, !tbaa !5
  %114 = sub nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef %115)
  %117 = load i8, ptr %116, align 1, !tbaa !11
  %118 = sext i8 %117 to i32
  %119 = icmp eq i32 %118, 55
  br i1 %119, label %120, label %160

120:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %129, %120
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = load i32, ptr @a1, align 4, !tbaa !5
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %136

126:                                              ; preds = %121
  %127 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef @.str.4)
          to label %128 unwind label %132

128:                                              ; preds = %126
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %7, align 4, !tbaa !5
  br label %121, !llvm.loop !12

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

136:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #7
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %10, ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11)
          to label %137 unwind label %144

137:                                              ; preds = %136
  %138 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %10) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %151, %137
  %140 = load i32, ptr %11, align 4, !tbaa !5
  %141 = load i32, ptr @a2, align 4, !tbaa !5
  %142 = icmp slt i32 %140, %141
  br i1 %142, label %148, label %143

143:                                              ; preds = %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %158

144:                                              ; preds = %136
  %145 = landingpad { ptr, i32 }
          cleanup
  %146 = extractvalue { ptr, i32 } %145, 0
  store ptr %146, ptr %8, align 8
  %147 = extractvalue { ptr, i32 } %145, 1
  store i32 %147, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #7
  br label %159

148:                                              ; preds = %139
  %149 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef @.str.5)
          to label %150 unwind label %154

150:                                              ; preds = %148
  br label %151

151:                                              ; preds = %150
  %152 = load i32, ptr %11, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %11, align 4, !tbaa !5
  br label %139, !llvm.loop !13

154:                                              ; preds = %148
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %8, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %159

158:                                              ; preds = %143
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #7
  br label %320

159:                                              ; preds = %154, %144, %132
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #7
  br label %347

160:                                              ; preds = %112, %107
  %161 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef 0)
  %162 = load i8, ptr %161, align 1, !tbaa !11
  %163 = sext i8 %162 to i32
  %164 = icmp eq i32 %163, 52
  br i1 %164, label %165, label %232

165:                                              ; preds = %160
  %166 = load i32, ptr %5, align 4, !tbaa !5
  %167 = sub nsw i32 %166, 1
  %168 = sext i32 %167 to i64
  %169 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef %168)
  %170 = load i8, ptr %169, align 1, !tbaa !11
  %171 = sext i8 %170 to i32
  %172 = icmp eq i32 %171, 52
  br i1 %172, label %173, label %232

173:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %174

174:                                              ; preds = %182, %173
  %175 = load i32, ptr %13, align 4, !tbaa !5
  %176 = load i32, ptr @a1, align 4, !tbaa !5
  %177 = icmp slt i32 %175, %176
  br i1 %177, label %179, label %178

178:                                              ; preds = %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %189

179:                                              ; preds = %174
  %180 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str.4)
          to label %181 unwind label %185

181:                                              ; preds = %179
  br label %182

182:                                              ; preds = %181
  %183 = load i32, ptr %13, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %13, align 4, !tbaa !5
  br label %174, !llvm.loop !14

185:                                              ; preds = %179
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %8, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %231

189:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #7
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %14, ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11)
          to label %190 unwind label %209

190:                                              ; preds = %189
  %191 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #7
  %192 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11) #7
  %193 = trunc i64 %192 to i32
  store i32 %193, ptr %5, align 4, !tbaa !5
  %194 = load i32, ptr @a2, align 4, !tbaa !5
  %195 = icmp ne i32 %194, 0
  br i1 %195, label %196, label %230

196:                                              ; preds = %190
  %197 = load i32, ptr %5, align 4, !tbaa !5
  %198 = sub nsw i32 %197, 1
  %199 = sext i32 %198 to i64
  %200 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef %199)
          to label %201 unwind label %213

201:                                              ; preds = %196
  store i8 55, ptr %200, align 1, !tbaa !11
  %202 = load i32, ptr @a2, align 4, !tbaa !5
  %203 = add nsw i32 %202, -1
  store i32 %203, ptr @a2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %204

204:                                              ; preds = %220, %201
  %205 = load i32, ptr %15, align 4, !tbaa !5
  %206 = load i32, ptr @a2, align 4, !tbaa !5
  %207 = icmp slt i32 %205, %206
  br i1 %207, label %217, label %208

208:                                              ; preds = %204
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %227

209:                                              ; preds = %189
  %210 = landingpad { ptr, i32 }
          cleanup
  %211 = extractvalue { ptr, i32 } %210, 0
  store ptr %211, ptr %8, align 8
  %212 = extractvalue { ptr, i32 } %210, 1
  store i32 %212, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #7
  br label %231

213:                                              ; preds = %227, %196
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %8, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %9, align 4
  br label %231

217:                                              ; preds = %204
  %218 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef @.str.5)
          to label %219 unwind label %223

219:                                              ; preds = %217
  br label %220

220:                                              ; preds = %219
  %221 = load i32, ptr %15, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %15, align 4, !tbaa !5
  br label %204, !llvm.loop !15

223:                                              ; preds = %217
  %224 = landingpad { ptr, i32 }
          cleanup
  %225 = extractvalue { ptr, i32 } %224, 0
  store ptr %225, ptr %8, align 8
  %226 = extractvalue { ptr, i32 } %224, 1
  store i32 %226, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %231

227:                                              ; preds = %208
  %228 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef @.str.4)
          to label %229 unwind label %213

229:                                              ; preds = %227
  br label %230

230:                                              ; preds = %229, %190
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  br label %319

231:                                              ; preds = %223, %213, %209, %185
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  br label %347

232:                                              ; preds = %165, %160
  %233 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef 0)
  %234 = load i8, ptr %233, align 1, !tbaa !11
  %235 = sext i8 %234 to i32
  %236 = icmp eq i32 %235, 55
  br i1 %236, label %237, label %306

237:                                              ; preds = %232
  %238 = load i32, ptr %5, align 4, !tbaa !5
  %239 = sub nsw i32 %238, 1
  %240 = sext i32 %239 to i64
  %241 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef %240)
  %242 = load i8, ptr %241, align 1, !tbaa !11
  %243 = sext i8 %242 to i32
  %244 = icmp eq i32 %243, 52
  br i1 %244, label %245, label %306

245:                                              ; preds = %237
  %246 = load i32, ptr @a1, align 4, !tbaa !5
  %247 = icmp ne i32 %246, 0
  br i1 %247, label %248, label %281

248:                                              ; preds = %245
  %249 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef 0)
  store i8 52, ptr %249, align 1, !tbaa !11
  %250 = load i32, ptr @a1, align 4, !tbaa !5
  %251 = add nsw i32 %250, -1
  store i32 %251, ptr @a1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef @.str.5, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %252 unwind label %258

252:                                              ; preds = %248
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %253

253:                                              ; preds = %265, %252
  %254 = load i32, ptr %18, align 4, !tbaa !5
  %255 = load i32, ptr @a1, align 4, !tbaa !5
  %256 = icmp slt i32 %254, %255
  br i1 %256, label %262, label %257

257:                                              ; preds = %253
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %272

258:                                              ; preds = %248
  %259 = landingpad { ptr, i32 }
          cleanup
  %260 = extractvalue { ptr, i32 } %259, 0
  store ptr %260, ptr %8, align 8
  %261 = extractvalue { ptr, i32 } %259, 1
  store i32 %261, ptr %9, align 4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  br label %280

262:                                              ; preds = %253
  %263 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef @.str.4)
          to label %264 unwind label %268

264:                                              ; preds = %262
  br label %265

265:                                              ; preds = %264
  %266 = load i32, ptr %18, align 4, !tbaa !5
  %267 = add nsw i32 %266, 1
  store i32 %267, ptr %18, align 4, !tbaa !5
  br label %253, !llvm.loop !16

268:                                              ; preds = %262
  %269 = landingpad { ptr, i32 }
          cleanup
  %270 = extractvalue { ptr, i32 } %269, 0
  store ptr %270, ptr %8, align 8
  %271 = extractvalue { ptr, i32 } %269, 1
  store i32 %271, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %279

272:                                              ; preds = %257
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #7
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %19, ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11)
          to label %273 unwind label %275

273:                                              ; preds = %272
  %274 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #7
  br label %281

275:                                              ; preds = %272
  %276 = landingpad { ptr, i32 }
          cleanup
  %277 = extractvalue { ptr, i32 } %276, 0
  store ptr %277, ptr %8, align 8
  %278 = extractvalue { ptr, i32 } %276, 1
  store i32 %278, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #7
  br label %279

279:                                              ; preds = %275, %268
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  br label %280

280:                                              ; preds = %279, %258
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #7
  br label %347

281:                                              ; preds = %273, %245
  %282 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11) #7
  %283 = trunc i64 %282 to i32
  store i32 %283, ptr %5, align 4, !tbaa !5
  %284 = load i32, ptr @a2, align 4, !tbaa !5
  %285 = icmp ne i32 %284, 0
  br i1 %285, label %286, label %305

286:                                              ; preds = %281
  %287 = load i32, ptr %5, align 4, !tbaa !5
  %288 = sub nsw i32 %287, 1
  %289 = sext i32 %288 to i64
  %290 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef %289)
  store i8 55, ptr %290, align 1, !tbaa !11
  %291 = load i32, ptr @a2, align 4, !tbaa !5
  %292 = add nsw i32 %291, -1
  store i32 %292, ptr @a2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %293

293:                                              ; preds = %300, %286
  %294 = load i32, ptr %20, align 4, !tbaa !5
  %295 = load i32, ptr @a2, align 4, !tbaa !5
  %296 = icmp slt i32 %294, %295
  br i1 %296, label %298, label %297

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

298:                                              ; preds = %293
  %299 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef @.str.5)
  br label %300

300:                                              ; preds = %298
  %301 = load i32, ptr %20, align 4, !tbaa !5
  %302 = add nsw i32 %301, 1
  store i32 %302, ptr %20, align 4, !tbaa !5
  br label %293, !llvm.loop !17

303:                                              ; preds = %297
  %304 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef @.str.4)
  br label %305

305:                                              ; preds = %303, %281
  br label %318

306:                                              ; preds = %237, %232
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %307

307:                                              ; preds = %314, %306
  %308 = load i32, ptr %21, align 4, !tbaa !5
  %309 = load i32, ptr @a2, align 4, !tbaa !5
  %310 = icmp slt i32 %308, %309
  br i1 %310, label %312, label %311

311:                                              ; preds = %307
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %317

312:                                              ; preds = %307
  %313 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i8 noundef signext 55)
  br label %314

314:                                              ; preds = %312
  %315 = load i32, ptr %21, align 4, !tbaa !5
  %316 = add nsw i32 %315, 1
  store i32 %316, ptr %21, align 4, !tbaa !5
  br label %307, !llvm.loop !18

317:                                              ; preds = %311
  br label %318

318:                                              ; preds = %317, %305
  br label %319

319:                                              ; preds = %318, %230
  br label %320

320:                                              ; preds = %319, %158
  br label %344

321:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %322

322:                                              ; preds = %329, %321
  %323 = load i32, ptr %22, align 4, !tbaa !5
  %324 = load i32, ptr @a1, align 4, !tbaa !5
  %325 = icmp slt i32 %323, %324
  br i1 %325, label %327, label %326

326:                                              ; preds = %322
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %332

327:                                              ; preds = %322
  %328 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef @.str.4)
  br label %329

329:                                              ; preds = %327
  %330 = load i32, ptr %22, align 4, !tbaa !5
  %331 = add nsw i32 %330, 1
  store i32 %331, ptr %22, align 4, !tbaa !5
  br label %322, !llvm.loop !19

332:                                              ; preds = %326
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %333

333:                                              ; preds = %340, %332
  %334 = load i32, ptr %23, align 4, !tbaa !5
  %335 = load i32, ptr @a2, align 4, !tbaa !5
  %336 = icmp slt i32 %334, %335
  br i1 %336, label %338, label %337

337:                                              ; preds = %333
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %343

338:                                              ; preds = %333
  %339 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef @.str.5)
  br label %340

340:                                              ; preds = %338
  %341 = load i32, ptr %23, align 4, !tbaa !5
  %342 = add nsw i32 %341, 1
  store i32 %342, ptr %23, align 4, !tbaa !5
  br label %333, !llvm.loop !20

343:                                              ; preds = %337
  br label %344

344:                                              ; preds = %343, %320
  %345 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11) #7
  %346 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %345)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %348

347:                                              ; preds = %280, %231, %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %350

348:                                              ; preds = %344, %101, %42, %31
  %349 = load i32, ptr %1, align 4
  ret i32 %349

350:                                              ; preds = %347
  %351 = load ptr, ptr %8, align 8
  %352 = load i32, ptr %9, align 4
  %353 = insertvalue { ptr, i32 } poison, ptr %351, 0
  %354 = insertvalue { ptr, i32 } %353, i32 %352, 1
  resume { ptr, i32 } %354
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) #1

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext) #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

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


; 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::__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] }
%"class.std::allocator" = type { i8 }

@_Z3resB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@a1 = external dso_local global i32, align 4
@a2 = external dso_local global i32, align 4
@a3 = external dso_local global i32, align 4
@a4 = external dso_local global i32, align 4
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4failv() local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @a1, ptr noundef nonnull @a2)
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @a3, ptr noundef nonnull @a4)
  %12 = load i32, ptr @a3, align 4, !tbaa !5
  %13 = load i32, ptr @a4, align 4, !tbaa !5
  %14 = sub nsw i32 %12, %13
  %15 = tail call i32 @llvm.abs.i32(i32 %14, i1 true)
  %16 = icmp ugt i32 %15, 1
  br i1 %16, label %17, label %18

17:                                               ; preds = %0
  tail call void @_Z4failv()
  br label %225

18:                                               ; preds = %0
  %19 = load i32, ptr @a1, align 4, !tbaa !5
  %20 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @a3, ptr noundef nonnull align 4 dereferenceable(4) @a4)
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = icmp slt i32 %19, %21
  br i1 %22, label %28, label %23

23:                                               ; preds = %18
  %24 = load i32, ptr @a2, align 4, !tbaa !5
  %25 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @a3, ptr noundef nonnull align 4 dereferenceable(4) @a4)
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = icmp slt i32 %24, %26
  br i1 %27, label %28, label %29

28:                                               ; preds = %23, %18
  tail call void @_Z4failv()
  br label %225

29:                                               ; preds = %23
  %30 = load i32, ptr @a3, align 4, !tbaa !5
  %31 = load i32, ptr @a1, align 4, !tbaa !5
  %32 = sub nsw i32 %31, %30
  store i32 %32, ptr @a1, align 4, !tbaa !5
  %33 = load i32, ptr @a2, align 4, !tbaa !5
  %34 = sub nsw i32 %33, %30
  store i32 %34, ptr @a2, align 4, !tbaa !5
  %35 = icmp sgt i32 %30, 0
  br i1 %35, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %29
  %.lcssa = phi i32 [ %30, %29 ], [ %40, %.lr.ph ]
  %36 = load i32, ptr @a4, align 4, !tbaa !5
  %37 = icmp slt i32 %36, 1
  %.not = icmp slt i32 %36, %.lcssa
  %or.cond61 = or i1 %37, %.not
  br i1 %or.cond61, label %57, label %42

.lr.ph:                                           ; preds = %29, %.lr.ph
  %.04364 = phi i32 [ %39, %.lr.ph ], [ 0, %29 ]
  %38 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull @.str.3)
  %39 = add nuw nsw i32 %.04364, 1
  %40 = load i32, ptr @a3, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %.lr.ph, label %._crit_edge, !llvm.loop !9

42:                                               ; preds = %._crit_edge
  %43 = load i32, ptr @a1, align 4, !tbaa !5
  %.not48 = icmp eq i32 %43, 0
  br i1 %.not48, label %48, label %44

44:                                               ; preds = %42
  %45 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull @.str.4)
  %46 = load i32, ptr @a1, align 4, !tbaa !5
  %47 = add nsw i32 %46, -1
  store i32 %47, ptr @a1, align 4, !tbaa !5
  %.pre = load i32, ptr @a4, align 4, !tbaa !5
  br label %57

48:                                               ; preds = %42
  %49 = load i32, ptr @a2, align 4, !tbaa !5
  %.not49 = icmp eq i32 %49, 0
  br i1 %.not49, label %56, label %50

50:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #7
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %1, ptr noundef nonnull @.str.5, ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11)
  %51 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  %52 = load i32, ptr @a2, align 4, !tbaa !5
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr @a2, align 4, !tbaa !5
  %54 = load i32, ptr @a4, align 4, !tbaa !5
  %55 = add nsw i32 %54, -1
  store i32 %55, ptr @a4, align 4, !tbaa !5
  br label %57

56:                                               ; preds = %48
  store i32 -1, ptr @a1, align 4, !tbaa !5
  store i32 -1, ptr @a2, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %44, %56, %50, %._crit_edge
  %58 = phi i32 [ %.pre, %44 ], [ %36, %56 ], [ %55, %50 ], [ %36, %._crit_edge ]
  %59 = load i32, ptr @a3, align 4, !tbaa !5
  %60 = icmp sgt i32 %58, %59
  br i1 %60, label %61, label %._crit_edge98

._crit_edge98:                                    ; preds = %57
  %.pre99 = load i32, ptr @a2, align 4
  br label %65

61:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #7
  call void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %2, ptr noundef nonnull @.str.5, ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11)
  %62 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  %63 = load i32, ptr @a2, align 4, !tbaa !5
  %64 = add nsw i32 %63, -1
  store i32 %64, ptr @a2, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %._crit_edge98, %61
  %66 = phi i32 [ %.pre99, %._crit_edge98 ], [ %64, %61 ]
  %67 = load i32, ptr @a1, align 4, !tbaa !5
  %68 = icmp slt i32 %67, 0
  %69 = icmp slt i32 %66, 0
  %or.cond = select i1 %68, i1 true, i1 %69
  br i1 %or.cond, label %70, label %71

70:                                               ; preds = %65
  call void @_Z4failv()
  br label %225

71:                                               ; preds = %65
  %72 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11) #7
  %73 = trunc i64 %72 to i32
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %77, label %.preheader63

.preheader63:                                     ; preds = %71
  %75 = load i32, ptr @a1, align 4, !tbaa !5
  %76 = icmp sgt i32 %75, 0
  br i1 %76, label %.lr.ph66, label %.preheader

77:                                               ; preds = %71
  %78 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef 0)
  %79 = load i8, ptr %78, align 1, !tbaa !11
  %80 = icmp eq i8 %79, 52
  br i1 %80, label %81, label %111

81:                                               ; preds = %77
  %82 = add i64 %72, 4294967295
  %83 = and i64 %82, 4294967295
  %84 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef %83)
  %85 = load i8, ptr %84, align 1, !tbaa !11
  %86 = icmp eq i8 %85, 55
  br i1 %86, label %87, label %111

87:                                               ; preds = %81
  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
  %88 = load i32, ptr @a1, align 4, !tbaa !5
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %.lr.ph90, label %._crit_edge91

._crit_edge91:                                    ; preds = %91, %87
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11)
          to label %97 unwind label %101

.lr.ph90:                                         ; preds = %87, %91
  %.04288 = phi i32 [ %92, %91 ], [ 0, %87 ]
  %90 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.4)
          to label %91 unwind label %95

91:                                               ; preds = %.lr.ph90
  %92 = add nuw nsw i32 %.04288, 1
  %93 = load i32, ptr @a1, align 4, !tbaa !5
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %.lr.ph90, label %._crit_edge91, !llvm.loop !12

95:                                               ; preds = %.lr.ph90
  %96 = landingpad { ptr, i32 }
          cleanup
  br label %110

97:                                               ; preds = %._crit_edge91
  %98 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  %99 = load i32, ptr @a2, align 4, !tbaa !5
  %100 = icmp sgt i32 %99, 0
  br i1 %100, label %.lr.ph94, label %._crit_edge95

._crit_edge95:                                    ; preds = %104, %97
  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
  br label %.loopexit

101:                                              ; preds = %._crit_edge91
  %102 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  br label %110

.lr.ph94:                                         ; preds = %97, %104
  %.03592 = phi i32 [ %105, %104 ], [ 0, %97 ]
  %103 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull @.str.5)
          to label %104 unwind label %108

104:                                              ; preds = %.lr.ph94
  %105 = add nuw nsw i32 %.03592, 1
  %106 = load i32, ptr @a2, align 4, !tbaa !5
  %107 = icmp slt i32 %105, %106
  br i1 %107, label %.lr.ph94, label %._crit_edge95, !llvm.loop !13

108:                                              ; preds = %.lr.ph94
  %109 = landingpad { ptr, i32 }
          cleanup
  br label %110

110:                                              ; preds = %108, %101, %95
  %.pn58 = phi { ptr, i32 } [ %96, %95 ], [ %109, %108 ], [ %102, %101 ]
  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
  br label %224

111:                                              ; preds = %81, %77
  %112 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef 0)
  %113 = load i8, ptr %112, align 1, !tbaa !11
  %114 = icmp eq i8 %113, 52
  br i1 %114, label %115, label %156

115:                                              ; preds = %111
  %116 = add i64 %72, 4294967295
  %117 = and i64 %116, 4294967295
  %118 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef %117)
  %119 = load i8, ptr %118, align 1, !tbaa !11
  %120 = icmp eq i8 %119, 52
  br i1 %120, label %121, label %156

121:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  %122 = load i32, ptr @a1, align 4, !tbaa !5
  %123 = icmp sgt i32 %122, 0
  br i1 %123, label %.lr.ph82, label %._crit_edge83

._crit_edge83:                                    ; preds = %125, %121
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %6, ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11)
          to label %131 unwind label %143

.lr.ph82:                                         ; preds = %121, %125
  %.03480 = phi i32 [ %126, %125 ], [ 0, %121 ]
  %124 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.4)
          to label %125 unwind label %129

125:                                              ; preds = %.lr.ph82
  %126 = add nuw nsw i32 %.03480, 1
  %127 = load i32, ptr @a1, align 4, !tbaa !5
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %.lr.ph82, label %._crit_edge83, !llvm.loop !14

129:                                              ; preds = %.lr.ph82
  %130 = landingpad { ptr, i32 }
          cleanup
  br label %155

131:                                              ; preds = %._crit_edge83
  %132 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  %133 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11) #7
  %134 = load i32, ptr @a2, align 4, !tbaa !5
  %.not54 = icmp eq i32 %134, 0
  br i1 %.not54, label %154, label %135

135:                                              ; preds = %131
  %136 = shl i64 %133, 32
  %sext55 = add i64 %136, -4294967296
  %137 = ashr exact i64 %sext55, 32
  %138 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef %137)
  store i8 55, ptr %138, align 1, !tbaa !11
  %139 = load i32, ptr @a2, align 4, !tbaa !5
  %140 = add nsw i32 %139, -1
  store i32 %140, ptr @a2, align 4, !tbaa !5
  %141 = icmp sgt i32 %139, 1
  br i1 %141, label %.lr.ph86, label %._crit_edge87

._crit_edge87:                                    ; preds = %148, %135
  %142 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull @.str.4)
          to label %154 unwind label %145

143:                                              ; preds = %._crit_edge83
  %144 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  br label %155

145:                                              ; preds = %._crit_edge87
  %146 = landingpad { ptr, i32 }
          cleanup
  br label %155

.lr.ph86:                                         ; preds = %135, %148
  %.03384 = phi i32 [ %149, %148 ], [ 0, %135 ]
  %147 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull @.str.5)
          to label %148 unwind label %152

148:                                              ; preds = %.lr.ph86
  %149 = add nuw nsw i32 %.03384, 1
  %150 = load i32, ptr @a2, align 4, !tbaa !5
  %151 = icmp slt i32 %149, %150
  br i1 %151, label %.lr.ph86, label %._crit_edge87, !llvm.loop !15

152:                                              ; preds = %.lr.ph86
  %153 = landingpad { ptr, i32 }
          cleanup
  br label %155

154:                                              ; preds = %._crit_edge87, %131
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  br label %.loopexit

155:                                              ; preds = %152, %145, %143, %129
  %.pn56 = phi { ptr, i32 } [ %130, %129 ], [ %153, %152 ], [ %146, %145 ], [ %144, %143 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  br label %224

156:                                              ; preds = %115, %111
  %157 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef 0)
  %158 = load i8, ptr %157, align 1, !tbaa !11
  %159 = icmp eq i8 %158, 55
  br i1 %159, label %160, label %205

160:                                              ; preds = %156
  %161 = add i64 %72, 4294967295
  %162 = and i64 %161, 4294967295
  %163 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef %162)
  %164 = load i8, ptr %163, align 1, !tbaa !11
  %165 = icmp eq i8 %164, 52
  br i1 %165, label %166, label %205

166:                                              ; preds = %160
  %167 = load i32, ptr @a1, align 4, !tbaa !5
  %.not50 = icmp eq i32 %167, 0
  br i1 %.not50, label %190, label %168

168:                                              ; preds = %166
  %169 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef 0)
  store i8 52, ptr %169, align 1, !tbaa !11
  %170 = load i32, ptr @a1, align 4, !tbaa !5
  %171 = add nsw i32 %170, -1
  store i32 %171, ptr @a1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull @.str.5, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %172 unwind label %175

172:                                              ; preds = %168
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  %173 = load i32, ptr @a1, align 4, !tbaa !5
  %174 = icmp sgt i32 %173, 0
  br i1 %174, label %.lr.ph74, label %._crit_edge75

._crit_edge75:                                    ; preds = %178, %172
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #7
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11)
          to label %184 unwind label %186

175:                                              ; preds = %168
  %176 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  br label %189

.lr.ph74:                                         ; preds = %172, %178
  %.03272 = phi i32 [ %179, %178 ], [ 0, %172 ]
  %177 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull @.str.4)
          to label %178 unwind label %182

178:                                              ; preds = %.lr.ph74
  %179 = add nuw nsw i32 %.03272, 1
  %180 = load i32, ptr @a1, align 4, !tbaa !5
  %181 = icmp slt i32 %179, %180
  br i1 %181, label %.lr.ph74, label %._crit_edge75, !llvm.loop !16

182:                                              ; preds = %.lr.ph74
  %183 = landingpad { ptr, i32 }
          cleanup
  br label %188

184:                                              ; preds = %._crit_edge75
  %185 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  br label %190

186:                                              ; preds = %._crit_edge75
  %187 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  br label %188

188:                                              ; preds = %186, %182
  %.pn = phi { ptr, i32 } [ %183, %182 ], [ %187, %186 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  br label %189

189:                                              ; preds = %188, %175
  %.pn.pn = phi { ptr, i32 } [ %.pn, %188 ], [ %176, %175 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  br label %224

190:                                              ; preds = %184, %166
  %191 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11) #7
  %192 = load i32, ptr @a2, align 4, !tbaa !5
  %.not51 = icmp eq i32 %192, 0
  br i1 %.not51, label %.loopexit, label %193

193:                                              ; preds = %190
  %194 = shl i64 %191, 32
  %sext = add i64 %194, -4294967296
  %195 = ashr exact i64 %sext, 32
  %196 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i64 noundef %195)
  store i8 55, ptr %196, align 1, !tbaa !11
  %197 = load i32, ptr @a2, align 4, !tbaa !5
  %198 = add nsw i32 %197, -1
  store i32 %198, ptr @a2, align 4, !tbaa !5
  %199 = icmp sgt i32 %197, 1
  br i1 %199, label %.lr.ph78, label %._crit_edge79

._crit_edge79:                                    ; preds = %.lr.ph78, %193
  %200 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull @.str.4)
  br label %.loopexit

.lr.ph78:                                         ; preds = %193, %.lr.ph78
  %.03176 = phi i32 [ %202, %.lr.ph78 ], [ 0, %193 ]
  %201 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull @.str.5)
  %202 = add nuw nsw i32 %.03176, 1
  %203 = load i32, ptr @a2, align 4, !tbaa !5
  %204 = icmp slt i32 %202, %203
  br i1 %204, label %.lr.ph78, label %._crit_edge79, !llvm.loop !17

205:                                              ; preds = %160, %156
  %206 = load i32, ptr @a2, align 4, !tbaa !5
  %207 = icmp sgt i32 %206, 0
  br i1 %207, label %.lr.ph71, label %.loopexit

.lr.ph71:                                         ; preds = %205, %.lr.ph71
  %.03069 = phi i32 [ %209, %.lr.ph71 ], [ 0, %205 ]
  %208 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, i8 noundef signext 55)
  %209 = add nuw nsw i32 %.03069, 1
  %210 = load i32, ptr @a2, align 4, !tbaa !5
  %211 = icmp slt i32 %209, %210
  br i1 %211, label %.lr.ph71, label %.loopexit, !llvm.loop !18

.preheader:                                       ; preds = %.lr.ph66, %.preheader63
  %212 = load i32, ptr @a2, align 4, !tbaa !5
  %213 = icmp sgt i32 %212, 0
  br i1 %213, label %.lr.ph68, label %.loopexit

.lr.ph66:                                         ; preds = %.preheader63, %.lr.ph66
  %.02965 = phi i32 [ %215, %.lr.ph66 ], [ 0, %.preheader63 ]
  %214 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull @.str.4)
  %215 = add nuw nsw i32 %.02965, 1
  %216 = load i32, ptr @a1, align 4, !tbaa !5
  %217 = icmp slt i32 %215, %216
  br i1 %217, label %.lr.ph66, label %.preheader, !llvm.loop !19

.lr.ph68:                                         ; preds = %.preheader, %.lr.ph68
  %.067 = phi i32 [ %219, %.lr.ph68 ], [ 0, %.preheader ]
  %218 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11, ptr noundef nonnull @.str.5)
  %219 = add nuw nsw i32 %.067, 1
  %220 = load i32, ptr @a2, align 4, !tbaa !5
  %221 = icmp slt i32 %219, %220
  br i1 %221, label %.lr.ph68, label %.loopexit, !llvm.loop !20

.loopexit:                                        ; preds = %.lr.ph68, %.lr.ph71, %.preheader, %205, %._crit_edge95, %._crit_edge79, %190, %154
  %222 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z3resB5cxx11) #7
  %223 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef %222)
  br label %225

224:                                              ; preds = %189, %155, %110
  %.pn58.pn = phi { ptr, i32 } [ %.pn58, %110 ], [ %.pn56, %155 ], [ %.pn.pn, %189 ]
  resume { ptr, i32 } %.pn58.pn

225:                                              ; preds = %.loopexit, %70, %28, %17
  ret i32 0
}

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32), i8 noundef signext) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

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


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