; LLVM IR from tangjz/acm-icpc :: codeforces/gym (101471K)

; 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
@m = external dso_local global i32, align 4
@f = external dso_local global [100001 x i32], align 16
@border = external dso_local global [11 x [100001 x i32]], align 16
@ord = external dso_local global [11 x i32], align 16
@str = external dso_local global [11 x [100001 x i8]], align 16
@.str = external hidden unnamed_addr constant [5 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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #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 ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  br label %10

10:                                               ; preds = %122, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  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
  br label %125

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [11 x i32], ptr @ord, i64 0, i64 %18
  store i32 %16, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [11 x [100001 x i8]], ptr @str, i64 0, i64 %21
  %23 = getelementptr inbounds [100001 x i8], ptr %22, i64 0, i64 0
  store ptr %23, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [11 x [100001 x i32]], ptr @border, i64 0, i64 %25
  %27 = getelementptr inbounds [100001 x i32], ptr %26, i64 0, i64 0
  store ptr %27, ptr %6, align 8, !tbaa !9
  %28 = load ptr, ptr %5, align 8, !tbaa !9
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %28)
  store i32 1, ptr %3, align 4, !tbaa !5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %87, %15
  %31 = load ptr, ptr %5, align 8, !tbaa !9
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds i8, ptr %31, i64 %33
  %35 = load i8, ptr %34, align 1, !tbaa !11
  %36 = icmp ne i8 %35, 0
  br i1 %36, label %37, label %90

37:                                               ; preds = %30
  br label %38

38:                                               ; preds = %58, %37
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %55

41:                                               ; preds = %38
  %42 = load ptr, ptr %5, align 8, !tbaa !9
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i8, ptr %42, i64 %44
  %46 = load i8, ptr %45, align 1, !tbaa !11
  %47 = sext i8 %46 to i32
  %48 = load ptr, ptr %5, align 8, !tbaa !9
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i8, ptr %48, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !11
  %53 = sext i8 %52 to i32
  %54 = icmp ne i32 %47, %53
  br label %55

55:                                               ; preds = %41, %38
  %56 = phi i1 [ false, %38 ], [ %54, %41 ]
  br i1 %56, label %57, label %63

57:                                               ; preds = %55
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  store i32 %62, ptr %4, align 4, !tbaa !5
  br label %38, !llvm.loop !12

63:                                               ; preds = %55
  %64 = load ptr, ptr %5, align 8, !tbaa !9
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i8, ptr %64, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !11
  %69 = sext i8 %68 to i32
  %70 = load ptr, ptr %5, align 8, !tbaa !9
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds i8, ptr %70, i64 %72
  %74 = load i8, ptr %73, align 1, !tbaa !11
  %75 = sext i8 %74 to i32
  %76 = icmp eq i32 %69, %75
  br i1 %76, label %77, label %80

77:                                               ; preds = %63
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %4, align 4, !tbaa !5
  br label %81

80:                                               ; preds = %63
  br label %81

81:                                               ; preds = %80, %77
  %82 = phi i32 [ %79, %77 ], [ 0, %80 ]
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %85
  store i32 %82, ptr %86, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %81
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %3, align 4, !tbaa !5
  br label %30, !llvm.loop !14

90:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %91 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %91, ptr %7, align 4, !tbaa !5
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  store i32 %95, ptr %3, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %116, %90
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %121

99:                                               ; preds = %96
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = shl i32 %100, 1
  %102 = load i32, ptr %3, align 4, !tbaa !5
  %103 = sub nsw i32 %101, %102
  %104 = load i32, ptr @n, align 4, !tbaa !5
  %105 = icmp sle i32 %103, %104
  br i1 %105, label %106, label %115

106:                                              ; preds = %99
  %107 = load i32, ptr %3, align 4, !tbaa !5
  %108 = load ptr, ptr %6, align 8, !tbaa !9
  %109 = load ptr, ptr %6, align 8, !tbaa !9
  %110 = getelementptr inbounds i32, ptr %109, i64 0
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %110, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds i32, ptr %108, i64 %113
  store i32 %107, ptr %114, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %106, %99
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %3, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  store i32 %120, ptr %3, align 4, !tbaa !5
  br label %96, !llvm.loop !15

121:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %2, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !16

125:                                              ; preds = %14
  %126 = load i32, ptr @m, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i32, ptr @ord, i64 %127
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef @ord, ptr noundef %128, ptr noundef @_Z3cmpRKiS0_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %143, %125
  %130 = load i32, ptr %8, align 4, !tbaa !5
  %131 = load i32, ptr @m, align 4, !tbaa !5
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %134, label %133

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

134:                                              ; preds = %129
  %135 = load i32, ptr %8, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [11 x i32], ptr @ord, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [11 x [100001 x i8]], ptr @str, i64 0, i64 %139
  %141 = getelementptr inbounds [100001 x i8], ptr %140, i64 0, i64 0
  %142 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %141)
  br label %143

143:                                              ; preds = %134
  %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 %129, !llvm.loop !17

146:                                              ; preds = %133
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef, 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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}


; 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
@m = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [100001 x i32], align 16
@border = external dso_local local_unnamed_addr global [11 x [100001 x i32]], align 16
@ord = external dso_local global [11 x i32], align 16
@str = external dso_local global [11 x [100001 x i8]], align 16
@.str = external hidden unnamed_addr constant [5 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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %2 = load i32, ptr @m, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph61, label %.._crit_edge62_crit_edge

.._crit_edge62_crit_edge:                         ; preds = %0
  %.pre = sext i32 %2 to i64
  br label %._crit_edge62

._crit_edge62:                                    ; preds = %._crit_edge, %.._crit_edge62_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge62_crit_edge ], [ %42, %._crit_edge ]
  %4 = getelementptr inbounds i32, ptr @ord, i64 %.pre-phi
  tail call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull @ord, ptr noundef nonnull %4, ptr noundef nonnull @_Z3cmpRKiS0_)
  %5 = load i32, ptr @m, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph66, label %._crit_edge67

.lr.ph61:                                         ; preds = %0, %._crit_edge
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %._crit_edge ], [ 0, %0 ]
  %7 = getelementptr inbounds [11 x i32], ptr @ord, i64 0, i64 %indvars.iv71
  %8 = trunc nuw nsw i64 %indvars.iv71 to i32
  store i32 %8, ptr %7, align 4, !tbaa !5
  %9 = getelementptr inbounds [11 x [100001 x i8]], ptr @str, i64 0, i64 %indvars.iv71
  %10 = getelementptr inbounds [11 x [100001 x i32]], ptr @border, i64 0, i64 %indvars.iv71
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %9)
  %12 = getelementptr inbounds i8, ptr %9, i64 1
  %13 = load i8, ptr %12, align 1, !tbaa !9
  %.not49 = icmp eq i8 %13, 0
  br i1 %.not49, label %.lr.ph61..preheader43_crit_edge, label %.preheader

.lr.ph61..preheader43_crit_edge:                  ; preds = %.lr.ph61
  %.155.pre = load i32, ptr getelementptr inbounds (i8, ptr @f, i64 4), align 4, !tbaa !5
  br label %.preheader43

.preheader43.loopexit:                            ; preds = %.critedge
  %14 = trunc nuw nsw i64 %indvars.iv.next to i32
  br label %.preheader43

.preheader43:                                     ; preds = %.lr.ph61..preheader43_crit_edge, %.preheader43.loopexit
  %.155 = phi i32 [ %.155.pre, %.lr.ph61..preheader43_crit_edge ], [ %spec.select42, %.preheader43.loopexit ]
  %.034.lcssa = phi i32 [ 1, %.lr.ph61..preheader43_crit_edge ], [ %14, %.preheader43.loopexit ]
  %.not3856 = icmp eq i32 %.155, 0
  br i1 %.not3856, label %._crit_edge, label %.lr.ph58

.lr.ph58:                                         ; preds = %.preheader43
  %15 = shl nuw i32 %.034.lcssa, 1
  %16 = load i32, ptr @n, align 4, !tbaa !5
  br label %32

.preheader:                                       ; preds = %.lr.ph61, %.critedge
  %indvars.iv = phi i64 [ %indvars.iv.next, %.critedge ], [ 1, %.lr.ph61 ]
  %17 = phi i8 [ %31, %.critedge ], [ %13, %.lr.ph61 ]
  %.03550 = phi i32 [ %spec.select, %.critedge ], [ 0, %.lr.ph61 ]
  %.not4045 = icmp eq i32 %.03550, 0
  br i1 %.not4045, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %21
  %.13646 = phi i32 [ %23, %21 ], [ %.03550, %.preheader ]
  %18 = sext i32 %.13646 to i64
  %19 = getelementptr inbounds i8, ptr %9, i64 %18
  %20 = load i8, ptr %19, align 1, !tbaa !9
  %.not41 = icmp eq i8 %17, %20
  br i1 %.not41, label %.critedge, label %21

21:                                               ; preds = %.lr.ph
  %22 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %18
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %.not40 = icmp eq i32 %23, 0
  br i1 %.not40, label %.critedge, label %.lr.ph, !llvm.loop !10

.critedge:                                        ; preds = %.lr.ph, %21, %.preheader
  %.136.lcssa = phi i32 [ 0, %.preheader ], [ 0, %21 ], [ %.13646, %.lr.ph ]
  %24 = sext i32 %.136.lcssa to i64
  %25 = getelementptr inbounds i8, ptr %9, i64 %24
  %26 = load i8, ptr %25, align 1, !tbaa !9
  %27 = icmp eq i8 %17, %26
  %28 = add nsw i32 %.136.lcssa, 1
  %spec.select = select i1 %27, i32 %28, i32 %.136.lcssa
  %spec.select42 = select i1 %27, i32 %28, i32 0
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv.next
  store i32 %spec.select42, ptr %29, align 4, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %9, i64 %indvars.iv.next
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %.not = icmp eq i8 %31, 0
  br i1 %.not, label %.preheader43.loopexit, label %.preheader, !llvm.loop !12

32:                                               ; preds = %.lr.ph58, %39
  %.157 = phi i32 [ %.155, %.lr.ph58 ], [ %.1, %39 ]
  %33 = sub nsw i32 %15, %.157
  %.not39 = icmp sgt i32 %33, %16
  br i1 %.not39, label %39, label %34

34:                                               ; preds = %32
  %35 = load i32, ptr %10, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %10, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i32, ptr %10, i64 %37
  store i32 %.157, ptr %38, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %32, %34
  %40 = sext i32 %.157 to i64
  %.1.in = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %40
  %.1 = load i32, ptr %.1.in, align 4, !tbaa !5
  %.not38 = icmp eq i32 %.1, 0
  br i1 %.not38, label %._crit_edge, label %32, !llvm.loop !13

._crit_edge:                                      ; preds = %39, %.preheader43
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %41 = load i32, ptr @m, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = icmp slt i64 %indvars.iv.next72, %42
  br i1 %43, label %.lr.ph61, label %._crit_edge62, !llvm.loop !14

._crit_edge67:                                    ; preds = %.lr.ph66, %._crit_edge62
  ret i32 0

.lr.ph66:                                         ; preds = %._crit_edge62, %.lr.ph66
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %.lr.ph66 ], [ 0, %._crit_edge62 ]
  %44 = getelementptr inbounds [11 x i32], ptr @ord, i64 0, i64 %indvars.iv74
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [11 x [100001 x i8]], ptr @str, i64 0, i64 %46
  %48 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %47)
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %49 = load i32, ptr @m, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next75, %50
  br i1 %51, label %.lr.ph66, label %._crit_edge67, !llvm.loop !15
}

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

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

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

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 = { 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 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}


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