; LLVM IR from Izaron/ACM-ICPC :: Timus Online Judge/Volume 9/1893. A380 (main)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  %10 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %11 unwind label %18

11:                                               ; preds = %0
  %12 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  %13 = icmp eq i64 %12, 2
  br i1 %13, label %14, label %26

14:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #7
  invoke void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %6, ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 0, i64 noundef 1)
          to label %15 unwind label %22

15:                                               ; preds = %14
  %16 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %6) #7
  %17 = call i32 @atoi(ptr noundef %16) #8
  store i32 %17, ptr %2, align 4, !tbaa !5
  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 %34

18:                                               ; preds = %0
  %19 = landingpad { ptr, i32 }
          cleanup
  %20 = extractvalue { ptr, i32 } %19, 0
  store ptr %20, ptr %4, align 8
  %21 = extractvalue { ptr, i32 } %19, 1
  store i32 %21, ptr %5, align 4
  br label %228

22:                                               ; preds = %14
  %23 = landingpad { ptr, i32 }
          cleanup
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %4, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #7
  br label %228

26:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #7
  invoke void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %7, ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 0, i64 noundef 2)
          to label %27 unwind label %30

27:                                               ; preds = %26
  %28 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  %29 = call i32 @atoi(ptr noundef %28) #8
  store i32 %29, ptr %2, align 4, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  br label %34

30:                                               ; preds = %26
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %4, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  br label %228

34:                                               ; preds = %27, %15
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #7
  %35 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  %36 = sub i64 %35, 1
  %37 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %36)
          to label %38 unwind label %62

38:                                               ; preds = %34
  %39 = load i8, ptr %37, align 1, !tbaa !9
  store i8 %39, ptr %8, align 1, !tbaa !9
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = icmp sge i32 %40, 1
  br i1 %41, label %42, label %49

42:                                               ; preds = %38
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = icmp sle i32 %43, 2
  br i1 %44, label %45, label %49

45:                                               ; preds = %42
  %46 = load i8, ptr %8, align 1, !tbaa !9
  %47 = sext i8 %46 to i32
  %48 = icmp eq i32 %47, 65
  br i1 %48, label %59, label %49

49:                                               ; preds = %45, %42, %38
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = icmp sge i32 %50, 1
  br i1 %51, label %52, label %66

52:                                               ; preds = %49
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = icmp sle i32 %53, 2
  br i1 %54, label %55, label %66

55:                                               ; preds = %52
  %56 = load i8, ptr %8, align 1, !tbaa !9
  %57 = sext i8 %56 to i32
  %58 = icmp eq i32 %57, 68
  br i1 %58, label %59, label %66

59:                                               ; preds = %55, %45
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %61 unwind label %62

61:                                               ; preds = %59
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  br label %224

62:                                               ; preds = %221, %218, %175, %132, %109, %86, %59, %34
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %4, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  br label %228

66:                                               ; preds = %55, %52, %49
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = icmp sge i32 %67, 3
  br i1 %68, label %69, label %76

69:                                               ; preds = %66
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = icmp sle i32 %70, 20
  br i1 %71, label %72, label %76

72:                                               ; preds = %69
  %73 = load i8, ptr %8, align 1, !tbaa !9
  %74 = sext i8 %73 to i32
  %75 = icmp eq i32 %74, 65
  br i1 %75, label %86, label %76

76:                                               ; preds = %72, %69, %66
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = icmp sge i32 %77, 3
  br i1 %78, label %79, label %89

79:                                               ; preds = %76
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = icmp sle i32 %80, 20
  br i1 %81, label %82, label %89

82:                                               ; preds = %79
  %83 = load i8, ptr %8, align 1, !tbaa !9
  %84 = sext i8 %83 to i32
  %85 = icmp eq i32 %84, 70
  br i1 %85, label %86, label %89

86:                                               ; preds = %82, %72
  %87 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %88 unwind label %62

88:                                               ; preds = %86
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  br label %224

89:                                               ; preds = %82, %79, %76
  %90 = load i32, ptr %2, align 4, !tbaa !5
  %91 = icmp sge i32 %90, 21
  br i1 %91, label %92, label %99

92:                                               ; preds = %89
  %93 = load i32, ptr %2, align 4, !tbaa !5
  %94 = icmp sle i32 %93, 65
  br i1 %94, label %95, label %99

95:                                               ; preds = %92
  %96 = load i8, ptr %8, align 1, !tbaa !9
  %97 = sext i8 %96 to i32
  %98 = icmp eq i32 %97, 65
  br i1 %98, label %109, label %99

99:                                               ; preds = %95, %92, %89
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = icmp sge i32 %100, 21
  br i1 %101, label %102, label %112

102:                                              ; preds = %99
  %103 = load i32, ptr %2, align 4, !tbaa !5
  %104 = icmp sle i32 %103, 65
  br i1 %104, label %105, label %112

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

109:                                              ; preds = %105, %95
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %111 unwind label %62

111:                                              ; preds = %109
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  br label %224

112:                                              ; preds = %105, %102, %99
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = icmp sge i32 %113, 1
  br i1 %114, label %115, label %122

115:                                              ; preds = %112
  %116 = load i32, ptr %2, align 4, !tbaa !5
  %117 = icmp sle i32 %116, 2
  br i1 %117, label %118, label %122

118:                                              ; preds = %115
  %119 = load i8, ptr %8, align 1, !tbaa !9
  %120 = sext i8 %119 to i32
  %121 = icmp eq i32 %120, 66
  br i1 %121, label %132, label %122

122:                                              ; preds = %118, %115, %112
  %123 = load i32, ptr %2, align 4, !tbaa !5
  %124 = icmp sge i32 %123, 1
  br i1 %124, label %125, label %135

125:                                              ; preds = %122
  %126 = load i32, ptr %2, align 4, !tbaa !5
  %127 = icmp sle i32 %126, 2
  br i1 %127, label %128, label %135

128:                                              ; preds = %125
  %129 = load i8, ptr %8, align 1, !tbaa !9
  %130 = sext i8 %129 to i32
  %131 = icmp eq i32 %130, 67
  br i1 %131, label %132, label %135

132:                                              ; preds = %128, %118
  %133 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
          to label %134 unwind label %62

134:                                              ; preds = %132
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  br label %224

135:                                              ; preds = %128, %125, %122
  %136 = load i32, ptr %2, align 4, !tbaa !5
  %137 = icmp sge i32 %136, 3
  br i1 %137, label %138, label %145

138:                                              ; preds = %135
  %139 = load i32, ptr %2, align 4, !tbaa !5
  %140 = icmp sle i32 %139, 20
  br i1 %140, label %141, label %145

141:                                              ; preds = %138
  %142 = load i8, ptr %8, align 1, !tbaa !9
  %143 = sext i8 %142 to i32
  %144 = icmp eq i32 %143, 66
  br i1 %144, label %175, label %145

145:                                              ; preds = %141, %138, %135
  %146 = load i32, ptr %2, align 4, !tbaa !5
  %147 = icmp sge i32 %146, 3
  br i1 %147, label %148, label %155

148:                                              ; preds = %145
  %149 = load i32, ptr %2, align 4, !tbaa !5
  %150 = icmp sle i32 %149, 20
  br i1 %150, label %151, label %155

151:                                              ; preds = %148
  %152 = load i8, ptr %8, align 1, !tbaa !9
  %153 = sext i8 %152 to i32
  %154 = icmp eq i32 %153, 67
  br i1 %154, label %175, label %155

155:                                              ; preds = %151, %148, %145
  %156 = load i32, ptr %2, align 4, !tbaa !5
  %157 = icmp sge i32 %156, 3
  br i1 %157, label %158, label %165

158:                                              ; preds = %155
  %159 = load i32, ptr %2, align 4, !tbaa !5
  %160 = icmp sle i32 %159, 20
  br i1 %160, label %161, label %165

161:                                              ; preds = %158
  %162 = load i8, ptr %8, align 1, !tbaa !9
  %163 = sext i8 %162 to i32
  %164 = icmp eq i32 %163, 68
  br i1 %164, label %175, label %165

165:                                              ; preds = %161, %158, %155
  %166 = load i32, ptr %2, align 4, !tbaa !5
  %167 = icmp sge i32 %166, 3
  br i1 %167, label %168, label %178

