; LLVM IR from reyadussalahin/problem-solving :: data_structure/array/codeforces/F1490F (Solution)

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

@a = external dso_local global [200020 x i32], align 16
@c = external dso_local global [200020 x i32], align 16
@b = external dso_local global [200020 x i32], align 16
@s = external dso_local global [200020 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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %161, %0
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %164

22:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %37, %22
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %24
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %31
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %32)
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [200020 x i32], ptr @c, i64 0, i64 %35
  store i32 0, ptr %36, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %29
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %6, align 4, !tbaa !5
  br label %24, !llvm.loop !9

40:                                               ; preds = %28
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr @a, i64 %42
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @a, ptr noundef %43)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %44 = load i32, ptr @a, align 16, !tbaa !5
  store i32 %44, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %71, %40
  %46 = load i32, ptr %9, align 4, !tbaa !5
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %74

50:                                               ; preds = %45
  %51 = load i32, ptr %9, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = icmp eq i32 %54, %55
  br i1 %56, label %57, label %60

57:                                               ; preds = %50
  %58 = load i32, ptr %8, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %8, align 4, !tbaa !5
  br label %70

60:                                               ; preds = %50
  %61 = load i32, ptr %8, align 4, !tbaa !5
  %62 = load i32, ptr %9, align 4, !tbaa !5
  %63 = sub nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [200020 x i32], ptr @c, i64 0, i64 %64
  store i32 %61, ptr %65, align 4, !tbaa !5
  %66 = load i32, ptr %9, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  store i32 %69, ptr %7, align 4, !tbaa !5
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %60, %57
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %9, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %9, align 4, !tbaa !5
  br label %45, !llvm.loop !11

74:                                               ; preds = %49
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = sub nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [200020 x i32], ptr @c, i64 0, i64 %78
  store i32 %75, ptr %79, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %101, %74
  %81 = load i32, ptr %11, align 4, !tbaa !5
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %85, label %84

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

85:                                               ; preds = %80
  %86 = load i32, ptr %11, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [200020 x i32], ptr @c, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = icmp sgt i32 %89, 0
  br i1 %90, label %91, label %100

91:                                               ; preds = %85
  %92 = load i32, ptr %11, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [200020 x i32], ptr @c, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = load i32, ptr %10, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %10, align 4, !tbaa !5
  %98 = sext i32 %96 to i64
  %99 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %98
  store i32 %95, ptr %99, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %91, %85
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %11, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %11, align 4, !tbaa !5
  br label %80, !llvm.loop !12

104:                                              ; preds = %84
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds i32, ptr @b, i64 %106
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @b, ptr noundef %107)
  %108 = load i32, ptr @b, align 16, !tbaa !5
  store i32 %108, ptr @s, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %128, %104
  %110 = load i32, ptr %12, align 4, !tbaa !5
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %131

114:                                              ; preds = %109
  %115 = load i32, ptr %12, align 4, !tbaa !5
  %116 = sub nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [200020 x i32], ptr @s, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = load i32, ptr %12, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = add nsw i32 %119, %123
  %125 = load i32, ptr %12, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [200020 x i32], ptr @s, i64 0, i64 %126
  store i32 %124, ptr %127, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %114
  %129 = load i32, ptr %12, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %12, align 4, !tbaa !5
  br label %109, !llvm.loop !13

131:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 200020, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = sub nsw i32 %132, 1
  store i32 %133, ptr %14, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %155, %131
  %135 = load i32, ptr %14, align 4, !tbaa !5
  %136 = icmp sge i32 %135, 0
  br i1 %136, label %138, label %137

137:                                              ; preds = %134
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %158

138:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %139 = load i32, ptr %10, align 4, !tbaa !5
  %140 = sub nsw i32 %139, 1
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [200020 x i32], ptr @s, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = load i32, ptr %14, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = load i32, ptr %10, align 4, !tbaa !5
  %149 = load i32, ptr %14, align 4, !tbaa !5
  %150 = sub nsw i32 %148, %149
  %151 = mul nsw i32 %147, %150
  %152 = sub nsw i32 %143, %151
  store i32 %152, ptr %15, align 4, !tbaa !5
  %153 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %154 = load i32, ptr %153, align 4, !tbaa !5
  store i32 %154, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %155

155:                                              ; preds = %138
  %156 = load i32, ptr %14, align 4, !tbaa !5
  %157 = add nsw i32 %156, -1
  store i32 %157, ptr %14, align 4, !tbaa !5
  br label %134, !llvm.loop !14

158:                                              ; preds = %137
  %159 = load i32, ptr %13, align 4, !tbaa !5
  %160 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %159)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %161

161:                                              ; preds = %158
  %162 = load i32, ptr %3, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %3, align 4, !tbaa !5
  br label %17, !llvm.loop !15

164:                                              ; preds = %21
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %165 = load i32, ptr %1, align 4
  ret i32 %165
}

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

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

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

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

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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}
!15 = distinct !{!15, !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"

@a = external dso_local global [200020 x i32], align 16
@c = external dso_local local_unnamed_addr global [200020 x i32], align 16
@b = external dso_local global [200020 x i32], align 16
@s = external dso_local local_unnamed_addr global [200020 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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph75, label %._crit_edge76

._crit_edge76:                                    ; preds = %._crit_edge72, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

.lr.ph75:                                         ; preds = %0, %._crit_edge72
  %.04473 = phi i32 [ %110, %._crit_edge72 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %.lr.ph75.._crit_edge_crit_edge

.lr.ph75.._crit_edge_crit_edge:                   ; preds = %.lr.ph75
  %.pre = sext i32 %9 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph75.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.lr.ph75.._crit_edge_crit_edge ], [ %21, %.lr.ph ]
  %11 = getelementptr inbounds i32, ptr @a, i64 %.pre-phi
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @a, ptr noundef nonnull %11)
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 1
  br i1 %13, label %.lr.ph55.preheader, label %._crit_edge56

.lr.ph55.preheader:                               ; preds = %._crit_edge
  %14 = load i32, ptr @a, align 16, !tbaa !5
  %wide.trip.count = zext nneg i32 %12 to i64
  %15 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %15, 1
  %16 = icmp eq i32 %12, 2
  br i1 %16, label %._crit_edge56.loopexit.unr-lcssa, label %.lr.ph55.preheader.new

.lr.ph55.preheader.new:                           ; preds = %.lr.ph55.preheader
  %unroll_iter = and i64 %15, -2
  br label %.lr.ph55

.lr.ph:                                           ; preds = %.lr.ph75, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph75 ]
  %17 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %indvars.iv
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %17)
  %19 = getelementptr inbounds [200020 x i32], ptr @c, i64 0, i64 %indvars.iv
  store i32 0, ptr %19, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge56.loopexit.unr-lcssa:                 ; preds = %51, %.lr.ph55.preheader
  %.140.lcssa.ph = phi i32 [ poison, %.lr.ph55.preheader ], [ %.140.1, %51 ]
  %indvars.iv79.unr = phi i64 [ 1, %.lr.ph55.preheader ], [ %indvars.iv.next80.1, %51 ]
  %.03952.unr = phi i32 [ 1, %.lr.ph55.preheader ], [ %.140.1, %51 ]
  %.04151.unr = phi i32 [ %14, %.lr.ph55.preheader ], [ %.142.1, %51 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge56, label %.lr.ph55.epil

.lr.ph55.epil:                                    ; preds = %._crit_edge56.loopexit.unr-lcssa
  %23 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %indvars.iv79.unr
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = icmp eq i32 %24, %.04151.unr
  br i1 %25, label %29, label %26

26:                                               ; preds = %.lr.ph55.epil
  %27 = add nsw i64 %indvars.iv79.unr, -1
  %28 = getelementptr inbounds [200020 x i32], ptr @c, i64 0, i64 %27
  store i32 %.03952.unr, ptr %28, align 4, !tbaa !5
  br label %._crit_edge56

29:                                               ; preds = %.lr.ph55.epil
  %30 = add nsw i32 %.03952.unr, 1
  br label %._crit_edge56

._crit_edge56:                                    ; preds = %._crit_edge56.loopexit.unr-lcssa, %29, %26, %._crit_edge
  %.039.lcssa = phi i32 [ 1, %._crit_edge ], [ %.140.lcssa.ph, %._crit_edge56.loopexit.unr-lcssa ], [ %30, %29 ], [ 1, %26 ]
  %31 = add nsw i32 %12, -1
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [200020 x i32], ptr @c, i64 0, i64 %32
  store i32 %.039.lcssa, ptr %33, align 4, !tbaa !5
  %34 = icmp sgt i32 %12, 0
  br i1 %34, label %.lr.ph62.preheader, label %._crit_edge63

.lr.ph62.preheader:                               ; preds = %._crit_edge56
  %wide.trip.count85 = zext nneg i32 %12 to i64
  %xtraiter100 = and i64 %wide.trip.count85, 1
  %35 = icmp eq i32 %12, 1
  br i1 %35, label %._crit_edge63.loopexit.unr-lcssa, label %.lr.ph62.preheader.new

.lr.ph62.preheader.new:                           ; preds = %.lr.ph62.preheader
  %unroll_iter103 = and i64 %wide.trip.count85, 2147483646
  br label %.lr.ph62

.lr.ph55:                                         ; preds = %51, %.lr.ph55.preheader.new
  %indvars.iv79 = phi i64 [ 1, %.lr.ph55.preheader.new ], [ %indvars.iv.next80.1, %51 ]
  %.03952 = phi i32 [ 1, %.lr.ph55.preheader.new ], [ %.140.1, %51 ]
  %.04151 = phi i32 [ %14, %.lr.ph55.preheader.new ], [ %.142.1, %51 ]
  %niter = phi i64 [ 0, %.lr.ph55.preheader.new ], [ %niter.next.1, %51 ]
  %36 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %indvars.iv79
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = icmp eq i32 %37, %.04151
  br i1 %38, label %39, label %41

39:                                               ; preds = %.lr.ph55
  %40 = add nsw i32 %.03952, 1
  br label %.lr.ph55.1

41:                                               ; preds = %.lr.ph55
  %42 = add nsw i64 %indvars.iv79, -1
  %43 = getelementptr inbounds [200020 x i32], ptr @c, i64 0, i64 %42
  store i32 %.03952, ptr %43, align 4, !tbaa !5
  br label %.lr.ph55.1

.lr.ph55.1:                                       ; preds = %39, %41
  %.142 = phi i32 [ %.04151, %39 ], [ %37, %41 ]
  %.140 = phi i32 [ %40, %39 ], [ 1, %41 ]
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %44 = getelementptr inbounds [200020 x i32], ptr @a, i64 0, i64 %indvars.iv.next80
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = icmp eq i32 %45, %.142
  br i1 %46, label %49, label %47

47:                                               ; preds = %.lr.ph55.1
  %48 = getelementptr inbounds [200020 x i32], ptr @c, i64 0, i64 %indvars.iv79
  store i32 %.140, ptr %48, align 4, !tbaa !5
  br label %51

49:                                               ; preds = %.lr.ph55.1
  %50 = add nsw i32 %.140, 1
  br label %51

51:                                               ; preds = %49, %47
  %.142.1 = phi i32 [ %.142, %49 ], [ %45, %47 ]
  %.140.1 = phi i32 [ %50, %49 ], [ 1, %47 ]
  %indvars.iv.next80.1 = add nuw nsw i64 %indvars.iv79, 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 %._crit_edge56.loopexit.unr-lcssa, label %.lr.ph55, !llvm.loop !11

._crit_edge63.loopexit.unr-lcssa:                 ; preds = %80, %.lr.ph62.preheader
  %.1.lcssa.ph = phi i32 [ poison, %.lr.ph62.preheader ], [ %.1.1, %80 ]
  %indvars.iv82.unr = phi i64 [ 0, %.lr.ph62.preheader ], [ %indvars.iv.next83.1, %80 ]
  %.03759.unr = phi i32 [ 0, %.lr.ph62.preheader ], [ %.1.1, %80 ]
  %lcmp.mod101.not = icmp eq i64 %xtraiter100, 0
  br i1 %lcmp.mod101.not, label %._crit_edge63, label %.lr.ph62.epil

.lr.ph62.epil:                                    ; preds = %._crit_edge63.loopexit.unr-lcssa
  %52 = getelementptr inbounds [200020 x i32], ptr @c, i64 0, i64 %indvars.iv82.unr
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = icmp sgt i32 %53, 0
  br i1 %54, label %55, label %._crit_edge63

55:                                               ; preds = %.lr.ph62.epil
  %56 = add nsw i32 %.03759.unr, 1
  %57 = sext i32 %.03759.unr to i64
  %58 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %57
  store i32 %53, ptr %58, align 4, !tbaa !5
  br label %._crit_edge63

._crit_edge63:                                    ; preds = %._crit_edge63.loopexit.unr-lcssa, %55, %.lr.ph62.epil, %._crit_edge56
  %.037.lcssa = phi i32 [ 0, %._crit_edge56 ], [ %.1.lcssa.ph, %._crit_edge63.loopexit.unr-lcssa ], [ %56, %55 ], [ %.03759.unr, %.lr.ph62.epil ]
  %59 = sext i32 %.037.lcssa to i64
  %60 = getelementptr inbounds i32, ptr @b, i64 %59
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @b, ptr noundef nonnull %60)
  %61 = load i32, ptr @b, align 16, !tbaa !5
  store i32 %61, ptr @s, align 16, !tbaa !5
  %62 = icmp sgt i32 %.037.lcssa, 1
  br i1 %62, label %.lr.ph67.preheader, label %._crit_edge68

.lr.ph67.preheader:                               ; preds = %._crit_edge63
  %wide.trip.count90 = zext nneg i32 %.037.lcssa to i64
  %63 = add nsw i64 %wide.trip.count90, -1
  %64 = add nsw i64 %wide.trip.count90, -2
  %xtraiter105 = and i64 %63, 3
  %65 = icmp ult i64 %64, 3
  br i1 %65, label %._crit_edge68.loopexit.unr-lcssa, label %.lr.ph67.preheader.new

.lr.ph67.preheader.new:                           ; preds = %.lr.ph67.preheader
  %unroll_iter107 = and i64 %63, -4
  br label %.lr.ph67

.lr.ph62:                                         ; preds = %80, %.lr.ph62.preheader.new
  %indvars.iv82 = phi i64 [ 0, %.lr.ph62.preheader.new ], [ %indvars.iv.next83.1, %80 ]
  %.03759 = phi i32 [ 0, %.lr.ph62.preheader.new ], [ %.1.1, %80 ]
  %niter104 = phi i64 [ 0, %.lr.ph62.preheader.new ], [ %niter104.next.1, %80 ]
  %66 = getelementptr inbounds [200020 x i32], ptr @c, i64 0, i64 %indvars.iv82
  %67 = load i32, ptr %66, align 8, !tbaa !5
  %68 = icmp sgt i32 %67, 0
  br i1 %68, label %69, label %.lr.ph62.1

69:                                               ; preds = %.lr.ph62
  %70 = add nsw i32 %.03759, 1
  %71 = sext i32 %.03759 to i64
  %72 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %71
  store i32 %67, ptr %72, align 4, !tbaa !5
  br label %.lr.ph62.1

.lr.ph62.1:                                       ; preds = %.lr.ph62, %69
  %.1 = phi i32 [ %70, %69 ], [ %.03759, %.lr.ph62 ]
  %indvars.iv.next83 = or disjoint i64 %indvars.iv82, 1
  %73 = getelementptr inbounds [200020 x i32], ptr @c, i64 0, i64 %indvars.iv.next83
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %76, label %80

76:                                               ; preds = %.lr.ph62.1
  %77 = add nsw i32 %.1, 1
  %78 = sext i32 %.1 to i64
  %79 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %78
  store i32 %74, ptr %79, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %76, %.lr.ph62.1
  %.1.1 = phi i32 [ %77, %76 ], [ %.1, %.lr.ph62.1 ]
  %indvars.iv.next83.1 = add nuw nsw i64 %indvars.iv82, 2
  %niter104.next.1 = add i64 %niter104, 2
  %niter104.ncmp.1 = icmp eq i64 %niter104.next.1, %unroll_iter103
  br i1 %niter104.ncmp.1, label %._crit_edge63.loopexit.unr-lcssa, label %.lr.ph62, !llvm.loop !12

._crit_edge68.loopexit.unr-lcssa:                 ; preds = %.lr.ph67, %.lr.ph67.preheader
  %.unr = phi i32 [ %61, %.lr.ph67.preheader ], [ %106, %.lr.ph67 ]
  %indvars.iv87.unr = phi i64 [ 1, %.lr.ph67.preheader ], [ %indvars.iv.next88.3, %.lr.ph67 ]
  %lcmp.mod106.not = icmp eq i64 %xtraiter105, 0
  br i1 %lcmp.mod106.not, label %._crit_edge68, label %.lr.ph67.epil

.lr.ph67.epil:                                    ; preds = %._crit_edge68.loopexit.unr-lcssa, %.lr.ph67.epil
  %81 = phi i32 [ %84, %.lr.ph67.epil ], [ %.unr, %._crit_edge68.loopexit.unr-lcssa ]
  %indvars.iv87.epil = phi i64 [ %indvars.iv.next88.epil, %.lr.ph67.epil ], [ %indvars.iv87.unr, %._crit_edge68.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph67.epil ], [ 0, %._crit_edge68.loopexit.unr-lcssa ]
  %82 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %indvars.iv87.epil
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = add nsw i32 %83, %81
  %85 = getelementptr inbounds [200020 x i32], ptr @s, i64 0, i64 %indvars.iv87.epil
  store i32 %84, ptr %85, align 4, !tbaa !5
  %indvars.iv.next88.epil = add nuw nsw i64 %indvars.iv87.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter105
  br i1 %epil.iter.cmp.not, label %._crit_edge68, label %.lr.ph67.epil, !llvm.loop !13

._crit_edge68:                                    ; preds = %._crit_edge68.loopexit.unr-lcssa, %.lr.ph67.epil, %._crit_edge63
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 200020, ptr %3, align 4, !tbaa !5
  %86 = icmp sgt i32 %.037.lcssa, 0
  br i1 %86, label %.lr.ph71, label %._crit_edge72

.lr.ph71:                                         ; preds = %._crit_edge68
  %87 = add nsw i32 %.037.lcssa, -1
  %88 = zext nneg i32 %87 to i64
  %89 = getelementptr inbounds [200020 x i32], ptr @s, i64 0, i64 %88
  %90 = zext nneg i32 %87 to i64
  br label %113

.lr.ph67:                                         ; preds = %.lr.ph67, %.lr.ph67.preheader.new
  %91 = phi i32 [ %61, %.lr.ph67.preheader.new ], [ %106, %.lr.ph67 ]
  %indvars.iv87 = phi i64 [ 1, %.lr.ph67.preheader.new ], [ %indvars.iv.next88.3, %.lr.ph67 ]
  %niter108 = phi i64 [ 0, %.lr.ph67.preheader.new ], [ %niter108.next.3, %.lr.ph67 ]
  %92 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %indvars.iv87
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = add nsw i32 %93, %91
  %95 = getelementptr inbounds [200020 x i32], ptr @s, i64 0, i64 %indvars.iv87
  store i32 %94, ptr %95, align 4, !tbaa !5
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %96 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %indvars.iv.next88
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = add nsw i32 %97, %94
  %99 = getelementptr inbounds [200020 x i32], ptr @s, i64 0, i64 %indvars.iv.next88
  store i32 %98, ptr %99, align 4, !tbaa !5
  %indvars.iv.next88.1 = add nuw nsw i64 %indvars.iv87, 2
  %100 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %indvars.iv.next88.1
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = add nsw i32 %101, %98
  %103 = getelementptr inbounds [200020 x i32], ptr @s, i64 0, i64 %indvars.iv.next88.1
  store i32 %102, ptr %103, align 4, !tbaa !5
  %indvars.iv.next88.2 = add nuw nsw i64 %indvars.iv87, 3
  %104 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %indvars.iv.next88.2
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = add nsw i32 %105, %102
  %107 = getelementptr inbounds [200020 x i32], ptr @s, i64 0, i64 %indvars.iv.next88.2
  store i32 %106, ptr %107, align 4, !tbaa !5
  %indvars.iv.next88.3 = add nuw nsw i64 %indvars.iv87, 4
  %niter108.next.3 = add i64 %niter108, 4
  %niter108.ncmp.3 = icmp eq i64 %niter108.next.3, %unroll_iter107
  br i1 %niter108.ncmp.3, label %._crit_edge68.loopexit.unr-lcssa, label %.lr.ph67, !llvm.loop !15

._crit_edge72:                                    ; preds = %113, %._crit_edge68
  %108 = phi i32 [ 200020, %._crit_edge68 ], [ %121, %113 ]
  %109 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %108)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %110 = add nuw nsw i32 %.04473, 1
  %111 = load i32, ptr %1, align 4, !tbaa !5
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %.lr.ph75, label %._crit_edge76, !llvm.loop !16

113:                                              ; preds = %.lr.ph71, %113
  %indvars.iv92 = phi i64 [ %90, %.lr.ph71 ], [ %indvars.iv.next93, %113 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %114 = load i32, ptr %89, align 4, !tbaa !5
  %115 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %indvars.iv92
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = trunc i64 %indvars.iv92 to i32
  %118 = sub i32 %117, %.037.lcssa
  %.neg48 = mul i32 %116, %118
  %119 = add i32 %.neg48, %114
  store i32 %119, ptr %4, align 4, !tbaa !5
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %121 = load i32, ptr %120, align 4, !tbaa !5
  store i32 %121, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %indvars.iv.next93 = add nsw i64 %indvars.iv92, -1
  %.not = icmp eq i64 %indvars.iv92, 0
  br i1 %.not, label %._crit_edge72, label %113, !llvm.loop !17
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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