; LLVM IR from reyadussalahin/problem-solving :: greedy/basic/codeforces/F1392C (Solution)

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

@x = external dso_local global [200020 x i32], align 16
@a = external dso_local global [200020 x i32], align 16
@seen = external dso_local global [200020 x i32], 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpii(i32 noundef, i32 noundef) #0

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

11:                                               ; preds = %150, %0
  %12 = load i32, ptr %3, align 4, !tbaa !5
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %16, label %15

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

16:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %35, %16
  %19 = load i32, ptr %6, align 4, !tbaa !5
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %38

23:                                               ; preds = %18
  %24 = load i32, ptr %6, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %25
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %26)
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [200020 x i32], ptr @x, i64 0, i64 %30
  store i32 %28, ptr %31, align 4, !tbaa !5
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [200020 x i32], ptr @seen, i64 0, i64 %33
  store i32 0, ptr %34, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %23
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %6, align 4, !tbaa !5
  br label %18, !llvm.loop !9

38:                                               ; preds = %22
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i32, ptr @x, i64 %40
  call void @_ZSt4sortIPiPFbiiEEvT_S3_T0_(ptr noundef @x, ptr noundef %41, ptr noundef @_Z3cmpii)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %146, %75, %38
  %43 = load i32, ptr %8, align 4, !tbaa !5
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %46, label %147

46:                                               ; preds = %42
  %47 = load i32, ptr %8, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [200020 x i32], ptr @seen, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %143, label %52

52:                                               ; preds = %46
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [200020 x i32], ptr @x, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %75, label %58

58:                                               ; preds = %52
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [200020 x i32], ptr @x, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sub nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = load i32, ptr %8, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [200020 x i32], ptr @x, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp sle i32 %66, %73
  br i1 %74, label %75, label %78

75:                                               ; preds = %58, %52
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %8, align 4, !tbaa !5
  br label %42, !llvm.loop !13

78:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %9, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %115, %78
  %82 = load i32, ptr %9, align 4, !tbaa !5
  %83 = load i32, ptr %5, align 4, !tbaa !5
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %85, label %113

85:                                               ; preds = %81
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [200020 x i32], ptr @x, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [200020 x i32], ptr @x, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = icmp eq i32 %92, %99
  br i1 %100, label %101, label %113

101:                                              ; preds = %85
  %102 = load i32, ptr %9, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [200020 x i32], ptr @x, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = load i32, ptr %9, align 4, !tbaa !5
  %107 = sub nsw i32 %106, 1
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [200020 x i32], ptr @x, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  %112 = icmp eq i32 %105, %111
  br label %113

113:                                              ; preds = %101, %85, %81
  %114 = phi i1 [ false, %85 ], [ false, %81 ], [ %112, %101 ]
  br i1 %114, label %115, label %121

115:                                              ; preds = %113
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [200020 x i32], ptr @seen, i64 0, i64 %117
  store i32 1, ptr %118, align 4, !tbaa !5
  %119 = load i32, ptr %9, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %9, align 4, !tbaa !5
  br label %81, !llvm.loop !14

121:                                              ; preds = %113
  %122 = load i64, ptr %7, align 8, !tbaa !11
  %123 = load i32, ptr %8, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [200020 x i32], ptr @x, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = sub nsw i32 %126, 1
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = add nsw i64 %122, %131
  %133 = load i32, ptr %8, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [200020 x i32], ptr @x, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = sub nsw i64 %132, %140
  store i64 %141, ptr %7, align 8, !tbaa !11
  %142 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %142, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %146

143:                                              ; preds = %46
  %144 = load i32, ptr %8, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %8, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %143, %121
  br label %42, !llvm.loop !13

147:                                              ; preds = %42
  %148 = load i64, ptr %7, align 8, !tbaa !11
  %149 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %148)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %150

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

153:                                              ; preds = %15
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %154 = load i32, ptr %1, align 4
  ret i32 %154
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFbiiEEvT_S3_T0_(ptr noundef, ptr noundef, ptr noundef) #4

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

@x = external dso_local global [200020 x i32], align 16
@a = external dso_local global [200020 x i32], align 16
@seen = external dso_local local_unnamed_addr global [200020 x i32], 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph64, label %._crit_edge65

._crit_edge65:                                    ; preds = %.outer._crit_edge, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

.lr.ph64:                                         ; preds = %0, %.outer._crit_edge
  %.03362 = phi i32 [ %68, %.outer._crit_edge ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %.lr.ph64.._crit_edge_crit_edge

.lr.ph64.._crit_edge_crit_edge:                   ; preds = %.lr.ph64
  %.pre = sext i32 %7 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph64.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.lr.ph64.._crit_edge_crit_edge ], [ %20, %.lr.ph ]
  %9 = getelementptr inbounds i32, ptr @x, i64 %.pre-phi
  call void @_ZSt4sortIPiPFbiiEEvT_S3_T0_(ptr noundef nonnull @x, ptr noundef nonnull %9, ptr noundef nonnull @_Z3cmpii)
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph46.preheader, label %.outer._crit_edge

.lr.ph46.preheader:                               ; preds = %._crit_edge
  %12 = zext nneg i32 %10 to i64
  br label %.lr.ph46

.lr.ph46:                                         ; preds = %.lr.ph46.preheader, %.outer
  %.029.ph60 = phi i32 [ %.1, %.outer ], [ 0, %.lr.ph46.preheader ]
  %.030.ph59 = phi i64 [ %.131, %.outer ], [ 0, %.lr.ph46.preheader ]
  %13 = sext i32 %.029.ph60 to i64
  br label %22

.lr.ph:                                           ; preds = %.lr.ph64, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph64 ]
  %14 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %indvars.iv
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %14)
  %16 = getelementptr inbounds [200020 x i32], ptr @x, i64 0, i64 %indvars.iv
  %17 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %17, ptr %16, align 4, !tbaa !5
  %18 = getelementptr inbounds [200020 x i32], ptr @seen, i64 0, i64 %indvars.iv
  store i32 0, ptr %18, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = icmp slt i64 %indvars.iv.next, %20
  br i1 %21, label %.lr.ph, label %._crit_edge, !llvm.loop !9

22:                                               ; preds = %.lr.ph46, %40
  %indvars.iv77.in = phi i32 [ %.029.ph60, %.lr.ph46 ], [ %indvars.iv77, %40 ]
  %indvars.iv74 = phi i64 [ %13, %.lr.ph46 ], [ %indvars.iv.next75, %40 ]
  %indvars.iv77 = add i32 %indvars.iv77.in, 1
  %23 = getelementptr inbounds [200020 x i32], ptr @seen, i64 0, i64 %indvars.iv74
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %.not = icmp eq i32 %24, 0
  br i1 %.not, label %25, label %63

25:                                               ; preds = %22
  %26 = getelementptr inbounds [200020 x i32], ptr @x, i64 0, i64 %indvars.iv74
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %40, label %29

29:                                               ; preds = %25
  %30 = add nsw i32 %27, -1
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = sext i32 %27 to i64
  %35 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %.not36 = icmp sgt i32 %33, %36
  br i1 %.not36, label %.preheader, label %40

.preheader:                                       ; preds = %29
  %37 = trunc nsw i64 %indvars.iv74 to i32
  %.050 = add nsw i32 %37, 1
  %38 = icmp slt i32 %.050, %10
  br i1 %38, label %.lr.ph53.preheader, label %.critedge

.lr.ph53.preheader:                               ; preds = %.preheader
  %39 = sext i32 %indvars.iv77 to i64
  br label %.lr.ph53

40:                                               ; preds = %29, %25
  %indvars.iv.next75 = add nsw i64 %indvars.iv74, 1
  %41 = icmp slt i64 %indvars.iv.next75, %12
  br i1 %41, label %22, label %.outer._crit_edge, !llvm.loop !11

.lr.ph53:                                         ; preds = %.lr.ph53.preheader, %54
  %indvars.iv81 = phi i64 [ %39, %.lr.ph53.preheader ], [ %indvars.iv.next82, %54 ]
  %.0.in51 = phi i64 [ %indvars.iv74, %.lr.ph53.preheader ], [ %indvars.iv81, %54 ]
  %42 = getelementptr inbounds [200020 x i32], ptr @x, i64 0, i64 %indvars.iv81
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp eq i32 %46, %36
  br i1 %47, label %48, label %.critedge.loopexit.split.loop.exit

48:                                               ; preds = %.lr.ph53
  %sext = shl i64 %.0.in51, 32
  %49 = ashr exact i64 %sext, 32
  %50 = getelementptr inbounds [200020 x i32], ptr @x, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  %53 = icmp eq i32 %43, %52
  br i1 %53, label %54, label %.critedge.loopexit.split.loop.exit94

54:                                               ; preds = %48
  %55 = getelementptr inbounds [200020 x i32], ptr @seen, i64 0, i64 %indvars.iv81
  store i32 1, ptr %55, align 4, !tbaa !5
  %indvars.iv.next82 = add nsw i64 %indvars.iv81, 1
  %56 = icmp slt i64 %indvars.iv.next82, %12
  br i1 %56, label %.lr.ph53, label %.critedge, !llvm.loop !12

.critedge.loopexit.split.loop.exit:               ; preds = %.lr.ph53
  %57 = trunc nsw i64 %indvars.iv81 to i32
  br label %.critedge

.critedge.loopexit.split.loop.exit94:             ; preds = %48
  %58 = trunc nsw i64 %indvars.iv81 to i32
  br label %.critedge

.critedge:                                        ; preds = %54, %.critedge.loopexit.split.loop.exit, %.critedge.loopexit.split.loop.exit94, %.preheader
  %.0.lcssa = phi i32 [ %.050, %.preheader ], [ %57, %.critedge.loopexit.split.loop.exit ], [ %58, %.critedge.loopexit.split.loop.exit94 ], [ %10, %54 ]
  %59 = sext i32 %33 to i64
  %60 = add nsw i64 %.030.ph59, %59
  %61 = sext i32 %36 to i64
  %62 = sub i64 %60, %61
  br label %.outer

63:                                               ; preds = %22
  %64 = trunc nsw i64 %indvars.iv74 to i32
  %65 = add nsw i32 %64, 1
  br label %.outer

.outer:                                           ; preds = %63, %.critedge
  %.131 = phi i64 [ %.030.ph59, %63 ], [ %62, %.critedge ]
  %.1 = phi i32 [ %65, %63 ], [ %.0.lcssa, %.critedge ]
  %66 = icmp slt i32 %.1, %10
  br i1 %66, label %.lr.ph46, label %.outer._crit_edge, !llvm.loop !11

.outer._crit_edge:                                ; preds = %.outer, %40, %._crit_edge
  %.030.ph.lcssa = phi i64 [ 0, %._crit_edge ], [ %.030.ph59, %40 ], [ %.131, %.outer ]
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.030.ph.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %68 = add nuw nsw i32 %.03362, 1
  %69 = load i32, ptr %1, align 4, !tbaa !5
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %.lr.ph64, label %._crit_edge65, !llvm.loop !13
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFbiiEEvT_S3_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; 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 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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}


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