; LLVM IR from tangjz/acm-icpc :: codeforces/complete (932C)

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

@n = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@p = external dso_local global [1000001 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 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
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @x, ptr noundef @y)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %156, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr @x, align 4, !tbaa !5
  %15 = mul nsw i32 %13, %14
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp sle i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %12
  store i32 2, ptr %3, align 4
  br label %159

19:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = load i32, ptr @x, align 4, !tbaa !5
  %22 = mul nsw i32 %20, %21
  store i32 %22, ptr %4, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = sub nsw i32 %23, %24
  %26 = load i32, ptr @y, align 4, !tbaa !5
  %27 = srem i32 %25, %26
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %19
  store i32 4, ptr %3, align 4
  br label %154

30:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = sub nsw i32 %31, %32
  %34 = load i32, ptr @y, align 4, !tbaa !5
  %35 = sdiv i32 %33, %34
  store i32 %35, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %75, %30
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %78

41:                                               ; preds = %36
  %42 = load i32, ptr @x, align 4, !tbaa !5
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  %45 = mul nsw i32 %42, %44
  %46 = sub nsw i32 %45, 1
  %47 = load i32, ptr @x, align 4, !tbaa !5
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = mul nsw i32 %47, %48
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %50
  store i32 %46, ptr %51, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %71, %41
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = load i32, ptr @x, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %52
  %58 = load i32, ptr @x, align 4, !tbaa !5
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = mul nsw i32 %58, %59
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = sub nsw i32 %61, 1
  %63 = add nsw i32 %60, %62
  %64 = load i32, ptr @x, align 4, !tbaa !5
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = mul nsw i32 %64, %65
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = add nsw i32 %66, %67
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %69
  store i32 %63, ptr %70, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %57
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %7, align 4, !tbaa !5
  br label %52, !llvm.loop !9

74:                                               ; preds = %56
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %6, align 4, !tbaa !5
  br label %36, !llvm.loop !11

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

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

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

84:                                               ; preds = %79
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = load i32, ptr @y, align 4, !tbaa !5
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  %89 = mul nsw i32 %86, %88
  %90 = add nsw i32 %85, %89
  %91 = sub nsw i32 %90, 1
  %92 = load i32, ptr %4, align 4, !tbaa !5
  %93 = load i32, ptr @y, align 4, !tbaa !5
  %94 = load i32, ptr %8, align 4, !tbaa !5
  %95 = mul nsw i32 %93, %94
  %96 = add nsw i32 %92, %95
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %97
  store i32 %91, ptr %98, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %122, %84
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = load i32, ptr @y, align 4, !tbaa !5
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %104, label %103

103:                                              ; preds = %99
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %125

104:                                              ; preds = %99
  %105 = load i32, ptr %4, align 4, !tbaa !5
  %106 = load i32, ptr @y, align 4, !tbaa !5
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = mul nsw i32 %106, %107
  %109 = add nsw i32 %105, %108
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = sub nsw i32 %110, 1
  %112 = add nsw i32 %109, %111
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = load i32, ptr @y, align 4, !tbaa !5
  %115 = load i32, ptr %8, align 4, !tbaa !5
  %116 = mul nsw i32 %114, %115
  %117 = add nsw i32 %113, %116
  %118 = load i32, ptr %9, align 4, !tbaa !5
  %119 = add nsw i32 %117, %118
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %120
  store i32 %112, ptr %121, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %104
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %9, align 4, !tbaa !5
  br label %99, !llvm.loop !12

125:                                              ; preds = %103
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %8, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %8, align 4, !tbaa !5
  br label %79, !llvm.loop !13

129:                                              ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %150, %129
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = load i32, ptr @n, align 4, !tbaa !5
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %130
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %153

135:                                              ; preds = %130
  %136 = load i32, ptr %10, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  %141 = load i32, ptr %10, align 4, !tbaa !5
  %142 = load i32, ptr @n, align 4, !tbaa !5
  %143 = sub nsw i32 %142, 1
  %144 = icmp eq i32 %141, %143
  %145 = zext i1 %144 to i64
  %146 = getelementptr inbounds [3 x i8], ptr @.str.2, i64 0, i64 %145
  %147 = load i8, ptr %146, align 1, !tbaa !14
  %148 = sext i8 %147 to i32
  %149 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %140, i32 noundef %148)
  br label %150

150:                                              ; preds = %135
  %151 = load i32, ptr %10, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %10, align 4, !tbaa !5
  br label %130, !llvm.loop !15

153:                                              ; preds = %134
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %154

154:                                              ; preds = %153, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %155 = load i32, ptr %3, align 4
  switch i32 %155, label %159 [
    i32 4, label %156
  ]

156:                                              ; preds = %154
  %157 = load i32, ptr %2, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !16

159:                                              ; preds = %154, %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  %160 = load i32, ptr %3, align 4
  switch i32 %160, label %165 [
    i32 2, label %161
    i32 1, label %163
  ]

161:                                              ; preds = %159
  %162 = call i32 @puts(ptr noundef @.str.3)
  store i32 0, ptr %1, align 4
  br label %163

163:                                              ; preds = %161, %159
  %164 = load i32, ptr %1, align 4
  ret i32 %164

165:                                              ; preds = %159
  unreachable
}

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

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

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

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

declare i32 @puts(ptr noundef) #1

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 = { 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 = distinct !{!13, !10}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !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"

@n = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@p = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @x, ptr noundef nonnull @y)
  %2 = load i32, ptr @x, align 4, !tbaa !5
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %.not67 = icmp slt i32 %3, 0
  br i1 %.not67, label %._crit_edge73, label %.lr.ph72.preheader

.lr.ph72.preheader:                               ; preds = %0
  %.pre = load i32, ptr @y, align 4, !tbaa !5
  br label %.lr.ph72

.lr.ph72:                                         ; preds = %.lr.ph72.preheader, %.thread
  %4 = phi i32 [ %135, %.thread ], [ 0, %.lr.ph72.preheader ]
  %.04368 = phi i32 [ %134, %.thread ], [ 0, %.lr.ph72.preheader ]
  %5 = sub nsw i32 %3, %4
  %6 = srem i32 %5, %.pre
  %7 = sdiv i32 %5, %.pre
  %8 = icmp sgt i32 %6, 0
  br i1 %8, label %.thread, label %9

9:                                                ; preds = %.lr.ph72
  %.not74 = icmp eq i32 %.04368, 0
  br i1 %.not74, label %.preheader57, label %.lr.ph61

.lr.ph61:                                         ; preds = %9
  %10 = icmp sgt i32 %2, 1
  %wide.trip.count98 = zext nneg i32 %.04368 to i64
  br i1 %10, label %.lr.ph.us.preheader, label %.loopexit56.preheader

.loopexit56.preheader:                            ; preds = %.lr.ph61
  %11 = sext i32 %2 to i64
  %min.iters.check = icmp ugt i32 %.04368, 7
  %ident.check.not = icmp eq i32 %2, 1
  %or.cond = select i1 %min.iters.check, i1 %ident.check.not, i1 false
  br i1 %or.cond, label %vector.ph, label %.loopexit56.preheader188

.loopexit56.preheader188:                         ; preds = %middle.block, %.loopexit56.preheader
  %indvars.iv.ph = phi i64 [ 0, %.loopexit56.preheader ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count98, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit56.prol.loopexit, label %.loopexit56.prol

.loopexit56.prol:                                 ; preds = %.loopexit56.preheader188, %.loopexit56.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.loopexit56.prol ], [ %indvars.iv.ph, %.loopexit56.preheader188 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.loopexit56.prol ], [ 0, %.loopexit56.preheader188 ]
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %12 = mul nsw i64 %indvars.iv.prol, %11
  %13 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %12
  %14 = trunc i64 %indvars.iv.next.prol to i32
  %15 = mul i32 %2, %14
  %16 = add i32 %15, -1
  store i32 %16, ptr %13, align 4, !tbaa !5
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.loopexit56.prol.loopexit, label %.loopexit56.prol, !llvm.loop !9

.loopexit56.prol.loopexit:                        ; preds = %.loopexit56.prol, %.loopexit56.preheader188
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.loopexit56.preheader188 ], [ %indvars.iv.next.prol, %.loopexit56.prol ]
  %17 = sub nsw i64 %indvars.iv.ph, %wide.trip.count98
  %18 = icmp ugt i64 %17, -4
  br i1 %18, label %.preheader57, label %.loopexit56

vector.ph:                                        ; preds = %.loopexit56.preheader
  %n.vec = and i64 %wide.trip.count98, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %19 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %index
  %20 = trunc <4 x i64> %vec.ind to <4 x i32>
  %21 = trunc <4 x i64> %vec.ind to <4 x i32>
  %22 = add <4 x i32> %21, <i32 4, i32 4, i32 4, i32 4>
  %23 = getelementptr inbounds i8, ptr %19, i64 16
  store <4 x i32> %20, ptr %19, align 16, !tbaa !5
  store <4 x i32> %22, ptr %23, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
  %24 = icmp eq i64 %index.next, %n.vec
  br i1 %24, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count98
  br i1 %cmp.n, label %.preheader57, label %.loopexit56.preheader188

.lr.ph.us.preheader:                              ; preds = %.lr.ph61
  %25 = zext nneg i32 %2 to i64
  %26 = add nsw i64 %25, -1
  %min.iters.check134 = icmp ult i32 %2, 9
  %n.vec137 = and i64 %26, -8
  %ind.end = or disjoint i64 %n.vec137, 1
  %cmp.n146 = icmp eq i64 %26, %n.vec137
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %..loopexit56_crit_edge.us
  %indvars.iv93 = phi i64 [ 0, %.lr.ph.us.preheader ], [ %indvars.iv.next94, %..loopexit56_crit_edge.us ]
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %27 = trunc i64 %indvars.iv.next94 to i32
  %28 = mul i32 %2, %27
  %29 = add nsw i32 %28, -1
  %30 = mul nuw nsw i64 %indvars.iv93, %25
  %31 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %30
  store i32 %29, ptr %31, align 4, !tbaa !5
  %32 = trunc nuw i64 %30 to i32
  %33 = add nsw i32 %32, -1
  br i1 %min.iters.check134, label %scalar.ph133.preheader, label %vector.ph135

vector.ph135:                                     ; preds = %.lr.ph.us
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %33, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body139

vector.body139:                                   ; preds = %vector.body139, %vector.ph135
  %index140 = phi i64 [ 0, %vector.ph135 ], [ %index.next145, %vector.body139 ]
  %vec.ind141 = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph135 ], [ %vec.ind.next144, %vector.body139 ]
  %step.add142 = add <4 x i32> %vec.ind141, <i32 4, i32 4, i32 4, i32 4>
  %offset.idx = or disjoint i64 %index140, 1
  %34 = add <4 x i32> %broadcast.splat, %vec.ind141
  %35 = add <4 x i32> %broadcast.splat, %step.add142
  %36 = add nuw nsw i64 %offset.idx, %30
  %37 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %36
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  store <4 x i32> %34, ptr %37, align 4, !tbaa !5
  store <4 x i32> %35, ptr %38, align 4, !tbaa !5
  %index.next145 = add nuw i64 %index140, 8
  %vec.ind.next144 = add <4 x i32> %vec.ind141, <i32 8, i32 8, i32 8, i32 8>
  %39 = icmp eq i64 %index.next145, %n.vec137
  br i1 %39, label %middle.block132, label %vector.body139, !llvm.loop !15

middle.block132:                                  ; preds = %vector.body139
  br i1 %cmp.n146, label %..loopexit56_crit_edge.us, label %scalar.ph133.preheader

scalar.ph133.preheader:                           ; preds = %middle.block132, %.lr.ph.us
  %indvars.iv88.ph = phi i64 [ 1, %.lr.ph.us ], [ %ind.end, %middle.block132 ]
  br label %scalar.ph133

scalar.ph133:                                     ; preds = %scalar.ph133.preheader, %scalar.ph133
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %scalar.ph133 ], [ %indvars.iv88.ph, %scalar.ph133.preheader ]
  %40 = trunc nuw nsw i64 %indvars.iv88 to i32
  %41 = add i32 %33, %40
  %42 = add nuw nsw i64 %indvars.iv88, %30
  %43 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %42
  store i32 %41, ptr %43, align 4, !tbaa !5
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond92.not = icmp eq i64 %indvars.iv.next89, %25
  br i1 %exitcond92.not, label %..loopexit56_crit_edge.us, label %scalar.ph133, !llvm.loop !16

..loopexit56_crit_edge.us:                        ; preds = %scalar.ph133, %middle.block132
  %exitcond99.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count98
  br i1 %exitcond99.not, label %.preheader57, label %.lr.ph.us, !llvm.loop !17

.preheader57:                                     ; preds = %.loopexit56.prol.loopexit, %.loopexit56, %..loopexit56_crit_edge.us, %middle.block, %9
  %44 = icmp sgt i32 %7, 0
  br i1 %44, label %.lr.ph64, label %.preheader

.lr.ph64:                                         ; preds = %.preheader57
  %45 = add i32 %4, -1
  %46 = icmp sgt i32 %.pre, 1
  %47 = sext i32 %4 to i64
  %wide.trip.count113 = zext nneg i32 %7 to i64
  br i1 %46, label %.lr.ph.us65.preheader, label %.loopexit.preheader

.loopexit.preheader:                              ; preds = %.lr.ph64
  %48 = sext i32 %.pre to i64
  %min.iters.check151 = icmp ugt i32 %7, 7
  %ident.check148.not = icmp eq i32 %.pre, 1
  %or.cond185 = and i1 %min.iters.check151, %ident.check148.not
  br i1 %or.cond185, label %vector.ph152, label %.loopexit.preheader186

.loopexit.preheader186:                           ; preds = %middle.block149, %.loopexit.preheader
  %indvars.iv100.ph = phi i64 [ 0, %.loopexit.preheader ], [ %n.vec154, %middle.block149 ]
  %xtraiter194 = and i64 %wide.trip.count113, 1
  %lcmp.mod195.not = icmp eq i64 %xtraiter194, 0
  br i1 %lcmp.mod195.not, label %.loopexit.prol.loopexit, label %.loopexit.prol

.loopexit.prol:                                   ; preds = %.loopexit.preheader186
  %indvars.iv.next101.prol = or disjoint i64 %indvars.iv100.ph, 1
  %49 = trunc nuw nsw i64 %indvars.iv.next101.prol to i32
  %50 = mul i32 %.pre, %49
  %51 = add i32 %45, %50
  %52 = mul nsw i64 %indvars.iv100.ph, %48
  %53 = add nsw i64 %52, %47
  %54 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %53
  store i32 %51, ptr %54, align 4, !tbaa !5
  br label %.loopexit.prol.loopexit

.loopexit.prol.loopexit:                          ; preds = %.loopexit.prol, %.loopexit.preheader186
  %indvars.iv100.unr = phi i64 [ %indvars.iv100.ph, %.loopexit.preheader186 ], [ %indvars.iv.next101.prol, %.loopexit.prol ]
  %55 = add nsw i64 %wide.trip.count113, -1
  %56 = icmp eq i64 %indvars.iv100.ph, %55
  br i1 %56, label %.preheader, label %.loopexit

vector.ph152:                                     ; preds = %.loopexit.preheader
  %n.vec154 = and i64 %wide.trip.count113, 2147483640
  %broadcast.splatinsert162 = insertelement <4 x i32> poison, i32 %45, i64 0
  %broadcast.splat163 = shufflevector <4 x i32> %broadcast.splatinsert162, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body156

vector.body156:                                   ; preds = %vector.body156, %vector.ph152
  %index157 = phi i64 [ 0, %vector.ph152 ], [ %index.next164, %vector.body156 ]
  %vec.ind158 = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph152 ], [ %vec.ind.next161, %vector.body156 ]
  %57 = trunc <4 x i64> %vec.ind158 to <4 x i32>
  %58 = add <4 x i32> %57, <i32 1, i32 1, i32 1, i32 1>
  %59 = trunc <4 x i64> %vec.ind158 to <4 x i32>
  %60 = add <4 x i32> %59, <i32 5, i32 5, i32 5, i32 5>
  %61 = add <4 x i32> %broadcast.splat163, %58
  %62 = add <4 x i32> %broadcast.splat163, %60
  %63 = add nsw i64 %index157, %47
  %64 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %63
  %65 = getelementptr inbounds i8, ptr %64, i64 16
  store <4 x i32> %61, ptr %64, align 4, !tbaa !5
  store <4 x i32> %62, ptr %65, align 4, !tbaa !5
  %index.next164 = add nuw i64 %index157, 8
  %vec.ind.next161 = add <4 x i64> %vec.ind158, <i64 8, i64 8, i64 8, i64 8>
  %66 = icmp eq i64 %index.next164, %n.vec154
  br i1 %66, label %middle.block149, label %vector.body156, !llvm.loop !18

middle.block149:                                  ; preds = %vector.body156
  %cmp.n165 = icmp eq i64 %n.vec154, %wide.trip.count113
  br i1 %cmp.n165, label %.preheader, label %.loopexit.preheader186

.lr.ph.us65.preheader:                            ; preds = %.lr.ph64
  %67 = zext nneg i32 %.pre to i64
  %wide.trip.count108 = zext nneg i32 %.pre to i64
  %68 = add nsw i64 %wide.trip.count108, -1
  %min.iters.check168 = icmp ult i32 %.pre, 9
  %n.vec171 = and i64 %68, -8
  %ind.end172 = or disjoint i64 %n.vec171, 1
  %cmp.n184 = icmp eq i64 %68, %n.vec171
  br label %.lr.ph.us65

.lr.ph.us65:                                      ; preds = %.lr.ph.us65.preheader, %..loopexit_crit_edge.us
  %indvars.iv110 = phi i64 [ 0, %.lr.ph.us65.preheader ], [ %indvars.iv.next111, %..loopexit_crit_edge.us ]
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %69 = trunc i64 %indvars.iv.next111 to i32
  %70 = mul i32 %.pre, %69
  %71 = add i32 %45, %70
  %72 = mul nuw nsw i64 %indvars.iv110, %67
  %73 = add nsw i64 %72, %47
  %74 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %73
  store i32 %71, ptr %74, align 4, !tbaa !5
  %75 = trunc nsw i64 %73 to i32
  %76 = add i32 %75, -1
  br i1 %min.iters.check168, label %scalar.ph167.preheader, label %vector.ph169

vector.ph169:                                     ; preds = %.lr.ph.us65
  %broadcast.splatinsert181 = insertelement <4 x i32> poison, i32 %76, i64 0
  %broadcast.splat182 = shufflevector <4 x i32> %broadcast.splatinsert181, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body174

vector.body174:                                   ; preds = %vector.body174, %vector.ph169
  %index175 = phi i64 [ 0, %vector.ph169 ], [ %index.next183, %vector.body174 ]
  %vec.ind176 = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph169 ], [ %vec.ind.next179, %vector.body174 ]
  %step.add177 = add <4 x i32> %vec.ind176, <i32 4, i32 4, i32 4, i32 4>
  %offset.idx180 = or disjoint i64 %index175, 1
  %77 = add <4 x i32> %broadcast.splat182, %vec.ind176
  %78 = add <4 x i32> %broadcast.splat182, %step.add177
  %79 = add nsw i64 %offset.idx180, %73
  %80 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %79
  %81 = getelementptr inbounds i8, ptr %80, i64 16
  store <4 x i32> %77, ptr %80, align 4, !tbaa !5
  store <4 x i32> %78, ptr %81, align 4, !tbaa !5
  %index.next183 = add nuw i64 %index175, 8
  %vec.ind.next179 = add <4 x i32> %vec.ind176, <i32 8, i32 8, i32 8, i32 8>
  %82 = icmp eq i64 %index.next183, %n.vec171
  br i1 %82, label %middle.block166, label %vector.body174, !llvm.loop !19

middle.block166:                                  ; preds = %vector.body174
  br i1 %cmp.n184, label %..loopexit_crit_edge.us, label %scalar.ph167.preheader

scalar.ph167.preheader:                           ; preds = %middle.block166, %.lr.ph.us65
  %indvars.iv105.ph = phi i64 [ 1, %.lr.ph.us65 ], [ %ind.end172, %middle.block166 ]
  br label %scalar.ph167

scalar.ph167:                                     ; preds = %scalar.ph167.preheader, %scalar.ph167
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %scalar.ph167 ], [ %indvars.iv105.ph, %scalar.ph167.preheader ]
  %83 = trunc nuw nsw i64 %indvars.iv105 to i32
  %84 = add i32 %76, %83
  %85 = add nsw i64 %indvars.iv105, %73
  %86 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %85
  store i32 %84, ptr %86, align 4, !tbaa !5
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %exitcond109.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count108
  br i1 %exitcond109.not, label %..loopexit_crit_edge.us, label %scalar.ph167, !llvm.loop !20

..loopexit_crit_edge.us:                          ; preds = %scalar.ph167, %middle.block166
  %exitcond114.not = icmp eq i64 %indvars.iv.next111, %wide.trip.count113
  br i1 %exitcond114.not, label %.preheader, label %.lr.ph.us65, !llvm.loop !21

.loopexit56:                                      ; preds = %.loopexit56.prol.loopexit, %.loopexit56
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.loopexit56 ], [ %indvars.iv.unr, %.loopexit56.prol.loopexit ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %87 = mul nsw i64 %indvars.iv, %11
  %88 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %87
  %89 = trunc i64 %indvars.iv.next to i32
  %90 = mul i32 %2, %89
  %91 = add i32 %90, -1
  store i32 %91, ptr %88, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %92 = mul nsw i64 %indvars.iv.next, %11
  %93 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %92
  %94 = trunc i64 %indvars.iv.next.1 to i32
  %95 = mul i32 %2, %94
  %96 = add i32 %95, -1
  store i32 %96, ptr %93, align 4, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %97 = mul nsw i64 %indvars.iv.next.1, %11
  %98 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %97
  %99 = trunc i64 %indvars.iv.next.2 to i32
  %100 = mul i32 %2, %99
  %101 = add i32 %100, -1
  store i32 %101, ptr %98, align 4, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %102 = mul nsw i64 %indvars.iv.next.2, %11
  %103 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %102
  %104 = trunc i64 %indvars.iv.next.3 to i32
  %105 = mul i32 %2, %104
  %106 = add i32 %105, -1
  store i32 %106, ptr %103, align 4, !tbaa !5
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count98
  br i1 %exitcond.not.3, label %.preheader57, label %.loopexit56, !llvm.loop !22

.preheader:                                       ; preds = %.loopexit.prol.loopexit, %.loopexit, %..loopexit_crit_edge.us, %middle.block149, %.preheader57
  %.not118 = icmp eq i32 %3, 0
  br i1 %.not118, label %.loopexit58, label %.lr.ph

.loopexit:                                        ; preds = %.loopexit.prol.loopexit, %.loopexit
  %indvars.iv100 = phi i64 [ %indvars.iv.next101.1, %.loopexit ], [ %indvars.iv100.unr, %.loopexit.prol.loopexit ]
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %107 = trunc i64 %indvars.iv.next101 to i32
  %108 = mul i32 %.pre, %107
  %109 = add i32 %45, %108
  %110 = mul nsw i64 %indvars.iv100, %48
  %111 = add nsw i64 %110, %47
  %112 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %111
  store i32 %109, ptr %112, align 4, !tbaa !5
  %indvars.iv.next101.1 = add nuw nsw i64 %indvars.iv100, 2
  %113 = trunc i64 %indvars.iv.next101.1 to i32
  %114 = mul i32 %.pre, %113
  %115 = add i32 %45, %114
  %116 = mul nsw i64 %indvars.iv.next101, %48
  %117 = add nsw i64 %116, %47
  %118 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %117
  store i32 %115, ptr %118, align 4, !tbaa !5
  %exitcond104.not.1 = icmp eq i64 %indvars.iv.next101.1, %wide.trip.count113
  br i1 %exitcond104.not.1, label %.preheader, label %.loopexit, !llvm.loop !23

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv115 = phi i64 [ %indvars.iv.next116, %.lr.ph ], [ 0, %.preheader ]
  %119 = phi i32 [ %131, %.lr.ph ], [ %3, %.preheader ]
  %120 = getelementptr inbounds [1000001 x i32], ptr @p, i64 0, i64 %indvars.iv115
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  %123 = add nsw i32 %119, -1
  %124 = zext i32 %123 to i64
  %125 = icmp eq i64 %indvars.iv115, %124
  %126 = zext i1 %125 to i64
  %127 = getelementptr inbounds [3 x i8], ptr @.str.2, i64 0, i64 %126
  %128 = load i8, ptr %127, align 1, !tbaa !24
  %129 = sext i8 %128 to i32
  %130 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %122, i32 noundef %129)
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %131 = load i32, ptr @n, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = icmp slt i64 %indvars.iv.next116, %132
  br i1 %133, label %.lr.ph, label %.loopexit58, !llvm.loop !25

.thread:                                          ; preds = %.lr.ph72
  %134 = add nuw nsw i32 %.04368, 1
  %135 = mul nsw i32 %2, %134
  %.not = icmp sgt i32 %135, %3
  br i1 %.not, label %._crit_edge73, label %.lr.ph72, !llvm.loop !26

._crit_edge73:                                    ; preds = %.thread, %0
  %136 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %.loopexit58

.loopexit58:                                      ; preds = %.lr.ph, %.preheader, %._crit_edge73
  ret i32 0
}

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1

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 = { 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" }

!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.unroll.disable"}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !13, !14}
!16 = distinct !{!16, !12, !14, !13}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12, !13, !14}
!19 = distinct !{!19, !12, !13, !14}
!20 = distinct !{!20, !12, !14, !13}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12, !13}
!23 = distinct !{!23, !12, !13}
!24 = !{!7, !7, i64 0}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,DivRemPairsPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass