; LLVM IR from DionysiosB/CodeForces :: 2050C-UninterestingNumber (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 [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 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 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 i32, align 4
  %11 = alloca i8, align 1
  store i32 0, ptr %1, align 4
  %12 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  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 = %185, %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 %192

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
  br label %21

21:                                               ; preds = %51, %20
  %22 = load i64, ptr %9, 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 %9) #6
  br label %58

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 %191

30:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %31 = load i64, ptr %9, 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 %54

33:                                               ; preds = %30
  %34 = load i8, ptr %32, align 1, !tbaa !9
  %35 = sext i8 %34 to i32
  %36 = sub nsw i32 %35, 48
  store i32 %36, ptr %10, align 4, !tbaa !10
  %37 = load i32, ptr %10, align 4, !tbaa !10
  %38 = sext i32 %37 to i64
  %39 = load i64, ptr %8, align 8, !tbaa !5
  %40 = add nsw i64 %39, %38
  store i64 %40, ptr %8, align 8, !tbaa !5
  %41 = load i32, ptr %10, align 4, !tbaa !10
  %42 = icmp eq i32 %41, 2
  %43 = zext i1 %42 to i64
  %44 = load i64, ptr %6, align 8, !tbaa !5
  %45 = add nsw i64 %44, %43
  store i64 %45, ptr %6, align 8, !tbaa !5
  %46 = load i32, ptr %10, align 4, !tbaa !10
  %47 = icmp eq i32 %46, 3
  %48 = zext i1 %47 to i64
  %49 = load i64, ptr %7, align 8, !tbaa !5
  %50 = add nsw i64 %49, %48
  store i64 %50, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %51

51:                                               ; preds = %33
  %52 = load i64, ptr %9, align 8, !tbaa !5
  %53 = add nsw i64 %52, 1
  store i64 %53, ptr %9, align 8, !tbaa !5
  br label %21, !llvm.loop !12

54:                                               ; preds = %30
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %4, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %190

58:                                               ; preds = %25
  %59 = load i64, ptr %8, align 8, !tbaa !5
  %60 = srem i64 %59, 9
  store i64 %60, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #6
  store i8 0, ptr %11, align 1, !tbaa !14
  %61 = load i64, ptr %8, align 8, !tbaa !5
  %62 = icmp ne i64 %61, 0
  br i1 %62, label %64, label %63

63:                                               ; preds = %58
  store i8 1, ptr %11, align 1, !tbaa !14
  br label %177

64:                                               ; preds = %58
  %65 = load i64, ptr %8, align 8, !tbaa !5
  %66 = icmp eq i64 %65, 1
  br i1 %66, label %67, label %77

67:                                               ; preds = %64
  %68 = load i64, ptr %6, align 8, !tbaa !5
  %69 = icmp sgt i64 %68, 3
  br i1 %69, label %76, label %70

70:                                               ; preds = %67
  %71 = load i64, ptr %6, align 8, !tbaa !5
  %72 = icmp sgt i64 %71, 0
  br i1 %72, label %73, label %77

73:                                               ; preds = %70
  %74 = load i64, ptr %7, align 8, !tbaa !5
  %75 = icmp sgt i64 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %73, %67
  store i8 1, ptr %11, align 1, !tbaa !14
  br label %176

77:                                               ; preds = %73, %70, %64
  %78 = load i64, ptr %8, align 8, !tbaa !5
  %79 = icmp eq i64 %78, 2
  br i1 %79, label %80, label %96

80:                                               ; preds = %77
  %81 = load i64, ptr %6, align 8, !tbaa !5
  %82 = icmp sge i64 %81, 8
  br i1 %82, label %95, label %83

83:                                               ; preds = %80
  %84 = load i64, ptr %6, align 8, !tbaa !5
  %85 = icmp sge i64 %84, 5
  br i1 %85, label %86, label %89

86:                                               ; preds = %83
  %87 = load i64, ptr %7, align 8, !tbaa !5
  %88 = icmp sge i64 %87, 1
  br i1 %88, label %95, label %89

89:                                               ; preds = %86, %83
  %90 = load i64, ptr %6, align 8, !tbaa !5
  %91 = icmp sge i64 %90, 2
  br i1 %91, label %92, label %96

92:                                               ; preds = %89
  %93 = load i64, ptr %7, align 8, !tbaa !5
  %94 = icmp sge i64 %93, 2
  br i1 %94, label %95, label %96

95:                                               ; preds = %92, %86, %80
  store i8 1, ptr %11, align 1, !tbaa !14
  br label %175

96:                                               ; preds = %92, %89, %77
  %97 = load i64, ptr %8, align 8, !tbaa !5
  %98 = icmp eq i64 %97, 3
  br i1 %98, label %99, label %106

99:                                               ; preds = %96
  %100 = load i64, ptr %6, align 8, !tbaa !5
  %101 = icmp sge i64 %100, 3
  br i1 %101, label %105, label %102

102:                                              ; preds = %99
  %103 = load i64, ptr %7, align 8, !tbaa !5
  %104 = icmp sge i64 %103, 1
  br i1 %104, label %105, label %106

105:                                              ; preds = %102, %99
  store i8 1, ptr %11, align 1, !tbaa !14
  br label %174

106:                                              ; preds = %102, %96
  %107 = load i64, ptr %8, align 8, !tbaa !5
  %108 = icmp eq i64 %107, 4
  br i1 %108, label %109, label %125

109:                                              ; preds = %106
  %110 = load i64, ptr %6, align 8, !tbaa !5
  %111 = icmp sge i64 %110, 7
  br i1 %111, label %124, label %112

112:                                              ; preds = %109
  %113 = load i64, ptr %6, align 8, !tbaa !5
  %114 = icmp sge i64 %113, 4
  br i1 %114, label %115, label %118

115:                                              ; preds = %112
  %116 = load i64, ptr %7, align 8, !tbaa !5
  %117 = icmp sge i64 %116, 1
  br i1 %117, label %124, label %118

118:                                              ; preds = %115, %112
  %119 = load i64, ptr %6, align 8, !tbaa !5
  %120 = icmp sge i64 %119, 1
  br i1 %120, label %121, label %125

121:                                              ; preds = %118
  %122 = load i64, ptr %7, align 8, !tbaa !5
  %123 = icmp sge i64 %122, 2
  br i1 %123, label %124, label %125

124:                                              ; preds = %121, %115, %109
  store i8 1, ptr %11, align 1, !tbaa !14
  br label %173

125:                                              ; preds = %121, %118, %106
  %126 = load i64, ptr %8, align 8, !tbaa !5
  %127 = icmp eq i64 %126, 5
  br i1 %127, label %128, label %132

128:                                              ; preds = %125
  %129 = load i64, ptr %6, align 8, !tbaa !5
  %130 = icmp sge i64 %129, 2
  br i1 %130, label %131, label %132

131:                                              ; preds = %128
  store i8 1, ptr %11, align 1, !tbaa !14
  br label %172

132:                                              ; preds = %128, %125
  %133 = load i64, ptr %8, align 8, !tbaa !5
  %134 = icmp eq i64 %133, 6
  br i1 %134, label %135, label %148

135:                                              ; preds = %132
  %136 = load i64, ptr %6, align 8, !tbaa !5
  %137 = icmp sge i64 %136, 6
  br i1 %137, label %147, label %138

138:                                              ; preds = %135
  %139 = load i64, ptr %6, align 8, !tbaa !5
  %140 = icmp sge i64 %139, 3
  br i1 %140, label %141, label %144

141:                                              ; preds = %138
  %142 = load i64, ptr %7, align 8, !tbaa !5
  %143 = icmp sge i64 %142, 1
  br i1 %143, label %147, label %144

144:                                              ; preds = %141, %138
  %145 = load i64, ptr %7, align 8, !tbaa !5
  %146 = icmp sge i64 %145, 2
  br i1 %146, label %147, label %148

147:                                              ; preds = %144, %141, %135
  store i8 1, ptr %11, align 1, !tbaa !14
  br label %171

148:                                              ; preds = %144, %132
  %149 = load i64, ptr %8, align 8, !tbaa !5
  %150 = icmp eq i64 %149, 7
  br i1 %150, label %151, label %155

151:                                              ; preds = %148
  %152 = load i64, ptr %6, align 8, !tbaa !5
  %153 = icmp sgt i64 %152, 0
  br i1 %153, label %154, label %155

154:                                              ; preds = %151
  store i8 1, ptr %11, align 1, !tbaa !14
  br label %170

155:                                              ; preds = %151, %148
  %156 = load i64, ptr %8, align 8, !tbaa !5
  %157 = icmp eq i64 %156, 8
  br i1 %157, label %158, label %168

158:                                              ; preds = %155
  %159 = load i64, ptr %6, align 8, !tbaa !5
  %160 = icmp sge i64 %159, 5
  br i1 %160, label %167, label %161

161:                                              ; preds = %158
  %162 = load i64, ptr %6, align 8, !tbaa !5
  %163 = icmp sge i64 %162, 2
  br i1 %163, label %164, label %168

164:                                              ; preds = %161
  %165 = load i64, ptr %7, align 8, !tbaa !5
  %166 = icmp sge i64 %165, 1
  br i1 %166, label %167, label %168

167:                                              ; preds = %164, %158
  store i8 1, ptr %11, align 1, !tbaa !14
  br label %169

168:                                              ; preds = %164, %161, %155
  store i8 0, ptr %11, align 1, !tbaa !14
  br label %169

169:                                              ; preds = %168, %167
  br label %170

170:                                              ; preds = %169, %154
  br label %171

171:                                              ; preds = %170, %147
  br label %172

172:                                              ; preds = %171, %131
  br label %173

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

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

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

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

177:                                              ; preds = %176, %63
  %178 = load i8, ptr %11, align 1, !tbaa !14, !range !16, !noundef !17
  %179 = trunc i8 %178 to i1
  %180 = zext i1 %179 to i64
  %181 = select i1 %179, ptr @.str, ptr @.str.1
  %182 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %181)
          to label %183 unwind label %186

183:                                              ; preds = %177
  %184 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %182, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %185 unwind label %186

185:                                              ; preds = %183
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #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 !18

186:                                              ; preds = %183, %177
  %187 = landingpad { ptr, i32 }
          cleanup
  %188 = extractvalue { ptr, i32 } %187, 0
  store ptr %188, ptr %4, align 8
  %189 = extractvalue { ptr, i32 } %187, 1
  store i32 %189, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  br label %190

190:                                              ; preds = %186, %54
  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 %191

191:                                              ; preds = %190, %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 %194

192:                                              ; preds = %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %193 = load i32, ptr %1, align 4
  ret i32 %193

194:                                              ; preds = %191
  %195 = load ptr, ptr %4, align 8
  %196 = load i32, ptr %5, align 4
  %197 = insertvalue { ptr, i32 } poison, ptr %195, 0
  %198 = insertvalue { ptr, i32 } %197, i32 %196, 1
  resume { ptr, i32 } %198
}

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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) #5

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

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

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

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

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

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


; 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 [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 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 i64, align 8
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %5 = load i64, ptr %1, align 8, !tbaa !5
  %6 = add nsw i64 %5, -1
  store i64 %6, ptr %1, align 8, !tbaa !5
  %.not89 = icmp eq i64 %5, 0
  br i1 %.not89, label %._crit_edge92, label %.lr.ph91

.lr.ph91:                                         ; preds = %0, %73
  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
  %7 = 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.ph91
  %8 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  %.not93 = icmp eq i64 %8, 0
  br i1 %.not93, label %._crit_edge.thread, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  %9 = srem i64 %17, 9
  switch i64 %9, label %51 [
    i64 0, label %._crit_edge.thread
    i64 1, label %27
    i64 2, label %32
    i64 3, label %40
    i64 4, label %43
  ]

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

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.06886 = phi i64 [ %24, %.lr.ph ], [ 0, %.preheader ]
  %.06985 = phi i64 [ %17, %.lr.ph ], [ 0, %.preheader ]
  %.07084 = phi i64 [ %23, %.lr.ph ], [ 0, %.preheader ]
  %.07183 = phi i64 [ %20, %.lr.ph ], [ 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 %.06886)
  %13 = load i8, ptr %12, align 1, !tbaa !9
  %14 = sext i8 %13 to i32
  %15 = add nsw i32 %14, -48
  %16 = sext i32 %15 to i64
  %17 = add nsw i64 %.06985, %16
  %18 = icmp eq i32 %15, 2
  %19 = zext i1 %18 to i64
  %20 = add nuw nsw i64 %.07183, %19
  %21 = icmp eq i32 %15, 3
  %22 = zext i1 %21 to i64
  %23 = add nuw nsw i64 %.07084, %22
  %24 = add nuw nsw i64 %.06886, 1
  %25 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  %26 = icmp ult i64 %24, %25
  br i1 %26, label %.lr.ph, label %._crit_edge, !llvm.loop !10

27:                                               ; preds = %._crit_edge
  %28 = icmp ugt i64 %20, 3
  br i1 %28, label %._crit_edge.thread, label %29

29:                                               ; preds = %27
  %30 = icmp ne i64 %20, 0
  %31 = icmp ne i64 %23, 0
  %or.cond = select i1 %30, i1 %31, i1 false
  br i1 %or.cond, label %._crit_edge.thread, label %.thread82

32:                                               ; preds = %._crit_edge
  %33 = icmp ugt i64 %20, 7
  br i1 %33, label %._crit_edge.thread, label %34

34:                                               ; preds = %32
  %35 = icmp ugt i64 %20, 4
  %36 = icmp ne i64 %23, 0
  %or.cond3 = select i1 %35, i1 %36, i1 false
  br i1 %or.cond3, label %._crit_edge.thread, label %37

37:                                               ; preds = %34
  %38 = icmp ugt i64 %20, 1
  %39 = icmp ugt i64 %23, 1
  %or.cond5 = select i1 %38, i1 %39, i1 false
  br i1 %or.cond5, label %._crit_edge.thread, label %.thread82

40:                                               ; preds = %._crit_edge
  %41 = icmp ugt i64 %20, 2
  %42 = icmp ne i64 %23, 0
  %or.cond7 = select i1 %41, i1 true, i1 %42
  br i1 %or.cond7, label %._crit_edge.thread, label %.thread82

43:                                               ; preds = %._crit_edge
  %44 = icmp ugt i64 %20, 6
  br i1 %44, label %._crit_edge.thread, label %45

45:                                               ; preds = %43
  %46 = icmp ugt i64 %20, 3
  %47 = icmp ne i64 %23, 0
  %or.cond9 = select i1 %46, i1 %47, i1 false
  br i1 %or.cond9, label %._crit_edge.thread, label %48

48:                                               ; preds = %45
  %49 = icmp ne i64 %20, 0
  %50 = icmp ugt i64 %23, 1
  %or.cond11 = select i1 %49, i1 %50, i1 false
  br i1 %or.cond11, label %._crit_edge.thread, label %.thread82

51:                                               ; preds = %._crit_edge
  %52 = icmp eq i64 %9, 5
  %53 = icmp ugt i64 %20, 1
  %or.cond13 = select i1 %52, i1 %53, i1 false
  br i1 %or.cond13, label %._crit_edge.thread, label %54

54:                                               ; preds = %51
  %55 = icmp eq i64 %9, 6
  br i1 %55, label %56, label %62

56:                                               ; preds = %54
  %57 = icmp ugt i64 %20, 5
  br i1 %57, label %._crit_edge.thread, label %58

58:                                               ; preds = %56
  %59 = icmp ugt i64 %20, 2
  %60 = icmp ne i64 %23, 0
  %or.cond15 = select i1 %59, i1 %60, i1 false
  %61 = icmp ugt i64 %23, 1
  %or.cond17 = select i1 %or.cond15, i1 true, i1 %61
  br i1 %or.cond17, label %._crit_edge.thread, label %.thread82

62:                                               ; preds = %54
  %63 = icmp eq i64 %9, 7
  %64 = icmp ne i64 %20, 0
  %or.cond19 = select i1 %63, i1 %64, i1 false
  br i1 %or.cond19, label %._crit_edge.thread, label %65

65:                                               ; preds = %62
  %66 = icmp eq i64 %9, 8
  br i1 %66, label %67, label %.thread82

67:                                               ; preds = %65
  %68 = icmp ugt i64 %20, 4
  %69 = icmp ne i64 %23, 0
  %or.cond21 = select i1 %53, i1 %69, i1 false
  %or.cond76 = select i1 %68, i1 true, i1 %or.cond21
  br i1 %or.cond76, label %._crit_edge.thread, label %.thread82

.thread82:                                        ; preds = %58, %48, %29, %37, %40, %67, %65
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.preheader, %67, %62, %56, %58, %51, %43, %45, %48, %._crit_edge, %40, %32, %34, %37, %27, %29, %.thread82
  %.0 = phi ptr [ @.str.1, %.thread82 ], [ @.str, %._crit_edge ], [ @.str, %29 ], [ @.str, %27 ], [ @.str, %37 ], [ @.str, %34 ], [ @.str, %32 ], [ @.str, %40 ], [ @.str, %48 ], [ @.str, %45 ], [ @.str, %43 ], [ @.str, %51 ], [ @.str, %58 ], [ @.str, %56 ], [ @.str, %62 ], [ @.str, %67 ], [ @.str, %.preheader ]
  %70 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.0)
          to label %71 unwind label %76

71:                                               ; preds = %._crit_edge.thread
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %73 unwind label %76

73:                                               ; preds = %71
  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
  %74 = load i64, ptr %1, align 8, !tbaa !5
  %75 = add nsw i64 %74, -1
  store i64 %75, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %74, 0
  br i1 %.not, label %._crit_edge92, label %.lr.ph91, !llvm.loop !12

76:                                               ; preds = %71, %._crit_edge.thread
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %78

78:                                               ; preds = %76, %10
  %.pn = phi { ptr, i32 } [ %77, %76 ], [ %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_edge92:                                    ; preds = %73, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0
}

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 #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 #3 align 2

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

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

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

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

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


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