; LLVM IR from DionysiosB/CodeForces :: 1000-1099 (1051A-VasyaAndPassword)

; 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

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

14:                                               ; preds = %182, %0
  %15 = load i64, ptr %2, align 8, !tbaa !5
  %16 = add nsw i64 %15, -1
  store i64 %16, ptr %2, align 8, !tbaa !5
  %17 = icmp ne i64 %15, 0
  br i1 %17, label %18, label %185

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  %19 = 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 %20 unwind label %26

20:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !5
  br label %21

21:                                               ; preds = %91, %20
  %22 = load i64, ptr %12, align 8, !tbaa !5
  %23 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  %24 = icmp ult i64 %22, %23
  br i1 %24, label %30, label %25

25:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %94

26:                                               ; preds = %18
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %4, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %5, align 4
  br label %184

30:                                               ; preds = %21
  %31 = load i64, ptr %12, align 8, !tbaa !5
  %32 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %31)
          to label %33 unwind label %48

33:                                               ; preds = %30
  %34 = load i8, ptr %32, align 1, !tbaa !9
  %35 = sext i8 %34 to i32
  %36 = icmp sle i32 65, %35
  br i1 %36, label %37, label %52

37:                                               ; preds = %33
  %38 = load i64, ptr %12, align 8, !tbaa !5
  %39 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %38)
          to label %40 unwind label %48

40:                                               ; preds = %37
  %41 = load i8, ptr %39, align 1, !tbaa !9
  %42 = sext i8 %41 to i32
  %43 = icmp sle i32 %42, 90
  br i1 %43, label %44, label %52

44:                                               ; preds = %40
  %45 = load i64, ptr %6, align 8, !tbaa !5
  %46 = add nsw i64 %45, 1
  store i64 %46, ptr %6, align 8, !tbaa !5
  %47 = load i64, ptr %12, align 8, !tbaa !5
  store i64 %47, ptr %9, align 8, !tbaa !5
  br label %90

48:                                               ; preds = %77, %70, %59, %52, %37, %30
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %4, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %183

52:                                               ; preds = %40, %33
  %53 = load i64, ptr %12, align 8, !tbaa !5
  %54 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %53)
          to label %55 unwind label %48

55:                                               ; preds = %52
  %56 = load i8, ptr %54, align 1, !tbaa !9
  %57 = sext i8 %56 to i32
  %58 = icmp sle i32 97, %57
  br i1 %58, label %59, label %70

59:                                               ; preds = %55
  %60 = load i64, ptr %12, align 8, !tbaa !5
  %61 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %60)
          to label %62 unwind label %48

62:                                               ; preds = %59
  %63 = load i8, ptr %61, align 1, !tbaa !9
  %64 = sext i8 %63 to i32
  %65 = icmp sle i32 %64, 122
  br i1 %65, label %66, label %70

66:                                               ; preds = %62
  %67 = load i64, ptr %7, align 8, !tbaa !5
  %68 = add nsw i64 %67, 1
  store i64 %68, ptr %7, align 8, !tbaa !5
  %69 = load i64, ptr %12, align 8, !tbaa !5
  store i64 %69, ptr %10, align 8, !tbaa !5
  br label %89

70:                                               ; preds = %62, %55
  %71 = load i64, ptr %12, align 8, !tbaa !5
  %72 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %71)
          to label %73 unwind label %48

73:                                               ; preds = %70
  %74 = load i8, ptr %72, align 1, !tbaa !9
  %75 = sext i8 %74 to i32
  %76 = icmp sle i32 48, %75
  br i1 %76, label %77, label %88

77:                                               ; preds = %73
  %78 = load i64, ptr %12, align 8, !tbaa !5
  %79 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %78)
          to label %80 unwind label %48

80:                                               ; preds = %77
  %81 = load i8, ptr %79, align 1, !tbaa !9
  %82 = sext i8 %81 to i32
  %83 = icmp sle i32 %82, 57
  br i1 %83, label %84, label %88

84:                                               ; preds = %80
  %85 = load i64, ptr %8, align 8, !tbaa !5
  %86 = add nsw i64 %85, 1
  store i64 %86, ptr %8, align 8, !tbaa !5
  %87 = load i64, ptr %12, align 8, !tbaa !5
  store i64 %87, ptr %11, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %84, %80, %73
  br label %89

89:                                               ; preds = %88, %66
  br label %90

90:                                               ; preds = %89, %44
  br label %91

91:                                               ; preds = %90
  %92 = load i64, ptr %12, align 8, !tbaa !5
  %93 = add nsw i64 %92, 1
  store i64 %93, ptr %12, align 8, !tbaa !5
  br label %21, !llvm.loop !10

94:                                               ; preds = %25
  %95 = load i64, ptr %6, align 8, !tbaa !5
  %96 = icmp eq i64 %95, 0
  br i1 %96, label %97, label %109

97:                                               ; preds = %94
  %98 = load i64, ptr %7, align 8, !tbaa !5
  %99 = icmp eq i64 %98, 0
  br i1 %99, label %100, label %109

100:                                              ; preds = %97
  %101 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 0)
          to label %102 unwind label %105

102:                                              ; preds = %100
  store i8 65, ptr %101, align 1, !tbaa !9
  %103 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 1)
          to label %104 unwind label %105

104:                                              ; preds = %102
  store i8 97, ptr %103, align 1, !tbaa !9
  br label %178

105:                                              ; preds = %180, %178, %169, %155, %141, %128, %126, %117, %115, %102, %100
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %4, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %5, align 4
  br label %183

109:                                              ; preds = %97, %94
  %110 = load i64, ptr %6, align 8, !tbaa !5
  %111 = icmp eq i64 %110, 0
  br i1 %111, label %112, label %120

112:                                              ; preds = %109
  %113 = load i64, ptr %8, align 8, !tbaa !5
  %114 = icmp eq i64 %113, 0
  br i1 %114, label %115, label %120

115:                                              ; preds = %112
  %116 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 0)
          to label %117 unwind label %105

117:                                              ; preds = %115
  store i8 65, ptr %116, align 1, !tbaa !9
  %118 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 1)
          to label %119 unwind label %105

119:                                              ; preds = %117
  store i8 48, ptr %118, align 1, !tbaa !9
  br label %177

120:                                              ; preds = %112, %109
  %121 = load i64, ptr %7, align 8, !tbaa !5
  %122 = icmp eq i64 %121, 0
  br i1 %122, label %123, label %131

123:                                              ; preds = %120
  %124 = load i64, ptr %8, align 8, !tbaa !5
  %125 = icmp eq i64 %124, 0
  br i1 %125, label %126, label %131

126:                                              ; preds = %123
  %127 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 0)
          to label %128 unwind label %105

128:                                              ; preds = %126
  store i8 48, ptr %127, align 1, !tbaa !9
  %129 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 1)
          to label %130 unwind label %105

130:                                              ; preds = %128
  store i8 97, ptr %129, align 1, !tbaa !9
  br label %176

131:                                              ; preds = %123, %120
  %132 = load i64, ptr %6, align 8, !tbaa !5
  %133 = icmp eq i64 %132, 0
  br i1 %133, label %134, label %145

134:                                              ; preds = %131
  %135 = load i64, ptr %8, align 8, !tbaa !5
  %136 = icmp sgt i64 %135, 1
  br i1 %136, label %137, label %139

137:                                              ; preds = %134
  %138 = load i64, ptr %11, align 8, !tbaa !5
  br label %141

139:                                              ; preds = %134
  %140 = load i64, ptr %10, align 8, !tbaa !5
  br label %141

141:                                              ; preds = %139, %137
  %142 = phi i64 [ %138, %137 ], [ %140, %139 ]
  %143 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %142)
          to label %144 unwind label %105

144:                                              ; preds = %141
  store i8 65, ptr %143, align 1, !tbaa !9
  br label %175

145:                                              ; preds = %131
  %146 = load i64, ptr %7, align 8, !tbaa !5
  %147 = icmp eq i64 %146, 0
  br i1 %147, label %148, label %159

148:                                              ; preds = %145
  %149 = load i64, ptr %8, align 8, !tbaa !5
  %150 = icmp sgt i64 %149, 1
  br i1 %150, label %151, label %153

151:                                              ; preds = %148
  %152 = load i64, ptr %11, align 8, !tbaa !5
  br label %155

153:                                              ; preds = %148
  %154 = load i64, ptr %9, align 8, !tbaa !5
  br label %155

155:                                              ; preds = %153, %151
  %156 = phi i64 [ %152, %151 ], [ %154, %153 ]
  %157 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %156)
          to label %158 unwind label %105

158:                                              ; preds = %155
  store i8 97, ptr %157, align 1, !tbaa !9
  br label %174

159:                                              ; preds = %145
  %160 = load i64, ptr %8, align 8, !tbaa !5
  %161 = icmp eq i64 %160, 0
  br i1 %161, label %162, label %173

162:                                              ; preds = %159
  %163 = load i64, ptr %7, align 8, !tbaa !5
  %164 = icmp sgt i64 %163, 1
  br i1 %164, label %165, label %167

165:                                              ; preds = %162
  %166 = load i64, ptr %10, align 8, !tbaa !5
  br label %169

167:                                              ; preds = %162
  %168 = load i64, ptr %9, align 8, !tbaa !5
  br label %169

169:                                              ; preds = %167, %165
  %170 = phi i64 [ %166, %165 ], [ %168, %167 ]
  %171 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %170)
          to label %172 unwind label %105

172:                                              ; preds = %169
  store i8 48, ptr %171, align 1, !tbaa !9
  br label %173

173:                                              ; preds = %172, %159
  br label %174

174:                                              ; preds = %173, %158
  br label %175

175:                                              ; preds = %174, %144
  br label %176

176:                                              ; preds = %175, %130
  br label %177

177:                                              ; preds = %176, %119
  br label %178

178:                                              ; preds = %177, %104
  %179 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %180 unwind label %105

180:                                              ; preds = %178
  %181 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %179, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %182 unwind label %105

182:                                              ; preds = %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #6
  br label %14, !llvm.loop !12

183:                                              ; preds = %105, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %184

184:                                              ; preds = %183, %26
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %186

185:                                              ; preds = %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  ret i32 0

186:                                              ; preds = %184
  %187 = load ptr, ptr %4, align 8
  %188 = load i32, ptr %5, align 4
  %189 = insertvalue { ptr, i32 } poison, ptr %187, 0
  %190 = insertvalue { ptr, i32 } %189, i32 %188, 1
  resume { ptr, i32 } %190
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 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)) #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 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) #3 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) #5

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

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

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

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

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

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


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

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %3 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %4 = load i64, ptr %1, align 8, !tbaa !5
  %5 = add nsw i64 %4, -1
  store i64 %5, ptr %1, align 8, !tbaa !5
  %.not65 = icmp eq i64 %4, 0
  br i1 %.not65, label %._crit_edge68, label %.lr.ph67

.lr.ph67:                                         ; preds = %0, %72
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  %6 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %.preheader unwind label %10

.preheader:                                       ; preds = %.lr.ph67
  %7 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  %.not69 = icmp eq i64 %7, 0
  br i1 %.not69, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %40, %.preheader
  %.047.lcssa = phi i64 [ 0, %.preheader ], [ %.148, %40 ]
  %.045.lcssa = phi i64 [ 0, %.preheader ], [ %.146, %40 ]
  %.043.lcssa = phi i64 [ 0, %.preheader ], [ %.144, %40 ]
  %.041.lcssa = phi i64 [ 0, %.preheader ], [ %.142, %40 ]
  %.039.lcssa = phi i64 [ 0, %.preheader ], [ %.140, %40 ]
  %.038.lcssa = phi i64 [ 0, %.preheader ], [ %.1, %40 ]
  %8 = icmp eq i64 %.047.lcssa, 0
  %9 = icmp eq i64 %.045.lcssa, 0
  %or.cond = select i1 %8, i1 %9, i1 false
  br i1 %or.cond, label %44, label %48

10:                                               ; preds = %.lr.ph67
  %11 = landingpad { ptr, i32 }
          cleanup
  br label %75

.lr.ph:                                           ; preds = %.preheader, %40
  %.059 = phi i64 [ %41, %40 ], [ 0, %.preheader ]
  %.03858 = phi i64 [ %.1, %40 ], [ 0, %.preheader ]
  %.03957 = phi i64 [ %.140, %40 ], [ 0, %.preheader ]
  %.04156 = phi i64 [ %.142, %40 ], [ 0, %.preheader ]
  %.04355 = phi i64 [ %.144, %40 ], [ 0, %.preheader ]
  %.04554 = phi i64 [ %.146, %40 ], [ 0, %.preheader ]
  %.04753 = phi i64 [ %.148, %40 ], [ 0, %.preheader ]
  %12 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %.059)
  %13 = load i8, ptr %12, align 1, !tbaa !9
  %14 = icmp sgt i8 %13, 64
  br i1 %14, label %15, label %21

15:                                               ; preds = %.lr.ph
  %16 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %.059)
  %17 = load i8, ptr %16, align 1, !tbaa !9
  %18 = icmp slt i8 %17, 91
  br i1 %18, label %19, label %21

19:                                               ; preds = %15
  %20 = add nsw i64 %.04753, 1
  br label %40

21:                                               ; preds = %15, %.lr.ph
  %22 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %.059)
  %23 = load i8, ptr %22, align 1, !tbaa !9
  %24 = icmp sgt i8 %23, 96
  br i1 %24, label %25, label %31

25:                                               ; preds = %21
  %26 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %.059)
  %27 = load i8, ptr %26, align 1, !tbaa !9
  %28 = icmp slt i8 %27, 123
  br i1 %28, label %29, label %31

29:                                               ; preds = %25
  %30 = add nsw i64 %.04554, 1
  br label %40

31:                                               ; preds = %25, %21
  %32 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %.059)
  %33 = load i8, ptr %32, align 1, !tbaa !9
  %34 = icmp sgt i8 %33, 47
  br i1 %34, label %35, label %40

35:                                               ; preds = %31
  %36 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %.059)
  %37 = load i8, ptr %36, align 1, !tbaa !9
  %38 = icmp slt i8 %37, 58
  %39 = zext i1 %38 to i64
  %spec.select = add nsw i64 %.04355, %39
  %spec.select52 = select i1 %38, i64 %.059, i64 %.03858
  br label %40

40:                                               ; preds = %35, %19, %31, %29
  %.148 = phi i64 [ %20, %19 ], [ %.04753, %29 ], [ %.04753, %31 ], [ %.04753, %35 ]
  %.146 = phi i64 [ %.04554, %19 ], [ %30, %29 ], [ %.04554, %31 ], [ %.04554, %35 ]
  %.144 = phi i64 [ %.04355, %19 ], [ %.04355, %29 ], [ %.04355, %31 ], [ %spec.select, %35 ]
  %.142 = phi i64 [ %.059, %19 ], [ %.04156, %29 ], [ %.04156, %31 ], [ %.04156, %35 ]
  %.140 = phi i64 [ %.03957, %19 ], [ %.059, %29 ], [ %.03957, %31 ], [ %.03957, %35 ]
  %.1 = phi i64 [ %.03858, %19 ], [ %.03858, %29 ], [ %.03858, %31 ], [ %spec.select52, %35 ]
  %41 = add nuw nsw i64 %.059, 1
  %42 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  %43 = icmp ult i64 %41, %42
  br i1 %43, label %.lr.ph, label %._crit_edge, !llvm.loop !10

44:                                               ; preds = %._crit_edge
  %45 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  store i8 65, ptr %45, align 1, !tbaa !9
  br label %.sink.split

46:                                               ; preds = %70, %68
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %75

48:                                               ; preds = %._crit_edge
  %49 = icmp eq i64 %.043.lcssa, 0
  %or.cond3 = select i1 %8, i1 %49, i1 false
  br i1 %or.cond3, label %50, label %52

50:                                               ; preds = %48
  %51 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  store i8 65, ptr %51, align 1, !tbaa !9
  br label %.sink.split

52:                                               ; preds = %48
  %or.cond5 = select i1 %9, i1 %49, i1 false
  br i1 %or.cond5, label %53, label %55

53:                                               ; preds = %52
  %54 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  store i8 48, ptr %54, align 1, !tbaa !9
  br label %.sink.split

55:                                               ; preds = %52
  br i1 %8, label %56, label %59

56:                                               ; preds = %55
  %57 = icmp sgt i64 %.043.lcssa, 1
  %58 = select i1 %57, i64 %.038.lcssa, i64 %.039.lcssa
  br label %.sink.split

59:                                               ; preds = %55
  br i1 %9, label %60, label %63

60:                                               ; preds = %59
  %61 = icmp sgt i64 %.043.lcssa, 1
  %62 = select i1 %61, i64 %.038.lcssa, i64 %.041.lcssa
  br label %.sink.split

63:                                               ; preds = %59
  br i1 %49, label %64, label %68

64:                                               ; preds = %63
  %65 = icmp sgt i64 %.045.lcssa, 1
  %66 = select i1 %65, i64 %.039.lcssa, i64 %.041.lcssa
  br label %.sink.split

.sink.split:                                      ; preds = %44, %53, %60, %64, %56, %50
  %.sink71 = phi i64 [ 1, %50 ], [ %58, %56 ], [ %66, %64 ], [ %62, %60 ], [ 1, %53 ], [ 1, %44 ]
  %.sink = phi i8 [ 48, %50 ], [ 65, %56 ], [ 48, %64 ], [ 97, %60 ], [ 97, %53 ], [ 97, %44 ]
  %67 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %.sink71)
  store i8 %.sink, ptr %67, align 1, !tbaa !9
  br label %68

68:                                               ; preds = %.sink.split, %63
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %70 unwind label %46

70:                                               ; preds = %68
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %72 unwind label %46

72:                                               ; preds = %70
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  %73 = load i64, ptr %1, align 8, !tbaa !5
  %74 = add nsw i64 %73, -1
  store i64 %74, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %73, 0
  br i1 %.not, label %._crit_edge68, label %.lr.ph67, !llvm.loop !12

75:                                               ; preds = %46, %10
  %.pn = phi { ptr, i32 } [ %47, %46 ], [ %11, %10 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn

._crit_edge68:                                    ; preds = %72, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 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 #4

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 #3 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 #3 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

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

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

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

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

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

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


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