168:                                              ; preds = %165
  %169 = load i32, ptr %2, align 4, !tbaa !5
  %170 = icmp sle i32 %169, 20
  br i1 %170, label %171, label %178

171:                                              ; preds = %168
  %172 = load i8, ptr %8, align 1, !tbaa !9
  %173 = sext i8 %172 to i32
  %174 = icmp eq i32 %173, 69
  br i1 %174, label %175, label %178

175:                                              ; preds = %171, %161, %151, %141
  %176 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
          to label %177 unwind label %62

177:                                              ; preds = %175
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  br label %224

178:                                              ; preds = %171, %168, %165
  %179 = load i32, ptr %2, align 4, !tbaa !5
  %180 = icmp sge i32 %179, 21
  br i1 %180, label %181, label %188

181:                                              ; preds = %178
  %182 = load i32, ptr %2, align 4, !tbaa !5
  %183 = icmp sle i32 %182, 65
  br i1 %183, label %184, label %188

184:                                              ; preds = %181
  %185 = load i8, ptr %8, align 1, !tbaa !9
  %186 = sext i8 %185 to i32
  %187 = icmp eq i32 %186, 67
  br i1 %187, label %218, label %188

188:                                              ; preds = %184, %181, %178
  %189 = load i32, ptr %2, align 4, !tbaa !5
  %190 = icmp sge i32 %189, 21
  br i1 %190, label %191, label %198

191:                                              ; preds = %188
  %192 = load i32, ptr %2, align 4, !tbaa !5
  %193 = icmp sle i32 %192, 65
  br i1 %193, label %194, label %198

194:                                              ; preds = %191
  %195 = load i8, ptr %8, align 1, !tbaa !9
  %196 = sext i8 %195 to i32
  %197 = icmp eq i32 %196, 68
  br i1 %197, label %218, label %198

198:                                              ; preds = %194, %191, %188
  %199 = load i32, ptr %2, align 4, !tbaa !5
  %200 = icmp sge i32 %199, 21
  br i1 %200, label %201, label %208

201:                                              ; preds = %198
  %202 = load i32, ptr %2, align 4, !tbaa !5
  %203 = icmp sle i32 %202, 65
  br i1 %203, label %204, label %208

204:                                              ; preds = %201
  %205 = load i8, ptr %8, align 1, !tbaa !9
  %206 = sext i8 %205 to i32
  %207 = icmp eq i32 %206, 71
  br i1 %207, label %218, label %208

208:                                              ; preds = %204, %201, %198
  %209 = load i32, ptr %2, align 4, !tbaa !5
  %210 = icmp sge i32 %209, 21
  br i1 %210, label %211, label %221

211:                                              ; preds = %208
  %212 = load i32, ptr %2, align 4, !tbaa !5
  %213 = icmp sle i32 %212, 65
  br i1 %213, label %214, label %221

214:                                              ; preds = %211
  %215 = load i8, ptr %8, align 1, !tbaa !9
  %216 = sext i8 %215 to i32
  %217 = icmp eq i32 %216, 72
  br i1 %217, label %218, label %221

218:                                              ; preds = %214, %204, %194, %184
  %219 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
          to label %220 unwind label %62

220:                                              ; preds = %218
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  br label %224

221:                                              ; preds = %214, %211, %208
  %222 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
          to label %223 unwind label %62

223:                                              ; preds = %221
  store i32 0, ptr %9, align 4
  br label %224

224:                                              ; preds = %223, %220, %177, %134, %111, %88, %61
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #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
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %225 = load i32, ptr %9, align 4
  switch i32 %225, label %234 [
    i32 0, label %226
    i32 1, label %226
  ]

226:                                              ; preds = %224, %224
  %227 = load i32, ptr %1, align 4
  ret i32 %227

228:                                              ; preds = %62, %30, %22, %18
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %229

229:                                              ; preds = %228
  %230 = load ptr, ptr %4, align 8
  %231 = load i32, ptr %5, align 4
  %232 = insertvalue { ptr, i32 } poison, ptr %230, 0
  %233 = insertvalue { ptr, i32 } %232, i32 %231, 1
  resume { ptr, i32 } %233

234:                                              ; preds = %224
  unreachable
}

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #3

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #5

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

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

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

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

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

!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 = !{!7, !7, i64 0}


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

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %4 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %5 unwind label %12

5:                                                ; preds = %0
  %6 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %7 = icmp eq i64 %6, 2
  br i1 %7, label %8, label %16

8:                                                ; preds = %5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #7
  invoke void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %2, ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 0, i64 noundef 1)
          to label %9 unwind label %14

9:                                                ; preds = %8
  %10 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  %11 = call i32 @atoi(ptr nocapture noundef %10) #8
  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
  br label %22

12:                                               ; preds = %0
  %13 = landingpad { ptr, i32 }
          cleanup
  br label %56

14:                                               ; preds = %8
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #7
  br label %56

16:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  invoke void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %3, ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 0, i64 noundef 2)
          to label %17 unwind label %20

17:                                               ; preds = %16
  %18 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  %19 = call i32 @atoi(ptr nocapture noundef %18) #8
  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 %22

20:                                               ; preds = %16
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  br label %56

22:                                               ; preds = %17, %9
  %.0131 = phi i32 [ %11, %9 ], [ %19, %17 ]
  %23 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %24 = add i64 %23, -1
  %25 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %24)
  %26 = load i8, ptr %25, align 1, !tbaa !5
  %27 = add i32 %.0131, -1
  %or.cond = icmp ult i32 %27, 2
  %28 = icmp eq i8 %26, 65
  %29 = icmp eq i8 %26, 68
  %30 = or i1 %28, %29
  %or.cond141 = select i1 %or.cond, i1 %30, i1 false
  br i1 %or.cond141, label %.invoke, label %33

31:                                               ; preds = %.invoke
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %56

33:                                               ; preds = %22
  %34 = add i32 %.0131, -3
  %or.cond11 = icmp ult i32 %34, 18
  %35 = icmp eq i8 %26, 70
  %36 = or i1 %28, %35
  %or.cond133 = select i1 %or.cond11, i1 %36, i1 false
  br i1 %or.cond133, label %.invoke, label %37

37:                                               ; preds = %33
  %38 = add i32 %.0131, -21
  %or.cond21 = icmp ult i32 %38, 45
  %39 = icmp eq i8 %26, 75
  %40 = or i1 %28, %39
  %or.cond134 = select i1 %or.cond21, i1 %40, i1 false
  br i1 %or.cond134, label %.invoke, label %41

41:                                               ; preds = %37
  %42 = and i8 %26, -2
  %43 = icmp eq i8 %42, 66
  %or.cond142 = select i1 %or.cond, i1 %43, i1 false
  br i1 %or.cond142, label %.invoke, label %44

44:                                               ; preds = %41
  %45 = icmp eq i8 %42, 68
  %46 = or i1 %43, %45
  %or.cond137 = select i1 %or.cond11, i1 %46, i1 false
  br i1 %or.cond137, label %.invoke, label %47

47:                                               ; preds = %44
  %48 = add i8 %26, -67
  %49 = icmp ult i8 %48, 2
  %50 = add i8 %26, -71
  %51 = icmp ult i8 %50, 2
  %52 = or i1 %49, %51
  %or.cond140 = select i1 %or.cond21, i1 %52, i1 false
  %.str.1..str.2 = select i1 %or.cond140, ptr @.str.1, ptr @.str.2
  br label %.invoke

.invoke:                                          ; preds = %22, %47, %44, %41, %37, %33
  %53 = phi ptr [ @.str, %33 ], [ @.str, %37 ], [ @.str.1, %41 ], [ @.str.1, %44 ], [ %.str.1..str.2, %47 ], [ @.str, %22 ]
  %54 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %53)
          to label %55 unwind label %31

55:                                               ; preds = %.invoke
  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
  ret i32 0

56:                                               ; preds = %31, %20, %14, %12
  %.pn = phi { ptr, i32 } [ %32, %31 ], [ %15, %14 ], [ %21, %20 ], [ %13, %12 ]
  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
  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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #5

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

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

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

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

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

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

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


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