; LLVM IR from tangjz/acm-icpc :: lydsy (2082)

; 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"

@ptot = external dso_local global i32, align 4
@pr = external dso_local global [1000001 x i32], align 16
@d = external dso_local global [1000001 x i32], align 16
@cnt = external dso_local global i32, align 4
@e = external dso_local global [10001 x i32], align 16
@n = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@_ZZ4mainE3len = external hidden global i32, align 4
@_ZZ4mainE3num = external hidden global [10001 x i32], align 16

; 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 uwtable
declare dso_local void @_Z9decomposex(i64 noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %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
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %66, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp slt i32 %14, 1000001
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %69

17:                                               ; preds = %13
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [1000001 x i32], ptr @d, i64 0, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %32, label %23

23:                                               ; preds = %17
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [1000001 x i32], ptr @d, i64 0, i64 %26
  store i32 %24, ptr %27, align 4, !tbaa !5
  %28 = load i32, ptr @ptot, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr @ptot, align 4, !tbaa !5
  %30 = sext i32 %28 to i64
  %31 = getelementptr inbounds [1000001 x i32], ptr @pr, i64 0, i64 %30
  store i32 %24, ptr %31, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %23, %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  br label %33

33:                                               ; preds = %61, %32
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [1000001 x i32], ptr @pr, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = mul nsw i32 %34, %38
  store i32 %39, ptr %5, align 4, !tbaa !5
  %40 = icmp slt i32 %39, 1000001
  br i1 %40, label %42, label %41

41:                                               ; preds = %33
  store i32 5, ptr %3, align 4
  br label %64

42:                                               ; preds = %33
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [1000001 x i32], ptr @pr, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [1000001 x i32], ptr @d, i64 0, i64 %48
  store i32 %46, ptr %49, align 4, !tbaa !5
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [1000001 x i32], ptr @d, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1000001 x i32], ptr @pr, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = icmp eq i32 %53, %57
  br i1 %58, label %59, label %60

59:                                               ; preds = %42
  store i32 5, ptr %3, align 4
  br label %64

60:                                               ; preds = %42
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %4, align 4, !tbaa !5
  br label %33, !llvm.loop !9

64:                                               ; preds = %59, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %65

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !11

69:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %70 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %6)
  br label %71

71:                                               ; preds = %75, %69
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = add nsw i32 %72, -1
  store i32 %73, ptr %6, align 4, !tbaa !5
  %74 = icmp ne i32 %72, 0
  br i1 %74, label %75, label %78

75:                                               ; preds = %71
  %76 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n)
  %77 = load i64, ptr @n, align 8, !tbaa !12
  call void @_Z9decomposex(i64 noundef %77)
  br label %71, !llvm.loop !14

78:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %90, %78
  %80 = load i32, ptr %8, align 4, !tbaa !5
  %81 = load i32, ptr @cnt, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %93

84:                                               ; preds = %79
  %85 = load i32, ptr %8, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [10001 x i32], ptr @e, i64 0, i64 %86
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %87)
  %89 = load i32, ptr %88, align 4, !tbaa !5
  store i32 %89, ptr %7, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %84
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %8, align 4, !tbaa !5
  br label %79, !llvm.loop !15

93:                                               ; preds = %83
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %94)
  store i32 1, ptr @_ZZ4mainE3num, align 16, !tbaa !5
  store i32 1, ptr @_ZZ4mainE3len, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %151, %93
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = load i32, ptr @cnt, align 4, !tbaa !5
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %154

101:                                              ; preds = %96
  %102 = load i32, ptr %9, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [10001 x i32], ptr @e, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = icmp slt i32 %105, %106
  br i1 %107, label %108, label %109

108:                                              ; preds = %101
  br label %151

109:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %139, %109
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = load i32, ptr @_ZZ4mainE3len, align 4, !tbaa !5
  %113 = icmp sle i32 %111, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %110
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %142

115:                                              ; preds = %110
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3num, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = shl i32 %119, 1
  %121 = load i32, ptr %11, align 4, !tbaa !5
  %122 = or i32 %120, %121
  %123 = load i32, ptr %10, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3num, i64 0, i64 %124
  store i32 %122, ptr %125, align 4, !tbaa !5
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3num, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = icmp sge i32 %129, 10
  %131 = zext i1 %130 to i32
  store i32 %131, ptr %11, align 4, !tbaa !5
  br i1 %130, label %132, label %138

132:                                              ; preds = %115
  %133 = load i32, ptr %10, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3num, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = sub nsw i32 %136, 10
  store i32 %137, ptr %135, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %132, %115
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %10, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %10, align 4, !tbaa !5
  br label %110, !llvm.loop !16

142:                                              ; preds = %114
  %143 = load i32, ptr @_ZZ4mainE3len, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3num, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = icmp sgt i32 %146, 0
  %148 = zext i1 %147 to i32
  %149 = load i32, ptr @_ZZ4mainE3len, align 4, !tbaa !5
  %150 = add nsw i32 %149, %148
  store i32 %150, ptr @_ZZ4mainE3len, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %142, %108
  %152 = load i32, ptr %9, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %9, align 4, !tbaa !5
  br label %96, !llvm.loop !17

154:                                              ; preds = %100
  %155 = load i32, ptr @_ZZ4mainE3num, align 16, !tbaa !5
  %156 = add nsw i32 %155, -1
  store i32 %156, ptr @_ZZ4mainE3num, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %157 = load i32, ptr @_ZZ4mainE3len, align 4, !tbaa !5
  %158 = sub nsw i32 %157, 1
  store i32 %158, ptr %12, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %170, %154
  %160 = load i32, ptr %12, align 4, !tbaa !5
  %161 = icmp sge i32 %160, 0
  br i1 %161, label %163, label %162

162:                                              ; preds = %159
  store i32 19, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %173

163:                                              ; preds = %159
  %164 = load i32, ptr %12, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3num, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = add nsw i32 48, %167
  %169 = call i32 @putchar(i32 noundef %168)
  br label %170

170:                                              ; preds = %163
  %171 = load i32, ptr %12, align 4, !tbaa !5
  %172 = add nsw i32 %171, -1
  store i32 %172, ptr %12, align 4, !tbaa !5
  br label %159, !llvm.loop !18

173:                                              ; preds = %162
  %174 = call i32 @putchar(i32 noundef 10)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %175 = load i32, ptr %1, align 4
  ret i32 %175
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @putchar(i32 noundef) #5

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


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

@ptot = external dso_local local_unnamed_addr global i32, align 4
@pr = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@d = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@cnt = external dso_local local_unnamed_addr global i32, align 4
@e = external dso_local global [10001 x i32], align 16
@n = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@_ZZ4mainE3len = external hidden local_unnamed_addr global i32, align 4
@_ZZ4mainE3num = external hidden local_unnamed_addr global [10001 x i32], align 16

; 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 uwtable
declare dso_local void @_Z9decomposex(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %ptot.promoted = load i32, ptr @ptot, align 4, !tbaa !5
  br label %7

3:                                                ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = add nsw i32 %5, -1
  store i32 %6, ptr %1, align 4, !tbaa !5
  %.not43 = icmp eq i32 %5, 0
  br i1 %.not43, label %._crit_edge46, label %.lr.ph45

7:                                                ; preds = %0, %._crit_edge
  %indvars.iv65 = phi i64 [ 2, %0 ], [ %indvars.iv.next66, %._crit_edge ]
  %8 = phi i32 [ %ptot.promoted, %0 ], [ %16, %._crit_edge ]
  %9 = getelementptr inbounds [1000001 x i32], ptr @d, i64 0, i64 %indvars.iv65
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %.not39 = icmp eq i32 %10, 0
  %11 = trunc nuw nsw i64 %indvars.iv65 to i32
  br i1 %.not39, label %12, label %._crit_edge83

12:                                               ; preds = %7
  store i32 %11, ptr %9, align 4, !tbaa !5
  %13 = add nsw i32 %8, 1
  store i32 %13, ptr @ptot, align 4, !tbaa !5
  %14 = sext i32 %8 to i64
  %15 = getelementptr inbounds [1000001 x i32], ptr @pr, i64 0, i64 %14
  store i32 %11, ptr %15, align 4, !tbaa !5
  br label %._crit_edge83

._crit_edge83:                                    ; preds = %7, %12
  %16 = phi i32 [ %13, %12 ], [ %8, %7 ]
  %17 = load i32, ptr @pr, align 16, !tbaa !5
  %18 = mul nsw i32 %17, %11
  %19 = icmp slt i32 %18, 1000001
  br i1 %19, label %.lr.ph, label %._crit_edge

20:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = getelementptr inbounds [1000001 x i32], ptr @pr, i64 0, i64 %indvars.iv.next
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = mul nsw i32 %22, %11
  %24 = icmp slt i32 %23, 1000001
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph:                                           ; preds = %._crit_edge83, %20
  %indvars.iv = phi i64 [ %indvars.iv.next, %20 ], [ 0, %._crit_edge83 ]
  %25 = phi i32 [ %23, %20 ], [ %18, %._crit_edge83 ]
  %26 = phi i32 [ %22, %20 ], [ %17, %._crit_edge83 ]
  %27 = sext i32 %25 to i64
  %28 = getelementptr inbounds [1000001 x i32], ptr @d, i64 0, i64 %27
  store i32 %26, ptr %28, align 4, !tbaa !5
  %29 = load i32, ptr %9, align 4, !tbaa !5
  %30 = icmp eq i32 %29, %26
  br i1 %30, label %._crit_edge, label %20

._crit_edge:                                      ; preds = %20, %.lr.ph, %._crit_edge83
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next66, 1000001
  br i1 %exitcond.not, label %3, label %7, !llvm.loop !11

.lr.ph45:                                         ; preds = %3, %.lr.ph45
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n)
  %32 = load i64, ptr @n, align 8, !tbaa !12
  call void @_Z9decomposex(i64 noundef %32)
  %33 = load i32, ptr %1, align 4, !tbaa !5
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %33, 0
  br i1 %.not, label %._crit_edge46, label %.lr.ph45, !llvm.loop !14

._crit_edge46:                                    ; preds = %.lr.ph45, %3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  %35 = load i32, ptr @cnt, align 4, !tbaa !5
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %.lr.ph49, label %._crit_edge50

._crit_edge50:                                    ; preds = %.lr.ph49, %._crit_edge46
  %37 = phi i32 [ 0, %._crit_edge46 ], [ %44, %.lr.ph49 ]
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %37)
  store i32 1, ptr @_ZZ4mainE3num, align 16, !tbaa !5
  store i32 1, ptr @_ZZ4mainE3len, align 4, !tbaa !5
  %39 = load i32, ptr @cnt, align 4, !tbaa !5
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.lr.ph58, label %._crit_edge59.thread

._crit_edge59.thread:                             ; preds = %._crit_edge50
  store i32 0, ptr @_ZZ4mainE3num, align 16, !tbaa !5
  br label %.lr.ph62.preheader

.lr.ph58:                                         ; preds = %._crit_edge50
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %wide.trip.count78 = zext nneg i32 %39 to i64
  br label %52

.lr.ph49:                                         ; preds = %._crit_edge46, %.lr.ph49
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %.lr.ph49 ], [ 0, %._crit_edge46 ]
  %42 = getelementptr inbounds [10001 x i32], ptr @e, i64 0, i64 %indvars.iv68
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %42)
  %44 = load i32, ptr %43, align 4, !tbaa !5
  store i32 %44, ptr %2, align 4, !tbaa !5
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %45 = load i32, ptr @cnt, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next69, %46
  br i1 %47, label %.lr.ph49, label %._crit_edge50, !llvm.loop !15

._crit_edge59:                                    ; preds = %85
  %.pre = load i32, ptr @_ZZ4mainE3num, align 16, !tbaa !5
  %48 = add nsw i32 %.pre, -1
  store i32 %48, ptr @_ZZ4mainE3num, align 16, !tbaa !5
  %49 = icmp sgt i32 %86, 0
  br i1 %49, label %.lr.ph62.preheader, label %._crit_edge63

.lr.ph62.preheader:                               ; preds = %._crit_edge59.thread, %._crit_edge59
  %50 = phi i32 [ 1, %._crit_edge59.thread ], [ %86, %._crit_edge59 ]
  %51 = zext nneg i32 %50 to i64
  br label %.lr.ph62

52:                                               ; preds = %.lr.ph58, %85
  %indvars.iv75 = phi i64 [ 0, %.lr.ph58 ], [ %indvars.iv.next76, %85 ]
  %53 = phi i32 [ 1, %.lr.ph58 ], [ %86, %85 ]
  %54 = getelementptr inbounds [10001 x i32], ptr @e, i64 0, i64 %indvars.iv75
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = icmp slt i32 %55, %41
  br i1 %56, label %85, label %.preheader

.preheader:                                       ; preds = %52
  %.not3851 = icmp slt i32 %53, 0
  br i1 %.not3851, label %._crit_edge55, label %.lr.ph54.preheader

.lr.ph54.preheader:                               ; preds = %.preheader
  %57 = add nuw i32 %53, 1
  %wide.trip.count = zext i32 %57 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %58 = icmp eq i32 %53, 0
  br i1 %58, label %._crit_edge55.loopexit.unr-lcssa, label %.lr.ph54.preheader.new

.lr.ph54.preheader.new:                           ; preds = %.lr.ph54.preheader
  %unroll_iter = and i64 %wide.trip.count, 4294967294
  br label %.lr.ph54

._crit_edge55.loopexit.unr-lcssa:                 ; preds = %.lr.ph54, %.lr.ph54.preheader
  %indvars.iv71.unr = phi i64 [ 0, %.lr.ph54.preheader ], [ %indvars.iv.next72.1, %.lr.ph54 ]
  %.02953.unr = phi i32 [ 0, %.lr.ph54.preheader ], [ %83, %.lr.ph54 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge55, label %.lr.ph54.epil

.lr.ph54.epil:                                    ; preds = %._crit_edge55.loopexit.unr-lcssa
  %59 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3num, i64 0, i64 %indvars.iv71.unr
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = shl i32 %60, 1
  %62 = or disjoint i32 %61, %.02953.unr
  %63 = icmp sgt i32 %62, 9
  %64 = add nsw i32 %62, -10
  %spec.select.epil = select i1 %63, i32 %64, i32 %62
  store i32 %spec.select.epil, ptr %59, align 4, !tbaa !5
  br label %._crit_edge55

._crit_edge55:                                    ; preds = %.lr.ph54.epil, %._crit_edge55.loopexit.unr-lcssa, %.preheader
  %65 = sext i32 %53 to i64
  %66 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3num, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp sgt i32 %67, 0
  %69 = zext i1 %68 to i32
  %70 = add nsw i32 %53, %69
  store i32 %70, ptr @_ZZ4mainE3len, align 4, !tbaa !5
  br label %85

.lr.ph54:                                         ; preds = %.lr.ph54, %.lr.ph54.preheader.new
  %indvars.iv71 = phi i64 [ 0, %.lr.ph54.preheader.new ], [ %indvars.iv.next72.1, %.lr.ph54 ]
  %.02953 = phi i32 [ 0, %.lr.ph54.preheader.new ], [ %83, %.lr.ph54 ]
  %niter = phi i64 [ 0, %.lr.ph54.preheader.new ], [ %niter.next.1, %.lr.ph54 ]
  %71 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3num, i64 0, i64 %indvars.iv71
  %72 = load i32, ptr %71, align 8, !tbaa !5
  %73 = shl i32 %72, 1
  %74 = or disjoint i32 %73, %.02953
  %75 = icmp sgt i32 %74, 9
  %76 = zext i1 %75 to i32
  %77 = add nsw i32 %74, -10
  %spec.select = select i1 %75, i32 %77, i32 %74
  store i32 %spec.select, ptr %71, align 8, !tbaa !5
  %indvars.iv.next72 = or disjoint i64 %indvars.iv71, 1
  %78 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3num, i64 0, i64 %indvars.iv.next72
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = shl i32 %79, 1
  %81 = or disjoint i32 %80, %76
  %82 = icmp sgt i32 %81, 9
  %83 = zext i1 %82 to i32
  %84 = add nsw i32 %81, -10
  %spec.select.1 = select i1 %82, i32 %84, i32 %81
  store i32 %spec.select.1, ptr %78, align 4, !tbaa !5
  %indvars.iv.next72.1 = add nuw nsw i64 %indvars.iv71, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge55.loopexit.unr-lcssa, label %.lr.ph54, !llvm.loop !16

85:                                               ; preds = %52, %._crit_edge55
  %86 = phi i32 [ %53, %52 ], [ %70, %._crit_edge55 ]
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count78
  br i1 %exitcond79.not, label %._crit_edge59, label %52, !llvm.loop !17

._crit_edge63:                                    ; preds = %.lr.ph62, %._crit_edge59
  %87 = call i32 @putchar(i32 noundef 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph62:                                         ; preds = %.lr.ph62.preheader, %.lr.ph62
  %indvars.iv80 = phi i64 [ %51, %.lr.ph62.preheader ], [ %indvars.iv.next81, %.lr.ph62 ]
  %indvars.iv.next81 = add nsw i64 %indvars.iv80, -1
  %88 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3num, i64 0, i64 %indvars.iv.next81
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = add nsw i32 %89, 48
  %91 = call i32 @putchar(i32 noundef %90)
  %92 = icmp ugt i64 %indvars.iv80, 1
  br i1 %92, label %.lr.ph62, label %._crit_edge63, !llvm.loop !18
}

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

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

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

; Function Attrs: inlinehint mustprogress nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5

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


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