; LLVM IR from upupming/algorithm :: AdvancedLevel_C++/1082. Read Number in Chinese (25)  (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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::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" }

@_Z3numB5cxx11 = external dso_local global [10 x %"class.std::__cxx11::basic_string"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_Z1cB5cxx11 = external dso_local global [6 x %"class.std::__cxx11::basic_string"], align 16
@J = external dso_local global [9 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.20 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca [3 x i32], align 4
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %17

15:                                               ; preds = %0
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %172

17:                                               ; preds = %0
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = icmp slt i32 %18, 0
  br i1 %19, label %20, label %24

20:                                               ; preds = %17
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.20)
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sub nsw i32 0, %22
  store i32 %23, ptr %2, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %20, %17
  call void @llvm.lifetime.start.p0(i64 12, ptr %4) #4
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sdiv i32 %25, 100000000
  %27 = getelementptr inbounds [3 x i32], ptr %4, i64 0, i64 0
  store i32 %26, ptr %27, align 4, !tbaa !5
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = srem i32 %28, 100000000
  %30 = sdiv i32 %29, 10000
  %31 = getelementptr inbounds [3 x i32], ptr %4, i64 0, i64 1
  store i32 %30, ptr %31, align 4, !tbaa !5
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = srem i32 %32, 10000
  %34 = getelementptr inbounds [3 x i32], ptr %4, i64 0, i64 2
  store i32 %33, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #4
  store i8 0, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %168, %24
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = icmp slt i32 %36, 3
  br i1 %37, label %39, label %38

38:                                               ; preds = %35
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %171

39:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [3 x i32], ptr %4, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  store i32 %43, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 3, ptr %9, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %148, %39
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = icmp sge i32 %45, 0
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %151

48:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = mul nsw i32 %49, 4
  %51 = sub nsw i32 8, %50
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = add nsw i32 %51, %52
  store i32 %53, ptr %10, align 4, !tbaa !5
  %54 = load i32, ptr %10, align 4, !tbaa !5
  %55 = icmp sge i32 %54, 9
  br i1 %55, label %56, label %57

56:                                               ; preds = %48
  store i32 7, ptr %3, align 4
  br label %145

57:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %58 = load i32, ptr %8, align 4, !tbaa !5
  %59 = load i32, ptr %9, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [9 x i32], ptr @J, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sdiv i32 %58, %62
  %64 = srem i32 %63, 10
  store i32 %64, ptr %11, align 4, !tbaa !5
  %65 = load i32, ptr %11, align 4, !tbaa !5
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %128

67:                                               ; preds = %57
  %68 = load i8, ptr %5, align 1, !tbaa !9, !range !11, !noundef !12
  %69 = trunc i8 %68 to i1
  br i1 %69, label %70, label %80

70:                                               ; preds = %67
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %6, align 4, !tbaa !5
  %73 = icmp eq i32 %71, 0
  br i1 %73, label %74, label %76

74:                                               ; preds = %70
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  br label %78

76:                                               ; preds = %70
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.21)
  br label %78

78:                                               ; preds = %76, %74
  %79 = phi ptr [ %75, %74 ], [ %77, %76 ]
  store i8 0, ptr %5, align 1, !tbaa !9
  br label %80

80:                                               ; preds = %78, %67
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %83, label %100

83:                                               ; preds = %80
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %6, align 4, !tbaa !5
  %86 = icmp eq i32 %84, 0
  br i1 %86, label %87, label %92

87:                                               ; preds = %83
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [10 x %"class.std::__cxx11::basic_string"], ptr @_Z3numB5cxx11, i64 0, i64 %89
  %91 = call 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) %90)
  br label %98

92:                                               ; preds = %83
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 32)
  %94 = load i32, ptr %11, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [10 x %"class.std::__cxx11::basic_string"], ptr @_Z3numB5cxx11, i64 0, i64 %95
  %97 = call 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) %93, ptr noundef nonnull align 8 dereferenceable(32) %96)
  br label %98

98:                                               ; preds = %92, %87
  %99 = phi ptr [ %91, %87 ], [ %97, %92 ]
  br label %127

100:                                              ; preds = %80
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %6, align 4, !tbaa !5
  %103 = icmp eq i32 %101, 0
  br i1 %103, label %104, label %114

104:                                              ; preds = %100
  %105 = load i32, ptr %11, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [10 x %"class.std::__cxx11::basic_string"], ptr @_Z3numB5cxx11, i64 0, i64 %106
  %108 = call 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) %107)
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %108, i8 noundef signext 32)
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [6 x %"class.std::__cxx11::basic_string"], ptr @_Z1cB5cxx11, i64 0, i64 %111
  %113 = call 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) %109, ptr noundef nonnull align 8 dereferenceable(32) %112)
  br label %125

114:                                              ; preds = %100
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 32)
  %116 = load i32, ptr %11, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [10 x %"class.std::__cxx11::basic_string"], ptr @_Z3numB5cxx11, i64 0, i64 %117
  %119 = call 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) %115, ptr noundef nonnull align 8 dereferenceable(32) %118)
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %119, i8 noundef signext 32)
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [6 x %"class.std::__cxx11::basic_string"], ptr @_Z1cB5cxx11, i64 0, i64 %122
  %124 = call 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) %120, ptr noundef nonnull align 8 dereferenceable(32) %123)
  br label %125

125:                                              ; preds = %114, %104
  %126 = phi ptr [ %113, %104 ], [ %124, %114 ]
  br label %127

127:                                              ; preds = %125, %98
  br label %144

128:                                              ; preds = %57
  %129 = load i8, ptr %5, align 1, !tbaa !9, !range !11, !noundef !12
  %130 = trunc i8 %129 to i1
  br i1 %130, label %143, label %131

131:                                              ; preds = %128
  %132 = load i32, ptr %9, align 4, !tbaa !5
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %143

134:                                              ; preds = %131
  %135 = load i32, ptr %2, align 4, !tbaa !5
  %136 = load i32, ptr %10, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [9 x i32], ptr @J, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = sdiv i32 %135, %139
  %141 = icmp sge i32 %140, 10
  br i1 %141, label %142, label %143

142:                                              ; preds = %134
  store i8 1, ptr %5, align 1, !tbaa !9
  br label %143

143:                                              ; preds = %142, %134, %131, %128
  br label %144

144:                                              ; preds = %143, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  store i32 0, ptr %3, align 4
  br label %145

145:                                              ; preds = %144, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %146 = load i32, ptr %3, align 4
  switch i32 %146, label %174 [
    i32 0, label %147
    i32 7, label %148
  ]

147:                                              ; preds = %145
  br label %148

148:                                              ; preds = %147, %145
  %149 = load i32, ptr %9, align 4, !tbaa !5
  %150 = add nsw i32 %149, -1
  store i32 %150, ptr %9, align 4, !tbaa !5
  br label %44, !llvm.loop !13

151:                                              ; preds = %47
  %152 = load i32, ptr %7, align 4, !tbaa !5
  %153 = icmp ne i32 %152, 2
  br i1 %153, label %154, label %167

154:                                              ; preds = %151
  %155 = load i32, ptr %7, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [3 x i32], ptr %4, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = icmp sgt i32 %158, 0
  br i1 %159, label %160, label %167

160:                                              ; preds = %154
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 32)
  %162 = load i32, ptr %7, align 4, !tbaa !5
  %163 = add nsw i32 %162, 4
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [6 x %"class.std::__cxx11::basic_string"], ptr @_Z1cB5cxx11, i64 0, i64 %164
  %166 = call 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) %161, ptr noundef nonnull align 8 dereferenceable(32) %165)
  br label %167

167:                                              ; preds = %160, %154, %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %7, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %7, align 4, !tbaa !5
  br label %35, !llvm.loop !15

171:                                              ; preds = %38
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #4
  br label %172

172:                                              ; preds = %171, %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %173 = load i32, ptr %1, align 4
  ret i32 %173

174:                                              ; preds = %145
  unreachable
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #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) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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 #4 = { nounwind }

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

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


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::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" }

@_Z3numB5cxx11 = external dso_local global [10 x %"class.std::__cxx11::basic_string"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_Z1cB5cxx11 = external dso_local global [6 x %"class.std::__cxx11::basic_string"], align 16
@J = external dso_local local_unnamed_addr global [9 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.20 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca [3 x i32], align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %3 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %5 = icmp eq i32 %4, 0
  br i1 %5, label %6, label %8

6:                                                ; preds = %0
  %7 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  br label %86

8:                                                ; preds = %0
  %9 = icmp slt i32 %4, 0
  br i1 %9, label %10, label %14

10:                                               ; preds = %8
  %11 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.20)
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = sub nsw i32 0, %12
  store i32 %13, ptr %1, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %10, %8
  %15 = phi i32 [ %13, %10 ], [ %4, %8 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #4
  %16 = sdiv i32 %15, 100000000
  store i32 %16, ptr %2, align 4, !tbaa !5
  %17 = srem i32 %15, 100000000
  %18 = sdiv i32 %17, 10000
  %19 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 %18, ptr %19, align 4, !tbaa !5
  %20 = srem i32 %15, 10000
  %21 = getelementptr inbounds i8, ptr %2, i64 8
  store i32 %20, ptr %21, align 4, !tbaa !5
  br label %23

22:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #4
  br label %86

23:                                               ; preds = %14, %85
  %indvars.iv50 = phi i64 [ 0, %14 ], [ %indvars.iv.next51, %85 ]
  %.03148 = phi i8 [ 0, %14 ], [ %.474, %85 ]
  %.03346 = phi i32 [ 0, %14 ], [ %.43773, %85 ]
  %24 = getelementptr inbounds [3 x i32], ptr %2, i64 0, i64 %indvars.iv50
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = shl nuw nsw i64 %indvars.iv50, 2
  br label %31

.thread68.sink.split:                             ; preds = %52, %.thread58
  %.sink = phi ptr [ %54, %.thread58 ], [ @_ZSt4cout, %52 ]
  %.474.ph = phi i8 [ %.25661, %.thread58 ], [ %.2, %52 ]
  %.43773.ph = phi i32 [ %53, %.thread58 ], [ 1, %52 ]
  %27 = sext i32 %39 to i64
  %28 = getelementptr inbounds [10 x %"class.std::__cxx11::basic_string"], ptr @_Z3numB5cxx11, i64 0, i64 %27
  %29 = call 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) %.sink, ptr noundef nonnull align 8 dereferenceable(32) %28)
  br label %.thread68

.thread68:                                        ; preds = %79, %.thread68.sink.split
  %.474 = phi i8 [ %.474.ph, %.thread68.sink.split ], [ %.4, %79 ]
  %.43773 = phi i32 [ %.43773.ph, %.thread68.sink.split ], [ %.437, %79 ]
  %.not40 = icmp ne i64 %indvars.iv50, 2
  %30 = icmp sgt i32 %25, 0
  %or.cond = select i1 %.not40, i1 %30, i1 false
  br i1 %or.cond, label %80, label %85

31:                                               ; preds = %23, %79
  %indvars.iv = phi i64 [ 3, %23 ], [ %indvars.iv.next, %79 ]
  %.144 = phi i8 [ %.03148, %23 ], [ %.4, %79 ]
  %.13443 = phi i32 [ %.03346, %23 ], [ %.437, %79 ]
  %32 = sub nsw i64 %indvars.iv, %26
  %33 = add nsw i64 %32, 8
  %34 = icmp ugt i64 %33, 8
  br i1 %34, label %79, label %35

35:                                               ; preds = %31
  %36 = getelementptr inbounds [9 x i32], ptr @J, i64 0, i64 %indvars.iv
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = sdiv i32 %25, %37
  %39 = srem i32 %38, 10
  %.not41 = icmp eq i32 %39, 0
  %40 = trunc i8 %.144 to i1
  br i1 %.not41, label %71, label %41

41:                                               ; preds = %35
  br i1 %40, label %42, label %47

42:                                               ; preds = %41
  %43 = icmp eq i32 %.13443, 0
  br i1 %43, label %.thread, label %44

44:                                               ; preds = %42
  %45 = add nsw i32 %.13443, 1
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.21)
  br label %47

47:                                               ; preds = %44, %41
  %.235 = phi i32 [ %.13443, %41 ], [ %45, %44 ]
  %.2 = phi i8 [ %.144, %41 ], [ 0, %44 ]
  %48 = icmp eq i64 %indvars.iv, 0
  %49 = icmp eq i32 %.235, 0
  br i1 %48, label %52, label %55

.thread:                                          ; preds = %42
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %51 = icmp eq i64 %indvars.iv, 0
  br i1 %51, label %.thread58, label %.thread63

52:                                               ; preds = %47
  br i1 %49, label %.thread68.sink.split, label %.thread58

.thread58:                                        ; preds = %.thread, %52
  %.2355462 = phi i32 [ %.235, %52 ], [ 1, %.thread ]
  %.25661 = phi i8 [ %.2, %52 ], [ 0, %.thread ]
  %53 = add nsw i32 %.2355462, 1
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 32)
  br label %.thread68.sink.split

55:                                               ; preds = %47
  br i1 %49, label %56, label %.thread63

56:                                               ; preds = %55
  %57 = sext i32 %39 to i64
  %58 = getelementptr inbounds [10 x %"class.std::__cxx11::basic_string"], ptr @_Z3numB5cxx11, i64 0, i64 %57
  %59 = call 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) %58)
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %59, i8 noundef signext 32)
  %61 = getelementptr inbounds [6 x %"class.std::__cxx11::basic_string"], ptr @_Z1cB5cxx11, i64 0, i64 %indvars.iv
  %62 = call 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) %60, ptr noundef nonnull align 8 dereferenceable(32) %61)
  br label %79

.thread63:                                        ; preds = %.thread, %55
  %.2355567 = phi i32 [ %.235, %55 ], [ 1, %.thread ]
  %.25766 = phi i8 [ %.2, %55 ], [ 0, %.thread ]
  %63 = add nsw i32 %.2355567, 1
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 32)
  %65 = sext i32 %39 to i64
  %66 = getelementptr inbounds [10 x %"class.std::__cxx11::basic_string"], ptr @_Z3numB5cxx11, i64 0, i64 %65
  %67 = call 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) %64, ptr noundef nonnull align 8 dereferenceable(32) %66)
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %67, i8 noundef signext 32)
  %69 = getelementptr inbounds [6 x %"class.std::__cxx11::basic_string"], ptr @_Z1cB5cxx11, i64 0, i64 %indvars.iv
  %70 = call 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) %68, ptr noundef nonnull align 8 dereferenceable(32) %69)
  br label %79

71:                                               ; preds = %35
  %72 = icmp eq i64 %indvars.iv, 0
  %or.cond.not = or i1 %72, %40
  br i1 %or.cond.not, label %79, label %73

73:                                               ; preds = %71
  %74 = load i32, ptr %1, align 4, !tbaa !5
  %75 = getelementptr inbounds [9 x i32], ptr @J, i64 0, i64 %33
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = sdiv i32 %74, %76
  %78 = icmp sgt i32 %77, 9
  %spec.select = select i1 %78, i8 1, i8 %.144
  br label %79

79:                                               ; preds = %73, %56, %.thread63, %71, %31
  %.437 = phi i32 [ %.13443, %31 ], [ 1, %56 ], [ %63, %.thread63 ], [ %.13443, %71 ], [ %.13443, %73 ]
  %.4 = phi i8 [ %.144, %31 ], [ %.2, %56 ], [ %.25766, %.thread63 ], [ %.144, %71 ], [ %spec.select, %73 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %.not = icmp eq i64 %indvars.iv, 0
  br i1 %.not, label %.thread68, label %31, !llvm.loop !9

80:                                               ; preds = %.thread68
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 32)
  %82 = or disjoint i64 %indvars.iv50, 4
  %83 = getelementptr inbounds [6 x %"class.std::__cxx11::basic_string"], ptr @_Z1cB5cxx11, i64 0, i64 %82
  %84 = call 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) %81, ptr noundef nonnull align 8 dereferenceable(32) %83)
  br label %85

85:                                               ; preds = %80, %.thread68
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next51, 3
  br i1 %exitcond.not, label %22, label %23, !llvm.loop !11

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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 #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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 #4 = { nounwind }

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

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


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