; LLVM IR from VastoLorde95/Competitive-Programming :: SPOJ/Random/GCDEX (A)

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

@p = external dso_local global [1000001 x i32], align 16
@phi = external dso_local global [1000001 x i32], align 16
@tot = external dso_local global [1000001 x i64], align 16
@sum = external dso_local global [1000001 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

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

10:                                               ; preds = %22, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = icmp slt i32 %11, 1000001
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  br label %25

14:                                               ; preds = %10
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %16
  store i32 1, ptr %17, align 4, !tbaa !5
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [1000001 x i32], ptr @phi, i64 0, i64 %20
  store i32 %18, ptr %21, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %14
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !9

25:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 2, ptr %3, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %63, %25
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = icmp slt i32 %27, 1000001
  br i1 %28, label %30, label %29

29:                                               ; preds = %26
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %66

30:                                               ; preds = %26
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %37, label %36

36:                                               ; preds = %30
  br label %63

37:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %38 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %38, ptr %5, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %58, %37
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = icmp slt i32 %40, 1000001
  br i1 %41, label %43, label %42

42:                                               ; preds = %39
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %62

43:                                               ; preds = %39
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %45
  store i32 0, ptr %46, 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 @phi, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = sdiv i32 %50, %51
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [1000001 x i32], ptr @phi, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = sub nsw i32 %56, %52
  store i32 %57, ptr %55, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %43
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = add nsw i32 %60, %59
  store i32 %61, ptr %5, align 4, !tbaa !5
  br label %39, !llvm.loop !11

62:                                               ; preds = %42
  br label %63

63:                                               ; preds = %62, %36
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %3, align 4, !tbaa !5
  br label %26, !llvm.loop !12

66:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %98, %66
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = icmp slt i32 %68, 1000001
  br i1 %69, label %71, label %70

70:                                               ; preds = %67
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %101

71:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = mul nsw i32 2, %72
  store i32 %73, ptr %7, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %93, %71
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = icmp slt i32 %75, 1000001
  br i1 %76, label %78, label %77

77:                                               ; preds = %74
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %97

78:                                               ; preds = %74
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = sdiv i32 %79, %80
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [1000001 x i32], ptr @phi, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = mul nsw i32 %84, %85
  %87 = sext i32 %86 to i64
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1000001 x i64], ptr @tot, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !13
  %92 = add nsw i64 %91, %87
  store i64 %92, ptr %90, align 8, !tbaa !13
  br label %93

93:                                               ; preds = %78
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = add nsw i32 %95, %94
  store i32 %96, ptr %7, align 4, !tbaa !5
  br label %74, !llvm.loop !15

97:                                               ; preds = %77
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %6, align 4, !tbaa !5
  br label %67, !llvm.loop !16

101:                                              ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %120, %101
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = icmp slt i32 %103, 1000001
  br i1 %104, label %106, label %105

105:                                              ; preds = %102
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %123

106:                                              ; preds = %102
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = sub nsw i32 %107, 1
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [1000001 x i64], ptr @sum, i64 0, i64 %109
  %111 = load i64, ptr %110, align 8, !tbaa !13
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [1000001 x i64], ptr @tot, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !13
  %116 = add nsw i64 %111, %115
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [1000001 x i64], ptr @sum, i64 0, i64 %118
  store i64 %116, ptr %119, align 8, !tbaa !13
  br label %120

120:                                              ; preds = %106
  %121 = load i32, ptr %8, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %8, align 4, !tbaa !5
  br label %102, !llvm.loop !17

123:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %124 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %9)
  br label %125

125:                                              ; preds = %128, %123
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %135

128:                                              ; preds = %125
  %129 = load i32, ptr %9, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [1000001 x i64], ptr @sum, i64 0, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !13
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %132)
  %134 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %9)
  br label %125, !llvm.loop !18

135:                                              ; preds = %125
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  %136 = load i32, ptr %1, align 4
  ret i32 %136
}

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

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

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

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

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

@p = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@phi = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@tot = external dso_local local_unnamed_addr global [1000001 x i64], align 16
@sum = external dso_local local_unnamed_addr global [1000001 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
vector.ph:
  %0 = alloca i32, align 4
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next.1, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next.1, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %offset.idx = or disjoint i64 %index, 1
  %1 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %offset.idx
  %2 = getelementptr inbounds i8, ptr %1, i64 16
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %1, align 4, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %2, align 4, !tbaa !5
  %3 = getelementptr inbounds [1000001 x i32], ptr @phi, i64 0, i64 %offset.idx
  %4 = getelementptr inbounds i8, ptr %3, i64 16
  store <4 x i32> %vec.ind, ptr %3, align 4, !tbaa !5
  store <4 x i32> %step.add, ptr %4, align 4, !tbaa !5
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %step.add.1 = add <4 x i32> %vec.ind, <i32 12, i32 12, i32 12, i32 12>
  %offset.idx.1 = or disjoint i64 %index, 9
  %5 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %offset.idx.1
  %6 = getelementptr inbounds i8, ptr %5, i64 16
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %5, align 4, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %6, align 4, !tbaa !5
  %7 = getelementptr inbounds [1000001 x i32], ptr @phi, i64 0, i64 %offset.idx.1
  %8 = getelementptr inbounds i8, ptr %7, i64 16
  store <4 x i32> %vec.ind.next, ptr %7, align 4, !tbaa !5
  store <4 x i32> %step.add.1, ptr %8, align 4, !tbaa !5
  %index.next.1 = add nuw nsw i64 %index, 16
  %vec.ind.next.1 = add <4 x i32> %vec.ind, <i32 16, i32 16, i32 16, i32 16>
  %9 = icmp eq i64 %index.next.1, 1000000
  br i1 %9, label %.preheader41, label %vector.body, !llvm.loop !9

.preheader41:                                     ; preds = %vector.body, %.loopexit
  %indvars.iv55 = phi i64 [ %indvars.iv.next56, %.loopexit ], [ 2, %vector.body ]
  %10 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %indvars.iv55
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %.not38.not = icmp eq i32 %11, 0
  br i1 %.not38.not, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader41
  %12 = trunc nuw nsw i64 %indvars.iv55 to i32
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv57 = phi i64 [ %indvars.iv55, %.lr.ph.preheader ], [ %indvars.iv.next58, %.lr.ph ]
  %13 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %indvars.iv57
  store i32 0, ptr %13, align 4, !tbaa !5
  %14 = getelementptr inbounds [1000001 x i32], ptr @phi, i64 0, i64 %indvars.iv57
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = sdiv i32 %15, %12
  %17 = sub nsw i32 %15, %16
  store i32 %17, ptr %14, align 4, !tbaa !5
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, %indvars.iv55
  %18 = icmp ult i64 %indvars.iv.next58, 1000001
  br i1 %18, label %.lr.ph, label %.loopexit, !llvm.loop !13

.loopexit:                                        ; preds = %.lr.ph, %.preheader41
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next56, 1000001
  br i1 %exitcond61.not, label %.preheader39, label %.preheader41, !llvm.loop !14

.preheader39:                                     ; preds = %.loopexit, %._crit_edge
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %._crit_edge ], [ 1, %.loopexit ]
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %._crit_edge ], [ 2, %.loopexit ]
  %indvars69 = trunc i64 %indvars.iv64 to i32
  %19 = icmp ult i32 %indvars69, 500001
  br i1 %19, label %.lr.ph47, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph47, %.preheader39
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 2
  %exitcond70.not = icmp eq i64 %indvars.iv.next65, 1000001
  br i1 %exitcond70.not, label %.preheader.preheader, label %.preheader39, !llvm.loop !15

.preheader.preheader:                             ; preds = %._crit_edge
  %.pre = load i64, ptr @sum, align 16, !tbaa !16
  br label %.preheader

.lr.ph47:                                         ; preds = %.preheader39, %.lr.ph47
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %.lr.ph47 ], [ %indvars.iv62, %.preheader39 ]
  %20 = trunc nuw nsw i64 %indvars.iv66 to i32
  %21 = udiv i32 %20, %indvars69
  %22 = zext nneg i32 %21 to i64
  %23 = getelementptr inbounds [1000001 x i32], ptr @phi, i64 0, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = mul nsw i32 %24, %indvars69
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [1000001 x i64], ptr @tot, i64 0, i64 %indvars.iv66
  %28 = load i64, ptr %27, align 8, !tbaa !16
  %29 = add nsw i64 %28, %26
  store i64 %29, ptr %27, align 8, !tbaa !16
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, %indvars.iv64
  %30 = icmp ult i64 %indvars.iv.next67, 1000001
  br i1 %30, label %.lr.ph47, label %._crit_edge, !llvm.loop !18

31:                                               ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #3
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %0)
  %33 = load i32, ptr %0, align 4, !tbaa !5
  %.not50 = icmp eq i32 %33, 0
  br i1 %.not50, label %._crit_edge53, label %.lr.ph52

.preheader:                                       ; preds = %.preheader, %.preheader.preheader
  %34 = phi i64 [ %.pre, %.preheader.preheader ], [ %53, %.preheader ]
  %indvars.iv71 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next72.4, %.preheader ]
  %35 = getelementptr inbounds [1000001 x i64], ptr @tot, i64 0, i64 %indvars.iv71
  %36 = load i64, ptr %35, align 8, !tbaa !16
  %37 = add nsw i64 %36, %34
  %38 = getelementptr inbounds [1000001 x i64], ptr @sum, i64 0, i64 %indvars.iv71
  store i64 %37, ptr %38, align 8, !tbaa !16
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %39 = getelementptr inbounds [1000001 x i64], ptr @tot, i64 0, i64 %indvars.iv.next72
  %40 = load i64, ptr %39, align 8, !tbaa !16
  %41 = add nsw i64 %40, %37
  %42 = getelementptr inbounds [1000001 x i64], ptr @sum, i64 0, i64 %indvars.iv.next72
  store i64 %41, ptr %42, align 8, !tbaa !16
  %indvars.iv.next72.1 = add nuw nsw i64 %indvars.iv71, 2
  %43 = getelementptr inbounds [1000001 x i64], ptr @tot, i64 0, i64 %indvars.iv.next72.1
  %44 = load i64, ptr %43, align 8, !tbaa !16
  %45 = add nsw i64 %44, %41
  %46 = getelementptr inbounds [1000001 x i64], ptr @sum, i64 0, i64 %indvars.iv.next72.1
  store i64 %45, ptr %46, align 8, !tbaa !16
  %indvars.iv.next72.2 = add nuw nsw i64 %indvars.iv71, 3
  %47 = getelementptr inbounds [1000001 x i64], ptr @tot, i64 0, i64 %indvars.iv.next72.2
  %48 = load i64, ptr %47, align 8, !tbaa !16
  %49 = add nsw i64 %48, %45
  %50 = getelementptr inbounds [1000001 x i64], ptr @sum, i64 0, i64 %indvars.iv.next72.2
  store i64 %49, ptr %50, align 8, !tbaa !16
  %indvars.iv.next72.3 = add nuw nsw i64 %indvars.iv71, 4
  %51 = getelementptr inbounds [1000001 x i64], ptr @tot, i64 0, i64 %indvars.iv.next72.3
  %52 = load i64, ptr %51, align 8, !tbaa !16
  %53 = add nsw i64 %52, %49
  %54 = getelementptr inbounds [1000001 x i64], ptr @sum, i64 0, i64 %indvars.iv.next72.3
  store i64 %53, ptr %54, align 8, !tbaa !16
  %indvars.iv.next72.4 = add nuw nsw i64 %indvars.iv71, 5
  %exitcond74.not.4 = icmp eq i64 %indvars.iv.next72.4, 1000001
  br i1 %exitcond74.not.4, label %31, label %.preheader, !llvm.loop !19

.lr.ph52:                                         ; preds = %31, %.lr.ph52
  %55 = phi i32 [ %61, %.lr.ph52 ], [ %33, %31 ]
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [1000001 x i64], ptr @sum, i64 0, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !16
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %58)
  %60 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %0)
  %61 = load i32, ptr %0, align 4, !tbaa !5
  %.not = icmp eq i32 %61, 0
  br i1 %.not, label %._crit_edge53, label %.lr.ph52, !llvm.loop !20

._crit_edge53:                                    ; preds = %.lr.ph52, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #3
  ret i32 0
}

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

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

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

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

attributes #0 = { mustprogress nofree norecurse 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!17, !17, i64 0}
!17 = !{!"long long", !7, i64 0}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass