; LLVM IR from smv1999/CompetitiveProgrammingQuestionBank :: Arrays (integer)

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

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local 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 ptr, align 8
  %9 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !5
  %10 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %2)
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = icmp sle i32 %12, 0
  br i1 %13, label %14, label %16

14:                                               ; preds = %0
  %15 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 0) #6
  unreachable

16:                                               ; preds = %0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = zext i32 %17 to i64
  %19 = call ptr @llvm.stacksave.p0()
  store ptr %19, ptr %8, align 8
  %20 = alloca i32, i64 %18, align 16
  store i64 %18, ptr %9, align 8
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %31, %16
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %26, label %34

26:                                               ; preds = %22
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr %20, i64 %28
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %29)
  br label %31

31:                                               ; preds = %26
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %4, align 4, !tbaa !5
  br label %22, !llvm.loop !9

34:                                               ; preds = %22
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %79, %34
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %39, label %82

39:                                               ; preds = %35
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %75, %39
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = sub nsw i32 %42, 1
  %44 = icmp slt i32 %41, %43
  br i1 %44, label %45, label %78

45:                                               ; preds = %40
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i32, ptr %20, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i32, ptr %20, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = icmp sgt i32 %49, %54
  br i1 %55, label %56, label %74

56:                                               ; preds = %45
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds i32, ptr %20, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  store i32 %60, ptr %6, align 4, !tbaa !5
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i32, ptr %20, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds i32, ptr %20, i64 %67
  store i32 %65, ptr %68, align 4, !tbaa !5
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds i32, ptr %20, i64 %72
  store i32 %69, ptr %73, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %56, %45
  br label %75

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

78:                                               ; preds = %40
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %4, align 4, !tbaa !5
  br label %35, !llvm.loop !12

82:                                               ; preds = %35
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %94, %82
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %88, label %97

88:                                               ; preds = %84
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %20, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %92)
  br label %94

94:                                               ; preds = %88
  %95 = load i32, ptr %4, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %4, align 4, !tbaa !5
  br label %84, !llvm.loop !13

97:                                               ; preds = %84
  %98 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %99 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = sub nsw i32 %100, 1
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i32, ptr %20, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = icmp sle i32 %104, 0
  br i1 %105, label %106, label %108

106:                                              ; preds = %97
  %107 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  br label %155

108:                                              ; preds = %97
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %151, %108
  %110 = load i32, ptr %4, align 4, !tbaa !5
  %111 = load i32, ptr %2, align 4, !tbaa !5
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %113, label %154

113:                                              ; preds = %109
  %114 = load i32, ptr %4, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i32, ptr %20, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = icmp sgt i32 %117, 0
  br i1 %118, label %119, label %150

119:                                              ; preds = %113
  %120 = load i32, ptr %4, align 4, !tbaa !5
  %121 = add nsw i32 0, %120
  store i32 %121, ptr %3, align 4, !tbaa !5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %144, %119
  %123 = load i32, ptr %3, align 4, !tbaa !5
  %124 = load i32, ptr %2, align 4, !tbaa !5
  %125 = icmp sle i32 %123, %124
  br i1 %125, label %126, label %131

126:                                              ; preds = %122
  %127 = load i32, ptr %5, align 4, !tbaa !5
  %128 = load i32, ptr %2, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  %130 = icmp sle i32 %127, %129
  br label %131

131:                                              ; preds = %126, %122
  %132 = phi i1 [ false, %122 ], [ %130, %126 ]
  br i1 %132, label %133, label %149

133:                                              ; preds = %131
  %134 = load i32, ptr %3, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds i32, ptr %20, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = load i32, ptr %5, align 4, !tbaa !5
  %139 = icmp eq i32 %137, %138
  br i1 %139, label %140, label %141

140:                                              ; preds = %133
  br label %144

141:                                              ; preds = %133
  %142 = load i32, ptr %5, align 4, !tbaa !5
  %143 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %142)
  call void @exit(i32 noundef 0) #6
  unreachable

144:                                              ; preds = %140
  %145 = load i32, ptr %5, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %5, align 4, !tbaa !5
  %147 = load i32, ptr %3, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %3, align 4, !tbaa !5
  br label %122, !llvm.loop !14

149:                                              ; preds = %131
  br label %150

150:                                              ; preds = %149, %113
  br label %151

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

154:                                              ; preds = %109
  br label %155

155:                                              ; preds = %154, %106
  %156 = load ptr, ptr %8, align 8
  call void @llvm.stackrestore.p0(ptr %156)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %157 = load i32, ptr %1, align 4
  ret i32 %157
}

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

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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

attributes #0 = { 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 = { "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 = { noreturn 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 = { nocallback nofree nosync nounwind willreturn }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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"

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %5 = icmp slt i32 %4, 1
  br i1 %5, label %6, label %8

6:                                                ; preds = %0
  %7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  call void @exit(i32 noundef 0) #6
  unreachable

8:                                                ; preds = %0
  %9 = zext nneg i32 %4 to i64
  %10 = call ptr @llvm.stacksave.p0()
  %11 = alloca i32, i64 %9, align 16
  %12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge44

.preheader38:                                     ; preds = %.lr.ph
  %or.cond = icmp slt i32 %39, 2
  br i1 %or.cond, label %._crit_edge44, label %.preheader37.us.preheader

.preheader37.us.preheader:                        ; preds = %.preheader38
  %15 = add nsw i32 %39, -1
  %wide.trip.count = zext i32 %15 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %16 = icmp eq i32 %15, 1
  %unroll_iter = and i64 %wide.trip.count, 4294967294
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %invariant.gep = getelementptr i8, ptr %11, i64 4
  br label %.preheader37.us

.preheader37.us:                                  ; preds = %.preheader37.us.preheader, %._crit_edge.us
  %.13043.us = phi i32 [ %36, %._crit_edge.us ], [ 0, %.preheader37.us.preheader ]
  %.pre = load i32, ptr %11, align 16, !tbaa !5
  br i1 %16, label %._crit_edge.us.unr-lcssa, label %.preheader37.us.new

.preheader37.us.new:                              ; preds = %.preheader37.us, %30
  %17 = phi i32 [ %31, %30 ], [ %.pre, %.preheader37.us ]
  %indvars.iv58 = phi i64 [ %indvars.iv.next59.1, %30 ], [ 0, %.preheader37.us ]
  %niter = phi i64 [ %niter.next.1, %30 ], [ 0, %.preheader37.us ]
  %indvars.iv.next59 = or disjoint i64 %indvars.iv58, 1
  %18 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv.next59
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = icmp sgt i32 %17, %19
  br i1 %20, label %21, label %23

21:                                               ; preds = %.preheader37.us.new
  %22 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv58
  store i32 %19, ptr %22, align 8, !tbaa !5
  store i32 %17, ptr %18, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %21, %.preheader37.us.new
  %24 = phi i32 [ %17, %21 ], [ %19, %.preheader37.us.new ]
  %indvars.iv.next59.1 = add nuw nsw i64 %indvars.iv58, 2
  %25 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv.next59.1
  %26 = load i32, ptr %25, align 8, !tbaa !5
  %27 = icmp sgt i32 %24, %26
  br i1 %27, label %28, label %30

28:                                               ; preds = %23
  %29 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv.next59
  store i32 %26, ptr %29, align 4, !tbaa !5
  store i32 %24, ptr %25, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %28, %23
  %31 = phi i32 [ %24, %28 ], [ %26, %23 ]
  %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_edge.us.unr-lcssa, label %.preheader37.us.new, !llvm.loop !9

._crit_edge.us.unr-lcssa:                         ; preds = %30, %.preheader37.us
  %.unr = phi i32 [ %.pre, %.preheader37.us ], [ %31, %30 ]
  %indvars.iv58.unr = phi i64 [ 0, %.preheader37.us ], [ %indvars.iv.next59.1, %30 ]
  br i1 %lcmp.mod.not, label %._crit_edge.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us.unr-lcssa
  %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv58.unr
  %32 = load i32, ptr %gep, align 4, !tbaa !5
  %33 = icmp sgt i32 %.unr, %32
  br i1 %33, label %34, label %._crit_edge.us

34:                                               ; preds = %.epil.preheader
  %35 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv58.unr
  store i32 %32, ptr %35, align 4, !tbaa !5
  store i32 %.unr, ptr %gep, align 4, !tbaa !5
  br label %._crit_edge.us

._crit_edge.us:                                   ; preds = %.epil.preheader, %34, %._crit_edge.us.unr-lcssa
  %36 = add nuw nsw i32 %.13043.us, 1
  %exitcond61.not = icmp eq i32 %36, %39
  br i1 %exitcond61.not, label %._crit_edge44, label %.preheader37.us, !llvm.loop !11

.lr.ph:                                           ; preds = %8, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %8 ]
  %37 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %37)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = load i32, ptr %1, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next, %40
  br i1 %41, label %.lr.ph, label %.preheader38, !llvm.loop !12

._crit_edge44:                                    ; preds = %._crit_edge.us, %8, %.preheader38
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %43 = load i32, ptr %1, align 4, !tbaa !5
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %.lr.ph46, label %._crit_edge

.lr.ph46:                                         ; preds = %._crit_edge44, %.lr.ph46
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %.lr.ph46 ], [ 0, %._crit_edge44 ]
  %45 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv62
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %46)
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %48 = load i32, ptr %1, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %indvars.iv.next63, %49
  br i1 %50, label %.lr.ph46, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph46, %._crit_edge44
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %53 = load i32, ptr %1, align 4
  %54 = sext i32 %53 to i64
  %55 = getelementptr i32, ptr %11, i64 %54
  %56 = getelementptr i8, ptr %55, i64 -4
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = icmp slt i32 %57, 1
  br i1 %58, label %60, label %.preheader35

.preheader35:                                     ; preds = %._crit_edge
  %59 = icmp sgt i32 %53, 0
  br i1 %59, label %.lr.ph52.split.preheader, label %.loopexit36

.lr.ph52.split.preheader:                         ; preds = %.preheader35
  %wide.trip.count71 = zext nneg i32 %53 to i64
  br label %.lr.ph52.split

60:                                               ; preds = %._crit_edge
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  br label %.loopexit36

.lr.ph52.split:                                   ; preds = %.lr.ph52.split.preheader, %.loopexit
  %indvars.iv65 = phi i64 [ 0, %.lr.ph52.split.preheader ], [ %indvars.iv.next66, %.loopexit ]
  %62 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv65
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %.lr.ph49, label %.loopexit

.lr.ph49:                                         ; preds = %.lr.ph52.split, %70
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %70 ], [ %indvars.iv65, %.lr.ph52.split ]
  %.03147 = phi i32 [ %71, %70 ], [ 1, %.lr.ph52.split ]
  %65 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv67
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp eq i32 %66, %.03147
  br i1 %67, label %70, label %68

68:                                               ; preds = %.lr.ph49
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %.03147)
  call void @exit(i32 noundef 0) #6
  unreachable

70:                                               ; preds = %.lr.ph49
  %71 = add nuw nsw i32 %.03147, 1
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %72 = icmp slt i64 %indvars.iv67, %54
  %73 = icmp sle i32 %.03147, %53
  %74 = and i1 %72, %73
  br i1 %74, label %.lr.ph49, label %.loopexit, !llvm.loop !14

.loopexit:                                        ; preds = %70, %.lr.ph52.split
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond72.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count71
  br i1 %exitcond72.not, label %.loopexit36, label %.lr.ph52.split, !llvm.loop !15

.loopexit36:                                      ; preds = %.loopexit, %.preheader35, %60
  call void @llvm.stackrestore.p0(ptr %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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

attributes #0 = { 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 = { noreturn 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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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