// File: /workspace/github_cpp_makefile_star2_O3/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), %rdx
leaq 0xc8(%rsp), %r15
movq %rdi, %r14
movq %r15, %rdi
callq 0x3fda
movq 0x8(%r15), %rax
vxorpd %xmm0, %xmm0, %xmm0
leaq 0xa0(%rsp), %r12
subq (%r15), %rax
vmovapd %xmm0, (%r12)
vmovapd %xmm0, 0x100(%rsp)
vmovapd %xmm0, 0xe0(%rsp)
movq %rax, 0x30(%rsp)
xorl %eax, %eax
movq %rax, 0x10(%r12)
movq %rax, 0x110(%rsp)
movq %rax, 0xf0(%rsp)
movq (%r14), %rax
leaq 0x20(,%rax,4), %rsi
movq %r12, %rdi
callq 0x599c
movq (%r14), %rax
leaq 0x20(,%rax,4), %rsi
leaq 0x100(%rsp), %rdi
callq 0x599c
movq (%r14), %rax
leaq 0x20(,%rax,4), %rsi
leaq 0xe0(%rsp), %rdi
callq 0x599c
movq %r15, 0x120(%rsp)
movq %r12, 0x128(%rsp)
leaq 0x83fe(%rip), %rdi      # 0xd45b
leaq 0x8400(%rip), %rsi      # 0xd464
movq (%r14), %rax
movq %rax, 0xc0(%rsp)
xorl %eax, %eax
callq 0x2050
movq 0xbf3b(%rip), %rax      # 0x10fb8
movq (%rax), %rdi
callq 0x2200
leaq 0x130(%rsp), %rdi
callq 0x59cc
leaq 0x38(%rsp), %rdi
callq 0x5aac
movq %rbx, 0x8(%rsp)
testq %rbx, %rbx
je 0x515a
movq 0x8(%rsp), %rbx
leaq 0x158(%rsp), %r14
leaq 0x138(%rsp), %r15
leaq 0x38(%rsp), %rbp
leaq 0x10(%rsp), %r12
movq %r14, %rdi
callq 0x66bc
callq 0x2210
movq %rax, 0x150(%rsp)
leaq 0x120(%rsp), %rdi
callq 0x5b9e
callq 0x2210
movq %rax, %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x67bc
subq 0x150(%rsp), %r13
vcvtsi2sd %r13, %xmm1, %xmm0
vdivsd 0x81d5(%rip), %xmm0, %xmm0 # 0xd2e8
vmovsd %xmm0, 0x130(%rsp)
vmovsd %xmm0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x6900
movq %rbp, %rdi
movq %r12, %rsi
callq 0x5cf4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x5151
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
decq %rbx
jne 0x50c9
vcvtusi2sdq 0x30(%rsp), %xmm1, %xmm3
vmovsd 0x60(%rsp), %xmm1
cmpb $0x1, 0x15c(%rsp)
vmulsd 0x8170(%rip), %xmm1, %xmm0 # 0xd2e8
vdivsd %xmm0, %xmm3, %xmm2
vmovsd %xmm3, 0x30(%rsp)
jne 0x51b6
movq 0x68(%rsp), %rax
vcvtusi2sdq 0x8(%rax), %xmm4, %xmm0
leaq 0x82d4(%rip), %rdi      # 0xd46b
vdivsd %xmm3, %xmm0, %xmm0
vcvtusi2sdq (%rax), %xmm4, %xmm3
movb $0x3, %al
vdivsd %xmm1, %xmm3, %xmm1
vdivsd 0x8139(%rip), %xmm1, %xmm1 # 0xd2e8
callq 0x2050
jmp 0x51c8
leaq 0x82f5(%rip), %rdi      # 0xd4b2
movb $0x1, %al
vmovapd %xmm2, %xmm0
callq 0x2050
movq 0x8(%rsp), %rbx
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x51ea
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x5201
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x5218
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x158(%rsp), %r14
movq %r14, %rdi
callq 0x6b8e
movq -0x20(%r14), %rdi
testq %rdi, %rdi
je 0x5241
movq 0x148(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x8213(%rip), %rdi      # 0xd45b
leaq 0x828f(%rip), %rsi      # 0xd4de
xorl %eax, %eax
callq 0x2050
movq 0xbd5b(%rip), %rax      # 0x10fb8
movq (%rax), %rdi
callq 0x2200
leaq 0x130(%rsp), %rdi
callq 0x59cc
leaq 0x38(%rsp), %rdi
callq 0x5aac
testq %rbx, %rbx
je 0x535f
movq 0x8(%rsp), %rbx
leaq 0x158(%rsp), %r15
leaq 0x138(%rsp), %r12
leaq 0x38(%rsp), %r14
leaq 0x10(%rsp), %r13
movq %r15, %rdi
callq 0x66bc
callq 0x2210
movq %rax, 0x150(%rsp)
movq 0xa0(%rsp), %rax
cmpq %rax, 0xa8(%rsp)
je 0x52d3
movq %rax, 0xa8(%rsp)
movq 0xc8(%rsp), %rdi
movq 0xd0(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
callq 0x6bdf
callq 0x2210
movq %rax, %rbp
movq %r15, %rdi
movq %r12, %rsi
callq 0x67bc
subq 0x150(%rsp), %rbp
vcvtsi2sd %rbp, %xmm4, %xmm0
vdivsd 0x7fd0(%rip), %xmm0, %xmm0 # 0xd2e8
vmovsd %xmm0, 0x130(%rsp)
vmovsd %xmm0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x6900
movq %r14, %rdi
movq %r13, %rsi
callq 0x5cf4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x5356
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
decq %rbx
jne 0x52a4
vmovsd 0x60(%rsp), %xmm1
vmovsd 0x30(%rsp), %xmm3
cmpb $0x1, 0x15c(%rsp)
vmulsd 0x7f6d(%rip), %xmm1, %xmm0 # 0xd2e8
vdivsd %xmm0, %xmm3, %xmm2
jne 0x53b3
movq 0x68(%rsp), %rax
vcvtusi2sdq 0x8(%rax), %xmm4, %xmm0
leaq 0x80d7(%rip), %rdi      # 0xd46b
vdivsd %xmm3, %xmm0, %xmm0
vcvtusi2sdq (%rax), %xmm4, %xmm3
movb $0x3, %al
vdivsd %xmm1, %xmm3, %xmm1
vdivsd 0x7f3c(%rip), %xmm1, %xmm1 # 0xd2e8
callq 0x2050
jmp 0x53c5
leaq 0x80f8(%rip), %rdi      # 0xd4b2
movb $0x1, %al
vmovapd %xmm2, %xmm0
callq 0x2050
movq 0x8(%rsp), %rbx
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x53e7
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x53fe
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x5415
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x158(%rsp), %r14
movq %r14, %rdi
callq 0x6b8e
movq -0x20(%r14), %rdi
testq %rdi, %rdi
je 0x543e
movq 0x148(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x8016(%rip), %rdi      # 0xd45b
leaq 0x80a1(%rip), %rsi      # 0xd4ed
xorl %eax, %eax
callq 0x2050
movq 0xbb5e(%rip), %rax      # 0x10fb8
movq (%rax), %rdi
callq 0x2200
leaq 0x130(%rsp), %rdi
callq 0x59cc
leaq 0x38(%rsp), %rdi
callq 0x5aac
testq %rbx, %rbx
je 0x5542
movq 0x8(%rsp), %rbx
leaq 0x158(%rsp), %r14
leaq 0x138(%rsp), %r15
leaq 0x38(%rsp), %r13
leaq 0x10(%rsp), %rbp
movq %r14, %rdi
callq 0x66bc
callq 0x2210
movq 0x100(%rsp), %rdx
movq 0xc8(%rsp), %rdi
movq %rax, 0x150(%rsp)
movq 0xc0(%rsp), %rsi
callq 0x2b60
callq 0x2210
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x67bc
subq 0x150(%rsp), %r12
vcvtsi2sd %r12, %xmm4, %xmm0
vdivsd 0x7ded(%rip), %xmm0, %xmm0 # 0xd2e8
vmovsd %xmm0, 0x130(%rsp)
vmovsd %xmm0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x6900
movq %r13, %rdi
movq %rbp, %rsi
callq 0x5cf4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x5539
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
decq %rbx
jne 0x54a1
vmovsd 0x60(%rsp), %xmm1
vmovsd 0x30(%rsp), %xmm3
cmpb $0x1, 0x15c(%rsp)
vmulsd 0x7d8a(%rip), %xmm1, %xmm0 # 0xd2e8
vdivsd %xmm0, %xmm3, %xmm2
jne 0x5596
movq 0x68(%rsp), %rax
vcvtusi2sdq 0x8(%rax), %xmm4, %xmm0
leaq 0x7ef4(%rip), %rdi      # 0xd46b
vdivsd %xmm3, %xmm0, %xmm0
vcvtusi2sdq (%rax), %xmm4, %xmm3
movb $0x3, %al
vdivsd %xmm1, %xmm3, %xmm1
vdivsd 0x7d59(%rip), %xmm1, %xmm1 # 0xd2e8
callq 0x2050
jmp 0x55a8
leaq 0x7f15(%rip), %rdi      # 0xd4b2
movb $0x1, %al
vmovapd %xmm2, %xmm0
callq 0x2050
movq 0x8(%rsp), %rbx
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x55ca
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x55e1
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x55f8
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x158(%rsp), %r14
movq %r14, %rdi
callq 0x6b8e
movq -0x20(%r14), %rdi
testq %rdi, %rdi
je 0x5621
movq 0x148(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x7e33(%rip), %rdi      # 0xd45b
leaq 0x7ec2(%rip), %rsi      # 0xd4f1
xorl %eax, %eax
callq 0x2050
movq 0xb97b(%rip), %rax      # 0x10fb8
movq (%rax), %rdi
callq 0x2200
leaq 0x130(%rsp), %rdi
callq 0x59cc
leaq 0x38(%rsp), %rdi
callq 0x5aac
testq %rbx, %rbx
je 0x5720
leaq 0x158(%rsp), %r14
leaq 0x138(%rsp), %r15
leaq 0x38(%rsp), %r13
leaq 0x10(%rsp), %rbp
movq %r14, %rdi
callq 0x66bc
callq 0x2210
movq 0xe0(%rsp), %rdx
movq 0xc8(%rsp), %rdi
movq %rax, 0x150(%rsp)
movq 0xc0(%rsp), %rsi
callq 0x4780
callq 0x2210
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x67bc
subq 0x150(%rsp), %r12
vcvtsi2sd %r12, %xmm4, %xmm0
vdivsd 0x7c0f(%rip), %xmm0, %xmm0 # 0xd2e8
vmovsd %xmm0, 0x130(%rsp)
vmovsd %xmm0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x6900
movq %r13, %rdi
movq %rbp, %rsi
callq 0x5cf4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x5717
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
decq %rbx
jne 0x567f
vmovsd 0x60(%rsp), %xmm1
vmovsd 0x30(%rsp), %xmm3
cmpb $0x1, 0x15c(%rsp)
vmulsd 0x7bac(%rip), %xmm1, %xmm0 # 0xd2e8
vdivsd %xmm0, %xmm3, %xmm2
jne 0x5774
movq 0x68(%rsp), %rax
vcvtusi2sdq 0x8(%rax), %xmm4, %xmm0
leaq 0x7d16(%rip), %rdi      # 0xd46b
vdivsd %xmm3, %xmm0, %xmm0
vcvtusi2sdq (%rax), %xmm4, %xmm3
movb $0x3, %al
vdivsd %xmm1, %xmm3, %xmm1
vdivsd 0x7b7b(%rip), %xmm1, %xmm1 # 0xd2e8
callq 0x2050
jmp 0x5786
leaq 0x7d37(%rip), %rdi      # 0xd4b2
movb $0x1, %al
vmovapd %xmm2, %xmm0
callq 0x2050
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x57a3
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x57ba
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x57d1
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x158(%rsp), %rbx
movq %rbx, %rdi
callq 0x6b8e
movq -0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x57fa
movq 0x148(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x5817
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x5834
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x5851
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x586e
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 0x588c
jmp 0x5893
jmp 0x588c
jmp 0x5893
jmp 0x588c
jmp 0x5893
movq %rax, %rbx
jmp 0x58d5
jmp 0x5893
movq %rax, %rbx
jmp 0x58e2
jmp 0x589e
jmp 0x589e
jmp 0x589e
movq 0x18(%rsp), %rdi
movq %rax, %rbx
testq %rdi, %rdi
je 0x58cb
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
jmp 0x58cb
jmp 0x58c8
jmp 0x58c8
jmp 0x58c8
jmp 0x58c8
jmp 0x58c8
jmp 0x58c8
jmp 0x58c8
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x5d7c
leaq 0x130(%rsp), %rdi
callq 0x5dc2
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x58ff
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x591c
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x5939
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x5956
movq 0xd8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x22b0