; LLVM IR from fast-pack/LittleIntPacker :: benchmarks (bitpackingbenchmark)

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

@global_rdtsc_overhead = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@__func__.bmidemo128 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: noinline nounwind uwtable
declare dso_local i64 @rdtsc_overhead_func(i64 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @get_random_array_from_bit_width(i32 noundef, i32 noundef) #1

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @bmidemo128() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  store i32 128, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @__func__.bmidemo128)
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef 128)
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %188, %0
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = icmp ule i32 %31, 32
  br i1 %32, label %33, label %191

33:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = call ptr @get_random_array_from_bit_width(i32 noundef 128, i32 noundef %34)
  store ptr %35, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %36 = call noalias ptr @malloc(i64 noundef 512) #7
  store ptr %36, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %37 = call noalias ptr @malloc(i64 noundef 512) #7
  store ptr %37, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 50000, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %38)
  br label %40

40:                                               ; preds = %33
  store i64 -1, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %41

41:                                               ; preds = %101, %40
  %42 = load i64, ptr %8, align 8, !tbaa !11
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = zext i32 %43 to i64
  %45 = icmp ult i64 %42, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  store i32 7, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %104

47:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  br label %48

48:                                               ; preds = %47
  %49 = load i64, ptr @global_rdtsc_overhead, align 8, !tbaa !11
  %50 = icmp eq i64 %49, -1
  br i1 %50, label %51, label %77

51:                                               ; preds = %48
  br label %52

52:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 -1, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !11
  br label %53

53:                                               ; preds = %68, %52
  %54 = load i64, ptr %15, align 8, !tbaa !11
  %55 = icmp ult i64 %54, 1000
  br i1 %55, label %57, label %56

56:                                               ; preds = %53
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %71

57:                                               ; preds = %53
  call void asm sideeffect "cpuid\0Ardtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr %11) #6, !srcloc !13
  %58 = call i64 @rdtsc_overhead_func(i64 noundef 1)
  call void asm sideeffect "rdtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)\0Acpuid", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr %12) #6, !srcloc !14
  %59 = load i64, ptr %12, align 8, !tbaa !11
  %60 = load i64, ptr %11, align 8, !tbaa !11
  %61 = sub i64 %59, %60
  store i64 %61, ptr %13, align 8, !tbaa !11
  %62 = load i64, ptr %13, align 8, !tbaa !11
  %63 = load i64, ptr %14, align 8, !tbaa !11
  %64 = icmp ult i64 %62, %63
  br i1 %64, label %65, label %67

65:                                               ; preds = %57
  %66 = load i64, ptr %13, align 8, !tbaa !11
  store i64 %66, ptr %14, align 8, !tbaa !11
  br label %67

67:                                               ; preds = %65, %57
  br label %68

68:                                               ; preds = %67
  %69 = load i64, ptr %15, align 8, !tbaa !11
  %70 = add i64 %69, 1
  store i64 %70, ptr %15, align 8, !tbaa !11
  br label %53, !llvm.loop !15

71:                                               ; preds = %56
  %72 = load i64, ptr %14, align 8, !tbaa !11
  store i64 %72, ptr @global_rdtsc_overhead, align 8, !tbaa !11
  %73 = load i64, ptr @global_rdtsc_overhead, align 8, !tbaa !11
  %74 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %73)
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %75

75:                                               ; preds = %71
  br label %76

76:                                               ; preds = %75
  br label %77

77:                                               ; preds = %76, %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void asm sideeffect "cpuid\0Ardtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr %16) #6, !srcloc !17
  %78 = load ptr, ptr %3, align 8, !tbaa !9
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = load ptr, ptr %4, align 8, !tbaa !9
  call void @bmipack32(ptr noundef %78, i32 noundef 128, i32 noundef %79, ptr noundef %80)
  call void asm sideeffect "rdtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)\0Acpuid", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr %17) #6, !srcloc !18
  %81 = load i64, ptr %17, align 8, !tbaa !11
  %82 = load i64, ptr %16, align 8, !tbaa !11
  %83 = sub i64 %81, %82
  store i64 %83, ptr %10, align 8, !tbaa !11
  %84 = load i64, ptr %10, align 8, !tbaa !11
  %85 = load i64, ptr @global_rdtsc_overhead, align 8, !tbaa !11
  %86 = icmp ule i64 %84, %85
  br i1 %86, label %87, label %88

87:                                               ; preds = %77
  store i64 0, ptr %10, align 8, !tbaa !11
  br label %92

88:                                               ; preds = %77
  %89 = load i64, ptr %10, align 8, !tbaa !11
  %90 = load i64, ptr @global_rdtsc_overhead, align 8, !tbaa !11
  %91 = sub i64 %89, %90
  store i64 %91, ptr %10, align 8, !tbaa !11
  br label %92

92:                                               ; preds = %88, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  %95 = load i64, ptr %10, align 8, !tbaa !11
  %96 = load i64, ptr %7, align 8, !tbaa !11
  %97 = icmp ult i64 %95, %96
  br i1 %97, label %98, label %100

98:                                               ; preds = %94
  %99 = load i64, ptr %10, align 8, !tbaa !11
  store i64 %99, ptr %7, align 8, !tbaa !11
  br label %100

100:                                              ; preds = %98, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %101

101:                                              ; preds = %100
  %102 = load i64, ptr %8, align 8, !tbaa !11
  %103 = add i64 %102, 1
  store i64 %103, ptr %8, align 8, !tbaa !11
  br label %41, !llvm.loop !19

104:                                              ; preds = %46
  br label %105

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105
  %107 = load i64, ptr %7, align 8, !tbaa !11
  %108 = uitofp i64 %107 to double
  %109 = fmul double %108, 1.000000e+00
  %110 = fdiv double %109, 1.280000e+02
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, double noundef %110)
  br label %112

112:                                              ; preds = %106
  store i64 -1, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store i64 0, ptr %18, align 8, !tbaa !11
  br label %113

113:                                              ; preds = %173, %112
  %114 = load i64, ptr %18, align 8, !tbaa !11
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = zext i32 %115 to i64
  %117 = icmp ult i64 %114, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %113
  store i32 19, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %176

119:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  br label %120

120:                                              ; preds = %119
  %121 = load i64, ptr @global_rdtsc_overhead, align 8, !tbaa !11
  %122 = icmp eq i64 %121, -1
  br i1 %122, label %123, label %149

123:                                              ; preds = %120
  br label %124

124:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store i64 -1, ptr %23, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  store i64 0, ptr %24, align 8, !tbaa !11
  br label %125

125:                                              ; preds = %140, %124
  %126 = load i64, ptr %24, align 8, !tbaa !11
  %127 = icmp ult i64 %126, 1000
  br i1 %127, label %129, label %128

128:                                              ; preds = %125
  store i32 26, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %143

129:                                              ; preds = %125
  call void asm sideeffect "cpuid\0Ardtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr %20) #6, !srcloc !20
  %130 = call i64 @rdtsc_overhead_func(i64 noundef 1)
  call void asm sideeffect "rdtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)\0Acpuid", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr %21) #6, !srcloc !21
  %131 = load i64, ptr %21, align 8, !tbaa !11
  %132 = load i64, ptr %20, align 8, !tbaa !11
  %133 = sub i64 %131, %132
  store i64 %133, ptr %22, align 8, !tbaa !11
  %134 = load i64, ptr %22, align 8, !tbaa !11
  %135 = load i64, ptr %23, align 8, !tbaa !11
  %136 = icmp ult i64 %134, %135
  br i1 %136, label %137, label %139

137:                                              ; preds = %129
  %138 = load i64, ptr %22, align 8, !tbaa !11
  store i64 %138, ptr %23, align 8, !tbaa !11
  br label %139

139:                                              ; preds = %137, %129
  br label %140

140:                                              ; preds = %139
  %141 = load i64, ptr %24, align 8, !tbaa !11
  %142 = add i64 %141, 1
  store i64 %142, ptr %24, align 8, !tbaa !11
  br label %125, !llvm.loop !22

143:                                              ; preds = %128
  %144 = load i64, ptr %23, align 8, !tbaa !11
  store i64 %144, ptr @global_rdtsc_overhead, align 8, !tbaa !11
  %145 = load i64, ptr @global_rdtsc_overhead, align 8, !tbaa !11
  %146 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %145)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %147

147:                                              ; preds = %143
  br label %148

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148, %120
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  call void asm sideeffect "cpuid\0Ardtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr %25) #6, !srcloc !23
  %150 = load ptr, ptr %4, align 8, !tbaa !9
  %151 = load i32, ptr %2, align 4, !tbaa !5
  %152 = load ptr, ptr %5, align 8, !tbaa !9
  call void @bmiunpack32(ptr noundef %150, i32 noundef 128, i32 noundef %151, ptr noundef %152)
  call void asm sideeffect "rdtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)\0Acpuid", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr %26) #6, !srcloc !24
  %153 = load i64, ptr %26, align 8, !tbaa !11
  %154 = load i64, ptr %25, align 8, !tbaa !11
  %155 = sub i64 %153, %154
  store i64 %155, ptr %19, align 8, !tbaa !11
  %156 = load i64, ptr %19, align 8, !tbaa !11
  %157 = load i64, ptr @global_rdtsc_overhead, align 8, !tbaa !11
  %158 = icmp ule i64 %156, %157
  br i1 %158, label %159, label %160

159:                                              ; preds = %149
  store i64 0, ptr %19, align 8, !tbaa !11
  br label %164

160:                                              ; preds = %149
  %161 = load i64, ptr %19, align 8, !tbaa !11
  %162 = load i64, ptr @global_rdtsc_overhead, align 8, !tbaa !11
  %163 = sub i64 %161, %162
  store i64 %163, ptr %19, align 8, !tbaa !11
  br label %164

164:                                              ; preds = %160, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  %167 = load i64, ptr %19, align 8, !tbaa !11
  %168 = load i64, ptr %7, align 8, !tbaa !11
  %169 = icmp ult i64 %167, %168
  br i1 %169, label %170, label %172

170:                                              ; preds = %166
  %171 = load i64, ptr %19, align 8, !tbaa !11
  store i64 %171, ptr %7, align 8, !tbaa !11
  br label %172

172:                                              ; preds = %170, %166
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %173

173:                                              ; preds = %172
  %174 = load i64, ptr %18, align 8, !tbaa !11
  %175 = add i64 %174, 1
  store i64 %175, ptr %18, align 8, !tbaa !11
  br label %113, !llvm.loop !25

176:                                              ; preds = %118
  br label %177

177:                                              ; preds = %176
  br label %178

178:                                              ; preds = %177
  %179 = load i64, ptr %7, align 8, !tbaa !11
  %180 = uitofp i64 %179 to double
  %181 = fmul double %180, 1.000000e+00
  %182 = fdiv double %181, 1.280000e+02
  %183 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, double noundef %182)
  %184 = load ptr, ptr %3, align 8, !tbaa !9
  call void @free(ptr noundef %184) #6
  %185 = load ptr, ptr %4, align 8, !tbaa !9
  call void @free(ptr noundef %185) #6
  %186 = load ptr, ptr %5, align 8, !tbaa !9
  call void @free(ptr noundef %186) #6
  %187 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %188

188:                                              ; preds = %178
  %189 = load i32, ptr %2, align 4, !tbaa !5
  %190 = add i32 %189, 1
  store i32 %190, ptr %2, align 4, !tbaa !5
  br label %30, !llvm.loop !26

191:                                              ; preds = %30
  %192 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  ret void
}

declare void @bmipack32(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #4

declare void @bmiunpack32(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #4

attributes #0 = { noinline 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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { 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 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 = !{!"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 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{i64 2147920795, i64 2147920870, i64 2147920944, i64 2147921018, i64 2147921092}
!14 = !{i64 2147921399, i64 2147921474, i64 2147921548, i64 2147921622, i64 2147921696}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{i64 2147922002, i64 2147922077, i64 2147922151, i64 2147922225, i64 2147922299}
!18 = !{i64 2147922606, i64 2147922681, i64 2147922755, i64 2147922829, i64 2147922903}
!19 = distinct !{!19, !16}
!20 = !{i64 2147925778, i64 2147925853, i64 2147925927, i64 2147926001, i64 2147926075}
!21 = !{i64 2147926382, i64 2147926457, i64 2147926531, i64 2147926605, i64 2147926679}
!22 = distinct !{!22, !16}
!23 = !{i64 2147926985, i64 2147927060, i64 2147927134, i64 2147927208, i64 2147927282}
!24 = !{i64 2147927589, i64 2147927664, i64 2147927738, i64 2147927812, i64 2147927886}
!25 = distinct !{!25, !16}
!26 = distinct !{!26, !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"

@global_rdtsc_overhead = external dso_local local_unnamed_addr global i64, align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@__func__.bmidemo128 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: noinline nounwind uwtable
declare dso_local i64 @rdtsc_overhead_func(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @get_random_array_from_bit_width(i32 noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) 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) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @bmidemo128() local_unnamed_addr #1 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @__func__.bmidemo128)
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 128)
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %12

12:                                               ; preds = %0, %39
  %.04369 = phi i32 [ 1, %0 ], [ %44, %39 ]
  %13 = call ptr @get_random_array_from_bit_width(i32 noundef 128, i32 noundef %.04369)
  %14 = call noalias dereferenceable_or_null(512) ptr @malloc(i64 noundef 512) #8
  %15 = call noalias dereferenceable_or_null(512) ptr @malloc(i64 noundef 512) #8
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.04369)
  %.pre = load i64, ptr @global_rdtsc_overhead, align 8, !tbaa !5
  br label %21

17:                                               ; preds = %33
  %18 = uitofp i64 %.150 to double
  %19 = fmul double %18, 7.812500e-03
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, double noundef %19)
  %.pre74 = load i64, ptr @global_rdtsc_overhead, align 8, !tbaa !5
  br label %45

21:                                               ; preds = %12, %33
  %22 = phi i64 [ %.pre, %12 ], [ %37, %33 ]
  %.04964 = phi i64 [ -1, %12 ], [ %.150, %33 ]
  %.05263 = phi i64 [ 0, %12 ], [ %38, %33 ]
  %23 = icmp eq i64 %22, -1
  br i1 %23, label %24, label %33

24:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  br label %27

25:                                               ; preds = %27
  store i64 %spec.select, ptr @global_rdtsc_overhead, align 8, !tbaa !5
  %26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %spec.select)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #9
  br label %33

27:                                               ; preds = %24, %27
  %.04662 = phi i64 [ 0, %24 ], [ %32, %27 ]
  %.04761 = phi i64 [ -1, %24 ], [ %spec.select, %27 ]
  call void asm sideeffect "cpuid\0Ardtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr nonnull %1) #9, !srcloc !9
  %28 = call i64 @rdtsc_overhead_func(i64 noundef 1)
  call void asm sideeffect "rdtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)\0Acpuid", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr nonnull %2) #9, !srcloc !10
  %29 = load i64, ptr %2, align 8, !tbaa !5
  %30 = load i64, ptr %1, align 8, !tbaa !5
  %31 = sub i64 %29, %30
  %spec.select = call i64 @llvm.umin.i64(i64 %31, i64 %.04761)
  %32 = add nuw nsw i64 %.04662, 1
  %exitcond.not = icmp eq i64 %32, 1000
  br i1 %exitcond.not, label %25, label %27, !llvm.loop !11

33:                                               ; preds = %25, %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  call void asm sideeffect "cpuid\0Ardtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr nonnull %3) #9, !srcloc !13
  call void @bmipack32(ptr noundef %13, i32 noundef 128, i32 noundef %.04369, ptr noundef %14) #9
  call void asm sideeffect "rdtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)\0Acpuid", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr nonnull %4) #9, !srcloc !14
  %34 = load i64, ptr %4, align 8, !tbaa !5
  %35 = load i64, ptr %3, align 8, !tbaa !5
  %36 = sub i64 %34, %35
  %37 = load i64, ptr @global_rdtsc_overhead, align 8, !tbaa !5
  %.051 = call i64 @llvm.usub.sat.i64(i64 %36, i64 %37)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  %.150 = call i64 @llvm.umin.i64(i64 %.051, i64 %.04964)
  %38 = add nuw nsw i64 %.05263, 1
  %exitcond70.not = icmp eq i64 %38, 50000
  br i1 %exitcond70.not, label %17, label %21, !llvm.loop !15

39:                                               ; preds = %57
  %40 = uitofp i64 %.3 to double
  %41 = fmul double %40, 7.812500e-03
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, double noundef %41)
  call void @free(ptr noundef %13) #9
  call void @free(ptr noundef %14) #9
  call void @free(ptr noundef %15) #9
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %44 = add nuw nsw i32 %.04369, 1
  %exitcond73.not = icmp eq i32 %44, 33
  br i1 %exitcond73.not, label %63, label %12, !llvm.loop !16

45:                                               ; preds = %17, %57
  %46 = phi i64 [ %.pre74, %17 ], [ %61, %57 ]
  %.04568 = phi i64 [ 0, %17 ], [ %62, %57 ]
  %.267 = phi i64 [ -1, %17 ], [ %.3, %57 ]
  %47 = icmp eq i64 %46, -1
  br i1 %47, label %48, label %57

48:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  br label %51

49:                                               ; preds = %51
  store i64 %spec.select60, ptr @global_rdtsc_overhead, align 8, !tbaa !5
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %spec.select60)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  br label %57

51:                                               ; preds = %48, %51
  %.066 = phi i64 [ 0, %48 ], [ %56, %51 ]
  %.04265 = phi i64 [ -1, %48 ], [ %spec.select60, %51 ]
  call void asm sideeffect "cpuid\0Ardtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr nonnull %5) #9, !srcloc !17
  %52 = call i64 @rdtsc_overhead_func(i64 noundef 1)
  call void asm sideeffect "rdtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)\0Acpuid", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr nonnull %6) #9, !srcloc !18
  %53 = load i64, ptr %6, align 8, !tbaa !5
  %54 = load i64, ptr %5, align 8, !tbaa !5
  %55 = sub i64 %53, %54
  %spec.select60 = call i64 @llvm.umin.i64(i64 %55, i64 %.04265)
  %56 = add nuw nsw i64 %.066, 1
  %exitcond71.not = icmp eq i64 %56, 1000
  br i1 %exitcond71.not, label %49, label %51, !llvm.loop !19

57:                                               ; preds = %49, %45
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  call void asm sideeffect "cpuid\0Ardtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr nonnull %7) #9, !srcloc !20
  call void @bmiunpack32(ptr noundef %14, i32 noundef 128, i32 noundef %.04369, ptr noundef %15) #9
  call void asm sideeffect "rdtscp\0Ashl $$32, %rdx\0Aor %rax, %rdx\0Amov %rdx, ($0)\0Acpuid", "r,~{memory},~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"(ptr nonnull %8) #9, !srcloc !21
  %58 = load i64, ptr %8, align 8, !tbaa !5
  %59 = load i64, ptr %7, align 8, !tbaa !5
  %60 = sub i64 %58, %59
  %61 = load i64, ptr @global_rdtsc_overhead, align 8, !tbaa !5
  %.044 = call i64 @llvm.usub.sat.i64(i64 %60, i64 %61)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  %.3 = call i64 @llvm.umin.i64(i64 %.044, i64 %.267)
  %62 = add nuw nsw i64 %.04568, 1
  %exitcond72.not = icmp eq i64 %62, 50000
  br i1 %exitcond72.not, label %39, label %45, !llvm.loop !22

63:                                               ; preds = %39
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  ret void
}

declare void @bmipack32(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

declare void @bmiunpack32(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

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

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

attributes #0 = { noinline 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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { 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 #6 = { "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 allocsize(0) }
attributes #9 = { 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 = !{i64 2147920795, i64 2147920870, i64 2147920944, i64 2147921018, i64 2147921092}
!10 = !{i64 2147921399, i64 2147921474, i64 2147921548, i64 2147921622, i64 2147921696}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{i64 2147922002, i64 2147922077, i64 2147922151, i64 2147922225, i64 2147922299}
!14 = !{i64 2147922606, i64 2147922681, i64 2147922755, i64 2147922829, i64 2147922903}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{i64 2147925778, i64 2147925853, i64 2147925927, i64 2147926001, i64 2147926075}
!18 = !{i64 2147926382, i64 2147926457, i64 2147926531, i64 2147926605, i64 2147926679}
!19 = distinct !{!19, !12}
!20 = !{i64 2147926985, i64 2147927060, i64 2147927134, i64 2147927208, i64 2147927282}
!21 = !{i64 2147927589, i64 2147927664, i64 2147927738, i64 2147927812, i64 2147927886}
!22 = distinct !{!22, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass