; LLVM IR from tangjz/acm-icpc :: codeforces/complete (297C)

; 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
@s = external dso_local global [111111 x i32], align 16
@no = external dso_local global [111111 x i32], align 16
@a = external dso_local global [111111 x i32], align 16
@b = external dso_local global [111111 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 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)) #0

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

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

13:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %26

14:                                               ; preds = %9
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds i32, ptr @s, i64 %16
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %17)
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %21
  store i32 %19, ptr %22, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %14
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %2, align 4, !tbaa !5
  br label %9, !llvm.loop !9

26:                                               ; preds = %13
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr @no, i64 %28
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef @no, ptr noundef %29, ptr noundef @_Z3cmpRKiS0_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %57, %26
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = add nsw i32 %32, 2
  %34 = sdiv i32 %33, 3
  %35 = icmp slt i32 %31, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %60

37:                                               ; preds = %30
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [111111 x i32], ptr @a, i64 0, i64 %42
  store i32 0, ptr %43, align 4, !tbaa !5
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [111111 x i32], ptr @s, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [111111 x i32], ptr @b, i64 0, i64 %55
  store i32 %50, ptr %56, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %37
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %3, align 4, !tbaa !5
  br label %30, !llvm.loop !11

60:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = add nsw i32 %61, 2
  %63 = sdiv i32 %62, 3
  store i32 %63, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %116, %60
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = load i32, ptr @n, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %69, label %68

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

69:                                               ; preds = %64
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = ashr i32 %70, 1
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [111111 x i32], ptr @a, i64 0, i64 %76
  store i32 %71, ptr %77, align 4, !tbaa !5
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [111111 x i32], ptr @s, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [111111 x i32], ptr @a, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sub nsw i32 %84, %91
  %93 = load i32, ptr %4, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [111111 x i32], ptr @b, i64 0, i64 %97
  store i32 %92, ptr %98, align 4, !tbaa !5
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = and i32 %99, 1
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %115

102:                                              ; preds = %69
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [111111 x i32], ptr @a, i64 0, i64 %107
  %109 = load i32, ptr %4, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [111111 x i32], ptr @b, i64 0, i64 %113
  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) %108, ptr noundef nonnull align 4 dereferenceable(4) %114) #6
  br label %115

115:                                              ; preds = %102, %69
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %4, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %4, align 4, !tbaa !5
  %119 = load i32, ptr %5, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %5, align 4, !tbaa !5
  br label %64, !llvm.loop !12

121:                                              ; preds = %68
  %122 = call i32 @puts(ptr noundef @.str.1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %134, %121
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = load i32, ptr @n, align 4, !tbaa !5
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %137

128:                                              ; preds = %123
  %129 = load i32, ptr %6, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [111111 x i32], ptr @a, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %132)
  br label %134

134:                                              ; preds = %128
  %135 = load i32, ptr %6, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %6, align 4, !tbaa !5
  br label %123, !llvm.loop !13

137:                                              ; preds = %127
  %138 = call i32 @putchar(i32 noundef 10)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %150, %137
  %140 = load i32, ptr %7, align 4, !tbaa !5
  %141 = load i32, ptr @n, align 4, !tbaa !5
  %142 = icmp slt i32 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %153

144:                                              ; preds = %139
  %145 = load i32, ptr %7, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [111111 x i32], ptr @b, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %148)
  br label %150

150:                                              ; preds = %144
  %151 = load i32, ptr %7, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %7, align 4, !tbaa !5
  br label %139, !llvm.loop !14

153:                                              ; preds = %143
  %154 = call i32 @putchar(i32 noundef 10)
  ret i32 0
}

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

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

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

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

; 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)) #5

declare i32 @puts(ptr noundef) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @putchar(i32 noundef) #4

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !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
@s = external dso_local global [111111 x i32], align 16
@no = external dso_local global [111111 x i32], align 16
@a = external dso_local global [111111 x i32], align 16
@b = external dso_local global [111111 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 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)) #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)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre65 = sext i32 %2 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre65, %.._crit_edge_crit_edge ], [ %15, %.lr.ph ]
  %4 = getelementptr inbounds i32, ptr @no, i64 %.pre-phi
  tail call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull @no, ptr noundef nonnull %4, ptr noundef nonnull @_Z3cmpRKiS0_)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = add nsw i32 %5, 2
  %7 = sdiv i32 %6, 3
  %8 = icmp sgt i32 %5, 0
  br i1 %8, label %.lr.ph38.preheader, label %.preheader

.lr.ph38.preheader:                               ; preds = %._crit_edge
  %smax = tail call i32 @llvm.smax.i32(i32 %7, i32 1)
  %wide.trip.count = zext nneg i32 %smax to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %9 = icmp slt i32 %5, 4
  br i1 %9, label %.preheader.loopexit.unr-lcssa, label %.lr.ph38.preheader.new

.lr.ph38.preheader.new:                           ; preds = %.lr.ph38.preheader
  %unroll_iter = and i64 %wide.trip.count, 1073741822
  br label %.lr.ph38

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %10 = getelementptr inbounds i32, ptr @s, i64 %indvars.iv
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %10)
  %12 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %indvars.iv
  %13 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %13, ptr %12, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = icmp slt i64 %indvars.iv.next, %15
  br i1 %16, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader.loopexit.unr-lcssa:                    ; preds = %.lr.ph38, %.lr.ph38.preheader
  %indvars.iv53.unr = phi i64 [ 0, %.lr.ph38.preheader ], [ %indvars.iv.next54.1, %.lr.ph38 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph38.epil

.lr.ph38.epil:                                    ; preds = %.preheader.loopexit.unr-lcssa
  %17 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %indvars.iv53.unr
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [111111 x i32], ptr @a, i64 0, i64 %19
  store i32 0, ptr %20, align 4, !tbaa !5
  %21 = getelementptr inbounds [111111 x i32], ptr @s, i64 0, i64 %19
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = getelementptr inbounds [111111 x i32], ptr @b, i64 0, i64 %19
  store i32 %22, ptr %23, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph38.epil, %.preheader.loopexit.unr-lcssa, %._crit_edge
  %24 = icmp slt i32 %7, %5
  br i1 %24, label %.lr.ph42.preheader, label %._crit_edge43

.lr.ph42.preheader:                               ; preds = %.preheader
  %25 = sext i32 %7 to i64
  br label %.lr.ph42

.lr.ph38:                                         ; preds = %.lr.ph38, %.lr.ph38.preheader.new
  %indvars.iv53 = phi i64 [ 0, %.lr.ph38.preheader.new ], [ %indvars.iv.next54.1, %.lr.ph38 ]
  %niter = phi i64 [ 0, %.lr.ph38.preheader.new ], [ %niter.next.1, %.lr.ph38 ]
  %26 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %indvars.iv53
  %27 = load i32, ptr %26, align 8, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [111111 x i32], ptr @a, i64 0, i64 %28
  store i32 0, ptr %29, align 4, !tbaa !5
  %30 = getelementptr inbounds [111111 x i32], ptr @s, i64 0, i64 %28
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = getelementptr inbounds [111111 x i32], ptr @b, i64 0, i64 %28
  store i32 %31, ptr %32, align 4, !tbaa !5
  %indvars.iv.next54 = or disjoint i64 %indvars.iv53, 1
  %33 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %indvars.iv.next54
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [111111 x i32], ptr @a, i64 0, i64 %35
  store i32 0, ptr %36, align 4, !tbaa !5
  %37 = getelementptr inbounds [111111 x i32], ptr @s, i64 0, i64 %35
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = getelementptr inbounds [111111 x i32], ptr @b, i64 0, i64 %35
  store i32 %38, ptr %39, align 4, !tbaa !5
  %indvars.iv.next54.1 = add nuw nsw i64 %indvars.iv53, 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 %.preheader.loopexit.unr-lcssa, label %.lr.ph38, !llvm.loop !11

._crit_edge43:                                    ; preds = %55, %.preheader
  %40 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.lr.ph46, label %._crit_edge47

.lr.ph42:                                         ; preds = %.lr.ph42.preheader, %55
  %43 = phi i32 [ %5, %.lr.ph42.preheader ], [ %56, %55 ]
  %indvars.iv56 = phi i64 [ %25, %.lr.ph42.preheader ], [ %indvars.iv.next57, %55 ]
  %.02841 = phi i32 [ 0, %.lr.ph42.preheader ], [ %57, %55 ]
  %44 = lshr i32 %.02841, 1
  %45 = getelementptr inbounds [111111 x i32], ptr @no, i64 0, i64 %indvars.iv56
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [111111 x i32], ptr @a, i64 0, i64 %47
  store i32 %44, ptr %48, align 4, !tbaa !5
  %49 = getelementptr inbounds [111111 x i32], ptr @s, i64 0, i64 %47
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = sub nsw i32 %50, %44
  %52 = getelementptr inbounds [111111 x i32], ptr @b, i64 0, i64 %47
  store i32 %51, ptr %52, align 4, !tbaa !5
  %53 = and i32 %.02841, 1
  %.not = icmp eq i32 %53, 0
  br i1 %.not, label %55, label %54

54:                                               ; preds = %.lr.ph42
  tail 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) %48, ptr noundef nonnull align 4 dereferenceable(4) %52) #7
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %.lr.ph42, %54
  %56 = phi i32 [ %43, %.lr.ph42 ], [ %.pre, %54 ]
  %indvars.iv.next57 = add nsw i64 %indvars.iv56, 1
  %57 = add nuw nsw i32 %.02841, 1
  %58 = sext i32 %56 to i64
  %59 = icmp slt i64 %indvars.iv.next57, %58
  br i1 %59, label %.lr.ph42, label %._crit_edge43, !llvm.loop !12

._crit_edge47:                                    ; preds = %.lr.ph46, %._crit_edge43
  %60 = tail call i32 @putchar(i32 noundef 10)
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = icmp sgt i32 %61, 0
  br i1 %62, label %.lr.ph50, label %._crit_edge51

.lr.ph46:                                         ; preds = %._crit_edge43, %.lr.ph46
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %.lr.ph46 ], [ 0, %._crit_edge43 ]
  %63 = getelementptr inbounds [111111 x i32], ptr @a, i64 0, i64 %indvars.iv59
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %64)
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %66 = load i32, ptr @n, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = icmp slt i64 %indvars.iv.next60, %67
  br i1 %68, label %.lr.ph46, label %._crit_edge47, !llvm.loop !13

._crit_edge51:                                    ; preds = %.lr.ph50, %._crit_edge47
  %69 = tail call i32 @putchar(i32 noundef 10)
  ret i32 0

.lr.ph50:                                         ; preds = %._crit_edge47, %.lr.ph50
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %.lr.ph50 ], [ 0, %._crit_edge47 ]
  %70 = getelementptr inbounds [111111 x i32], ptr @b, i64 0, i64 %indvars.iv62
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %71)
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %73 = load i32, ptr @n, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv.next63, %74
  br i1 %75, label %.lr.ph50, label %._crit_edge51, !llvm.loop !14
}

; 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: 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 #4

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

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

; Function Attrs: inlinehint mustprogress nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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" }
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 nofree 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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