; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/331 Division 2/Problem D (D)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@h = external dso_local global i32, align 4
@inf = external dso_local global i32, align 4
@x = external dso_local global [2002 x i32], align 16
@l = external dso_local global [2002 x i32], align 16
@r = external dso_local global [2002 x i32], align 16
@p = external dso_local global x86_fp80, align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef x86_fp80 @_Z2goiiii(i32 noundef, i32 noundef, 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
  store i32 0, ptr %1, align 4
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) @h)
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERe(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 16 dereferenceable(16) @p)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %18, %0
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = icmp sle i32 %9, %10
  br i1 %11, label %13, label %12

12:                                               ; preds = %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %21

13:                                               ; preds = %8
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %15
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %16)
  br label %18

18:                                               ; preds = %13
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = add nsw i32 %19, 1
  store i32 %20, ptr %2, align 4, !tbaa !5
  br label %8, !llvm.loop !9

21:                                               ; preds = %12
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds i32, ptr @x, i64 %23
  %25 = getelementptr inbounds i32, ptr %24, i64 1
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef getelementptr inbounds (i32, ptr @x, i64 1), ptr noundef %25)
  %26 = load i32, ptr @inf, align 4, !tbaa !5
  %27 = sub nsw i32 0, %26
  store i32 %27, ptr @x, align 16, !tbaa !5
  %28 = load i32, ptr @inf, align 4, !tbaa !5
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %31
  store i32 %28, ptr %32, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %64, %21
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = icmp sle i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %67

38:                                               ; preds = %33
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = sub nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = sub nsw i32 %42, %47
  %49 = load i32, ptr @h, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %51, label %57

51:                                               ; preds = %38
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sub nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [2002 x i32], ptr @l, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  br label %59

57:                                               ; preds = %38
  %58 = load i32, ptr %3, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %57, %51
  %60 = phi i32 [ %56, %51 ], [ %58, %57 ]
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [2002 x i32], ptr @l, i64 0, i64 %62
  store i32 %60, ptr %63, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %59
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %3, align 4, !tbaa !5
  br label %33, !llvm.loop !11

67:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %68 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %68, ptr %4, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %99, %67
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = icmp sge i32 %70, 1
  br i1 %71, label %73, label %72

72:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %102

73:                                               ; preds = %69
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = sub nsw i32 %78, %82
  %84 = load i32, ptr @h, align 4, !tbaa !5
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %86, label %92

86:                                               ; preds = %73
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [2002 x i32], ptr @r, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  br label %94

92:                                               ; preds = %73
  %93 = load i32, ptr %4, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %92, %86
  %95 = phi i32 [ %91, %86 ], [ %93, %92 ]
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [2002 x i32], ptr @r, i64 0, i64 %97
  store i32 %95, ptr %98, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %94
  %100 = load i32, ptr %4, align 4, !tbaa !5
  %101 = add nsw i32 %100, -1
  store i32 %101, ptr %4, align 4, !tbaa !5
  br label %69, !llvm.loop !12

102:                                              ; preds = %72
  %103 = load i32, ptr @n, align 4, !tbaa !5
  %104 = call noundef x86_fp80 @_Z2goiiii(i32 noundef 1, i32 noundef %103, i32 noundef 0, i32 noundef 1)
  %105 = fptrunc x86_fp80 %104 to double
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %105)
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERe(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) #0 align 2

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

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

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

attributes #0 = { 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 #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 = { 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}


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@h = external dso_local global i32, align 4
@inf = external dso_local local_unnamed_addr global i32, align 4
@x = external dso_local global [2002 x i32], align 16
@l = external dso_local local_unnamed_addr global [2002 x i32], align 16
@r = external dso_local local_unnamed_addr global [2002 x i32], align 16
@p = external dso_local global x86_fp80, align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef x86_fp80 @_Z2goiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) @h)
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERe(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 16 dereferenceable(16) @p)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %.not22 = icmp slt i32 %4, 1
  br i1 %.not22, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre39 = sext i32 %4 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre39, %.._crit_edge_crit_edge ], [ %19, %.lr.ph ]
  %5 = getelementptr inbounds i32, ptr @x, i64 %.pre-phi
  %6 = getelementptr inbounds i8, ptr %5, i64 4
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @x, i64 4), ptr noundef nonnull %6)
  %7 = load i32, ptr @inf, align 4, !tbaa !5
  %8 = sub nsw i32 0, %7
  store i32 %8, ptr @x, align 16, !tbaa !5
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = add i32 %9, 1
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %11
  store i32 %7, ptr %12, align 4, !tbaa !5
  %.not2124 = icmp slt i32 %9, 1
  br i1 %.not2124, label %._crit_edge30, label %.lr.ph27

.lr.ph27:                                         ; preds = %._crit_edge
  %13 = load i32, ptr @h, align 4, !tbaa !5
  %wide.trip.count = zext i32 %10 to i64
  %.pre = load i32, ptr @x, align 16, !tbaa !5
  %14 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %14, 1
  %15 = icmp eq i32 %10, 2
  br i1 %15, label %.lr.ph29.unr-lcssa, label %.lr.ph27.new

.lr.ph27.new:                                     ; preds = %.lr.ph27
  %unroll_iter = and i64 %14, -2
  br label %33

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %16 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %indvars.iv
  %17 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %16)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %.not.not = icmp slt i64 %indvars.iv, %19
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph29.unr-lcssa:                               ; preds = %55, %.lr.ph27
  %.unr = phi i32 [ %.pre, %.lr.ph27 ], [ %48, %55 ]
  %indvars.iv33.unr = phi i64 [ 1, %.lr.ph27 ], [ %indvars.iv.next34.1, %55 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph29, label %.epil.preheader

.epil.preheader:                                  ; preds = %.lr.ph29.unr-lcssa
  %20 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %indvars.iv33.unr
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = sub nsw i32 %21, %.unr
  %23 = icmp slt i32 %22, %13
  %24 = trunc nuw nsw i64 %indvars.iv33.unr to i32
  br i1 %23, label %25, label %.lr.ph29.epilog-lcssa

25:                                               ; preds = %.epil.preheader
  %26 = add nsw i64 %indvars.iv33.unr, -1
  %27 = getelementptr inbounds [2002 x i32], ptr @l, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  br label %.lr.ph29.epilog-lcssa

.lr.ph29.epilog-lcssa:                            ; preds = %25, %.epil.preheader
  %29 = phi i32 [ %28, %25 ], [ %24, %.epil.preheader ]
  %30 = getelementptr inbounds [2002 x i32], ptr @l, i64 0, i64 %indvars.iv33.unr
  store i32 %29, ptr %30, align 4, !tbaa !5
  br label %.lr.ph29

.lr.ph29:                                         ; preds = %.lr.ph29.unr-lcssa, %.lr.ph29.epilog-lcssa
  %31 = load i32, ptr @h, align 4, !tbaa !5
  %32 = zext nneg i32 %9 to i64
  br label %61

33:                                               ; preds = %55, %.lr.ph27.new
  %34 = phi i32 [ %.pre, %.lr.ph27.new ], [ %48, %55 ]
  %indvars.iv33 = phi i64 [ 1, %.lr.ph27.new ], [ %indvars.iv.next34.1, %55 ]
  %niter = phi i64 [ 0, %.lr.ph27.new ], [ %niter.next.1, %55 ]
  %35 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %indvars.iv33
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = sub nsw i32 %36, %34
  %38 = icmp slt i32 %37, %13
  %39 = trunc nuw nsw i64 %indvars.iv33 to i32
  br i1 %38, label %40, label %44

40:                                               ; preds = %33
  %41 = add nsw i64 %indvars.iv33, -1
  %42 = getelementptr inbounds [2002 x i32], ptr @l, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %33, %40
  %45 = phi i32 [ %43, %40 ], [ %39, %33 ]
  %46 = getelementptr inbounds [2002 x i32], ptr @l, i64 0, i64 %indvars.iv33
  store i32 %45, ptr %46, align 4, !tbaa !5
  %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
  %47 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %indvars.iv.next34
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sub nsw i32 %48, %36
  %50 = icmp slt i32 %49, %13
  %51 = trunc nuw nsw i64 %indvars.iv.next34 to i32
  br i1 %50, label %52, label %55

52:                                               ; preds = %44
  %53 = getelementptr inbounds [2002 x i32], ptr @l, i64 0, i64 %indvars.iv33
  %54 = load i32, ptr %53, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %52, %44
  %56 = phi i32 [ %54, %52 ], [ %51, %44 ]
  %57 = getelementptr inbounds [2002 x i32], ptr @l, i64 0, i64 %indvars.iv.next34
  store i32 %56, ptr %57, align 4, !tbaa !5
  %indvars.iv.next34.1 = add nuw nsw i64 %indvars.iv33, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.lr.ph29.unr-lcssa, label %33, !llvm.loop !11

._crit_edge30:                                    ; preds = %73, %._crit_edge
  %58 = tail call noundef x86_fp80 @_Z2goiiii(i32 noundef 1, i32 noundef %9, i32 noundef 0, i32 noundef 1)
  %59 = fptrunc x86_fp80 %58 to double
  %60 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %59)
  ret i32 0

61:                                               ; preds = %.lr.ph29, %73
  %indvars.iv36 = phi i64 [ %32, %.lr.ph29 ], [ %indvars.iv.next37, %73 ]
  %62 = add nuw nsw i64 %indvars.iv36, 1
  %63 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %indvars.iv36
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sub nsw i32 %64, %66
  %68 = icmp slt i32 %67, %31
  %69 = trunc nuw nsw i64 %indvars.iv36 to i32
  br i1 %68, label %70, label %73

70:                                               ; preds = %61
  %71 = getelementptr inbounds [2002 x i32], ptr @r, i64 0, i64 %62
  %72 = load i32, ptr %71, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %61, %70
  %74 = phi i32 [ %72, %70 ], [ %69, %61 ]
  %75 = getelementptr inbounds [2002 x i32], ptr @r, i64 0, i64 %indvars.iv36
  store i32 %74, ptr %75, align 4, !tbaa !5
  %indvars.iv.next37 = add nsw i64 %indvars.iv36, -1
  %76 = icmp sgt i64 %indvars.iv36, 1
  br i1 %76, label %61, label %._crit_edge30, !llvm.loop !12
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERe(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #0 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(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 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 = { "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 = { 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" }

!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}


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