; LLVM IR from tangjz/acm-icpc :: self_training/2016-11-19 (E)

; 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
@C = external dso_local global i32, align 4
@x = external dso_local global [100001 x i32], align 16
@y = external dso_local global [100001 x i32], align 16
@p = external dso_local global [100001 x i32], align 16
@ord = external dso_local global [100001 x i32], align 16
@ans = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [80 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solvev() #1

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

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

7:                                                ; preds = %148, %0
  %8 = load i32, ptr %2, align 4, !tbaa !9
  %9 = add nsw i32 %8, -1
  store i32 %9, ptr %2, align 4, !tbaa !9
  %10 = icmp ne i32 %8, 0
  br i1 %10, label %11, label %153

11:                                               ; preds = %7
  store i32 0, ptr @ans, align 4, !tbaa !9
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @C)
  %12 = load i32, ptr @n, align 4, !tbaa !9
  %13 = icmp slt i32 0, %12
  br i1 %13, label %14, label %17

14:                                               ; preds = %11
  %15 = load i32, ptr @n, align 4, !tbaa !9
  %16 = icmp sle i32 %15, 100000
  br label %17

17:                                               ; preds = %14, %11
  %18 = phi i1 [ false, %11 ], [ %16, %14 ]
  br i1 %18, label %19, label %20

19:                                               ; preds = %17
  br label %22

20:                                               ; preds = %17
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 173, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

21:                                               ; No predecessors!
  br label %22

22:                                               ; preds = %21, %19
  %23 = load i32, ptr @m, align 4, !tbaa !9
  %24 = icmp slt i32 0, %23
  br i1 %24, label %25, label %28

25:                                               ; preds = %22
  %26 = load i32, ptr @m, align 4, !tbaa !9
  %27 = icmp sle i32 %26, 100000
  br label %28

28:                                               ; preds = %25, %22
  %29 = phi i1 [ false, %22 ], [ %27, %25 ]
  br i1 %29, label %30, label %31

30:                                               ; preds = %28
  br label %33

31:                                               ; preds = %28
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 174, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

32:                                               ; No predecessors!
  br label %33

33:                                               ; preds = %32, %30
  %34 = load i32, ptr @C, align 4, !tbaa !9
  %35 = icmp sle i32 0, %34
  br i1 %35, label %36, label %39

36:                                               ; preds = %33
  %37 = load i32, ptr @C, align 4, !tbaa !9
  %38 = icmp sle i32 %37, 100000
  br label %39

39:                                               ; preds = %36, %33
  %40 = phi i1 [ false, %33 ], [ %38, %36 ]
  br i1 %40, label %41, label %42

41:                                               ; preds = %39
  br label %44

42:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.3, i32 noundef 175, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

43:                                               ; No predecessors!
  br label %44

44:                                               ; preds = %43, %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %118, %44
  %46 = load i32, ptr %3, align 4, !tbaa !9
  %47 = load i32, ptr @m, align 4, !tbaa !9
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %121

50:                                               ; preds = %45
  %51 = load i32, ptr %3, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %52
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %53)
  %54 = load i32, ptr %3, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %55
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %56)
  %57 = load i32, ptr %3, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100001 x i32], ptr @p, i64 0, i64 %58
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %59)
  %60 = load i32, ptr %3, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = icmp sle i32 1, %63
  br i1 %64, label %65, label %72

65:                                               ; preds = %50
  %66 = load i32, ptr %3, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = load i32, ptr @n, align 4, !tbaa !9
  %71 = icmp sle i32 %69, %70
  br label %72

72:                                               ; preds = %65, %50
  %73 = phi i1 [ false, %50 ], [ %71, %65 ]
  br i1 %73, label %74, label %75

74:                                               ; preds = %72
  br label %77

75:                                               ; preds = %72
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.3, i32 noundef 179, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

76:                                               ; No predecessors!
  br label %77

77:                                               ; preds = %76, %74
  %78 = load i32, ptr %3, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = icmp sle i32 1, %81
  br i1 %82, label %83, label %90

83:                                               ; preds = %77
  %84 = load i32, ptr %3, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = load i32, ptr @n, align 4, !tbaa !9
  %89 = icmp sle i32 %87, %88
  br label %90

90:                                               ; preds = %83, %77
  %91 = phi i1 [ false, %77 ], [ %89, %83 ]
  br i1 %91, label %92, label %93

92:                                               ; preds = %90
  br label %95

93:                                               ; preds = %90
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.3, i32 noundef 180, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

94:                                               ; No predecessors!
  br label %95

95:                                               ; preds = %94, %92
  %96 = load i32, ptr %3, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100001 x i32], ptr @p, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !9
  %100 = icmp sle i32 1, %99
  br i1 %100, label %101, label %108

101:                                              ; preds = %95
  %102 = load i32, ptr %3, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [100001 x i32], ptr @p, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !9
  %106 = load i32, ptr @n, align 4, !tbaa !9
  %107 = icmp sle i32 %105, %106
  br label %108

108:                                              ; preds = %101, %95
  %109 = phi i1 [ false, %95 ], [ %107, %101 ]
  br i1 %109, label %110, label %111

110:                                              ; preds = %108
  br label %113

111:                                              ; preds = %108
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.3, i32 noundef 181, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

112:                                              ; No predecessors!
  br label %113

113:                                              ; preds = %112, %110
  %114 = load i32, ptr %3, align 4, !tbaa !9
  %115 = load i32, ptr %3, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %116
  store i32 %114, ptr %117, align 4, !tbaa !9
  br label %118

118:                                              ; preds = %113
  %119 = load i32, ptr %3, align 4, !tbaa !9
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %3, align 4, !tbaa !9
  br label %45, !llvm.loop !11

121:                                              ; preds = %49
  %122 = load i32, ptr @m, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i32, ptr @ord, i64 %123
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef @ord, ptr noundef %124, ptr noundef @_Z3cmpRKiS0_)
  call void @_Z5solvev()
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %125

125:                                              ; preds = %145, %121
  %126 = load i32, ptr %4, align 4, !tbaa !9
  %127 = load i32, ptr @m, align 4, !tbaa !9
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %130, label %129

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

130:                                              ; preds = %125
  %131 = load i32, ptr %4, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %132
  %134 = load i32, ptr %4, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %135
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %133, ptr noundef nonnull align 4 dereferenceable(4) %136) #8
  %137 = load i32, ptr %4, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !9
  %141 = sub nsw i32 0, %140
  %142 = load i32, ptr %4, align 4, !tbaa !9
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %143
  store i32 %141, ptr %144, align 4, !tbaa !9
  br label %145

145:                                              ; preds = %130
  %146 = load i32, ptr %4, align 4, !tbaa !9
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %4, align 4, !tbaa !9
  br label %125, !llvm.loop !13

148:                                              ; preds = %129
  %149 = load i32, ptr @m, align 4, !tbaa !9
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds i32, ptr @ord, i64 %150
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef @ord, ptr noundef %151, ptr noundef @_Z3cmpRKiS0_)
  call void @_Z5solvev()
  %152 = load i32, ptr @ans, align 4, !tbaa !9
  call void @_ZN6fastIO7printlnEi(i32 noundef %152)
  br label %7, !llvm.loop !14

153:                                              ; preds = %7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #7

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


; 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
@C = external dso_local global i32, align 4
@x = external dso_local global [100001 x i32], align 16
@y = external dso_local global [100001 x i32], align 16
@p = external dso_local global [100001 x i32], align 16
@ord = external dso_local global [100001 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [80 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solvev() local_unnamed_addr #1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = load ptr, ptr @stdin, align 8, !tbaa !5
  %3 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %1)
  %4 = load i32, ptr %1, align 4, !tbaa !9
  %5 = add nsw i32 %4, -1
  store i32 %5, ptr %1, align 4, !tbaa !9
  %.not44 = icmp eq i32 %4, 0
  br i1 %.not44, label %._crit_edge47, label %.lr.ph46

.lr.ph46:                                         ; preds = %0, %._crit_edge42
  store i32 0, ptr @ans, align 4, !tbaa !9
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @C)
  %6 = load i32, ptr @n, align 4
  %7 = add i32 %6, -1
  %8 = icmp ult i32 %7, 100000
  br i1 %8, label %10, label %9

9:                                                ; preds = %.lr.ph46
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 173, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

10:                                               ; preds = %.lr.ph46
  %11 = load i32, ptr @m, align 4
  %12 = add i32 %11, -1
  %13 = icmp ult i32 %12, 100000
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 174, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

15:                                               ; preds = %10
  %16 = load i32, ptr @C, align 4
  %17 = icmp ult i32 %16, 100001
  br i1 %17, label %.lr.ph, label %18

18:                                               ; preds = %15
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, i32 noundef 175, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

._crit_edge:                                      ; preds = %35
  %19 = getelementptr inbounds i32, ptr @ord, i64 %39
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull @ord, ptr noundef nonnull %19, ptr noundef nonnull @_Z3cmpRKiS0_)
  call void @_Z5solvev()
  %20 = load i32, ptr @m, align 4, !tbaa !9
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph41, label %._crit_edge.._crit_edge42_crit_edge

._crit_edge.._crit_edge42_crit_edge:              ; preds = %._crit_edge
  %.pre54 = sext i32 %20 to i64
  br label %._crit_edge42

.lr.ph:                                           ; preds = %15, %35
  %indvars.iv = phi i64 [ %indvars.iv.next, %35 ], [ 0, %15 ]
  %22 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %indvars.iv
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %22)
  %23 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %indvars.iv
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %23)
  %24 = getelementptr inbounds [100001 x i32], ptr @p, i64 0, i64 %indvars.iv
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %24)
  %25 = load i32, ptr %22, align 4, !tbaa !9
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %27, label %.critedge

27:                                               ; preds = %.lr.ph
  %28 = load i32, ptr @n, align 4, !tbaa !9
  %.not30 = icmp sgt i32 %25, %28
  br i1 %.not30, label %.critedge, label %29

.critedge:                                        ; preds = %.lr.ph, %27
  call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.3, i32 noundef 179, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

29:                                               ; preds = %27
  %30 = load i32, ptr %23, align 4, !tbaa !9
  %31 = icmp slt i32 %30, 1
  %.not31 = icmp sgt i32 %30, %28
  %or.cond = or i1 %31, %.not31
  br i1 %or.cond, label %.critedge2, label %32

.critedge2:                                       ; preds = %29
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.3, i32 noundef 180, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

32:                                               ; preds = %29
  %33 = load i32, ptr %24, align 4, !tbaa !9
  %34 = icmp slt i32 %33, 1
  %.not32 = icmp sgt i32 %33, %28
  %or.cond33 = or i1 %34, %.not32
  br i1 %or.cond33, label %.critedge4, label %35

.critedge4:                                       ; preds = %32
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.3, i32 noundef 181, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

35:                                               ; preds = %32
  %36 = getelementptr inbounds [100001 x i32], ptr @ord, i64 0, i64 %indvars.iv
  %37 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %37, ptr %36, align 4, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %38 = load i32, ptr @m, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = icmp slt i64 %indvars.iv.next, %39
  br i1 %40, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge42:                                    ; preds = %.lr.ph41, %._crit_edge.._crit_edge42_crit_edge
  %.pre-phi55 = phi i64 [ %.pre54, %._crit_edge.._crit_edge42_crit_edge ], [ %50, %.lr.ph41 ]
  %41 = getelementptr inbounds i32, ptr @ord, i64 %.pre-phi55
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull @ord, ptr noundef nonnull %41, ptr noundef nonnull @_Z3cmpRKiS0_)
  call void @_Z5solvev()
  %42 = load i32, ptr @ans, align 4, !tbaa !9
  call void @_ZN6fastIO7printlnEi(i32 noundef %42)
  %43 = load i32, ptr %1, align 4, !tbaa !9
  %44 = add nsw i32 %43, -1
  store i32 %44, ptr %1, align 4, !tbaa !9
  %.not = icmp eq i32 %43, 0
  br i1 %.not, label %._crit_edge47, label %.lr.ph46, !llvm.loop !13

.lr.ph41:                                         ; preds = %._crit_edge, %.lr.ph41
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %.lr.ph41 ], [ 0, %._crit_edge ]
  %45 = getelementptr inbounds [100001 x i32], ptr @x, i64 0, i64 %indvars.iv51
  %46 = getelementptr inbounds [100001 x i32], ptr @y, i64 0, i64 %indvars.iv51
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %45, ptr noundef nonnull align 4 dereferenceable(4) %46) #8
  %47 = load i32, ptr %45, align 4, !tbaa !9
  %48 = sub nsw i32 0, %47
  store i32 %48, ptr %45, align 4, !tbaa !9
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %49 = load i32, ptr @m, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next52, %50
  br i1 %51, label %.lr.ph41, label %._crit_edge42, !llvm.loop !14

._crit_edge47:                                    ; preds = %._crit_edge42, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6fastIO7printlnEi(i32 noundef) local_unnamed_addr #5

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


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