; LLVM IR from tangjz/acm-icpc :: lanqiao (T116)

; 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
@p = external dso_local global i32, align 4
@x = external dso_local global [77 x i32], align 16
@y = external dso_local global [77 x i32], align 16
@dis = external dso_local global [26 x [51 x i32]], align 16
@ord = external dso_local global [26 x i32], align 16
@f = external dso_local global [11 x [51 x i32]], align 16
@h = external dso_local global [11 x i32], align 16
@ans = external dso_local global double, align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(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 uwtable
declare dso_local void @_Z3pfsi(i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %8 = call i64 @time(ptr noundef null) #8
  %9 = trunc i64 %8 to i32
  call void @srand(i32 noundef %9) #8
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @p)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %26, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = load i32, ptr @m, align 4, !tbaa !5
  %15 = add nsw i32 %13, %14
  %16 = icmp slt i32 %12, %15
  br i1 %16, label %18, label %17

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

18:                                               ; preds = %11
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds i32, ptr @x, i64 %20
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds i32, ptr @y, i64 %23
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %21, ptr noundef %24)
  br label %26

26:                                               ; preds = %18
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !9

29:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %81, %29
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = load i32, ptr @m, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %84

35:                                               ; preds = %30
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [26 x i32], ptr @ord, i64 0, i64 %38
  store i32 %36, ptr %39, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %77, %35
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %80

45:                                               ; preds = %40
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = add nsw i32 %46, %47
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [77 x i32], ptr @x, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [77 x i32], ptr @x, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = sub nsw i32 %51, %55
  %57 = call noundef i32 @_Z3sqri(i32 noundef %56)
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = add nsw i32 %58, %59
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [77 x i32], ptr @y, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [77 x i32], ptr @y, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = sub nsw i32 %63, %67
  %69 = call noundef i32 @_Z3sqri(i32 noundef %68)
  %70 = add nsw i32 %57, %69
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [26 x [51 x i32]], ptr @dis, i64 0, i64 %72
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [51 x i32], ptr %73, i64 0, i64 %75
  store i32 %70, ptr %76, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %45
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %5, align 4, !tbaa !5
  br label %40, !llvm.loop !11

80:                                               ; preds = %44
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %3, align 4, !tbaa !5
  br label %30, !llvm.loop !12

84:                                               ; preds = %34
  %85 = load i32, ptr @m, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds i32, ptr @ord, i64 %86
  call void @_ZSt14random_shuffleIPiEvT_S1_(ptr noundef @ord, ptr noundef %87)
  store double 1.000000e+10, ptr @ans, align 8, !tbaa !13
  %88 = load i32, ptr @n, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = mul i64 %89, 4
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 63, i64 %90, i1 false)
  call void @_Z3dfsi(i32 noundef 0)
  call void @_Z3pfsi(i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %107, %84
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = load i32, ptr @p, align 4, !tbaa !5
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %110

96:                                               ; preds = %91
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [11 x i32], ptr @h, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [26 x i32], ptr @ord, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [11 x i32], ptr @h, i64 0, i64 %105
  store i32 %103, ptr %106, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %96
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %6, align 4, !tbaa !5
  br label %91, !llvm.loop !15

110:                                              ; preds = %95
  %111 = load i32, ptr @p, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i32, ptr @h, i64 %112
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @h, ptr noundef %113)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %134, %110
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = load i32, ptr @p, align 4, !tbaa !5
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %137

119:                                              ; preds = %114
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [11 x i32], ptr @h, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  %125 = load i32, ptr %7, align 4, !tbaa !5
  %126 = load i32, ptr @p, align 4, !tbaa !5
  %127 = sub nsw i32 %126, 1
  %128 = icmp eq i32 %125, %127
  %129 = zext i1 %128 to i64
  %130 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %129
  %131 = load i8, ptr %130, align 1, !tbaa !16
  %132 = sext i8 %131 to i32
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %124, i32 noundef %132)
  br label %134

134:                                              ; preds = %119
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %7, align 4, !tbaa !5
  br label %114, !llvm.loop !17

137:                                              ; preds = %118
  ret i32 0
}

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

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sqri(i32 noundef) #5

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

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

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 = { 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 = { "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 = { inlinehint 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 #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { 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 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@x = external dso_local global [77 x i32], align 16
@y = external dso_local global [77 x i32], align 16
@dis = external dso_local local_unnamed_addr global [26 x [51 x i32]], align 16
@ord = external dso_local global [26 x i32], align 16
@f = external dso_local local_unnamed_addr global [11 x [51 x i32]], align 16
@h = external dso_local global [11 x i32], align 16
@ans = external dso_local local_unnamed_addr global double, align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3pfsi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i64 @time(ptr noundef null) #7
  %2 = trunc i64 %1 to i32
  tail call void @srand(i32 noundef %2) #7
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @p)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = load i32, ptr @m, align 4, !tbaa !5
  %6 = add nsw i32 %5, %4
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %0
  %8 = phi i32 [ %4, %0 ], [ %20, %.lr.ph ]
  %9 = phi i32 [ %5, %0 ], [ %21, %.lr.ph ]
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph37, label %._crit_edge38

.lr.ph37:                                         ; preds = %.preheader
  %11 = icmp sgt i32 %8, 0
  br i1 %11, label %.lr.ph37.split, label %.lr.ph37.split.us

.lr.ph37.split.us:                                ; preds = %.lr.ph37
  %wide.trip.count = zext nneg i32 %9 to i64
  %min.iters.check = icmp ult i32 %9, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph37.split.us
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %12 = getelementptr inbounds [26 x i32], ptr @ord, i64 0, i64 %index
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  store <4 x i32> %vec.ind, ptr %12, align 16, !tbaa !5
  store <4 x i32> %step.add, ptr %13, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %14 = icmp eq i64 %index.next, %n.vec
  br i1 %14, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge38, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph37.split.us
  %indvars.iv50.ph = phi i64 [ 0, %.lr.ph37.split.us ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv50 = phi i64 [ %indvars.iv.next51, %scalar.ph ], [ %indvars.iv50.ph, %scalar.ph.preheader ]
  %15 = getelementptr inbounds [26 x i32], ptr @ord, i64 0, i64 %indvars.iv50
  %16 = trunc nuw nsw i64 %indvars.iv50 to i32
  store i32 %16, ptr %15, align 4, !tbaa !5
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge38, label %scalar.ph, !llvm.loop !13

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %17 = getelementptr inbounds i32, ptr @x, i64 %indvars.iv
  %18 = getelementptr inbounds i32, ptr @y, i64 %indvars.iv
  %19 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %17, ptr noundef nonnull %18)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %22 = add nsw i32 %21, %20
  %23 = sext i32 %22 to i64
  %24 = icmp slt i64 %indvars.iv.next, %23
  br i1 %24, label %.lr.ph, label %.preheader, !llvm.loop !14

._crit_edge38:                                    ; preds = %scalar.ph, %._crit_edge, %middle.block, %.preheader
  %.lcssa32 = phi i32 [ %9, %.preheader ], [ %9, %middle.block ], [ %38, %._crit_edge ], [ %9, %scalar.ph ]
  %25 = sext i32 %.lcssa32 to i64
  %26 = getelementptr inbounds i32, ptr @ord, i64 %25
  tail call void @_ZSt14random_shuffleIPiEvT_S1_(ptr noundef nonnull @ord, ptr noundef nonnull %26)
  store double 1.000000e+10, ptr @ans, align 8, !tbaa !15
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = shl nsw i64 %28, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @f, i8 63, i64 %29, i1 false)
  tail call void @_Z3dfsi(i32 noundef 0)
  tail call void @_Z3pfsi(i32 noundef 0)
  %30 = load i32, ptr @p, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph41.preheader, label %._crit_edge42

.lr.ph41.preheader:                               ; preds = %._crit_edge38
  %wide.trip.count62 = zext nneg i32 %30 to i64
  %xtraiter = and i64 %wide.trip.count62, 3
  %32 = icmp ult i32 %30, 4
  br i1 %32, label %._crit_edge42.loopexit.unr-lcssa, label %.lr.ph41.preheader.new

.lr.ph41.preheader.new:                           ; preds = %.lr.ph41.preheader
  %unroll_iter = and i64 %wide.trip.count62, 2147483644
  br label %.lr.ph41

.lr.ph37.split:                                   ; preds = %.lr.ph37, %._crit_edge
  %33 = phi i32 [ %38, %._crit_edge ], [ %9, %.lr.ph37 ]
  %34 = phi i32 [ %39, %._crit_edge ], [ %8, %.lr.ph37 ]
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %._crit_edge ], [ 0, %.lr.ph37 ]
  %35 = getelementptr inbounds [26 x i32], ptr @ord, i64 0, i64 %indvars.iv56
  %36 = trunc nuw nsw i64 %indvars.iv56 to i32
  store i32 %36, ptr %35, align 4, !tbaa !5
  %37 = icmp sgt i32 %34, 0
  br i1 %37, label %.lr.ph35, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %.lr.ph35
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph37.split
  %38 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %33, %.lr.ph37.split ]
  %39 = phi i32 [ %62, %._crit_edge.loopexit ], [ %34, %.lr.ph37.split ]
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %40 = sext i32 %38 to i64
  %41 = icmp slt i64 %indvars.iv.next57, %40
  br i1 %41, label %.lr.ph37.split, label %._crit_edge38, !llvm.loop !17

.lr.ph35:                                         ; preds = %.lr.ph37.split, %.lr.ph35
  %indvars.iv53 = phi i64 [ %indvars.iv.next54, %.lr.ph35 ], [ 0, %.lr.ph37.split ]
  %42 = phi i32 [ %62, %.lr.ph35 ], [ %34, %.lr.ph37.split ]
  %43 = add nsw i32 %42, %36
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [77 x i32], ptr @x, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = getelementptr inbounds [77 x i32], ptr @x, i64 0, i64 %indvars.iv53
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sub nsw i32 %46, %48
  %50 = tail call noundef i32 @_Z3sqri(i32 noundef %49)
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = add nsw i32 %51, %36
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [77 x i32], ptr @y, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = getelementptr inbounds [77 x i32], ptr @y, i64 0, i64 %indvars.iv53
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sub nsw i32 %55, %57
  %59 = tail call noundef i32 @_Z3sqri(i32 noundef %58)
  %60 = add nsw i32 %59, %50
  %61 = getelementptr inbounds [26 x [51 x i32]], ptr @dis, i64 0, i64 %indvars.iv56, i64 %indvars.iv53
  store i32 %60, ptr %61, align 4, !tbaa !5
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %indvars.iv.next54, %63
  br i1 %64, label %.lr.ph35, label %._crit_edge.loopexit, !llvm.loop !19

._crit_edge42.loopexit.unr-lcssa:                 ; preds = %.lr.ph41, %.lr.ph41.preheader
  %indvars.iv59.unr = phi i64 [ 0, %.lr.ph41.preheader ], [ %indvars.iv.next60.3, %.lr.ph41 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge42, label %.lr.ph41.epil

.lr.ph41.epil:                                    ; preds = %._crit_edge42.loopexit.unr-lcssa, %.lr.ph41.epil
  %indvars.iv59.epil = phi i64 [ %indvars.iv.next60.epil, %.lr.ph41.epil ], [ %indvars.iv59.unr, %._crit_edge42.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph41.epil ], [ 0, %._crit_edge42.loopexit.unr-lcssa ]
  %65 = getelementptr inbounds [11 x i32], ptr @h, i64 0, i64 %indvars.iv59.epil
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [26 x i32], ptr @ord, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  store i32 %69, ptr %65, align 4, !tbaa !5
  %indvars.iv.next60.epil = add nuw nsw i64 %indvars.iv59.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge42, label %.lr.ph41.epil, !llvm.loop !20

._crit_edge42:                                    ; preds = %._crit_edge42.loopexit.unr-lcssa, %.lr.ph41.epil, %._crit_edge38
  %70 = sext i32 %30 to i64
  %71 = getelementptr inbounds i32, ptr @h, i64 %70
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @h, ptr noundef nonnull %71)
  %72 = load i32, ptr @p, align 4, !tbaa !5
  %73 = icmp sgt i32 %72, 0
  br i1 %73, label %.lr.ph46, label %._crit_edge47

.lr.ph41:                                         ; preds = %.lr.ph41, %.lr.ph41.preheader.new
  %indvars.iv59 = phi i64 [ 0, %.lr.ph41.preheader.new ], [ %indvars.iv.next60.3, %.lr.ph41 ]
  %niter = phi i64 [ 0, %.lr.ph41.preheader.new ], [ %niter.next.3, %.lr.ph41 ]
  %74 = getelementptr inbounds [11 x i32], ptr @h, i64 0, i64 %indvars.iv59
  %75 = load i32, ptr %74, align 16, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [26 x i32], ptr @ord, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  store i32 %78, ptr %74, align 16, !tbaa !5
  %indvars.iv.next60 = or disjoint i64 %indvars.iv59, 1
  %79 = getelementptr inbounds [11 x i32], ptr @h, i64 0, i64 %indvars.iv.next60
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [26 x i32], ptr @ord, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  store i32 %83, ptr %79, align 4, !tbaa !5
  %indvars.iv.next60.1 = or disjoint i64 %indvars.iv59, 2
  %84 = getelementptr inbounds [11 x i32], ptr @h, i64 0, i64 %indvars.iv.next60.1
  %85 = load i32, ptr %84, align 8, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [26 x i32], ptr @ord, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  store i32 %88, ptr %84, align 8, !tbaa !5
  %indvars.iv.next60.2 = or disjoint i64 %indvars.iv59, 3
  %89 = getelementptr inbounds [11 x i32], ptr @h, i64 0, i64 %indvars.iv.next60.2
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [26 x i32], ptr @ord, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  store i32 %93, ptr %89, align 4, !tbaa !5
  %indvars.iv.next60.3 = add nuw nsw i64 %indvars.iv59, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge42.loopexit.unr-lcssa, label %.lr.ph41, !llvm.loop !22

._crit_edge47:                                    ; preds = %.lr.ph46, %._crit_edge42
  ret i32 0

.lr.ph46:                                         ; preds = %._crit_edge42, %.lr.ph46
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %.lr.ph46 ], [ 0, %._crit_edge42 ]
  %94 = phi i32 [ %106, %.lr.ph46 ], [ %72, %._crit_edge42 ]
  %95 = getelementptr inbounds [11 x i32], ptr @h, i64 0, i64 %indvars.iv64
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  %98 = add nsw i32 %94, -1
  %99 = zext i32 %98 to i64
  %100 = icmp eq i64 %indvars.iv64, %99
  %101 = zext i1 %100 to i64
  %102 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !23
  %104 = sext i8 %103 to i32
  %105 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %97, i32 noundef %104)
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %106 = load i32, ptr @p, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = icmp slt i64 %indvars.iv.next65, %107
  br i1 %108, label %.lr.ph46, label %._crit_edge47, !llvm.loop !24
}

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sqri(i32 noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

; 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 = { 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 = { 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 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 #5 = { 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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = distinct !{!17, !10, !18}
!18 = !{!"llvm.loop.unswitch.partial.disable"}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !10}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !10}


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