; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/352 Division 1/Problem B (B)

; 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
@k = external dso_local global i32, align 4
@a = external dso_local global [500100 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress 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 i64, align 8
  %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 i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %17

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

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

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %24
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %25)
  br label %27

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

30:                                               ; preds = %21
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i32, ptr @a, i64 %32
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @a, ptr noundef %33)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %34 = load i32, ptr @a, align 16, !tbaa !5
  store i32 %34, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %35 = load i32, ptr @k, align 4, !tbaa !5
  store i32 %35, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %68, %30
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sub nsw i32 %45, %46
  %48 = sext i32 %47 to i64
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = mul nsw i64 %48, %50
  store i64 %51, ptr %7, align 8, !tbaa !11
  %52 = load i64, ptr %7, align 8, !tbaa !11
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = icmp sle i64 %52, %54
  br i1 %55, label %56, label %67

56:                                               ; preds = %41
  %57 = load i64, ptr %7, align 8, !tbaa !11
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = sub nsw i64 %59, %57
  %61 = trunc i64 %60 to i32
  store i32 %61, ptr %4, align 4, !tbaa !5
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  store i32 %65, ptr %3, align 4, !tbaa !5
  %66 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %66, ptr %5, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %56, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %6, align 4, !tbaa !5
  br label %36, !llvm.loop !13

71:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  %75 = sdiv i32 %72, %74
  store i32 %75, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  %79 = srem i32 %76, %78
  store i32 %79, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %102, %71
  %81 = load i32, ptr %10, align 4, !tbaa !5
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = icmp sle i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %105

85:                                               ; preds = %80
  %86 = load i32, ptr %3, align 4, !tbaa !5
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = add nsw i32 %86, %87
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %90
  store i32 %88, ptr %91, align 4, !tbaa !5
  %92 = load i32, ptr %10, align 4, !tbaa !5
  %93 = load i32, ptr %9, align 4, !tbaa !5
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %95, label %101

95:                                               ; preds = %85
  %96 = load i32, ptr %10, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %98, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %95, %85
  br label %102

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

105:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %120, %105
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = load i32, ptr @n, align 4, !tbaa !5
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %123

111:                                              ; preds = %106
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = sub nsw i32 0, %115
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %118
  store i32 %116, ptr %119, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %111
  %121 = load i32, ptr %11, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %11, align 4, !tbaa !5
  br label %106, !llvm.loop !15

123:                                              ; preds = %110
  %124 = load i32, ptr @n, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i32, ptr @a, i64 %125
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @a, ptr noundef %126)
  %127 = load i32, ptr @a, align 16, !tbaa !5
  store i32 %127, ptr %3, align 4, !tbaa !5
  %128 = load i32, ptr @k, align 4, !tbaa !5
  store i32 %128, ptr %4, align 4, !tbaa !5
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %161, %123
  %130 = load i32, ptr %12, align 4, !tbaa !5
  %131 = load i32, ptr @n, align 4, !tbaa !5
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %134, label %133

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

134:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %135 = load i32, ptr %12, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = load i32, ptr %3, align 4, !tbaa !5
  %140 = sub nsw i32 %138, %139
  %141 = sext i32 %140 to i64
  %142 = load i32, ptr %12, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = mul nsw i64 %141, %143
  store i64 %144, ptr %13, align 8, !tbaa !11
  %145 = load i64, ptr %13, align 8, !tbaa !11
  %146 = load i32, ptr %4, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = icmp sle i64 %145, %147
  br i1 %148, label %149, label %160

149:                                              ; preds = %134
  %150 = load i64, ptr %13, align 8, !tbaa !11
  %151 = load i32, ptr %4, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = sub nsw i64 %152, %150
  %154 = trunc i64 %153 to i32
  store i32 %154, ptr %4, align 4, !tbaa !5
  %155 = load i32, ptr %12, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  store i32 %158, ptr %3, align 4, !tbaa !5
  %159 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %159, ptr %5, align 4, !tbaa !5
  br label %160

160:                                              ; preds = %149, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %12, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %12, align 4, !tbaa !5
  br label %129, !llvm.loop !16

164:                                              ; preds = %133
  %165 = load i32, ptr %4, align 4, !tbaa !5
  %166 = load i32, ptr %5, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  %168 = sdiv i32 %165, %167
  store i32 %168, ptr %8, align 4, !tbaa !5
  %169 = load i32, ptr %4, align 4, !tbaa !5
  %170 = load i32, ptr %5, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  %172 = srem i32 %169, %171
  store i32 %172, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %173

173:                                              ; preds = %195, %164
  %174 = load i32, ptr %14, align 4, !tbaa !5
  %175 = load i32, ptr %5, align 4, !tbaa !5
  %176 = icmp sle i32 %174, %175
  br i1 %176, label %178, label %177

177:                                              ; preds = %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %198

178:                                              ; preds = %173
  %179 = load i32, ptr %3, align 4, !tbaa !5
  %180 = load i32, ptr %8, align 4, !tbaa !5
  %181 = add nsw i32 %179, %180
  %182 = load i32, ptr %14, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %183
  store i32 %181, ptr %184, align 4, !tbaa !5
  %185 = load i32, ptr %14, align 4, !tbaa !5
  %186 = load i32, ptr %9, align 4, !tbaa !5
  %187 = icmp slt i32 %185, %186
  br i1 %187, label %188, label %194

188:                                              ; preds = %178
  %189 = load i32, ptr %14, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %191, align 4, !tbaa !5
  br label %194

194:                                              ; preds = %188, %178
  br label %195

195:                                              ; preds = %194
  %196 = load i32, ptr %14, align 4, !tbaa !5
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %14, align 4, !tbaa !5
  br label %173, !llvm.loop !17

198:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %199

199:                                              ; preds = %213, %198
  %200 = load i32, ptr %15, align 4, !tbaa !5
  %201 = load i32, ptr @n, align 4, !tbaa !5
  %202 = icmp slt i32 %200, %201
  br i1 %202, label %204, label %203

203:                                              ; preds = %199
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %216

204:                                              ; preds = %199
  %205 = load i32, ptr %15, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !5
  %209 = sub nsw i32 0, %208
  %210 = load i32, ptr %15, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %211
  store i32 %209, ptr %212, align 4, !tbaa !5
  br label %213

213:                                              ; preds = %204
  %214 = load i32, ptr %15, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %15, align 4, !tbaa !5
  br label %199, !llvm.loop !18

216:                                              ; preds = %203
  %217 = load i32, ptr @n, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds i32, ptr @a, i64 %218
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @a, ptr noundef %219)
  %220 = load i32, ptr @n, align 4, !tbaa !5
  %221 = sub nsw i32 %220, 1
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !5
  %225 = load i32, ptr @a, align 16, !tbaa !5
  %226 = sub nsw i32 %224, %225
  %227 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %226)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret i32 0
}

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

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

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

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

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

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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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
@k = external dso_local global i32, align 4
@a = external dso_local global [500100 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @k)
  %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
  %.pre = sext i32 %2 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %14, %.lr.ph ]
  %4 = getelementptr inbounds i32, ptr @a, i64 %.pre-phi
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @a, ptr noundef nonnull %4)
  %5 = load i32, ptr @a, align 16, !tbaa !5
  %6 = load i32, ptr @k, align 4, !tbaa !5
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 1
  br i1 %8, label %.lr.ph95.preheader, label %.lr.ph104

.lr.ph95.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %7 to i64
  %9 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %9, 1
  %10 = icmp eq i32 %7, 2
  br i1 %10, label %._crit_edge96.unr-lcssa, label %.lr.ph95.preheader.new

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

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

._crit_edge96.unr-lcssa:                          ; preds = %.lr.ph95, %.lr.ph95.preheader
  %.171.lcssa.ph = phi i32 [ poison, %.lr.ph95.preheader ], [ %.171.1, %.lr.ph95 ]
  %.167.lcssa.ph = phi i32 [ poison, %.lr.ph95.preheader ], [ %.167.1, %.lr.ph95 ]
  %.1.lcssa.ph = phi i32 [ poison, %.lr.ph95.preheader ], [ %.1.1, %.lr.ph95 ]
  %indvars.iv127.unr = phi i64 [ 1, %.lr.ph95.preheader ], [ %indvars.iv.next128.1, %.lr.ph95 ]
  %.06493.unr = phi i32 [ %5, %.lr.ph95.preheader ], [ %.1.1, %.lr.ph95 ]
  %.06691.unr = phi i32 [ 0, %.lr.ph95.preheader ], [ %.167.1, %.lr.ph95 ]
  %.07090.unr = phi i32 [ %6, %.lr.ph95.preheader ], [ %.171.1, %.lr.ph95 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge96, label %.lr.ph95.epil

.lr.ph95.epil:                                    ; preds = %._crit_edge96.unr-lcssa
  %16 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %indvars.iv127.unr
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = sub nsw i32 %17, %.06493.unr
  %19 = sext i32 %18 to i64
  %20 = mul nsw i64 %indvars.iv127.unr, %19
  %21 = sext i32 %.07090.unr to i64
  %.not84.epil = icmp sgt i64 %20, %21
  %22 = trunc i64 %20 to i32
  %23 = select i1 %.not84.epil, i32 0, i32 %22
  %.171.epil = sub i32 %.07090.unr, %23
  %24 = trunc nuw nsw i64 %indvars.iv127.unr to i32
  %.167.epil = select i1 %.not84.epil, i32 %.06691.unr, i32 %24
  %.1.epil = select i1 %.not84.epil, i32 %.06493.unr, i32 %17
  br label %._crit_edge96

._crit_edge96:                                    ; preds = %._crit_edge96.unr-lcssa, %.lr.ph95.epil
  %.171.lcssa = phi i32 [ %.171.lcssa.ph, %._crit_edge96.unr-lcssa ], [ %.171.epil, %.lr.ph95.epil ]
  %.167.lcssa = phi i32 [ %.167.lcssa.ph, %._crit_edge96.unr-lcssa ], [ %.167.epil, %.lr.ph95.epil ]
  %.1.lcssa = phi i32 [ %.1.lcssa.ph, %._crit_edge96.unr-lcssa ], [ %.1.epil, %.lr.ph95.epil ]
  %.not101 = icmp slt i32 %.167.lcssa, 0
  br i1 %.not101, label %.preheader86, label %.lr.ph104

.lr.ph104:                                        ; preds = %._crit_edge, %._crit_edge96
  %.064.lcssa161 = phi i32 [ %.1.lcssa, %._crit_edge96 ], [ %5, %._crit_edge ]
  %.066.lcssa160 = phi i32 [ %.167.lcssa, %._crit_edge96 ], [ 0, %._crit_edge ]
  %.070.lcssa159 = phi i32 [ %.171.lcssa, %._crit_edge96 ], [ %6, %._crit_edge ]
  %25 = add nuw nsw i32 %.066.lcssa160, 1
  %26 = srem i32 %.070.lcssa159, %25
  %27 = sdiv i32 %.070.lcssa159, %25
  %28 = add nsw i32 %27, %.064.lcssa161
  %29 = sext i32 %26 to i64
  %wide.trip.count133 = zext nneg i32 %25 to i64
  %min.iters.check = icmp ult i32 %.066.lcssa160, 7
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph104
  %indvars.iv130.ph = phi i64 [ 0, %.lr.ph104 ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph104
  %n.vec = and i64 %wide.trip.count133, 2147483640
  %broadcast.splatinsert = insertelement <4 x i64> poison, i64 %29, i64 0
  %broadcast.splat = shufflevector <4 x i64> %broadcast.splatinsert, <4 x i64> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert170 = insertelement <4 x i32> poison, i32 %28, i64 0
  %broadcast.splat171 = shufflevector <4 x i32> %broadcast.splatinsert170, <4 x i32> poison, <4 x i32> zeroinitializer
  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 i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4>
  %30 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %index
  %31 = icmp slt <4 x i64> %vec.ind, %broadcast.splat
  %32 = icmp slt <4 x i64> %step.add, %broadcast.splat
  %33 = zext <4 x i1> %31 to <4 x i32>
  %34 = zext <4 x i1> %32 to <4 x i32>
  %35 = add nsw <4 x i32> %broadcast.splat171, %33
  %36 = add nsw <4 x i32> %broadcast.splat171, %34
  %37 = getelementptr inbounds i8, ptr %30, i64 16
  store <4 x i32> %35, ptr %30, align 16, !tbaa !5
  store <4 x i32> %36, ptr %37, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
  %38 = icmp eq i64 %index.next, %n.vec
  br i1 %38, label %middle.block, label %vector.body, !llvm.loop !11

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

.lr.ph95:                                         ; preds = %.lr.ph95, %.lr.ph95.preheader.new
  %indvars.iv127 = phi i64 [ 1, %.lr.ph95.preheader.new ], [ %indvars.iv.next128.1, %.lr.ph95 ]
  %.06493 = phi i32 [ %5, %.lr.ph95.preheader.new ], [ %.1.1, %.lr.ph95 ]
  %.06691 = phi i32 [ 0, %.lr.ph95.preheader.new ], [ %.167.1, %.lr.ph95 ]
  %.07090 = phi i32 [ %6, %.lr.ph95.preheader.new ], [ %.171.1, %.lr.ph95 ]
  %niter = phi i64 [ 0, %.lr.ph95.preheader.new ], [ %niter.next.1, %.lr.ph95 ]
  %39 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %indvars.iv127
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sub nsw i32 %40, %.06493
  %42 = sext i32 %41 to i64
  %43 = mul nsw i64 %indvars.iv127, %42
  %44 = sext i32 %.07090 to i64
  %.not84 = icmp sgt i64 %43, %44
  %45 = trunc i64 %43 to i32
  %46 = select i1 %.not84, i32 0, i32 %45
  %.171 = sub i32 %.07090, %46
  %47 = trunc nuw nsw i64 %indvars.iv127 to i32
  %.167 = select i1 %.not84, i32 %.06691, i32 %47
  %.1 = select i1 %.not84, i32 %.06493, i32 %40
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %48 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %indvars.iv.next128
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = sub nsw i32 %49, %.1
  %51 = sext i32 %50 to i64
  %52 = mul nsw i64 %indvars.iv.next128, %51
  %53 = sext i32 %.171 to i64
  %.not84.1 = icmp sgt i64 %52, %53
  %54 = trunc i64 %52 to i32
  %55 = select i1 %.not84.1, i32 0, i32 %54
  %.171.1 = sub i32 %.171, %55
  %56 = trunc nuw nsw i64 %indvars.iv.next128 to i32
  %.167.1 = select i1 %.not84.1, i32 %.167, i32 %56
  %.1.1 = select i1 %.not84.1, i32 %.1, i32 %49
  %indvars.iv.next128.1 = add nuw nsw i64 %indvars.iv127, 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_edge96.unr-lcssa, label %.lr.ph95, !llvm.loop !14

.preheader86:                                     ; preds = %scalar.ph, %middle.block, %._crit_edge96
  %57 = icmp sgt i32 %7, 0
  br i1 %57, label %.lr.ph106.preheader, label %._crit_edge107

.lr.ph106.preheader:                              ; preds = %.preheader86
  %wide.trip.count138 = zext nneg i32 %7 to i64
  %min.iters.check174 = icmp ult i32 %7, 8
  br i1 %min.iters.check174, label %.lr.ph106.preheader217, label %vector.ph175

.lr.ph106.preheader217:                           ; preds = %middle.block172, %.lr.ph106.preheader
  %indvars.iv135.ph = phi i64 [ 0, %.lr.ph106.preheader ], [ %n.vec177, %middle.block172 ]
  br label %.lr.ph106

vector.ph175:                                     ; preds = %.lr.ph106.preheader
  %n.vec177 = and i64 %wide.trip.count138, 2147483640
  br label %vector.body179

vector.body179:                                   ; preds = %vector.body179, %vector.ph175
  %index180 = phi i64 [ 0, %vector.ph175 ], [ %index.next182, %vector.body179 ]
  %58 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %index180
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  %wide.load = load <4 x i32>, ptr %58, align 16, !tbaa !5
  %wide.load181 = load <4 x i32>, ptr %59, align 16, !tbaa !5
  %60 = sub nsw <4 x i32> zeroinitializer, %wide.load
  %61 = sub nsw <4 x i32> zeroinitializer, %wide.load181
  store <4 x i32> %60, ptr %58, align 16, !tbaa !5
  store <4 x i32> %61, ptr %59, align 16, !tbaa !5
  %index.next182 = add nuw i64 %index180, 8
  %62 = icmp eq i64 %index.next182, %n.vec177
  br i1 %62, label %middle.block172, label %vector.body179, !llvm.loop !15

middle.block172:                                  ; preds = %vector.body179
  %cmp.n183 = icmp eq i64 %n.vec177, %wide.trip.count138
  br i1 %cmp.n183, label %._crit_edge107, label %.lr.ph106.preheader217

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv130 = phi i64 [ %indvars.iv.next131, %scalar.ph ], [ %indvars.iv130.ph, %scalar.ph.preheader ]
  %63 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %indvars.iv130
  %64 = icmp slt i64 %indvars.iv130, %29
  %65 = zext i1 %64 to i32
  %spec.select = add nsw i32 %28, %65
  store i32 %spec.select, ptr %63, align 4, !tbaa !5
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %exitcond134.not = icmp eq i64 %indvars.iv.next131, %wide.trip.count133
  br i1 %exitcond134.not, label %.preheader86, label %scalar.ph, !llvm.loop !16

._crit_edge107:                                   ; preds = %.lr.ph106, %middle.block172, %.preheader86
  %66 = sext i32 %7 to i64
  %67 = getelementptr inbounds i32, ptr @a, i64 %66
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @a, ptr noundef nonnull %67)
  %68 = load i32, ptr @a, align 16, !tbaa !5
  %69 = load i32, ptr @k, align 4, !tbaa !5
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %71 = icmp sgt i32 %70, 1
  br i1 %71, label %.lr.ph113.preheader, label %.lr.ph122

.lr.ph113.preheader:                              ; preds = %._crit_edge107
  %wide.trip.count143 = zext nneg i32 %70 to i64
  %72 = add nsw i64 %wide.trip.count143, -1
  %xtraiter221 = and i64 %72, 1
  %73 = icmp eq i32 %70, 2
  br i1 %73, label %._crit_edge114.unr-lcssa, label %.lr.ph113.preheader.new

.lr.ph113.preheader.new:                          ; preds = %.lr.ph113.preheader
  %unroll_iter226 = and i64 %72, -2
  br label %.lr.ph113

.lr.ph106:                                        ; preds = %.lr.ph106.preheader217, %.lr.ph106
  %indvars.iv135 = phi i64 [ %indvars.iv.next136, %.lr.ph106 ], [ %indvars.iv135.ph, %.lr.ph106.preheader217 ]
  %74 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %indvars.iv135
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sub nsw i32 0, %75
  store i32 %76, ptr %74, align 4, !tbaa !5
  %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
  %exitcond139.not = icmp eq i64 %indvars.iv.next136, %wide.trip.count138
  br i1 %exitcond139.not, label %._crit_edge107, label %.lr.ph106, !llvm.loop !17

._crit_edge114.unr-lcssa:                         ; preds = %.lr.ph113, %.lr.ph113.preheader
  %.373.lcssa.ph = phi i32 [ poison, %.lr.ph113.preheader ], [ %.373.1, %.lr.ph113 ]
  %.369.lcssa.ph = phi i32 [ poison, %.lr.ph113.preheader ], [ %.369.1, %.lr.ph113 ]
  %.3.lcssa.ph = phi i32 [ poison, %.lr.ph113.preheader ], [ %.3.1, %.lr.ph113 ]
  %indvars.iv140.unr = phi i64 [ 1, %.lr.ph113.preheader ], [ %indvars.iv.next141.1, %.lr.ph113 ]
  %.2110.unr = phi i32 [ %68, %.lr.ph113.preheader ], [ %.3.1, %.lr.ph113 ]
  %.268109.unr = phi i32 [ 0, %.lr.ph113.preheader ], [ %.369.1, %.lr.ph113 ]
  %.272108.unr = phi i32 [ %69, %.lr.ph113.preheader ], [ %.373.1, %.lr.ph113 ]
  %lcmp.mod222.not = icmp eq i64 %xtraiter221, 0
  br i1 %lcmp.mod222.not, label %._crit_edge114, label %.lr.ph113.epil

.lr.ph113.epil:                                   ; preds = %._crit_edge114.unr-lcssa
  %77 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %indvars.iv140.unr
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = sub nsw i32 %78, %.2110.unr
  %80 = sext i32 %79 to i64
  %81 = mul nsw i64 %indvars.iv140.unr, %80
  %82 = sext i32 %.272108.unr to i64
  %.not82.epil = icmp sgt i64 %81, %82
  %83 = trunc i64 %81 to i32
  %84 = select i1 %.not82.epil, i32 0, i32 %83
  %.373.epil = sub i32 %.272108.unr, %84
  %85 = trunc nuw nsw i64 %indvars.iv140.unr to i32
  %.369.epil = select i1 %.not82.epil, i32 %.268109.unr, i32 %85
  %.3.epil = select i1 %.not82.epil, i32 %.2110.unr, i32 %78
  br label %._crit_edge114

._crit_edge114:                                   ; preds = %._crit_edge114.unr-lcssa, %.lr.ph113.epil
  %.373.lcssa = phi i32 [ %.373.lcssa.ph, %._crit_edge114.unr-lcssa ], [ %.373.epil, %.lr.ph113.epil ]
  %.369.lcssa = phi i32 [ %.369.lcssa.ph, %._crit_edge114.unr-lcssa ], [ %.369.epil, %.lr.ph113.epil ]
  %.3.lcssa = phi i32 [ %.3.lcssa.ph, %._crit_edge114.unr-lcssa ], [ %.3.epil, %.lr.ph113.epil ]
  %.not81119 = icmp slt i32 %.369.lcssa, 0
  br i1 %.not81119, label %.preheader, label %.lr.ph122

.lr.ph122:                                        ; preds = %._crit_edge107, %._crit_edge114
  %.2.lcssa168 = phi i32 [ %.3.lcssa, %._crit_edge114 ], [ %68, %._crit_edge107 ]
  %.268.lcssa167 = phi i32 [ %.369.lcssa, %._crit_edge114 ], [ 0, %._crit_edge107 ]
  %.272.lcssa166 = phi i32 [ %.373.lcssa, %._crit_edge114 ], [ %69, %._crit_edge107 ]
  %86 = add nuw nsw i32 %.268.lcssa167, 1
  %87 = srem i32 %.272.lcssa166, %86
  %88 = sdiv i32 %.272.lcssa166, %86
  %89 = add nsw i32 %88, %.2.lcssa168
  %90 = sext i32 %87 to i64
  %wide.trip.count148 = zext nneg i32 %86 to i64
  %min.iters.check186 = icmp ult i32 %.268.lcssa167, 7
  br i1 %min.iters.check186, label %scalar.ph185.preheader, label %vector.ph187

scalar.ph185.preheader:                           ; preds = %middle.block184, %.lr.ph122
  %indvars.iv145.ph = phi i64 [ 0, %.lr.ph122 ], [ %n.vec189, %middle.block184 ]
  br label %scalar.ph185

vector.ph187:                                     ; preds = %.lr.ph122
  %n.vec189 = and i64 %wide.trip.count148, 2147483640
  %broadcast.splatinsert197 = insertelement <4 x i64> poison, i64 %90, i64 0
  %broadcast.splat198 = shufflevector <4 x i64> %broadcast.splatinsert197, <4 x i64> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert199 = insertelement <4 x i32> poison, i32 %89, i64 0
  %broadcast.splat200 = shufflevector <4 x i32> %broadcast.splatinsert199, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body191

vector.body191:                                   ; preds = %vector.body191, %vector.ph187
  %index192 = phi i64 [ 0, %vector.ph187 ], [ %index.next201, %vector.body191 ]
  %vec.ind193 = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph187 ], [ %vec.ind.next196, %vector.body191 ]
  %step.add194 = add <4 x i64> %vec.ind193, <i64 4, i64 4, i64 4, i64 4>
  %91 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %index192
  %92 = icmp slt <4 x i64> %vec.ind193, %broadcast.splat198
  %93 = icmp slt <4 x i64> %step.add194, %broadcast.splat198
  %94 = zext <4 x i1> %92 to <4 x i32>
  %95 = zext <4 x i1> %93 to <4 x i32>
  %96 = add nsw <4 x i32> %broadcast.splat200, %94
  %97 = add nsw <4 x i32> %broadcast.splat200, %95
  %98 = getelementptr inbounds i8, ptr %91, i64 16
  store <4 x i32> %96, ptr %91, align 16, !tbaa !5
  store <4 x i32> %97, ptr %98, align 16, !tbaa !5
  %index.next201 = add nuw i64 %index192, 8
  %vec.ind.next196 = add <4 x i64> %vec.ind193, <i64 8, i64 8, i64 8, i64 8>
  %99 = icmp eq i64 %index.next201, %n.vec189
  br i1 %99, label %middle.block184, label %vector.body191, !llvm.loop !18

middle.block184:                                  ; preds = %vector.body191
  %cmp.n202 = icmp eq i64 %n.vec189, %wide.trip.count148
  br i1 %cmp.n202, label %.preheader, label %scalar.ph185.preheader

.lr.ph113:                                        ; preds = %.lr.ph113, %.lr.ph113.preheader.new
  %indvars.iv140 = phi i64 [ 1, %.lr.ph113.preheader.new ], [ %indvars.iv.next141.1, %.lr.ph113 ]
  %.2110 = phi i32 [ %68, %.lr.ph113.preheader.new ], [ %.3.1, %.lr.ph113 ]
  %.268109 = phi i32 [ 0, %.lr.ph113.preheader.new ], [ %.369.1, %.lr.ph113 ]
  %.272108 = phi i32 [ %69, %.lr.ph113.preheader.new ], [ %.373.1, %.lr.ph113 ]
  %niter227 = phi i64 [ 0, %.lr.ph113.preheader.new ], [ %niter227.next.1, %.lr.ph113 ]
  %100 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %indvars.iv140
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sub nsw i32 %101, %.2110
  %103 = sext i32 %102 to i64
  %104 = mul nsw i64 %indvars.iv140, %103
  %105 = sext i32 %.272108 to i64
  %.not82 = icmp sgt i64 %104, %105
  %106 = trunc i64 %104 to i32
  %107 = select i1 %.not82, i32 0, i32 %106
  %.373 = sub i32 %.272108, %107
  %108 = trunc nuw nsw i64 %indvars.iv140 to i32
  %.369 = select i1 %.not82, i32 %.268109, i32 %108
  %.3 = select i1 %.not82, i32 %.2110, i32 %101
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %109 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %indvars.iv.next141
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sub nsw i32 %110, %.3
  %112 = sext i32 %111 to i64
  %113 = mul nsw i64 %indvars.iv.next141, %112
  %114 = sext i32 %.373 to i64
  %.not82.1 = icmp sgt i64 %113, %114
  %115 = trunc i64 %113 to i32
  %116 = select i1 %.not82.1, i32 0, i32 %115
  %.373.1 = sub i32 %.373, %116
  %117 = trunc nuw nsw i64 %indvars.iv.next141 to i32
  %.369.1 = select i1 %.not82.1, i32 %.369, i32 %117
  %.3.1 = select i1 %.not82.1, i32 %.3, i32 %110
  %indvars.iv.next141.1 = add nuw nsw i64 %indvars.iv140, 2
  %niter227.next.1 = add i64 %niter227, 2
  %niter227.ncmp.1 = icmp eq i64 %niter227.next.1, %unroll_iter226
  br i1 %niter227.ncmp.1, label %._crit_edge114.unr-lcssa, label %.lr.ph113, !llvm.loop !19

.preheader:                                       ; preds = %scalar.ph185, %middle.block184, %._crit_edge114
  %118 = icmp sgt i32 %70, 0
  br i1 %118, label %.lr.ph124.preheader, label %._crit_edge125

.lr.ph124.preheader:                              ; preds = %.preheader
  %wide.trip.count153 = zext nneg i32 %70 to i64
  %min.iters.check205 = icmp ult i32 %70, 8
  br i1 %min.iters.check205, label %.lr.ph124.preheader216, label %vector.ph206

.lr.ph124.preheader216:                           ; preds = %middle.block203, %.lr.ph124.preheader
  %indvars.iv150.ph = phi i64 [ 0, %.lr.ph124.preheader ], [ %n.vec208, %middle.block203 ]
  br label %.lr.ph124

vector.ph206:                                     ; preds = %.lr.ph124.preheader
  %n.vec208 = and i64 %wide.trip.count153, 2147483640
  br label %vector.body210

vector.body210:                                   ; preds = %vector.body210, %vector.ph206
  %index211 = phi i64 [ 0, %vector.ph206 ], [ %index.next214, %vector.body210 ]
  %119 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %index211
  %120 = getelementptr inbounds i8, ptr %119, i64 16
  %wide.load212 = load <4 x i32>, ptr %119, align 16, !tbaa !5
  %wide.load213 = load <4 x i32>, ptr %120, align 16, !tbaa !5
  %121 = sub nsw <4 x i32> zeroinitializer, %wide.load212
  %122 = sub nsw <4 x i32> zeroinitializer, %wide.load213
  store <4 x i32> %121, ptr %119, align 16, !tbaa !5
  store <4 x i32> %122, ptr %120, align 16, !tbaa !5
  %index.next214 = add nuw i64 %index211, 8
  %123 = icmp eq i64 %index.next214, %n.vec208
  br i1 %123, label %middle.block203, label %vector.body210, !llvm.loop !20

middle.block203:                                  ; preds = %vector.body210
  %cmp.n215 = icmp eq i64 %n.vec208, %wide.trip.count153
  br i1 %cmp.n215, label %._crit_edge125, label %.lr.ph124.preheader216

scalar.ph185:                                     ; preds = %scalar.ph185.preheader, %scalar.ph185
  %indvars.iv145 = phi i64 [ %indvars.iv.next146, %scalar.ph185 ], [ %indvars.iv145.ph, %scalar.ph185.preheader ]
  %124 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %indvars.iv145
  %125 = icmp slt i64 %indvars.iv145, %90
  %126 = zext i1 %125 to i32
  %spec.select85 = add nsw i32 %89, %126
  store i32 %spec.select85, ptr %124, align 4, !tbaa !5
  %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
  %exitcond149.not = icmp eq i64 %indvars.iv.next146, %wide.trip.count148
  br i1 %exitcond149.not, label %.preheader, label %scalar.ph185, !llvm.loop !21

._crit_edge125:                                   ; preds = %.lr.ph124, %middle.block203, %.preheader
  %127 = sext i32 %70 to i64
  %128 = getelementptr inbounds i32, ptr @a, i64 %127
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @a, ptr noundef nonnull %128)
  %129 = load i32, ptr @n, align 4, !tbaa !5
  %130 = add nsw i32 %129, -1
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = load i32, ptr @a, align 16, !tbaa !5
  %135 = sub nsw i32 %133, %134
  %136 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %135)
  ret i32 0

.lr.ph124:                                        ; preds = %.lr.ph124.preheader216, %.lr.ph124
  %indvars.iv150 = phi i64 [ %indvars.iv.next151, %.lr.ph124 ], [ %indvars.iv150.ph, %.lr.ph124.preheader216 ]
  %137 = getelementptr inbounds [500100 x i32], ptr @a, i64 0, i64 %indvars.iv150
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = sub nsw i32 0, %138
  store i32 %139, ptr %137, align 4, !tbaa !5
  %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
  %exitcond154.not = icmp eq i64 %indvars.iv.next151, %wide.trip.count153
  br i1 %exitcond154.not, label %._crit_edge125, label %.lr.ph124, !llvm.loop !22
}

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

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

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

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 = { 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 #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !12, !13}
!16 = distinct !{!16, !10, !13, !12}
!17 = distinct !{!17, !10, !13, !12}
!18 = distinct !{!18, !10, !12, !13}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !12, !13}
!21 = distinct !{!21, !10, !13, !12}
!22 = distinct !{!22, !10, !13, !12}


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