; LLVM IR from ssvb/tinymembench :: main (main)

; 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.bench_info = type { ptr, i32, ptr }

@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [2 x i8], align 1
@c_benchmarks = external hidden global [14 x %struct.bench_info], align 16
@.str.20 = external hidden unnamed_addr constant [6 x i8], align 1
@libc_benchmarks = external hidden global [3 x %struct.bench_info], align 16
@.str.21 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [76 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @latency_bench(i32 noundef, i32 noundef, i32 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
declare void @free(ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 67108864, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 10000000, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store i64 33554432, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store i64 0, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %12 = call ptr @mmap_framebuffer(ptr noundef %9)
  store ptr %12, ptr %10, align 8, !tbaa !11
  %13 = load i64, ptr %9, align 8, !tbaa !9
  %14 = udiv i64 %13, 2048
  %15 = mul i64 %14, 2048
  store i64 %15, ptr %9, align 8, !tbaa !9
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %17 = load i64, ptr %8, align 8, !tbaa !9
  %18 = trunc i64 %17 to i32
  %19 = load i64, ptr %8, align 8, !tbaa !9
  %20 = trunc i64 %19 to i32
  %21 = call ptr @alloc_four_nonaliased_buffers(ptr noundef %4, i32 noundef %18, ptr noundef %5, i32 noundef %20, ptr noundef %6, i32 noundef 2048, ptr noundef null, i32 noundef 0)
  store ptr %21, ptr %7, align 8, !tbaa !11
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  %31 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  %33 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  %36 = load ptr, ptr %5, align 8, !tbaa !11
  %37 = load ptr, ptr %4, align 8, !tbaa !11
  %38 = load ptr, ptr %6, align 8, !tbaa !11
  %39 = load i64, ptr %8, align 8, !tbaa !9
  %40 = trunc i64 %39 to i32
  call void @bandwidth_bench(ptr noundef %36, ptr noundef %37, ptr noundef %38, i32 noundef %40, i32 noundef 2048, ptr noundef @.str.19, ptr noundef @c_benchmarks)
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  %42 = load ptr, ptr %5, align 8, !tbaa !11
  %43 = load ptr, ptr %4, align 8, !tbaa !11
  %44 = load ptr, ptr %6, align 8, !tbaa !11
  %45 = load i64, ptr %8, align 8, !tbaa !9
  %46 = trunc i64 %45 to i32
  call void @bandwidth_bench(ptr noundef %42, ptr noundef %43, ptr noundef %44, i32 noundef %46, i32 noundef 2048, ptr noundef @.str.19, ptr noundef @libc_benchmarks)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %47 = call ptr @get_asm_benchmarks()
  store ptr %47, ptr %11, align 8, !tbaa !11
  %48 = load ptr, ptr %11, align 8, !tbaa !11
  %49 = getelementptr inbounds %struct.bench_info, ptr %48, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !13
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %60

52:                                               ; preds = %0
  %53 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  %54 = load ptr, ptr %5, align 8, !tbaa !11
  %55 = load ptr, ptr %4, align 8, !tbaa !11
  %56 = load ptr, ptr %6, align 8, !tbaa !11
  %57 = load i64, ptr %8, align 8, !tbaa !9
  %58 = trunc i64 %57 to i32
  %59 = load ptr, ptr %11, align 8, !tbaa !11
  call void @bandwidth_bench(ptr noundef %54, ptr noundef %55, ptr noundef %56, i32 noundef %58, i32 noundef 2048, ptr noundef @.str.19, ptr noundef %59)
  br label %60

60:                                               ; preds = %52, %0
  %61 = call ptr @get_asm_framebuffer_benchmarks()
  store ptr %61, ptr %11, align 8, !tbaa !11
  %62 = load ptr, ptr %11, align 8, !tbaa !11
  %63 = getelementptr inbounds %struct.bench_info, ptr %62, i32 0, i32 2
  %64 = load ptr, ptr %63, align 8, !tbaa !13
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %103

66:                                               ; preds = %60
  %67 = load ptr, ptr %10, align 8, !tbaa !11
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %103

69:                                               ; preds = %66
  %70 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str.21)
  %73 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %74 = call i32 (ptr, ...) @printf(ptr noundef @.str.22)
  %75 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  %77 = call i32 (ptr, ...) @printf(ptr noundef @.str.25)
  %78 = call i32 (ptr, ...) @printf(ptr noundef @.str.26)
  %79 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.27)
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str.28)
  %82 = call i32 (ptr, ...) @printf(ptr noundef @.str.29)
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %84 = call i32 (ptr, ...) @printf(ptr noundef @.str.30)
  %85 = call i32 (ptr, ...) @printf(ptr noundef @.str.31)
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str.33)
  %88 = call i32 (ptr, ...) @printf(ptr noundef @.str.34)
  %89 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  %90 = load ptr, ptr %10, align 8, !tbaa !11
  store ptr %90, ptr %4, align 8, !tbaa !11
  %91 = load i64, ptr %8, align 8, !tbaa !9
  %92 = load i64, ptr %9, align 8, !tbaa !9
  %93 = icmp ugt i64 %91, %92
  br i1 %93, label %94, label %96

94:                                               ; preds = %69
  %95 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %95, ptr %8, align 8, !tbaa !9
  br label %96

96:                                               ; preds = %94, %69
  %97 = load ptr, ptr %5, align 8, !tbaa !11
  %98 = load ptr, ptr %4, align 8, !tbaa !11
  %99 = load ptr, ptr %6, align 8, !tbaa !11
  %100 = load i64, ptr %8, align 8, !tbaa !9
  %101 = trunc i64 %100 to i32
  %102 = load ptr, ptr %11, align 8, !tbaa !11
  call void @bandwidth_bench(ptr noundef %97, ptr noundef %98, ptr noundef %99, i32 noundef %101, i32 noundef 2048, ptr noundef @.str.19, ptr noundef %102)
  br label %103

103:                                              ; preds = %96, %66, %60
  %104 = load ptr, ptr %7, align 8, !tbaa !11
  call void @free(ptr noundef %104) #4
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %107 = call i32 (ptr, ...) @printf(ptr noundef @.str.35)
  %108 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %109 = call i32 (ptr, ...) @printf(ptr noundef @.str.36)
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.37)
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.38)
  %112 = call i32 (ptr, ...) @printf(ptr noundef @.str.39)
  %113 = call i32 (ptr, ...) @printf(ptr noundef @.str.40)
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.41)
  %115 = call i32 (ptr, ...) @printf(ptr noundef @.str.42)
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %117 = call i32 (ptr, ...) @printf(ptr noundef @.str.43)
  %118 = call i32 (ptr, ...) @printf(ptr noundef @.str.44)
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.45)
  %120 = call i32 (ptr, ...) @printf(ptr noundef @.str.46)
  %121 = call i32 (ptr, ...) @printf(ptr noundef @.str.47)
  %122 = call i32 (ptr, ...) @printf(ptr noundef @.str.48)
  %123 = call i32 (ptr, ...) @printf(ptr noundef @.str.49)
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.50)
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %126 = load i32, ptr %2, align 4, !tbaa !5
  %127 = load i32, ptr %3, align 4, !tbaa !5
  %128 = call i32 @latency_bench(i32 noundef %126, i32 noundef %127, i32 noundef -1)
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %135

130:                                              ; preds = %103
  %131 = load i32, ptr %2, align 4, !tbaa !5
  %132 = load i32, ptr %3, align 4, !tbaa !5
  %133 = call i32 @latency_bench(i32 noundef %131, i32 noundef %132, i32 noundef 1)
  %134 = icmp ne i32 %133, 0
  br i1 %134, label %139, label %135

135:                                              ; preds = %130, %103
  %136 = load i32, ptr %2, align 4, !tbaa !5
  %137 = load i32, ptr %3, align 4, !tbaa !5
  %138 = call i32 @latency_bench(i32 noundef %136, i32 noundef %137, i32 noundef 0)
  br label %139

139:                                              ; preds = %135, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  ret i32 0
}

; Function Attrs: nounwind uwtable
declare hidden ptr @mmap_framebuffer(ptr noundef) #0

declare ptr @alloc_four_nonaliased_buffers(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #3

declare ptr @get_asm_benchmarks() #3

declare ptr @get_asm_framebuffer_benchmarks() #3

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 "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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

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


; 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.bench_info = type { ptr, i32, ptr }

@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [2 x i8], align 1
@c_benchmarks = external hidden global [14 x %struct.bench_info], align 16
@.str.20 = external hidden unnamed_addr constant [6 x i8], align 1
@libc_benchmarks = external hidden global [3 x %struct.bench_info], align 16
@.str.21 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [76 x i8], align 1

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store i64 0, ptr %4, align 8, !tbaa !5
  %5 = call ptr @mmap_framebuffer(ptr noundef nonnull %4)
  %6 = load i64, ptr %4, align 8, !tbaa !5
  %7 = and i64 %6, -2048
  store i64 %7, ptr %4, align 8, !tbaa !5
  %8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %9 = call ptr @alloc_four_nonaliased_buffers(ptr noundef nonnull %1, i32 noundef 33554432, ptr noundef nonnull %2, i32 noundef 33554432, ptr noundef nonnull %3, i32 noundef 2048, ptr noundef null, i32 noundef 0) #6
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16)
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18)
  %24 = load ptr, ptr %2, align 8, !tbaa !9
  %25 = load ptr, ptr %1, align 8, !tbaa !9
  %26 = load ptr, ptr %3, align 8, !tbaa !9
  call void @bandwidth_bench(ptr noundef %24, ptr noundef %25, ptr noundef %26, i32 noundef 33554432, i32 noundef 2048, ptr noundef nonnull @.str.19, ptr noundef nonnull @c_benchmarks)
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20)
  %28 = load ptr, ptr %2, align 8, !tbaa !9
  %29 = load ptr, ptr %1, align 8, !tbaa !9
  %30 = load ptr, ptr %3, align 8, !tbaa !9
  call void @bandwidth_bench(ptr noundef %28, ptr noundef %29, ptr noundef %30, i32 noundef 33554432, i32 noundef 2048, ptr noundef nonnull @.str.19, ptr noundef nonnull @libc_benchmarks)
  %31 = call ptr @get_asm_benchmarks() #6
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %.not = icmp eq ptr %33, null
  br i1 %.not, label %39, label %34

34:                                               ; preds = %0
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20)
  %36 = load ptr, ptr %2, align 8, !tbaa !9
  %37 = load ptr, ptr %1, align 8, !tbaa !9
  %38 = load ptr, ptr %3, align 8, !tbaa !9
  call void @bandwidth_bench(ptr noundef %36, ptr noundef %37, ptr noundef %38, i32 noundef 33554432, i32 noundef 2048, ptr noundef nonnull @.str.19, ptr noundef nonnull %31)
  br label %39

39:                                               ; preds = %34, %0
  %40 = call ptr @get_asm_framebuffer_benchmarks() #6
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  %43 = icmp ne ptr %42, null
  %44 = icmp ne ptr %5, null
  %or.cond = select i1 %43, i1 %44, i1 false
  br i1 %or.cond, label %45, label %69

45:                                               ; preds = %39
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21)
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22)
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23)
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24)
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25)
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26)
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27)
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28)
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29)
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30)
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.31)
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.32)
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.33)
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.34)
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18)
  store ptr %5, ptr %1, align 8, !tbaa !9
  %66 = load i64, ptr %4, align 8, !tbaa !5
  %spec.select24 = call i64 @llvm.umin.i64(i64 %66, i64 33554432)
  %spec.select = trunc nuw nsw i64 %spec.select24 to i32
  %67 = load ptr, ptr %2, align 8, !tbaa !9
  %68 = load ptr, ptr %3, align 8, !tbaa !9
  call void @bandwidth_bench(ptr noundef %67, ptr noundef nonnull %5, ptr noundef %68, i32 noundef %spec.select, i32 noundef 2048, ptr noundef nonnull @.str.19, ptr noundef nonnull %40)
  br label %69

69:                                               ; preds = %45, %39
  call void @free(ptr noundef %9) #6
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.35)
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.36)
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.37)
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.38)
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.39)
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.40)
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.41)
  %80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.42)
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.43)
  %83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.44)
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.45)
  %85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.46)
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.47)
  %87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.48)
  %88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.49)
  %89 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.50)
  %90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %91 = call i32 @latency_bench(i32 noundef 67108864, i32 noundef 10000000, i32 noundef -1)
  %.not22 = icmp eq i32 %91, 0
  br i1 %.not22, label %94, label %92

92:                                               ; preds = %69
  %93 = call i32 @latency_bench(i32 noundef 67108864, i32 noundef 10000000, i32 noundef 1)
  %.not23 = icmp eq i32 %93, 0
  br i1 %.not23, label %94, label %96

94:                                               ; preds = %92, %69
  %95 = call i32 @latency_bench(i32 noundef 67108864, i32 noundef 10000000, i32 noundef 0)
  br label %96

96:                                               ; preds = %94, %92
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0
}

; Function Attrs: nounwind uwtable
declare hidden ptr @mmap_framebuffer(ptr noundef) local_unnamed_addr #0

declare ptr @alloc_four_nonaliased_buffers(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare ptr @get_asm_benchmarks() local_unnamed_addr #4

declare ptr @get_asm_framebuffer_benchmarks() local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !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 = !{!12, !10, i64 16}
!12 = !{!"", !10, i64 0, !13, i64 8, !10, i64 16}
!13 = !{!"int", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass