// File: /workspace/github_cpp_makefile_star2_O1/WojciechMula[P]utf16utf8/benchmarks/benchmark_from_utf8.cpp
// Function: Benchmark::run_from_utf8(RandomUTF8&, unsigned long)
void run_from_utf8(RandomUTF8& generator, size_t repeat) {

        const auto UTF8 = generator.generate(size);
        size_t volume = UTF8.size() * sizeof(UTF8[0]);

        std::vector<uint16_t> scalar_out;
        std::vector<uint16_t> sse_out;
        std::vector<uint16_t> pext_out;
        scalar_out.resize(4 * size + 32);
        sse_out.resize(4 * size + 32);
        pext_out.resize(4 * size + 32);

        auto scalar = [&UTF8, &scalar_out]() {
            utf8_to_utf16(UTF8.data(), scalar_out.data());
        };

        auto scalar_utf8lib = [&UTF8, &scalar_out]() {
            scalar_out.clear();
            utf8::utf8to16(UTF8.begin(), UTF8.end(), back_inserter(scalar_out));
        };

        auto sse = [&UTF8, &sse_out, size=size]() {
            sse_convert_valid_utf8_to_utf16_lemire(UTF8.data(), size, sse_out.data());
        };

        auto pext = [&UTF8, &pext_out, size=size]() {
            pext_convert_utf8_to_utf16(UTF8.data(), size, pext_out.data());
        };

        RUN("scalar", scalar);
        RUN("scalar_utf8lib", scalar_utf8lib);
        RUN("SSE",    sse);
        RUN("PEXT",   pext);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdx, %rbx
movq %rdi, %r14
movq (%rdi), %rdx
leaq 0xc8(%rsp), %r15
movq %r15, %rdi
callq 0x3f86
movq 0x8(%r15), %rax
subq (%r15), %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
leaq 0xa0(%rsp), %r12
movq %rax, 0x10(%r12)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, (%r12)
movq %rax, 0x110(%rsp)
vmovapd %xmm0, 0x100(%rsp)
movq %rax, 0xf0(%rsp)
vmovapd %xmm0, 0xe0(%rsp)
movq (%r14), %rax
leaq 0x20(,%rax,4), %rsi
movq %r12, %rdi
callq 0x597c
movq (%r14), %rax
leaq 0x20(,%rax,4), %rsi
leaq 0x100(%rsp), %rdi
callq 0x597c
movq (%r14), %rax
leaq 0x20(,%rax,4), %rsi
leaq 0xe0(%rsp), %rdi
callq 0x597c
movq %r15, 0x120(%rsp)
movq %r12, 0x128(%rsp)
movq (%r14), %rax
movq %rax, 0xc0(%rsp)
leaq 0x8287(%rip), %rdi      # 0xd2cf
leaq 0x8289(%rip), %rsi      # 0xd2d8
xorl %eax, %eax
callq 0x2050
movq 0xbf5b(%rip), %rax      # 0x10fb8
movq (%rax), %rdi
callq 0x2200
leaq 0x130(%rsp), %rdi
callq 0x59ac
leaq 0x38(%rsp), %rdi
callq 0x5a8c
movq %rbx, 0x8(%rsp)
testq %rbx, %rbx
je 0x513a
leaq 0x158(%rsp), %r14
leaq 0x138(%rsp), %r15
leaq 0x38(%rsp), %rbp
leaq 0x10(%rsp), %r12
movq 0x8(%rsp), %rbx
movq %r14, %rdi
callq 0x667e
callq 0x2210
movq %rax, 0x150(%rsp)
leaq 0x120(%rsp), %rdi
callq 0x5b7e
callq 0x2210
movq %rax, %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x677e
subq 0x150(%rsp), %r13
vcvtsi2sd %r13, %xmm1, %xmm0
vdivsd 0x804d(%rip), %xmm0, %xmm0 # 0xd140
vmovsd %xmm0, 0x130(%rsp)
vmovsd %xmm0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x68c2
movq %rbp, %rdi
movq %r12, %rsi
callq 0x5cd4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x5131
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
decq %rbx
jne 0x50a9
vmovsd 0x60(%rsp), %xmm1
vcvtusi2sdq 0x30(%rsp), %xmm2, %xmm3
vmulsd 0x7ff0(%rip), %xmm1, %xmm0 # 0xd140
vdivsd %xmm0, %xmm3, %xmm2
cmpb $0x0, 0x15c(%rsp)
vmovsd %xmm3, 0x30(%rsp)
je 0x5196
movq 0x68(%rsp), %rax
vcvtusi2sdq 0x8(%rax), %xmm4, %xmm0
vdivsd %xmm3, %xmm0, %xmm0
vcvtusi2sdq (%rax), %xmm4, %xmm3
vdivsd %xmm1, %xmm3, %xmm1
vdivsd 0x7fba(%rip), %xmm1, %xmm1 # 0xd140
leaq 0x8152(%rip), %rdi      # 0xd2df
movb $0x3, %al
callq 0x2050
jmp 0x51a8
leaq 0x8189(%rip), %rdi      # 0xd326
vmovapd %xmm2, %xmm0
movb $0x1, %al
callq 0x2050
movq 0x8(%rsp), %rbx
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x51ca
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x51e1
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x51f8
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x158(%rsp), %r14
movq %r14, %rdi
callq 0x6b60
movq -0x20(%r14), %rdi
testq %rdi, %rdi
je 0x5221
movq 0x148(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x80a7(%rip), %rdi      # 0xd2cf
leaq 0x8123(%rip), %rsi      # 0xd352
xorl %eax, %eax
callq 0x2050
movq 0xbd7b(%rip), %rax      # 0x10fb8
movq (%rax), %rdi
callq 0x2200
leaq 0x130(%rsp), %rdi
callq 0x59ac
leaq 0x38(%rsp), %rdi
callq 0x5a8c
testq %rbx, %rbx
je 0x533f
leaq 0x158(%rsp), %r15
leaq 0x138(%rsp), %r12
leaq 0x38(%rsp), %r14
leaq 0x10(%rsp), %r13
movq 0x8(%rsp), %rbx
movq %r15, %rdi
callq 0x667e
callq 0x2210
movq %rax, 0x150(%rsp)
movq 0xa0(%rsp), %rax
cmpq %rax, 0xa8(%rsp)
je 0x52b3
movq %rax, 0xa8(%rsp)
movq 0xc8(%rsp), %rdi
movq 0xd0(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
callq 0x6bb1
callq 0x2210
movq %rax, %rbp
movq %r15, %rdi
movq %r12, %rsi
callq 0x677e
subq 0x150(%rsp), %rbp
vcvtsi2sd %rbp, %xmm4, %xmm0
vdivsd 0x7e48(%rip), %xmm0, %xmm0 # 0xd140
vmovsd %xmm0, 0x130(%rsp)
vmovsd %xmm0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x68c2
movq %r14, %rdi
movq %r13, %rsi
callq 0x5cd4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x5336
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
decq %rbx
jne 0x5284
vmovsd 0x60(%rsp), %xmm1
vmulsd 0x7df3(%rip), %xmm1, %xmm0 # 0xd140
vmovsd 0x30(%rsp), %xmm3
vdivsd %xmm0, %xmm3, %xmm2
cmpb $0x0, 0x15c(%rsp)
je 0x5393
movq 0x68(%rsp), %rax
vcvtusi2sdq 0x8(%rax), %xmm4, %xmm0
vdivsd %xmm3, %xmm0, %xmm0
vcvtusi2sdq (%rax), %xmm4, %xmm3
vdivsd %xmm1, %xmm3, %xmm1
vdivsd 0x7dbd(%rip), %xmm1, %xmm1 # 0xd140
leaq 0x7f55(%rip), %rdi      # 0xd2df
movb $0x3, %al
callq 0x2050
jmp 0x53a5
leaq 0x7f8c(%rip), %rdi      # 0xd326
vmovapd %xmm2, %xmm0
movb $0x1, %al
callq 0x2050
movq 0x8(%rsp), %rbx
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x53c7
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x53de
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x53f5
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x158(%rsp), %r14
movq %r14, %rdi
callq 0x6b60
movq -0x20(%r14), %rdi
testq %rdi, %rdi
je 0x541e
movq 0x148(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x7eaa(%rip), %rdi      # 0xd2cf
leaq 0x7f35(%rip), %rsi      # 0xd361
xorl %eax, %eax
callq 0x2050
movq 0xbb7e(%rip), %rax      # 0x10fb8
movq (%rax), %rdi
callq 0x2200
leaq 0x130(%rsp), %rdi
callq 0x59ac
leaq 0x38(%rsp), %rdi
callq 0x5a8c
testq %rbx, %rbx
je 0x5522
leaq 0x158(%rsp), %r14
leaq 0x138(%rsp), %r15
leaq 0x38(%rsp), %r13
leaq 0x10(%rsp), %rbp
movq 0x8(%rsp), %rbx
movq %r14, %rdi
callq 0x667e
callq 0x2210
movq %rax, 0x150(%rsp)
movq 0xc8(%rsp), %rdi
movq 0x100(%rsp), %rdx
movq 0xc0(%rsp), %rsi
callq 0x2bfa
callq 0x2210
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x677e
subq 0x150(%rsp), %r12
vcvtsi2sd %r12, %xmm4, %xmm0
vdivsd 0x7c65(%rip), %xmm0, %xmm0 # 0xd140
vmovsd %xmm0, 0x130(%rsp)
vmovsd %xmm0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x68c2
movq %r13, %rdi
movq %rbp, %rsi
callq 0x5cd4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x5519
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
decq %rbx
jne 0x5481
vmovsd 0x60(%rsp), %xmm1
vmulsd 0x7c10(%rip), %xmm1, %xmm0 # 0xd140
vmovsd 0x30(%rsp), %xmm3
vdivsd %xmm0, %xmm3, %xmm2
cmpb $0x0, 0x15c(%rsp)
je 0x5576
movq 0x68(%rsp), %rax
vcvtusi2sdq 0x8(%rax), %xmm4, %xmm0
vdivsd %xmm3, %xmm0, %xmm0
vcvtusi2sdq (%rax), %xmm4, %xmm3
vdivsd %xmm1, %xmm3, %xmm1
vdivsd 0x7bda(%rip), %xmm1, %xmm1 # 0xd140
leaq 0x7d72(%rip), %rdi      # 0xd2df
movb $0x3, %al
callq 0x2050
jmp 0x5588
leaq 0x7da9(%rip), %rdi      # 0xd326
vmovapd %xmm2, %xmm0
movb $0x1, %al
callq 0x2050
movq 0x8(%rsp), %rbx
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x55aa
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x55c1
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x55d8
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x158(%rsp), %r14
movq %r14, %rdi
callq 0x6b60
movq -0x20(%r14), %rdi
testq %rdi, %rdi
je 0x5601
movq 0x148(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x7cc7(%rip), %rdi      # 0xd2cf
leaq 0x7d56(%rip), %rsi      # 0xd365
xorl %eax, %eax
callq 0x2050
movq 0xb99b(%rip), %rax      # 0x10fb8
movq (%rax), %rdi
callq 0x2200
leaq 0x130(%rsp), %rdi
callq 0x59ac
leaq 0x38(%rsp), %rdi
callq 0x5a8c
testq %rbx, %rbx
je 0x5700
leaq 0x158(%rsp), %r14
leaq 0x138(%rsp), %r15
leaq 0x38(%rsp), %r13
leaq 0x10(%rsp), %rbp
movq %r14, %rdi
callq 0x667e
callq 0x2210
movq %rax, 0x150(%rsp)
movq 0xc8(%rsp), %rdi
movq 0xe0(%rsp), %rdx
movq 0xc0(%rsp), %rsi
callq 0x4738
callq 0x2210
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x677e
subq 0x150(%rsp), %r12
vcvtsi2sd %r12, %xmm4, %xmm0
vdivsd 0x7a87(%rip), %xmm0, %xmm0 # 0xd140
vmovsd %xmm0, 0x130(%rsp)
vmovsd %xmm0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x68c2
movq %r13, %rdi
movq %rbp, %rsi
callq 0x5cd4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x56f7
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
decq %rbx
jne 0x565f
vmovsd 0x60(%rsp), %xmm1
vmulsd 0x7a32(%rip), %xmm1, %xmm0 # 0xd140
vmovsd 0x30(%rsp), %xmm3
vdivsd %xmm0, %xmm3, %xmm2
cmpb $0x0, 0x15c(%rsp)
je 0x5754
movq 0x68(%rsp), %rax
vcvtusi2sdq 0x8(%rax), %xmm4, %xmm0
vdivsd %xmm3, %xmm0, %xmm0
vcvtusi2sdq (%rax), %xmm4, %xmm3
vdivsd %xmm1, %xmm3, %xmm1
vdivsd 0x79fc(%rip), %xmm1, %xmm1 # 0xd140
leaq 0x7b94(%rip), %rdi      # 0xd2df
movb $0x3, %al
callq 0x2050
jmp 0x5766
leaq 0x7bcb(%rip), %rdi      # 0xd326
vmovapd %xmm2, %xmm0
movb $0x1, %al
callq 0x2050
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x5783
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x579a
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x57b1
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x158(%rsp), %rbx
movq %rbx, %rdi
callq 0x6b60
movq -0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x57da
movq 0x148(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x57f7
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x5814
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x5831
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x584e
movq 0xd8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x586c
jmp 0x5873
jmp 0x586c
jmp 0x5873
jmp 0x586c
jmp 0x5873
movq %rax, %rbx
jmp 0x58b5
jmp 0x5873
movq %rax, %rbx
jmp 0x58c2
jmp 0x587e
jmp 0x587e
jmp 0x587e
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x58ab
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
jmp 0x58ab
jmp 0x58a8
jmp 0x58a8
jmp 0x58a8
jmp 0x58a8
jmp 0x58a8
jmp 0x58a8
jmp 0x58a8
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x5d42
leaq 0x130(%rsp), %rdi
callq 0x5d88
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x58df
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x58fc
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x5919
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x5936
movq 0xd8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x22b0