; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/Helvetic Coding Contest 2016/Problem C/C3 (C)

; 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
@p = external dso_local global [18 x [262144 x i32]], align 16
@l = external dso_local global [262144 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3LCAii(i32 noundef, i32 noundef) #0

; 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

; 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
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %16
  store i32 1, ptr %17, align 4, !tbaa !5
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 2, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 3, ptr %6, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %137, %0
  %20 = load i32, ptr %6, align 4, !tbaa !5
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = icmp sle i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %140

24:                                               ; preds = %19
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %32
  store i32 %30, ptr %33, align 4, !tbaa !5
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [262144 x i32], ptr @p, i64 0, i64 %36
  store i32 %34, ptr %37, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %64, %24
  %39 = load i32, ptr %8, align 4, !tbaa !5
  %40 = icmp slt i32 %39, 18
  br i1 %40, label %42, label %41

41:                                               ; preds = %38
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %67

42:                                               ; preds = %38
  %43 = load i32, ptr %8, align 4, !tbaa !5
  %44 = sub nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 %45
  %47 = load i32, ptr %8, align 4, !tbaa !5
  %48 = sub nsw i32 %47, 1
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 %49
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [262144 x i32], ptr %50, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [262144 x i32], ptr %46, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = load i32, ptr %8, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 %59
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [262144 x i32], ptr %60, i64 0, i64 %62
  store i32 %57, ptr %63, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %42
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %8, align 4, !tbaa !5
  br label %38, !llvm.loop !9

67:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = call noundef i32 @_Z3LCAii(i32 noundef %68, i32 noundef %69)
  store i32 %70, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = load i32, ptr %9, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = sub nsw i32 %74, %78
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = add nsw i32 %79, %83
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sub nsw i32 %84, %88
  store i32 %89, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = call noundef i32 @_Z3LCAii(i32 noundef %90, i32 noundef %91)
  store i32 %92, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = load i32, ptr %11, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = sub nsw i32 %96, %100
  %102 = load i32, ptr %4, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = add nsw i32 %101, %105
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sub nsw i32 %106, %110
  store i32 %111, ptr %12, align 4, !tbaa !5
  %112 = load i32, ptr %10, align 4, !tbaa !5
  %113 = load i32, ptr %12, align 4, !tbaa !5
  %114 = icmp sgt i32 %112, %113
  br i1 %114, label %115, label %122

115:                                              ; preds = %67
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = load i32, ptr %5, align 4, !tbaa !5
  %118 = icmp sgt i32 %116, %117
  br i1 %118, label %119, label %122

119:                                              ; preds = %115
  %120 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %120, ptr %5, align 4, !tbaa !5
  %121 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %121, ptr %4, align 4, !tbaa !5
  br label %134

122:                                              ; preds = %115, %67
  %123 = load i32, ptr %12, align 4, !tbaa !5
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = icmp sge i32 %123, %124
  br i1 %125, label %126, label %133

126:                                              ; preds = %122
  %127 = load i32, ptr %12, align 4, !tbaa !5
  %128 = load i32, ptr %5, align 4, !tbaa !5
  %129 = icmp sgt i32 %127, %128
  br i1 %129, label %130, label %133

130:                                              ; preds = %126
  %131 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %131, ptr %5, align 4, !tbaa !5
  %132 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %132, ptr %3, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %130, %126, %122
  br label %134

134:                                              ; preds = %133, %119
  %135 = load i32, ptr %5, align 4, !tbaa !5
  %136 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %135)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %137

137:                                              ; preds = %134
  %138 = load i32, ptr %6, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %6, align 4, !tbaa !5
  br label %19, !llvm.loop !11

140:                                              ; preds = %23
  %141 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %142 = load i32, ptr %1, align 4
  ret i32 %142
}

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

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

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


; 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
@p = external dso_local local_unnamed_addr global [18 x [262144 x i32]], align 16
@l = external dso_local local_unnamed_addr global [262144 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3LCAii(i32 noundef, i32 noundef) local_unnamed_addr #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: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %5 = sext i32 %4 to i64
  %6 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %5
  store i32 1, ptr %6, align 4, !tbaa !5
  %7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %.not50 = icmp slt i32 %8, 3
  br i1 %.not50, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %112, %0
  %9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret i32 0

.lr.ph:                                           ; preds = %0, %112
  %indvars.iv = phi i64 [ %indvars.iv.next, %112 ], [ 3, %0 ]
  %.054 = phi i32 [ %.1, %112 ], [ 1, %0 ]
  %.03753 = phi i32 [ %.138, %112 ], [ 2, %0 ]
  %.03952 = phi i32 [ %.140, %112 ], [ 1, %0 ]
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = add nsw i32 %14, 1
  %16 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %indvars.iv
  store i32 %15, ptr %16, align 4, !tbaa !5
  %17 = getelementptr inbounds [262144 x i32], ptr @p, i64 0, i64 %indvars.iv
  store i32 %11, ptr %17, align 4, !tbaa !5
  %18 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 0, i64 %12
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 1, i64 %indvars.iv
  store i32 %19, ptr %20, align 4, !tbaa !5
  %21 = sext i32 %19 to i64
  %22 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 1, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 2, i64 %indvars.iv
  store i32 %23, ptr %24, align 4, !tbaa !5
  %25 = sext i32 %23 to i64
  %26 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 2, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 3, i64 %indvars.iv
  store i32 %27, ptr %28, align 4, !tbaa !5
  %29 = sext i32 %27 to i64
  %30 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 3, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 4, i64 %indvars.iv
  store i32 %31, ptr %32, align 4, !tbaa !5
  %33 = sext i32 %31 to i64
  %34 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 4, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 5, i64 %indvars.iv
  store i32 %35, ptr %36, align 4, !tbaa !5
  %37 = sext i32 %35 to i64
  %38 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 5, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 6, i64 %indvars.iv
  store i32 %39, ptr %40, align 4, !tbaa !5
  %41 = sext i32 %39 to i64
  %42 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 6, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 7, i64 %indvars.iv
  store i32 %43, ptr %44, align 4, !tbaa !5
  %45 = sext i32 %43 to i64
  %46 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 7, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 8, i64 %indvars.iv
  store i32 %47, ptr %48, align 4, !tbaa !5
  %49 = sext i32 %47 to i64
  %50 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 8, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 9, i64 %indvars.iv
  store i32 %51, ptr %52, align 4, !tbaa !5
  %53 = sext i32 %51 to i64
  %54 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 9, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 10, i64 %indvars.iv
  store i32 %55, ptr %56, align 4, !tbaa !5
  %57 = sext i32 %55 to i64
  %58 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 10, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 11, i64 %indvars.iv
  store i32 %59, ptr %60, align 4, !tbaa !5
  %61 = sext i32 %59 to i64
  %62 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 11, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 12, i64 %indvars.iv
  store i32 %63, ptr %64, align 4, !tbaa !5
  %65 = sext i32 %63 to i64
  %66 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 12, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 13, i64 %indvars.iv
  store i32 %67, ptr %68, align 4, !tbaa !5
  %69 = sext i32 %67 to i64
  %70 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 13, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 14, i64 %indvars.iv
  store i32 %71, ptr %72, align 4, !tbaa !5
  %73 = sext i32 %71 to i64
  %74 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 14, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 15, i64 %indvars.iv
  store i32 %75, ptr %76, align 4, !tbaa !5
  %77 = sext i32 %75 to i64
  %78 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 15, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 16, i64 %indvars.iv
  store i32 %79, ptr %80, align 4, !tbaa !5
  %81 = sext i32 %79 to i64
  %82 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 16, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = getelementptr inbounds [18 x [262144 x i32]], ptr @p, i64 0, i64 17, i64 %indvars.iv
  store i32 %83, ptr %84, align 4, !tbaa !5
  %85 = trunc nuw nsw i64 %indvars.iv to i32
  %86 = call noundef i32 @_Z3LCAii(i32 noundef %85, i32 noundef %.054)
  %87 = load i32, ptr %16, align 4, !tbaa !5
  %88 = sext i32 %86 to i64
  %89 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sext i32 %.054 to i64
  %92 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = add i32 %93, %87
  %95 = shl i32 %90, 1
  %96 = sub i32 %94, %95
  %97 = call noundef i32 @_Z3LCAii(i32 noundef %85, i32 noundef %.03753)
  %98 = load i32, ptr %16, align 4, !tbaa !5
  %99 = sext i32 %97 to i64
  %100 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sext i32 %.03753 to i64
  %103 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = add i32 %104, %98
  %106 = shl i32 %101, 1
  %107 = sub i32 %105, %106
  %108 = icmp sgt i32 %96, %107
  %109 = icmp sgt i32 %96, %.03952
  %or.cond = and i1 %109, %108
  br i1 %or.cond, label %112, label %110

110:                                              ; preds = %.lr.ph
  %.not45 = icmp sge i32 %107, %96
  %111 = icmp sgt i32 %107, %.03952
  %or.cond46 = and i1 %.not45, %111
  %spec.select = select i1 %or.cond46, i32 %107, i32 %.03952
  %spec.select47 = select i1 %or.cond46, i32 %85, i32 %.054
  br label %112

112:                                              ; preds = %110, %.lr.ph
  %.140 = phi i32 [ %96, %.lr.ph ], [ %spec.select, %110 ]
  %.138 = phi i32 [ %85, %.lr.ph ], [ %.03753, %110 ]
  %.1 = phi i32 [ %.054, %.lr.ph ], [ %spec.select47, %110 ]
  %113 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.140)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %114 = load i32, ptr @n, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %.not.not = icmp slt i64 %indvars.iv, %115
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9
}

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

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass