; LLVM IR from attractivechaos/klib :: test (ksort_test)

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

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @ks_mergesort_int(i64 noundef, ptr noundef, ptr noundef) #0

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 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: nounwind
declare void @free(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @ks_heapmake_int(i64 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @ks_heapsort_int(i64 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @ks_combsort_int(i64 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @ks_introsort_int(i64 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @ks_ksmall_int(i64 noundef, ptr noundef, i64 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 10000000, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %14 = load i32, ptr %4, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 1
  br i1 %15, label %16, label %21

16:                                               ; preds = %2
  %17 = load ptr, ptr %5, align 8, !tbaa !9
  %18 = getelementptr inbounds ptr, ptr %17, i64 1
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = call i32 @atoi(ptr noundef %19) #7
  store i32 %20, ptr %7, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %16, %2
  %22 = load i32, ptr %7, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = mul i64 4, %23
  %25 = call noalias ptr @malloc(i64 noundef %24) #8
  store ptr %25, ptr %8, align 8, !tbaa !9
  call void @srand48(i64 noundef 11) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %37, %21
  %27 = load i32, ptr %6, align 4, !tbaa !5
  %28 = load i32, ptr %7, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %30, label %40

30:                                               ; preds = %26
  %31 = call i64 @lrand48() #6
  %32 = trunc i64 %31 to i32
  %33 = load ptr, ptr %8, align 8, !tbaa !9
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i32, ptr %33, i64 %35
  store i32 %32, ptr %36, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %30
  %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 %26, !llvm.loop !11

40:                                               ; preds = %26
  %41 = call i64 @clock() #6
  store i64 %41, ptr %10, align 8, !tbaa !13
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = load ptr, ptr %8, align 8, !tbaa !9
  %45 = call i32 @ks_ksmall_int(i64 noundef %43, ptr noundef %44, i64 noundef 10500)
  store i32 %45, ptr %9, align 4, !tbaa !5
  %46 = call i64 @clock() #6
  store i64 %46, ptr %11, align 8, !tbaa !13
  %47 = load ptr, ptr @stderr, align 8, !tbaa !9
  %48 = load i32, ptr %9, align 4, !tbaa !5
  %49 = load i64, ptr %11, align 8, !tbaa !13
  %50 = load i64, ptr %10, align 8, !tbaa !13
  %51 = sub nsw i64 %49, %50
  %52 = sitofp i64 %51 to double
  %53 = fdiv double %52, 1.000000e+06
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str, i32 noundef %48, double noundef %53) #6
  call void @srand48(i64 noundef 11) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %66, %40
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %59, label %69

59:                                               ; preds = %55
  %60 = call i64 @lrand48() #6
  %61 = trunc i64 %60 to i32
  %62 = load ptr, ptr %8, align 8, !tbaa !9
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i32, ptr %62, i64 %64
  store i32 %61, ptr %65, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %59
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %6, align 4, !tbaa !5
  br label %55, !llvm.loop !15

69:                                               ; preds = %55
  %70 = call i64 @clock() #6
  store i64 %70, ptr %10, align 8, !tbaa !13
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = load ptr, ptr %8, align 8, !tbaa !9
  call void @ks_introsort_int(i64 noundef %72, ptr noundef %73)
  %74 = call i64 @clock() #6
  store i64 %74, ptr %11, align 8, !tbaa !13
  %75 = load ptr, ptr @stderr, align 8, !tbaa !9
  %76 = load ptr, ptr %8, align 8, !tbaa !9
  %77 = getelementptr inbounds i32, ptr %76, i64 10500
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = load i64, ptr %11, align 8, !tbaa !13
  %80 = load i64, ptr %10, align 8, !tbaa !13
  %81 = sub nsw i64 %79, %80
  %82 = sitofp i64 %81 to double
  %83 = fdiv double %82, 1.000000e+06
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef @.str.1, i32 noundef %78, double noundef %83) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %107, %69
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = sub nsw i32 %87, 1
  %89 = icmp slt i32 %86, %88
  br i1 %89, label %90, label %110

90:                                               ; preds = %85
  %91 = load ptr, ptr %8, align 8, !tbaa !9
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i32, ptr %91, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = load ptr, ptr %8, align 8, !tbaa !9
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr %96, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = icmp sgt i32 %95, %101
  br i1 %102, label %103, label %106

103:                                              ; preds = %90
  %104 = load ptr, ptr @stderr, align 8, !tbaa !9
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef @.str.2) #6
  call void @exit(i32 noundef 1) #9
  unreachable

106:                                              ; preds = %90
  br label %107

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

110:                                              ; preds = %85
  call void @srand48(i64 noundef 11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = mul i64 %112, 4
  %114 = add i64 %113, 1
  %115 = call noalias ptr @malloc(i64 noundef %114) #8
  store ptr %115, ptr %12, align 8, !tbaa !9
  %116 = load ptr, ptr %12, align 8, !tbaa !9
  %117 = getelementptr inbounds i8, ptr %116, i64 1
  store ptr %117, ptr %13, align 8, !tbaa !9
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %129, %110
  %119 = load i32, ptr %6, align 4, !tbaa !5
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %122, label %132

122:                                              ; preds = %118
  %123 = call i64 @lrand48() #6
  %124 = trunc i64 %123 to i32
  %125 = load ptr, ptr %13, align 8, !tbaa !9
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i32, ptr %125, i64 %127
  store i32 %124, ptr %128, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %122
  %130 = load i32, ptr %6, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %6, align 4, !tbaa !5
  br label %118, !llvm.loop !17

132:                                              ; preds = %118
  %133 = call i64 @clock() #6
  store i64 %133, ptr %10, align 8, !tbaa !13
  %134 = load i32, ptr %7, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = load ptr, ptr %13, align 8, !tbaa !9
  call void @ks_introsort_int(i64 noundef %135, ptr noundef %136)
  %137 = call i64 @clock() #6
  store i64 %137, ptr %11, align 8, !tbaa !13
  %138 = load ptr, ptr @stderr, align 8, !tbaa !9
  %139 = load ptr, ptr %13, align 8, !tbaa !9
  %140 = getelementptr inbounds i32, ptr %139, i64 10500
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = load i64, ptr %11, align 8, !tbaa !13
  %143 = load i64, ptr %10, align 8, !tbaa !13
  %144 = sub nsw i64 %142, %143
  %145 = sitofp i64 %144 to double
  %146 = fdiv double %145, 1.000000e+06
  %147 = load ptr, ptr %13, align 8, !tbaa !9
  %148 = ptrtoint ptr %147 to i64
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef @.str.3, i32 noundef %141, double noundef %146, i64 noundef %148) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %150 = call i64 @clock() #6
  store i64 %150, ptr %10, align 8, !tbaa !13
  %151 = load i32, ptr %7, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = load ptr, ptr %8, align 8, !tbaa !9
  call void @ks_introsort_int(i64 noundef %152, ptr noundef %153)
  %154 = call i64 @clock() #6
  store i64 %154, ptr %11, align 8, !tbaa !13
  %155 = load ptr, ptr @stderr, align 8, !tbaa !9
  %156 = load i64, ptr %11, align 8, !tbaa !13
  %157 = load i64, ptr %10, align 8, !tbaa !13
  %158 = sub nsw i64 %156, %157
  %159 = sitofp i64 %158 to double
  %160 = fdiv double %159, 1.000000e+06
  %161 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %155, ptr noundef @.str.4, double noundef %160) #6
  call void @srand48(i64 noundef 11) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %173, %132
  %163 = load i32, ptr %6, align 4, !tbaa !5
  %164 = load i32, ptr %7, align 4, !tbaa !5
  %165 = icmp slt i32 %163, %164
  br i1 %165, label %166, label %176

166:                                              ; preds = %162
  %167 = call i64 @lrand48() #6
  %168 = trunc i64 %167 to i32
  %169 = load ptr, ptr %8, align 8, !tbaa !9
  %170 = load i32, ptr %6, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds i32, ptr %169, i64 %171
  store i32 %168, ptr %172, align 4, !tbaa !5
  br label %173

173:                                              ; preds = %166
  %174 = load i32, ptr %6, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %6, align 4, !tbaa !5
  br label %162, !llvm.loop !18

176:                                              ; preds = %162
  %177 = call i64 @clock() #6
  store i64 %177, ptr %10, align 8, !tbaa !13
  %178 = load i32, ptr %7, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = load ptr, ptr %8, align 8, !tbaa !9
  call void @ks_combsort_int(i64 noundef %179, ptr noundef %180)
  %181 = call i64 @clock() #6
  store i64 %181, ptr %11, align 8, !tbaa !13
  %182 = load ptr, ptr @stderr, align 8, !tbaa !9
  %183 = load i64, ptr %11, align 8, !tbaa !13
  %184 = load i64, ptr %10, align 8, !tbaa !13
  %185 = sub nsw i64 %183, %184
  %186 = sitofp i64 %185 to double
  %187 = fdiv double %186, 1.000000e+06
  %188 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %182, ptr noundef @.str.5, double noundef %187) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %189

189:                                              ; preds = %211, %176
  %190 = load i32, ptr %6, align 4, !tbaa !5
  %191 = load i32, ptr %7, align 4, !tbaa !5
  %192 = sub nsw i32 %191, 1
  %193 = icmp slt i32 %190, %192
  br i1 %193, label %194, label %214

194:                                              ; preds = %189
  %195 = load ptr, ptr %8, align 8, !tbaa !9
  %196 = load i32, ptr %6, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds i32, ptr %195, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = load ptr, ptr %8, align 8, !tbaa !9
  %201 = load i32, ptr %6, align 4, !tbaa !5
  %202 = add nsw i32 %201, 1
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds i32, ptr %200, i64 %203
  %205 = load i32, ptr %204, align 4, !tbaa !5
  %206 = icmp sgt i32 %199, %205
  br i1 %206, label %207, label %210

207:                                              ; preds = %194
  %208 = load ptr, ptr @stderr, align 8, !tbaa !9
  %209 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %208, ptr noundef @.str.6) #6
  call void @exit(i32 noundef 1) #9
  unreachable

210:                                              ; preds = %194
  br label %211

211:                                              ; preds = %210
  %212 = load i32, ptr %6, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %6, align 4, !tbaa !5
  br label %189, !llvm.loop !19

214:                                              ; preds = %189
  call void @srand48(i64 noundef 11) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %215

215:                                              ; preds = %226, %214
  %216 = load i32, ptr %6, align 4, !tbaa !5
  %217 = load i32, ptr %7, align 4, !tbaa !5
  %218 = icmp slt i32 %216, %217
  br i1 %218, label %219, label %229

219:                                              ; preds = %215
  %220 = call i64 @lrand48() #6
  %221 = trunc i64 %220 to i32
  %222 = load ptr, ptr %8, align 8, !tbaa !9
  %223 = load i32, ptr %6, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds i32, ptr %222, i64 %224
  store i32 %221, ptr %225, align 4, !tbaa !5
  br label %226

226:                                              ; preds = %219
  %227 = load i32, ptr %6, align 4, !tbaa !5
  %228 = add nsw i32 %227, 1
  store i32 %228, ptr %6, align 4, !tbaa !5
  br label %215, !llvm.loop !20

229:                                              ; preds = %215
  %230 = call i64 @clock() #6
  store i64 %230, ptr %10, align 8, !tbaa !13
  %231 = load i32, ptr %7, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = load ptr, ptr %8, align 8, !tbaa !9
  call void @ks_mergesort_int(i64 noundef %232, ptr noundef %233, ptr noundef null)
  %234 = call i64 @clock() #6
  store i64 %234, ptr %11, align 8, !tbaa !13
  %235 = load ptr, ptr @stderr, align 8, !tbaa !9
  %236 = load i64, ptr %11, align 8, !tbaa !13
  %237 = load i64, ptr %10, align 8, !tbaa !13
  %238 = sub nsw i64 %236, %237
  %239 = sitofp i64 %238 to double
  %240 = fdiv double %239, 1.000000e+06
  %241 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %235, ptr noundef @.str.7, double noundef %240) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %242

242:                                              ; preds = %264, %229
  %243 = load i32, ptr %6, align 4, !tbaa !5
  %244 = load i32, ptr %7, align 4, !tbaa !5
  %245 = sub nsw i32 %244, 1
  %246 = icmp slt i32 %243, %245
  br i1 %246, label %247, label %267

247:                                              ; preds = %242
  %248 = load ptr, ptr %8, align 8, !tbaa !9
  %249 = load i32, ptr %6, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds i32, ptr %248, i64 %250
  %252 = load i32, ptr %251, align 4, !tbaa !5
  %253 = load ptr, ptr %8, align 8, !tbaa !9
  %254 = load i32, ptr %6, align 4, !tbaa !5
  %255 = add nsw i32 %254, 1
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds i32, ptr %253, i64 %256
  %258 = load i32, ptr %257, align 4, !tbaa !5
  %259 = icmp sgt i32 %252, %258
  br i1 %259, label %260, label %263

260:                                              ; preds = %247
  %261 = load ptr, ptr @stderr, align 8, !tbaa !9
  %262 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %261, ptr noundef @.str.8) #6
  call void @exit(i32 noundef 1) #9
  unreachable

263:                                              ; preds = %247
  br label %264

264:                                              ; preds = %263
  %265 = load i32, ptr %6, align 4, !tbaa !5
  %266 = add nsw i32 %265, 1
  store i32 %266, ptr %6, align 4, !tbaa !5
  br label %242, !llvm.loop !21

267:                                              ; preds = %242
  %268 = call i64 @clock() #6
  store i64 %268, ptr %10, align 8, !tbaa !13
  %269 = load i32, ptr %7, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = load ptr, ptr %8, align 8, !tbaa !9
  call void @ks_mergesort_int(i64 noundef %270, ptr noundef %271, ptr noundef null)
  %272 = call i64 @clock() #6
  store i64 %272, ptr %11, align 8, !tbaa !13
  %273 = load ptr, ptr @stderr, align 8, !tbaa !9
  %274 = load i64, ptr %11, align 8, !tbaa !13
  %275 = load i64, ptr %10, align 8, !tbaa !13
  %276 = sub nsw i64 %274, %275
  %277 = sitofp i64 %276 to double
  %278 = fdiv double %277, 1.000000e+06
  %279 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %273, ptr noundef @.str.9, double noundef %278) #6
  call void @srand48(i64 noundef 11) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %280

280:                                              ; preds = %291, %267
  %281 = load i32, ptr %6, align 4, !tbaa !5
  %282 = load i32, ptr %7, align 4, !tbaa !5
  %283 = icmp slt i32 %281, %282
  br i1 %283, label %284, label %294

284:                                              ; preds = %280
  %285 = call i64 @lrand48() #6
  %286 = trunc i64 %285 to i32
  %287 = load ptr, ptr %8, align 8, !tbaa !9
  %288 = load i32, ptr %6, align 4, !tbaa !5
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds i32, ptr %287, i64 %289
  store i32 %286, ptr %290, align 4, !tbaa !5
  br label %291

291:                                              ; preds = %284
  %292 = load i32, ptr %6, align 4, !tbaa !5
  %293 = add nsw i32 %292, 1
  store i32 %293, ptr %6, align 4, !tbaa !5
  br label %280, !llvm.loop !22

294:                                              ; preds = %280
  %295 = call i64 @clock() #6
  store i64 %295, ptr %10, align 8, !tbaa !13
  %296 = load i32, ptr %7, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = load ptr, ptr %8, align 8, !tbaa !9
  call void @ks_heapmake_int(i64 noundef %297, ptr noundef %298)
  %299 = load i32, ptr %7, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = load ptr, ptr %8, align 8, !tbaa !9
  call void @ks_heapsort_int(i64 noundef %300, ptr noundef %301)
  %302 = call i64 @clock() #6
  store i64 %302, ptr %11, align 8, !tbaa !13
  %303 = load ptr, ptr @stderr, align 8, !tbaa !9
  %304 = load i64, ptr %11, align 8, !tbaa !13
  %305 = load i64, ptr %10, align 8, !tbaa !13
  %306 = sub nsw i64 %304, %305
  %307 = sitofp i64 %306 to double
  %308 = fdiv double %307, 1.000000e+06
  %309 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %303, ptr noundef @.str.10, double noundef %308) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %310

310:                                              ; preds = %332, %294
  %311 = load i32, ptr %6, align 4, !tbaa !5
  %312 = load i32, ptr %7, align 4, !tbaa !5
  %313 = sub nsw i32 %312, 1
  %314 = icmp slt i32 %311, %313
  br i1 %314, label %315, label %335

315:                                              ; preds = %310
  %316 = load ptr, ptr %8, align 8, !tbaa !9
  %317 = load i32, ptr %6, align 4, !tbaa !5
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds i32, ptr %316, i64 %318
  %320 = load i32, ptr %319, align 4, !tbaa !5
  %321 = load ptr, ptr %8, align 8, !tbaa !9
  %322 = load i32, ptr %6, align 4, !tbaa !5
  %323 = add nsw i32 %322, 1
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds i32, ptr %321, i64 %324
  %326 = load i32, ptr %325, align 4, !tbaa !5
  %327 = icmp sgt i32 %320, %326
  br i1 %327, label %328, label %331

328:                                              ; preds = %315
  %329 = load ptr, ptr @stderr, align 8, !tbaa !9
  %330 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %329, ptr noundef @.str.11) #6
  call void @exit(i32 noundef 1) #9
  unreachable

331:                                              ; preds = %315
  br label %332

332:                                              ; preds = %331
  %333 = load i32, ptr %6, align 4, !tbaa !5
  %334 = add nsw i32 %333, 1
  store i32 %334, ptr %6, align 4, !tbaa !5
  br label %310, !llvm.loop !23

335:                                              ; preds = %310
  %336 = load ptr, ptr %8, align 8, !tbaa !9
  call void @free(ptr noundef %336) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  ret i32 0
}

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #4

; Function Attrs: nounwind
declare void @srand48(i64 noundef) #3

; Function Attrs: nounwind
declare i64 @lrand48() #3

; Function Attrs: nounwind
declare i64 @clock() #3

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #5

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

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

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


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @ks_mergesort_int(i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @ks_heapmake_int(i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @ks_heapsort_int(i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @ks_combsort_int(i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @ks_introsort_int(i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @ks_ksmall_int(i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = icmp sgt i32 %0, 1
  br i1 %3, label %4, label %8

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call i32 @atoi(ptr nocapture noundef %6) #8
  br label %8

8:                                                ; preds = %4, %2
  %.0101 = phi i32 [ %7, %4 ], [ 10000000, %2 ]
  %9 = sext i32 %.0101 to i64
  %10 = shl nsw i64 %9, 2
  %11 = tail call noalias ptr @malloc(i64 noundef %10) #9
  tail call void @srand48(i64 noundef 11) #10
  %12 = icmp sgt i32 %.0101, 0
  br i1 %12, label %.lr.ph.preheader, label %._crit_edge108.critedge

.lr.ph.preheader:                                 ; preds = %8
  %wide.trip.count = zext nneg i32 %.0101 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %13 = tail call i64 @lrand48() #10
  %14 = trunc i64 %13 to i32
  %15 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv
  store i32 %14, ptr %15, align 4, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph
  %16 = tail call i64 @clock() #10
  %17 = tail call i32 @ks_ksmall_int(i64 noundef %9, ptr noundef %11, i64 noundef 10500)
  %18 = tail call i64 @clock() #10
  %19 = load ptr, ptr @stderr, align 8, !tbaa !5
  %20 = sub nsw i64 %18, %16
  %21 = sitofp i64 %20 to double
  %22 = fdiv double %21, 1.000000e+06
  %23 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef nonnull @.str, i32 noundef %17, double noundef %22) #11
  tail call void @srand48(i64 noundef 11) #10
  br i1 %12, label %.lr.ph107.preheader, label %._crit_edge108

.lr.ph107.preheader:                              ; preds = %._crit_edge
  %wide.trip.count129 = zext nneg i32 %.0101 to i64
  br label %.lr.ph107

.lr.ph107:                                        ; preds = %.lr.ph107.preheader, %.lr.ph107
  %indvars.iv126 = phi i64 [ 0, %.lr.ph107.preheader ], [ %indvars.iv.next127, %.lr.ph107 ]
  %24 = tail call i64 @lrand48() #10
  %25 = trunc i64 %24 to i32
  %26 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv126
  store i32 %25, ptr %26, align 4, !tbaa !9
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %exitcond130.not = icmp eq i64 %indvars.iv.next127, %wide.trip.count129
  br i1 %exitcond130.not, label %._crit_edge108, label %.lr.ph107, !llvm.loop !13

._crit_edge108.critedge:                          ; preds = %8
  %27 = tail call i64 @clock() #10
  %28 = tail call i32 @ks_ksmall_int(i64 noundef %9, ptr noundef %11, i64 noundef 10500)
  %29 = tail call i64 @clock() #10
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = sub nsw i64 %29, %27
  %32 = sitofp i64 %31 to double
  %33 = fdiv double %32, 1.000000e+06
  %34 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str, i32 noundef %28, double noundef %33) #11
  tail call void @srand48(i64 noundef 11) #10
  br label %._crit_edge108

._crit_edge108:                                   ; preds = %.lr.ph107, %._crit_edge108.critedge, %._crit_edge
  %35 = tail call i64 @clock() #10
  tail call void @ks_introsort_int(i64 noundef %9, ptr noundef %11)
  %36 = tail call i64 @clock() #10
  %37 = load ptr, ptr @stderr, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %11, i64 42000
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = sub nsw i64 %36, %35
  %41 = sitofp i64 %40 to double
  %42 = fdiv double %41, 1.000000e+06
  %43 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str.1, i32 noundef %39, double noundef %42) #11
  %44 = tail call i32 @llvm.smax.i32(i32 %.0101, i32 1)
  %smax = add nsw i32 %44, -1
  %wide.trip.count134 = zext nneg i32 %smax to i64
  br label %45

45:                                               ; preds = %46, %._crit_edge108
  %indvars.iv131 = phi i64 [ %indvars.iv.next132, %46 ], [ 0, %._crit_edge108 ]
  %exitcond135.not = icmp eq i64 %indvars.iv131, %wide.trip.count134
  br i1 %exitcond135.not, label %55, label %46

46:                                               ; preds = %45
  %47 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv131
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %49 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv.next132
  %50 = load i32, ptr %49, align 4, !tbaa !9
  %51 = icmp sgt i32 %48, %50
  br i1 %51, label %52, label %45, !llvm.loop !14

52:                                               ; preds = %46
  %53 = load ptr, ptr @stderr, align 8, !tbaa !5
  %54 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.2) #11
  tail call void @exit(i32 noundef 1) #12
  unreachable

55:                                               ; preds = %45
  tail call void @srand48(i64 noundef 11) #10
  %56 = or disjoint i64 %10, 1
  %57 = tail call noalias ptr @malloc(i64 noundef %56) #9
  %58 = getelementptr inbounds i8, ptr %57, i64 1
  br i1 %12, label %.lr.ph111.preheader, label %._crit_edge112

.lr.ph111.preheader:                              ; preds = %55
  %wide.trip.count139 = zext nneg i32 %.0101 to i64
  br label %.lr.ph111

.lr.ph111:                                        ; preds = %.lr.ph111.preheader, %.lr.ph111
  %indvars.iv136 = phi i64 [ 0, %.lr.ph111.preheader ], [ %indvars.iv.next137, %.lr.ph111 ]
  %59 = tail call i64 @lrand48() #10
  %60 = trunc i64 %59 to i32
  %61 = getelementptr inbounds i32, ptr %58, i64 %indvars.iv136
  store i32 %60, ptr %61, align 4, !tbaa !9
  %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
  %exitcond140.not = icmp eq i64 %indvars.iv.next137, %wide.trip.count139
  br i1 %exitcond140.not, label %._crit_edge112, label %.lr.ph111, !llvm.loop !15

._crit_edge112:                                   ; preds = %.lr.ph111, %55
  %62 = tail call i64 @clock() #10
  tail call void @ks_introsort_int(i64 noundef %9, ptr noundef nonnull %58)
  %63 = tail call i64 @clock() #10
  %64 = load ptr, ptr @stderr, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %57, i64 42001
  %66 = load i32, ptr %65, align 4, !tbaa !9
  %67 = sub nsw i64 %63, %62
  %68 = sitofp i64 %67 to double
  %69 = fdiv double %68, 1.000000e+06
  %70 = ptrtoint ptr %58 to i64
  %71 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef nonnull @.str.3, i32 noundef %66, double noundef %69, i64 noundef %70) #11
  %72 = tail call i64 @clock() #10
  tail call void @ks_introsort_int(i64 noundef %9, ptr noundef %11)
  %73 = tail call i64 @clock() #10
  %74 = load ptr, ptr @stderr, align 8, !tbaa !5
  %75 = sub nsw i64 %73, %72
  %76 = sitofp i64 %75 to double
  %77 = fdiv double %76, 1.000000e+06
  %78 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.4, double noundef %77) #11
  tail call void @srand48(i64 noundef 11) #10
  br i1 %12, label %.lr.ph115.preheader, label %._crit_edge116

