; LLVM IR from hoytech/vmtouch :: vmtouch (vmtouch_file)

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

%struct.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }

@total_pages = external dso_local global i64, align 8
@total_pages_in_core = external dso_local global i64, align 8
@offset = external dso_local global i64, align 8
@max_len = external dso_local global i64, align 8
@o_touch = external dso_local global i32, align 4
@o_evict = external dso_local global i32, align 4
@o_verbose = external dso_local global i32, align 4
@o_lock = external dso_local global i32, align 4
@o_lockall = external dso_local global i32, align 4
@o_max_file_size = external dso_local global i64, align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@pagesize = external dso_local global i64, align 8
@.str.49 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [77 x i8], align 1
@stdout = external global ptr, align 8
@junk_counter = external dso_local global i32, align 4
@.str.62 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #0

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #1

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

; Function Attrs: nounwind uwtable
declare hidden void @fatal(ptr noundef, ...) #3

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @bytes2pages(i64 noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @aligned_p(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @is_mincore_page_resident(i8 noundef signext) #3

; Function Attrs: nounwind uwtable
declare dso_local void @increment_nofile_rlimit() #3

; Function Attrs: nounwind uwtable
declare dso_local double @gettimeofday_as_double() #3

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

; Function Attrs: nounwind uwtable
define dso_local void @vmtouch_file(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca %struct.stat, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 -1, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 144, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !11
  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 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  br label %15

15:                                               ; preds = %44, %1
  store i32 0, ptr %11, align 4, !tbaa !9
  %16 = load i32, ptr %11, align 4, !tbaa !9
  %17 = or i32 %16, 262144
  store i32 %17, ptr %11, align 4, !tbaa !9
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = load i32, ptr %11, align 4, !tbaa !9
  %20 = call i32 (ptr, i32, ...) @open64(ptr noundef %18, i32 noundef %19, i32 noundef 0)
  store i32 %20, ptr %3, align 4, !tbaa !9
  %21 = load i32, ptr %3, align 4, !tbaa !9
  %22 = icmp eq i32 %21, -1
  br i1 %22, label %23, label %33

23:                                               ; preds = %15
  %24 = call ptr @__errno_location() #7
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = icmp eq i32 %25, 1
  br i1 %26, label %27, label %33

27:                                               ; preds = %23
  %28 = load i32, ptr %11, align 4, !tbaa !9
  %29 = and i32 %28, -262145
  store i32 %29, ptr %11, align 4, !tbaa !9
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = load i32, ptr %11, align 4, !tbaa !9
  %32 = call i32 (ptr, i32, ...) @open64(ptr noundef %30, i32 noundef %31, i32 noundef 0)
  store i32 %32, ptr %3, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %27, %23, %15
  %34 = load i32, ptr %3, align 4, !tbaa !9
  %35 = icmp eq i32 %34, -1
  br i1 %35, label %36, label %50

36:                                               ; preds = %33
  %37 = call ptr @__errno_location() #7
  %38 = load i32, ptr %37, align 4, !tbaa !9
  %39 = icmp eq i32 %38, 23
  br i1 %39, label %44, label %40

40:                                               ; preds = %36
  %41 = call ptr @__errno_location() #7
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = icmp eq i32 %42, 24
  br i1 %43, label %44, label %45

44:                                               ; preds = %40, %36
  call void @increment_nofile_rlimit()
  br label %15

45:                                               ; preds = %40
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = call ptr @__errno_location() #7
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = call ptr @strerror(i32 noundef %48) #6
  call void (ptr, ...) @warning(ptr noundef @.str.49, ptr noundef %46, ptr noundef %49)
  br label %277

50:                                               ; preds = %33
  %51 = load i32, ptr %3, align 4, !tbaa !9
  %52 = call i32 @fstat64(i32 noundef %51, ptr noundef %5) #6
  store i32 %52, ptr %10, align 4, !tbaa !9
  %53 = load i32, ptr %10, align 4, !tbaa !9
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %60

55:                                               ; preds = %50
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = call ptr @__errno_location() #7
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = call ptr @strerror(i32 noundef %58) #6
  call void (ptr, ...) @warning(ptr noundef @.str.50, ptr noundef %56, ptr noundef %59)
  br label %277

60:                                               ; preds = %50
  %61 = getelementptr inbounds %struct.stat, ptr %5, i32 0, i32 3
  %62 = load i32, ptr %61, align 8, !tbaa !13
  %63 = and i32 %62, 61440
  %64 = icmp eq i32 %63, 24576
  br i1 %64, label %65, label %75

65:                                               ; preds = %60
  %66 = load i32, ptr %3, align 4, !tbaa !9
  %67 = call i32 (i32, i64, ...) @ioctl(i32 noundef %66, i64 noundef 2148012658, ptr noundef %6) #6
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %74

69:                                               ; preds = %65
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = call ptr @__errno_location() #7
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = call ptr @strerror(i32 noundef %72) #6
  call void (ptr, ...) @warning(ptr noundef @.str.51, ptr noundef %70, ptr noundef %73)
  br label %277

74:                                               ; preds = %65
  br label %78

75:                                               ; preds = %60
  %76 = getelementptr inbounds %struct.stat, ptr %5, i32 0, i32 8
  %77 = load i64, ptr %76, align 8, !tbaa !16
  store i64 %77, ptr %6, align 8, !tbaa !11
  br label %78

78:                                               ; preds = %75, %74
  %79 = load i64, ptr %6, align 8, !tbaa !11
  %80 = icmp eq i64 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %78
  br label %277

82:                                               ; preds = %78
  %83 = load i64, ptr %6, align 8, !tbaa !11
  %84 = load i64, ptr @o_max_file_size, align 8, !tbaa !11
  %85 = icmp ugt i64 %83, %84
  br i1 %85, label %86, label %88

86:                                               ; preds = %82
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  call void (ptr, ...) @warning(ptr noundef @.str.52, ptr noundef %87)
  br label %277

88:                                               ; preds = %82
  %89 = load i64, ptr @max_len, align 8, !tbaa !11
  %90 = icmp sgt i64 %89, 0
  br i1 %90, label %91, label %99

91:                                               ; preds = %88
  %92 = load i64, ptr @offset, align 8, !tbaa !11
  %93 = load i64, ptr @max_len, align 8, !tbaa !11
  %94 = add nsw i64 %92, %93
  %95 = load i64, ptr %6, align 8, !tbaa !11
  %96 = icmp slt i64 %94, %95
  br i1 %96, label %97, label %99

97:                                               ; preds = %91
  %98 = load i64, ptr @max_len, align 8, !tbaa !11
  store i64 %98, ptr %7, align 8, !tbaa !11
  br label %110

99:                                               ; preds = %91, %88
  %100 = load i64, ptr @offset, align 8, !tbaa !11
  %101 = load i64, ptr %6, align 8, !tbaa !11
  %102 = icmp sge i64 %100, %101
  br i1 %102, label %103, label %105

103:                                              ; preds = %99
  %104 = load ptr, ptr %2, align 8, !tbaa !5
  call void (ptr, ...) @warning(ptr noundef @.str.53, ptr noundef %104)
  br label %277

105:                                              ; preds = %99
  %106 = load i64, ptr %6, align 8, !tbaa !11
  %107 = load i64, ptr @offset, align 8, !tbaa !11
  %108 = sub nsw i64 %106, %107
  store i64 %108, ptr %7, align 8, !tbaa !11
  br label %109

109:                                              ; preds = %105
  br label %110

110:                                              ; preds = %109, %97
  %111 = load i64, ptr %7, align 8, !tbaa !11
  %112 = load i32, ptr %3, align 4, !tbaa !9
  %113 = load i64, ptr @offset, align 8, !tbaa !11
  %114 = call ptr @mmap64(ptr noundef null, i64 noundef %111, i32 noundef 1, i32 noundef 1, i32 noundef %112, i64 noundef %113) #6
  store ptr %114, ptr %4, align 8, !tbaa !5
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = icmp eq ptr %115, inttoptr (i64 -1 to ptr)
  br i1 %116, label %117, label %122

117:                                              ; preds = %110
  %118 = load ptr, ptr %2, align 8, !tbaa !5
  %119 = call ptr @__errno_location() #7
  %120 = load i32, ptr %119, align 4, !tbaa !9
  %121 = call ptr @strerror(i32 noundef %120) #6
  call void (ptr, ...) @warning(ptr noundef @.str.54, ptr noundef %118, ptr noundef %121)
  br label %277

122:                                              ; preds = %110
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = call i32 @aligned_p(ptr noundef %123)
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %128, label %126

126:                                              ; preds = %122
  %127 = load ptr, ptr %2, align 8, !tbaa !5
  call void (ptr, ...) @fatal(ptr noundef @.str.55, ptr noundef %127)
  br label %128

128:                                              ; preds = %126, %122
  %129 = load i64, ptr %7, align 8, !tbaa !11
  %130 = call i64 @bytes2pages(i64 noundef %129)
  store i64 %130, ptr %8, align 8, !tbaa !11
  %131 = load i64, ptr %8, align 8, !tbaa !11
  %132 = load i64, ptr @total_pages, align 8, !tbaa !11
  %133 = add nsw i64 %132, %131
  store i64 %133, ptr @total_pages, align 8, !tbaa !11
  %134 = load i32, ptr @o_evict, align 4, !tbaa !9
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %154

136:                                              ; preds = %128
  %137 = load i32, ptr @o_verbose, align 4, !tbaa !9
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %142

139:                                              ; preds = %136
  %140 = load ptr, ptr %2, align 8, !tbaa !5
  %141 = call i32 (ptr, ...) @printf(ptr noundef @.str.56, ptr noundef %140)
  br label %142

142:                                              ; preds = %139, %136
  %143 = load i32, ptr %3, align 4, !tbaa !9
  %144 = load i64, ptr @offset, align 8, !tbaa !11
  %145 = load i64, ptr %7, align 8, !tbaa !11
  %146 = call i32 @posix_fadvise64(i32 noundef %143, i64 noundef %144, i64 noundef %145, i32 noundef 4) #6
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %148, label %153

148:                                              ; preds = %142
  %149 = load ptr, ptr %2, align 8, !tbaa !5
  %150 = call ptr @__errno_location() #7
  %151 = load i32, ptr %150, align 4, !tbaa !9
  %152 = call ptr @strerror(i32 noundef %151) #6
  call void (ptr, ...) @warning(ptr noundef @.str.57, ptr noundef %149, ptr noundef %152)
  br label %153

153:                                              ; preds = %148, %142
  br label %262

154:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store double 0.000000e+00, ptr %12, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %155 = load i64, ptr %8, align 8, !tbaa !11
  %156 = call noalias ptr @malloc(i64 noundef %155) #8
  store ptr %156, ptr %14, align 8, !tbaa !5
  %157 = load ptr, ptr %14, align 8, !tbaa !5
  %158 = icmp eq ptr %157, null
  br i1 %158, label %159, label %163

159:                                              ; preds = %154
  %160 = call ptr @__errno_location() #7
  %161 = load i32, ptr %160, align 4, !tbaa !9
  %162 = call ptr @strerror(i32 noundef %161) #6
  call void (ptr, ...) @fatal(ptr noundef @.str.58, ptr noundef %162)
  br label %163

163:                                              ; preds = %159, %154
  %164 = load ptr, ptr %4, align 8, !tbaa !5
  %165 = load i64, ptr %7, align 8, !tbaa !11
  %166 = load ptr, ptr %14, align 8, !tbaa !5
  %167 = call i32 @mincore(ptr noundef %164, i64 noundef %165, ptr noundef %166) #6
  %168 = icmp ne i32 %167, 0
  br i1 %168, label %169, label %174

169:                                              ; preds = %163
  %170 = load ptr, ptr %2, align 8, !tbaa !5
  %171 = call ptr @__errno_location() #7
  %172 = load i32, ptr %171, align 4, !tbaa !9
  %173 = call ptr @strerror(i32 noundef %172) #6
  call void (ptr, ...) @fatal(ptr noundef @.str.59, ptr noundef %170, ptr noundef %173)
  br label %174

174:                                              ; preds = %169, %163
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %175

175:                                              ; preds = %192, %174
  %176 = load i32, ptr %9, align 4, !tbaa !9
  %177 = sext i32 %176 to i64
  %178 = load i64, ptr %8, align 8, !tbaa !11
  %179 = icmp slt i64 %177, %178
  br i1 %179, label %180, label %195

180:                                              ; preds = %175
  %181 = load ptr, ptr %14, align 8, !tbaa !5
  %182 = load i32, ptr %9, align 4, !tbaa !9
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds i8, ptr %181, i64 %183
  %185 = load i8, ptr %184, align 1, !tbaa !19
  %186 = call i32 @is_mincore_page_resident(i8 noundef signext %185)
  %187 = icmp ne i32 %186, 0
  br i1 %187, label %188, label %191

188:                                              ; preds = %180
  %189 = load i64, ptr @total_pages_in_core, align 8, !tbaa !11
  %190 = add nsw i64 %189, 1
  store i64 %190, ptr @total_pages_in_core, align 8, !tbaa !11
  br label %191

191:                                              ; preds = %188, %180
  br label %192

192:                                              ; preds = %191
  %193 = load i32, ptr %9, align 4, !tbaa !9
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %9, align 4, !tbaa !9
  br label %175, !llvm.loop !20

195:                                              ; preds = %175
  %196 = load i32, ptr @o_verbose, align 4, !tbaa !9
  %197 = icmp ne i32 %196, 0
  br i1 %197, label %198, label %209

198:                                              ; preds = %195
  %199 = load ptr, ptr %2, align 8, !tbaa !5
  %200 = call i32 (ptr, ...) @printf(ptr noundef @.str.60, ptr noundef %199)
  %201 = call i32 @can_do_mincore(ptr noundef %5)
  %202 = icmp ne i32 %201, 0
  br i1 %202, label %204, label %203

203:                                              ; preds = %198
  call void (ptr, ...) @warning(ptr noundef @.str.61)
  br label %204

204:                                              ; preds = %203, %198
  %205 = call double @gettimeofday_as_double()
  store double %205, ptr %12, align 8, !tbaa !17
  %206 = load ptr, ptr @stdout, align 8, !tbaa !5
  %207 = load ptr, ptr %14, align 8, !tbaa !5
  %208 = load i64, ptr %8, align 8, !tbaa !11
  call void @print_page_residency_chart(ptr noundef %206, ptr noundef %207, i64 noundef %208)
  br label %209

209:                                              ; preds = %204, %195
  %210 = load i32, ptr @o_touch, align 4, !tbaa !9
  %211 = icmp ne i32 %210, 0
  br i1 %211, label %212, label %252

212:                                              ; preds = %209
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %213

213:                                              ; preds = %248, %212
  %214 = load i32, ptr %9, align 4, !tbaa !9
  %215 = sext i32 %214 to i64
  %216 = load i64, ptr %8, align 8, !tbaa !11
  %217 = icmp slt i64 %215, %216
  br i1 %217, label %218, label %251

218:                                              ; preds = %213
  %219 = load ptr, ptr %4, align 8, !tbaa !5
  %220 = load i32, ptr %9, align 4, !tbaa !9
  %221 = sext i32 %220 to i64
  %222 = load i64, ptr @pagesize, align 8, !tbaa !11
  %223 = mul nsw i64 %221, %222
  %224 = getelementptr inbounds i8, ptr %219, i64 %223
  %225 = load i8, ptr %224, align 1, !tbaa !19
  %226 = sext i8 %225 to i32
  %227 = load i32, ptr @junk_counter, align 4, !tbaa !9
  %228 = add i32 %227, %226
  store i32 %228, ptr @junk_counter, align 4, !tbaa !9
  %229 = load ptr, ptr %14, align 8, !tbaa !5
  %230 = load i32, ptr %9, align 4, !tbaa !9
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds i8, ptr %229, i64 %231
  store i8 1, ptr %232, align 1, !tbaa !19
  %233 = load i32, ptr @o_verbose, align 4, !tbaa !9
  %234 = icmp ne i32 %233, 0
  br i1 %234, label %235, label %247

235:                                              ; preds = %218
  %236 = call double @gettimeofday_as_double()
  store double %236, ptr %13, align 8, !tbaa !17
  %237 = load double, ptr %13, align 8, !tbaa !17
  %238 = load double, ptr %12, align 8, !tbaa !17
  %239 = fadd double %238, 1.000000e-01
  %240 = fcmp ogt double %237, %239
  br i1 %240, label %241, label %246

241:                                              ; preds = %235
  %242 = load double, ptr %13, align 8, !tbaa !17
  store double %242, ptr %12, align 8, !tbaa !17
  %243 = load ptr, ptr @stdout, align 8, !tbaa !5
  %244 = load ptr, ptr %14, align 8, !tbaa !5
  %245 = load i64, ptr %8, align 8, !tbaa !11
  call void @print_page_residency_chart(ptr noundef %243, ptr noundef %244, i64 noundef %245)
  br label %246

246:                                              ; preds = %241, %235
  br label %247

247:                                              ; preds = %246, %218
  br label %248

248:                                              ; preds = %247
  %249 = load i32, ptr %9, align 4, !tbaa !9
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %9, align 4, !tbaa !9
  br label %213, !llvm.loop !22

251:                                              ; preds = %213
  br label %252

252:                                              ; preds = %251, %209
  %253 = load i32, ptr @o_verbose, align 4, !tbaa !9
  %254 = icmp ne i32 %253, 0
  br i1 %254, label %255, label %260

255:                                              ; preds = %252
  %256 = load ptr, ptr @stdout, align 8, !tbaa !5
  %257 = load ptr, ptr %14, align 8, !tbaa !5
  %258 = load i64, ptr %8, align 8, !tbaa !11
  call void @print_page_residency_chart(ptr noundef %256, ptr noundef %257, i64 noundef %258)
  %259 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %260

260:                                              ; preds = %255, %252
  %261 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %261) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %262

262:                                              ; preds = %260, %153
  %263 = load i32, ptr @o_lock, align 4, !tbaa !9
  %264 = icmp ne i32 %263, 0
  br i1 %264, label %265, label %276

265:                                              ; preds = %262
  %266 = load ptr, ptr %4, align 8, !tbaa !5
  %267 = load i64, ptr %7, align 8, !tbaa !11
  %268 = call i32 @mlock(ptr noundef %266, i64 noundef %267) #6
  %269 = icmp ne i32 %268, 0
  br i1 %269, label %270, label %275

270:                                              ; preds = %265
  %271 = load ptr, ptr %2, align 8, !tbaa !5
  %272 = call ptr @__errno_location() #7
  %273 = load i32, ptr %272, align 4, !tbaa !9
  %274 = call ptr @strerror(i32 noundef %273) #6
  call void (ptr, ...) @fatal(ptr noundef @.str.62, ptr noundef %271, ptr noundef %274)
  br label %275

275:                                              ; preds = %270, %265
  br label %276

276:                                              ; preds = %275, %262
  br label %277

277:                                              ; preds = %276, %117, %103, %86, %81, %69, %55, %45
  %278 = load i32, ptr @o_lock, align 4, !tbaa !9
  %279 = icmp ne i32 %278, 0
  br i1 %279, label %297, label %280

280:                                              ; preds = %277
  %281 = load i32, ptr @o_lockall, align 4, !tbaa !9
  %282 = icmp ne i32 %281, 0
  br i1 %282, label %297, label %283

283:                                              ; preds = %280
  %284 = load ptr, ptr %4, align 8, !tbaa !5
  %285 = icmp ne ptr %284, null
  br i1 %285, label %286, label %297

286:                                              ; preds = %283
  %287 = load ptr, ptr %4, align 8, !tbaa !5
  %288 = load i64, ptr %7, align 8, !tbaa !11
  %289 = call i32 @munmap(ptr noundef %287, i64 noundef %288) #6
  %290 = icmp ne i32 %289, 0
  br i1 %290, label %291, label %296

291:                                              ; preds = %286
  %292 = load ptr, ptr %2, align 8, !tbaa !5
  %293 = call ptr @__errno_location() #7
  %294 = load i32, ptr %293, align 4, !tbaa !9
  %295 = call ptr @strerror(i32 noundef %294) #6
  call void (ptr, ...) @warning(ptr noundef @.str.63, ptr noundef %292, ptr noundef %295)
  br label %296

296:                                              ; preds = %291, %286
  br label %297

297:                                              ; preds = %296, %283, %280, %277
  %298 = load i32, ptr %3, align 4, !tbaa !9
  %299 = icmp ne i32 %298, -1
  br i1 %299, label %300, label %303

300:                                              ; preds = %297
  %301 = load i32, ptr %3, align 4, !tbaa !9
  %302 = call i32 @close(i32 noundef %301)
  br label %303

303:                                              ; preds = %300, %297
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, 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 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 144, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret void
}

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

; Function Attrs: nounwind uwtable
declare hidden void @warning(ptr noundef, ...) #3

; Function Attrs: nounwind
declare i32 @fstat64(i32 noundef, ptr noundef) #0

; Function Attrs: nounwind
declare i32 @ioctl(i32 noundef, i64 noundef, ...) #0

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

; Function Attrs: nounwind
declare i32 @posix_fadvise64(i32 noundef, i64 noundef, i64 noundef, i32 noundef) #0

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #5

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

; Function Attrs: nounwind uwtable
declare hidden i32 @can_do_mincore(ptr noundef) #3

; Function Attrs: nounwind
declare void @free(ptr noundef) #0

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

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

declare i32 @close(i32 noundef) #2

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

!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 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 24}
!14 = !{!"stat", !12, i64 0, !12, i64 8, !12, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !15, i64 72, !15, i64 88, !15, i64 104, !7, i64 120}
!15 = !{!"timespec", !12, i64 0, !12, i64 8}
!16 = !{!14, !12, i64 48}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


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

%struct.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }

@total_pages = external dso_local local_unnamed_addr global i64, align 8
@total_pages_in_core = external dso_local local_unnamed_addr global i64, align 8
@offset = external dso_local local_unnamed_addr global i64, align 8
@max_len = external dso_local local_unnamed_addr global i64, align 8
@o_touch = external dso_local local_unnamed_addr global i32, align 4
@o_evict = external dso_local local_unnamed_addr global i32, align 4
@o_verbose = external dso_local local_unnamed_addr global i32, align 4
@o_lock = external dso_local local_unnamed_addr global i32, align 4
@o_lockall = external dso_local local_unnamed_addr global i32, align 4
@o_max_file_size = external dso_local local_unnamed_addr global i64, align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@pagesize = external dso_local local_unnamed_addr global i64, align 8
@.str.49 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [77 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@junk_counter = external dso_local local_unnamed_addr global i32, align 4
@.str.62 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden void @fatal(ptr noundef, ...) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @bytes2pages(i64 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @aligned_p(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @is_mincore_page_resident(i8 noundef signext) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local void @increment_nofile_rlimit() local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local double @gettimeofday_as_double() local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
define dso_local void @vmtouch_file(ptr noundef %0) local_unnamed_addr #3 {
  %2 = alloca %struct.stat, align 8
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %2) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #10
  store i64 0, ptr %3, align 8, !tbaa !5
  %4 = tail call i32 (ptr, i32, ...) @open64(ptr noundef %0, i32 noundef 262144, i32 noundef 0) #10
  %5 = icmp eq i32 %4, -1
  br i1 %5, label %.lr.ph, label %.thread110

.lr.ph:                                           ; preds = %1
  %6 = tail call ptr @__errno_location() #11
  br label %7

7:                                                ; preds = %.lr.ph, %14
  %8 = load i32, ptr %6, align 4, !tbaa !9
  %9 = icmp eq i32 %8, 1
  br i1 %9, label %10, label %.thread

10:                                               ; preds = %7
  %11 = tail call i32 (ptr, i32, ...) @open64(ptr noundef %0, i32 noundef 0, i32 noundef 0) #10
  %12 = icmp eq i32 %11, -1
  br i1 %12, label %..thread_crit_edge, label %.thread110

..thread_crit_edge:                               ; preds = %10
  %.pre = load i32, ptr %6, align 4, !tbaa !9
  br label %.thread

.thread:                                          ; preds = %..thread_crit_edge, %7
  %13 = phi i32 [ %.pre, %..thread_crit_edge ], [ %8, %7 ]
  %.off = add i32 %13, -23
  %switch = icmp ult i32 %.off, 2
  br i1 %switch, label %14, label %17

14:                                               ; preds = %.thread
  tail call void @increment_nofile_rlimit()
  %15 = tail call i32 (ptr, i32, ...) @open64(ptr noundef %0, i32 noundef 262144, i32 noundef 0) #10
  %16 = icmp eq i32 %15, -1
  br i1 %16, label %7, label %.thread110

17:                                               ; preds = %.thread
  %18 = tail call ptr @strerror(i32 noundef %13) #10
  tail call void (ptr, ...) @warning(ptr noundef nonnull @.str.49, ptr noundef %0, ptr noundef %18)
  br label %173

.thread110:                                       ; preds = %10, %14, %1
  %.0112 = phi i32 [ %4, %1 ], [ %15, %14 ], [ %11, %10 ]
  %19 = call i32 @fstat64(i32 noundef %.0112, ptr noundef nonnull %2) #10
  %.not = icmp eq i32 %19, 0
  br i1 %.not, label %24, label %20

20:                                               ; preds = %.thread110
  %21 = tail call ptr @__errno_location() #11
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = tail call ptr @strerror(i32 noundef %22) #10
  tail call void (ptr, ...) @warning(ptr noundef nonnull @.str.50, ptr noundef %0, ptr noundef %23)
  br label %173

24:                                               ; preds = %.thread110
  %25 = getelementptr inbounds i8, ptr %2, i64 24
  %26 = load i32, ptr %25, align 8, !tbaa !11
  %27 = and i32 %26, 61440
  %28 = icmp eq i32 %27, 24576
  br i1 %28, label %29, label %35

29:                                               ; preds = %24
  %30 = call i32 (i32, i64, ...) @ioctl(i32 noundef %.0112, i64 noundef 2148012658, ptr noundef nonnull %3) #10
  %.not87 = icmp eq i32 %30, 0
  br i1 %.not87, label %thread-pre-split, label %31

31:                                               ; preds = %29
  %32 = tail call ptr @__errno_location() #11
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = call ptr @strerror(i32 noundef %33) #10
  call void (ptr, ...) @warning(ptr noundef nonnull @.str.51, ptr noundef %0, ptr noundef %34)
  br label %173

35:                                               ; preds = %24
  %36 = getelementptr inbounds i8, ptr %2, i64 48
  %37 = load i64, ptr %36, align 8, !tbaa !14
  store i64 %37, ptr %3, align 8, !tbaa !5
  br label %38

thread-pre-split:                                 ; preds = %29
  %.pr = load i64, ptr %3, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %thread-pre-split, %35
  %39 = phi i64 [ %.pr, %thread-pre-split ], [ %37, %35 ]
  %40 = icmp eq i64 %39, 0
  br i1 %40, label %173, label %41

41:                                               ; preds = %38
  %42 = load i64, ptr @o_max_file_size, align 8, !tbaa !5
  %43 = icmp ugt i64 %39, %42
  br i1 %43, label %44, label %45

44:                                               ; preds = %41
  call void (ptr, ...) @warning(ptr noundef nonnull @.str.52, ptr noundef %0)
  br label %173

45:                                               ; preds = %41
  %46 = load i64, ptr @max_len, align 8, !tbaa !5
  %47 = icmp sgt i64 %46, 0
  %.pre130 = load i64, ptr @offset, align 8, !tbaa !5
  %48 = add nsw i64 %.pre130, %46
  %49 = icmp slt i64 %48, %39
  %or.cond145 = select i1 %47, i1 %49, i1 false
  br i1 %or.cond145, label %54, label %50

50:                                               ; preds = %45
  %.not88 = icmp slt i64 %.pre130, %39
  br i1 %.not88, label %52, label %51

51:                                               ; preds = %50
  call void (ptr, ...) @warning(ptr noundef nonnull @.str.53, ptr noundef %0)
  br label %173

52:                                               ; preds = %50
  %53 = sub nsw i64 %39, %.pre130
  br label %54

54:                                               ; preds = %45, %52
  %.070 = phi i64 [ %53, %52 ], [ %46, %45 ]
  %55 = call ptr @mmap64(ptr noundef null, i64 noundef %.070, i32 noundef 1, i32 noundef 1, i32 noundef %.0112, i64 noundef %.pre130) #10
  %56 = icmp eq ptr %55, inttoptr (i64 -1 to ptr)
  br i1 %56, label %57, label %61

57:                                               ; preds = %54
  %58 = tail call ptr @__errno_location() #11
  %59 = load i32, ptr %58, align 4, !tbaa !9
  %60 = call ptr @strerror(i32 noundef %59) #10
  call void (ptr, ...) @warning(ptr noundef nonnull @.str.54, ptr noundef %0, ptr noundef %60)
  br label %173

61:                                               ; preds = %54
  %62 = call i32 @aligned_p(ptr noundef %55)
  %.not89 = icmp eq i32 %62, 0
  br i1 %.not89, label %63, label %64

63:                                               ; preds = %61
  call void (ptr, ...) @fatal(ptr noundef nonnull @.str.55, ptr noundef %0)
  br label %64

64:                                               ; preds = %63, %61
  %65 = call i64 @bytes2pages(i64 noundef %.070)
  %66 = load i64, ptr @total_pages, align 8, !tbaa !5
  %67 = add nsw i64 %66, %65
  store i64 %67, ptr @total_pages, align 8, !tbaa !5
  %68 = load i32, ptr @o_evict, align 4, !tbaa !9
  %.not90 = icmp eq i32 %68, 0
  br i1 %.not90, label %80, label %69

69:                                               ; preds = %64
  %70 = load i32, ptr @o_verbose, align 4, !tbaa !9
  %.not98 = icmp eq i32 %70, 0
  br i1 %.not98, label %73, label %71

71:                                               ; preds = %69
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.56, ptr noundef %0)
  br label %73

73:                                               ; preds = %71, %69
  %74 = load i64, ptr @offset, align 8, !tbaa !5
  %75 = call i32 @posix_fadvise64(i32 noundef %.0112, i64 noundef %74, i64 noundef %.070, i32 noundef 4) #10
  %.not99 = icmp eq i32 %75, 0
  br i1 %.not99, label %165, label %76

76:                                               ; preds = %73
  %77 = tail call ptr @__errno_location() #11
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %79 = call ptr @strerror(i32 noundef %78) #10
  call void (ptr, ...) @warning(ptr noundef nonnull @.str.57, ptr noundef %0, ptr noundef %79)
  br label %165

80:                                               ; preds = %64
  %81 = call noalias ptr @malloc(i64 noundef %65) #12
  %82 = icmp eq ptr %81, null
  br i1 %82, label %83, label %87

83:                                               ; preds = %80
  %84 = tail call ptr @__errno_location() #11
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = call ptr @strerror(i32 noundef %85) #10
  call void (ptr, ...) @fatal(ptr noundef nonnull @.str.58, ptr noundef %86)
  br label %87

87:                                               ; preds = %83, %80
  %88 = call i32 @mincore(ptr noundef %55, i64 noundef %.070, ptr noundef %81) #10
  %.not91 = icmp eq i32 %88, 0
  br i1 %.not91, label %93, label %89

89:                                               ; preds = %87
  %90 = tail call ptr @__errno_location() #11
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = call ptr @strerror(i32 noundef %91) #10
  call void (ptr, ...) @fatal(ptr noundef nonnull @.str.59, ptr noundef %0, ptr noundef %92)
  br label %93

93:                                               ; preds = %89, %87
  %94 = icmp sgt i64 %65, 0
  br i1 %94, label %.lr.ph116, label %._crit_edge

.lr.ph116:                                        ; preds = %93, %101
  %indvars.iv = phi i64 [ %indvars.iv.next, %101 ], [ 0, %93 ]
  %95 = getelementptr inbounds i8, ptr %81, i64 %indvars.iv
  %96 = load i8, ptr %95, align 1, !tbaa !15
  %97 = call i32 @is_mincore_page_resident(i8 noundef signext %96)
  %.not97 = icmp eq i32 %97, 0
  br i1 %.not97, label %101, label %98

98:                                               ; preds = %.lr.ph116
  %99 = load i64, ptr @total_pages_in_core, align 8, !tbaa !5
  %100 = add nsw i64 %99, 1
  store i64 %100, ptr @total_pages_in_core, align 8, !tbaa !5
  br label %101

101:                                              ; preds = %.lr.ph116, %98
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %65
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph116, !llvm.loop !16

._crit_edge:                                      ; preds = %101, %93
  %102 = load i32, ptr @o_verbose, align 4, !tbaa !9
  %.not92 = icmp eq i32 %102, 0
  br i1 %.not92, label %.thread134, label %103

103:                                              ; preds = %._crit_edge
  %104 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.60, ptr noundef %0)
  %105 = call i32 @can_do_mincore(ptr noundef nonnull %2)
  %.not93 = icmp eq i32 %105, 0
  br i1 %.not93, label %106, label %107

106:                                              ; preds = %103
  call void (ptr, ...) @warning(ptr noundef nonnull @.str.61)
  br label %107

107:                                              ; preds = %103, %106
  %108 = call double @gettimeofday_as_double()
  %109 = load ptr, ptr @stdout, align 8, !tbaa !18
  call void @print_page_residency_chart(ptr noundef %109, ptr noundef %81, i64 noundef %65)
  %.pre132.pre = load i32, ptr @o_verbose, align 4, !tbaa !9
  %110 = load i32, ptr @o_touch, align 4, !tbaa !9
  %.not94 = icmp ne i32 %110, 0
  %or.cond = and i1 %.not94, %94
  br i1 %or.cond, label %.lr.ph119, label %.loopexit

.thread134:                                       ; preds = %._crit_edge
  %111 = load i32, ptr @o_touch, align 4, !tbaa !9
  %.not94137 = icmp ne i32 %111, 0
  %or.cond138 = and i1 %.not94137, %94
  br i1 %or.cond138, label %.lr.ph119.split.us, label %.loopexit.thread

.lr.ph119:                                        ; preds = %107
  %112 = icmp eq i32 %.pre132.pre, 0
  br i1 %112, label %.lr.ph119.split.us, label %.lr.ph119.split

.lr.ph119.split.us:                               ; preds = %.thread134, %.lr.ph119
  %113 = load i64, ptr @pagesize, align 8, !tbaa !5
  %junk_counter.promoted = load i32, ptr @junk_counter, align 4, !tbaa !9
  %min.iters.check = icmp ugt i64 %65, 23
  %ident.check.not = icmp eq i64 %113, 1
  %or.cond156 = select i1 %min.iters.check, i1 %ident.check.not, i1 false
  br i1 %or.cond156, label %vector.memcheck, label %scalar.ph.preheader

vector.memcheck:                                  ; preds = %.lr.ph119.split.us
  %scevgep = getelementptr i8, ptr %81, i64 %65
  %scevgep146 = getelementptr i8, ptr %55, i64 %65
  %bound0 = icmp ugt ptr %scevgep, @junk_counter
  %bound1 = icmp ult ptr %81, getelementptr inbounds (i8, ptr @junk_counter, i64 4)
  %found.conflict = and i1 %bound0, %bound1
  %bound0147 = icmp ugt ptr %scevgep146, @junk_counter
  %bound1148 = icmp ult ptr %55, getelementptr inbounds (i8, ptr @junk_counter, i64 4)
  %found.conflict149 = and i1 %bound0147, %bound1148
  %conflict.rdx = or i1 %found.conflict, %found.conflict149
  %bound0150 = icmp ult ptr %81, %scevgep146
  %bound1151 = icmp ult ptr %55, %scevgep
  %found.conflict152 = and i1 %bound0150, %bound1151
  %conflict.rdx153 = or i1 %conflict.rdx, %found.conflict152
  br i1 %conflict.rdx153, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %65, -8
  %114 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %junk_counter.promoted, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %114, %vector.ph ], [ %119, %vector.body ]
  %vec.phi154 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %120, %vector.body ]
  %115 = getelementptr inbounds i8, ptr %55, i64 %index
  %116 = getelementptr inbounds i8, ptr %115, i64 4
  %wide.load = load <4 x i8>, ptr %115, align 1, !tbaa !15, !alias.scope !20
  %wide.load155 = load <4 x i8>, ptr %116, align 1, !tbaa !15, !alias.scope !20
  %117 = sext <4 x i8> %wide.load to <4 x i32>
  %118 = sext <4 x i8> %wide.load155 to <4 x i32>
  %119 = add <4 x i32> %vec.phi, %117
  %120 = add <4 x i32> %vec.phi154, %118
  %121 = getelementptr inbounds i8, ptr %81, i64 %index
  %122 = getelementptr inbounds i8, ptr %121, i64 4
  store <4 x i8> <i8 1, i8 1, i8 1, i8 1>, ptr %121, align 1, !tbaa !15, !alias.scope !23, !noalias !20
  store <4 x i8> <i8 1, i8 1, i8 1, i8 1>, ptr %122, align 1, !tbaa !15, !alias.scope !23, !noalias !20
  %index.next = add nuw i64 %index, 8
  %123 = icmp eq i64 %index.next, %n.vec
  br i1 %123, label %middle.block, label %vector.body, !llvm.loop !25

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %120, %119
  %124 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  store i32 %124, ptr @junk_counter, align 4, !tbaa !9
  %cmp.n = icmp eq i64 %65, %n.vec
  br i1 %cmp.n, label %.loopexit.thread, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph119.split.us
  %indvars.iv126.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph119.split.us ], [ %n.vec, %middle.block ]
  %.ph = phi i32 [ %junk_counter.promoted, %vector.memcheck ], [ %junk_counter.promoted, %.lr.ph119.split.us ], [ %124, %middle.block ]
  %.neg = or disjoint i64 %indvars.iv126.ph, 1
  %xtraiter = and i64 %65, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %125 = mul nsw i64 %113, %indvars.iv126.ph
  %126 = getelementptr inbounds i8, ptr %55, i64 %125
  %127 = load i8, ptr %126, align 1, !tbaa !15
  %128 = sext i8 %127 to i32
  %129 = add i32 %.ph, %128
  store i32 %129, ptr @junk_counter, align 4, !tbaa !9
  %130 = getelementptr inbounds i8, ptr %81, i64 %indvars.iv126.ph
  store i8 1, ptr %130, align 1, !tbaa !15
  %indvars.iv.next127.prol = or disjoint i64 %indvars.iv126.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv126.unr = phi i64 [ %indvars.iv126.ph, %scalar.ph.preheader ], [ %indvars.iv.next127.prol, %scalar.ph.prol ]
  %.unr = phi i32 [ %.ph, %scalar.ph.preheader ], [ %129, %scalar.ph.prol ]
  %131 = icmp eq i64 %65, %.neg
  br i1 %131, label %.loopexit.thread, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv126 = phi i64 [ %indvars.iv.next127.1, %scalar.ph ], [ %indvars.iv126.unr, %scalar.ph.prol.loopexit ]
  %132 = phi i32 [ %143, %scalar.ph ], [ %.unr, %scalar.ph.prol.loopexit ]
  %133 = mul nsw i64 %113, %indvars.iv126
  %134 = getelementptr inbounds i8, ptr %55, i64 %133
  %135 = load i8, ptr %134, align 1, !tbaa !15
  %136 = sext i8 %135 to i32
  %137 = add i32 %132, %136
  store i32 %137, ptr @junk_counter, align 4, !tbaa !9
  %138 = getelementptr inbounds i8, ptr %81, i64 %indvars.iv126
  store i8 1, ptr %138, align 1, !tbaa !15
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %139 = mul nsw i64 %113, %indvars.iv.next127
  %140 = getelementptr inbounds i8, ptr %55, i64 %139
  %141 = load i8, ptr %140, align 1, !tbaa !15
  %142 = sext i8 %141 to i32
  %143 = add i32 %137, %142
  store i32 %143, ptr @junk_counter, align 4, !tbaa !9
  %144 = getelementptr inbounds i8, ptr %81, i64 %indvars.iv.next127
  store i8 1, ptr %144, align 1, !tbaa !15
  %indvars.iv.next127.1 = add nuw nsw i64 %indvars.iv126, 2
  %exitcond129.not.1 = icmp eq i64 %indvars.iv.next127.1, %65
  br i1 %exitcond129.not.1, label %.loopexit.thread, label %scalar.ph, !llvm.loop !28

.lr.ph119.split:                                  ; preds = %.lr.ph119, %160
  %indvars.iv122 = phi i64 [ %indvars.iv.next123, %160 ], [ 0, %.lr.ph119 ]
  %.1118 = phi double [ %.2, %160 ], [ %108, %.lr.ph119 ]
  %145 = load i64, ptr @pagesize, align 8, !tbaa !5
  %146 = mul nsw i64 %145, %indvars.iv122
  %147 = getelementptr inbounds i8, ptr %55, i64 %146
  %148 = load i8, ptr %147, align 1, !tbaa !15
  %149 = sext i8 %148 to i32
  %150 = load i32, ptr @junk_counter, align 4, !tbaa !9
  %151 = add i32 %150, %149
  store i32 %151, ptr @junk_counter, align 4, !tbaa !9
  %152 = getelementptr inbounds i8, ptr %81, i64 %indvars.iv122
  store i8 1, ptr %152, align 1, !tbaa !15
  %153 = load i32, ptr @o_verbose, align 4, !tbaa !9
  %.not96 = icmp eq i32 %153, 0
  br i1 %.not96, label %160, label %154

154:                                              ; preds = %.lr.ph119.split
  %155 = call double @gettimeofday_as_double()
  %156 = fadd double %.1118, 1.000000e-01
  %157 = fcmp ogt double %155, %156
  br i1 %157, label %158, label %160

158:                                              ; preds = %154
  %159 = load ptr, ptr @stdout, align 8, !tbaa !18
  call void @print_page_residency_chart(ptr noundef %159, ptr noundef nonnull %81, i64 noundef %65)
  br label %160

160:                                              ; preds = %.lr.ph119.split, %158, %154
  %.2 = phi double [ %155, %158 ], [ %.1118, %154 ], [ %.1118, %.lr.ph119.split ]
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %exitcond125.not = icmp eq i64 %indvars.iv.next123, %65
  br i1 %exitcond125.not, label %.loopexit.loopexit120, label %.lr.ph119.split, !llvm.loop !29

.loopexit.loopexit120:                            ; preds = %160
  %.pre131 = load i32, ptr @o_verbose, align 4, !tbaa !9
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit120, %107
  %161 = phi i32 [ %.pre131, %.loopexit.loopexit120 ], [ %.pre132.pre, %107 ]
  %.not95 = icmp eq i32 %161, 0
  br i1 %.not95, label %.loopexit.thread, label %162

162:                                              ; preds = %.loopexit
  %163 = load ptr, ptr @stdout, align 8, !tbaa !18
  call void @print_page_residency_chart(ptr noundef %163, ptr noundef %81, i64 noundef %65)
  %164 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %.loopexit.thread

.loopexit.thread:                                 ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %.thread134, %162, %.loopexit
  call void @free(ptr noundef %81) #10
  br label %165

165:                                              ; preds = %73, %76, %.loopexit.thread
  %166 = load i32, ptr @o_lock, align 4, !tbaa !9
  %.not100 = icmp eq i32 %166, 0
  br i1 %.not100, label %173, label %167

167:                                              ; preds = %165
  %168 = call i32 @mlock(ptr noundef %55, i64 noundef %.070) #10
  %.not101 = icmp eq i32 %168, 0
  br i1 %.not101, label %173, label %169

169:                                              ; preds = %167
  %170 = tail call ptr @__errno_location() #11
  %171 = load i32, ptr %170, align 4, !tbaa !9
  %172 = call ptr @strerror(i32 noundef %171) #10
  call void (ptr, ...) @fatal(ptr noundef nonnull @.str.62, ptr noundef %0, ptr noundef %172)
  br label %173

173:                                              ; preds = %165, %169, %167, %38, %57, %51, %44, %31, %20, %17
  %174 = phi i1 [ true, %17 ], [ false, %20 ], [ false, %31 ], [ false, %38 ], [ false, %44 ], [ false, %57 ], [ false, %169 ], [ false, %167 ], [ false, %165 ], [ false, %51 ]
  %.0108 = phi i32 [ -1, %17 ], [ %.0112, %20 ], [ %.0112, %31 ], [ %.0112, %38 ], [ %.0112, %44 ], [ %.0112, %57 ], [ %.0112, %169 ], [ %.0112, %167 ], [ %.0112, %165 ], [ %.0112, %51 ]
  %.171 = phi i64 [ 0, %17 ], [ 0, %20 ], [ 0, %31 ], [ 0, %38 ], [ 0, %44 ], [ %.070, %57 ], [ %.070, %169 ], [ %.070, %167 ], [ %.070, %165 ], [ 0, %51 ]
  %.068 = phi ptr [ null, %17 ], [ null, %20 ], [ null, %31 ], [ null, %38 ], [ null, %44 ], [ inttoptr (i64 -1 to ptr), %57 ], [ %55, %169 ], [ %55, %167 ], [ %55, %165 ], [ null, %51 ]
  %175 = load i32, ptr @o_lock, align 4, !tbaa !9
  %176 = icmp eq i32 %175, 0
  %177 = load i32, ptr @o_lockall, align 4
  %178 = icmp eq i32 %177, 0
  %or.cond.not104 = select i1 %176, i1 %178, i1 false
  %179 = icmp ne ptr %.068, null
  %or.cond3 = and i1 %179, %or.cond.not104
  br i1 %or.cond3, label %180, label %186

180:                                              ; preds = %173
  %181 = call i32 @munmap(ptr noundef nonnull %.068, i64 noundef %.171) #10
  %.not105 = icmp eq i32 %181, 0
  br i1 %.not105, label %186, label %182

182:                                              ; preds = %180
  %183 = tail call ptr @__errno_location() #11
  %184 = load i32, ptr %183, align 4, !tbaa !9
  %185 = call ptr @strerror(i32 noundef %184) #10
  call void (ptr, ...) @warning(ptr noundef nonnull @.str.63, ptr noundef %0, ptr noundef %185)
  br label %186

186:                                              ; preds = %180, %182, %173
  br i1 %174, label %189, label %187

187:                                              ; preds = %186
  %188 = call i32 @close(i32 noundef %.0108) #10
  br label %189

189:                                              ; preds = %187, %186
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %2) #10
  ret void
}

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

; Function Attrs: nounwind uwtable
declare hidden void @warning(ptr noundef, ...) local_unnamed_addr #3

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

; Function Attrs: nounwind
declare i32 @ioctl(i32 noundef, i64 noundef, ...) local_unnamed_addr #0

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

; Function Attrs: nounwind
declare i32 @posix_fadvise64(i32 noundef, i64 noundef, i64 noundef, i32 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 #6

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

; Function Attrs: nounwind uwtable
declare hidden i32 @can_do_mincore(ptr noundef) local_unnamed_addr #3

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

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

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

declare i32 @close(i32 noundef) local_unnamed_addr #8

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #9

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

!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 = !{!"long", !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 = !{!12, !10, i64 24}
!12 = !{!"stat", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !13, i64 72, !13, i64 88, !13, i64 104, !7, i64 120}
!13 = !{!"timespec", !6, i64 0, !6, i64 8}
!14 = !{!12, !6, i64 48}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !19, i64 0}
!19 = !{!"any pointer", !7, i64 0}
!20 = !{!21}
!21 = distinct !{!21, !22}
!22 = distinct !{!22, !"LVerDomain"}
!23 = !{!24}
!24 = distinct !{!24, !22}
!25 = distinct !{!25, !17, !26, !27}
!26 = !{!"llvm.loop.isvectorized", i32 1}
!27 = !{!"llvm.loop.unroll.runtime.disable"}
!28 = distinct !{!28, !17, !26}
!29 = distinct !{!29, !17, !30}
!30 = !{!"llvm.loop.unswitch.partial.disable"}


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