.lr.ph115.preheader:                              ; preds = %._crit_edge112
  %wide.trip.count144 = zext nneg i32 %.0101 to i64
  br label %.lr.ph115

.lr.ph115:                                        ; preds = %.lr.ph115.preheader, %.lr.ph115
  %indvars.iv141 = phi i64 [ 0, %.lr.ph115.preheader ], [ %indvars.iv.next142, %.lr.ph115 ]
  %79 = tail call i64 @lrand48() #10
  %80 = trunc i64 %79 to i32
  %81 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv141
  store i32 %80, ptr %81, align 4, !tbaa !9
  %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
  %exitcond145.not = icmp eq i64 %indvars.iv.next142, %wide.trip.count144
  br i1 %exitcond145.not, label %._crit_edge116, label %.lr.ph115, !llvm.loop !16

._crit_edge116:                                   ; preds = %.lr.ph115, %._crit_edge112
  %82 = tail call i64 @clock() #10
  tail call void @ks_combsort_int(i64 noundef %9, ptr noundef %11)
  %83 = tail call i64 @clock() #10
  %84 = load ptr, ptr @stderr, align 8, !tbaa !5
  %85 = sub nsw i64 %83, %82
  %86 = sitofp i64 %85 to double
  %87 = fdiv double %86, 1.000000e+06
  %88 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef nonnull @.str.5, double noundef %87) #11
  br label %89

89:                                               ; preds = %90, %._crit_edge116
  %indvars.iv146 = phi i64 [ %indvars.iv.next147, %90 ], [ 0, %._crit_edge116 ]
  %exitcond150.not = icmp eq i64 %indvars.iv146, %wide.trip.count134
  br i1 %exitcond150.not, label %99, label %90

90:                                               ; preds = %89
  %91 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv146
  %92 = load i32, ptr %91, align 4, !tbaa !9
  %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
  %93 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv.next147
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = icmp sgt i32 %92, %94
  br i1 %95, label %96, label %89, !llvm.loop !17

96:                                               ; preds = %90
  %97 = load ptr, ptr @stderr, align 8, !tbaa !5
  %98 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef nonnull @.str.6) #11
  tail call void @exit(i32 noundef 1) #12
  unreachable

99:                                               ; preds = %89
  tail call void @srand48(i64 noundef 11) #10
  br i1 %12, label %.lr.ph119.preheader, label %._crit_edge120

.lr.ph119.preheader:                              ; preds = %99
  %wide.trip.count154 = zext nneg i32 %.0101 to i64
  br label %.lr.ph119

.lr.ph119:                                        ; preds = %.lr.ph119.preheader, %.lr.ph119
  %indvars.iv151 = phi i64 [ 0, %.lr.ph119.preheader ], [ %indvars.iv.next152, %.lr.ph119 ]
  %100 = tail call i64 @lrand48() #10
  %101 = trunc i64 %100 to i32
  %102 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv151
  store i32 %101, ptr %102, align 4, !tbaa !9
  %indvars.iv.next152 = add nuw nsw i64 %indvars.iv151, 1
  %exitcond155.not = icmp eq i64 %indvars.iv.next152, %wide.trip.count154
  br i1 %exitcond155.not, label %._crit_edge120, label %.lr.ph119, !llvm.loop !18

._crit_edge120:                                   ; preds = %.lr.ph119, %99
  %103 = tail call i64 @clock() #10
  tail call void @ks_mergesort_int(i64 noundef %9, ptr noundef %11, ptr noundef null)
  %104 = tail call i64 @clock() #10
  %105 = load ptr, ptr @stderr, align 8, !tbaa !5
  %106 = sub nsw i64 %104, %103
  %107 = sitofp i64 %106 to double
  %108 = fdiv double %107, 1.000000e+06
  %109 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %105, ptr noundef nonnull @.str.7, double noundef %108) #11
  br label %110

110:                                              ; preds = %111, %._crit_edge120
  %indvars.iv156 = phi i64 [ %indvars.iv.next157, %111 ], [ 0, %._crit_edge120 ]
  %exitcond160.not = icmp eq i64 %indvars.iv156, %wide.trip.count134
  br i1 %exitcond160.not, label %120, label %111

111:                                              ; preds = %110
  %112 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv156
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1
  %114 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv.next157
  %115 = load i32, ptr %114, align 4, !tbaa !9
  %116 = icmp sgt i32 %113, %115
  br i1 %116, label %117, label %110, !llvm.loop !19

117:                                              ; preds = %111
  %118 = load ptr, ptr @stderr, align 8, !tbaa !5
  %119 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef nonnull @.str.8) #11
  tail call void @exit(i32 noundef 1) #12
  unreachable

120:                                              ; preds = %110
  %121 = tail call i64 @clock() #10
  tail call void @ks_mergesort_int(i64 noundef %9, ptr noundef %11, ptr noundef null)
  %122 = tail call i64 @clock() #10
  %123 = load ptr, ptr @stderr, align 8, !tbaa !5
  %124 = sub nsw i64 %122, %121
  %125 = sitofp i64 %124 to double
  %126 = fdiv double %125, 1.000000e+06
  %127 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %123, ptr noundef nonnull @.str.9, double noundef %126) #11
  tail call void @srand48(i64 noundef 11) #10
  br i1 %12, label %.lr.ph123.preheader, label %._crit_edge124

.lr.ph123.preheader:                              ; preds = %120
  %wide.trip.count164 = zext nneg i32 %.0101 to i64
  br label %.lr.ph123

.lr.ph123:                                        ; preds = %.lr.ph123.preheader, %.lr.ph123
  %indvars.iv161 = phi i64 [ 0, %.lr.ph123.preheader ], [ %indvars.iv.next162, %.lr.ph123 ]
  %128 = tail call i64 @lrand48() #10
  %129 = trunc i64 %128 to i32
  %130 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv161
  store i32 %129, ptr %130, align 4, !tbaa !9
  %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
  %exitcond165.not = icmp eq i64 %indvars.iv.next162, %wide.trip.count164
  br i1 %exitcond165.not, label %._crit_edge124, label %.lr.ph123, !llvm.loop !20

._crit_edge124:                                   ; preds = %.lr.ph123, %120
  %131 = tail call i64 @clock() #10
  tail call void @ks_heapmake_int(i64 noundef %9, ptr noundef %11)
  tail call void @ks_heapsort_int(i64 noundef %9, ptr noundef %11)
  %132 = tail call i64 @clock() #10
  %133 = load ptr, ptr @stderr, align 8, !tbaa !5
  %134 = sub nsw i64 %132, %131
  %135 = sitofp i64 %134 to double
  %136 = fdiv double %135, 1.000000e+06
  %137 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef nonnull @.str.10, double noundef %136) #11
  br label %138

138:                                              ; preds = %139, %._crit_edge124
  %indvars.iv166 = phi i64 [ %indvars.iv.next167, %139 ], [ 0, %._crit_edge124 ]
  %exitcond170.not = icmp eq i64 %indvars.iv166, %wide.trip.count134
  br i1 %exitcond170.not, label %148, label %139

139:                                              ; preds = %138
  %140 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv166
  %141 = load i32, ptr %140, align 4, !tbaa !9
  %indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1
  %142 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv.next167
  %143 = load i32, ptr %142, align 4, !tbaa !9
  %144 = icmp sgt i32 %141, %143
  br i1 %144, label %145, label %138, !llvm.loop !21

145:                                              ; preds = %139
  %146 = load ptr, ptr @stderr, align 8, !tbaa !5
  %147 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %146, ptr noundef nonnull @.str.11) #11
  tail call void @exit(i32 noundef 1) #12
  unreachable

148:                                              ; preds = %138
  tail call void @free(ptr noundef %11) #10
  ret i32 0
}

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @srand48(i64 noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare i64 @lrand48() local_unnamed_addr #4

; Function Attrs: nounwind
declare i64 @clock() local_unnamed_addr #4

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

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

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

attributes #0 = { 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 nofree nounwind willreturn memory(read) 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 "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 = { 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 #6 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { nounwind }
attributes #11 = { cold nounwind }
attributes #12 = { noreturn nounwind }

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

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


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