// File: /workspace/github_cpp_makefile_star2_O3/WojciechMula[P]utf16utf8/benchmarks/benchmark_from_utf8.cpp
// Function: Benchmark::run_from_utf8()
void run_from_utf8() {
        printf("\n");
        printf("Running UTF8 => UTF16 benchmark.\n");
        printf("The speed is normalized by the number of input bytes.\n");
        const size_t repeat = 10000;
        RandomUTF8 gen_1byte (rd, 1, 0, 0, 0);
        RandomUTF8 gen_2bytes(rd, 0, 1, 0, 0);
        RandomUTF8 gen_3bytes(rd, 0, 0, 1, 0);
        RandomUTF8 gen_4bytes(rd, 0, 0, 0, 1);

        RandomUTF8 gen_1_2(rd, 1, 1, 0, 0);
        RandomUTF8 gen_1_2_3(rd, 1, 1, 1, 0);
        RandomUTF8 gen_1_2_3_4(rd, 1, 1, 1, 1);

        printf("Input size: (UTF8) %lu\n", size);

        puts("- Input ASCII characters");
        run_from_utf8(gen_1byte, repeat);

        puts("- Input exactly 2 UTF8 bytes");
        run_from_utf8(gen_2bytes, repeat);

        puts("- Input exactly 3 UTF8 bytes");
        run_from_utf8(gen_3bytes, repeat);

        puts("- Input exactly 4 UTF8 bytes");
        run_from_utf8(gen_3bytes, repeat);

        puts("- Input 1 or 2 UTF8 bytes");
        run_from_utf8(gen_1_2, repeat);

        puts("- Input 1 or 2 or 3 UTF8 bytes");
        run_from_utf8(gen_1_2_3, repeat);

        puts("- Input 1 or 2 or 3 or 4 UTF8 bytes");
        run_from_utf8(gen_1_2_3_4, repeat);
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x8a78, %rsp           # imm = 0x8A78
movq %rdi, %rbx
movl $0xa, %edi
callq 0x2230
leaq 0x8b32(%rip), %rdi      # 0xd5ae
callq 0x2270
leaq 0x8b47(%rip), %rdi      # 0xd5cf
callq 0x2270
leaq 0x8(%rbx), %r14
leaq 0x62e8(%rsp), %rdi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
movq %r14, %rsi
callq 0x3f24
leaq 0x4f20(%rsp), %rdi
movl $0x1, %ecx
movq %r14, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3f24
movl $0x1, %r8d
movq %rsp, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x3f24
leaq 0x76b0(%rsp), %rdi
movl $0x1, %r9d
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3f24
leaq 0x3b58(%rsp), %rdi
movl $0x1, %edx
movl $0x1, %ecx
movq %r14, %rsi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3f24
leaq 0x2790(%rsp), %rdi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x1, %r8d
movq %r14, %rsi
xorl %r9d, %r9d
callq 0x3f24
leaq 0x13c8(%rsp), %rdi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
movq %r14, %rsi
callq 0x3f24
movq (%rbx), %rsi
leaq 0x8803(%rip), %rdi      # 0xd376
xorl %eax, %eax
callq 0x2050
leaq 0x880d(%rip), %rdi      # 0xd38e
callq 0x2270
leaq 0x62e8(%rsp), %rsi
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
callq 0x4f92
leaq 0x8805(%rip), %rdi      # 0xd3a7
callq 0x2270
leaq 0x4f20(%rsp), %rsi
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
callq 0x4f92
leaq 0x8801(%rip), %rdi      # 0xd3c4
callq 0x2270
movl $0x2710, %edx           # imm = 0x2710
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x4f92
leaq 0x8802(%rip), %rdi      # 0xd3e1
callq 0x2270
movl $0x2710, %edx           # imm = 0x2710
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x4f92
leaq 0x8803(%rip), %rdi      # 0xd3fe
callq 0x2270
leaq 0x3b58(%rsp), %rsi
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
callq 0x4f92
leaq 0x87fc(%rip), %rdi      # 0xd418
callq 0x2270
leaq 0x2790(%rsp), %rsi
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
callq 0x4f92
leaq 0x87fa(%rip), %rdi      # 0xd437
callq 0x2270
leaq 0x13c8(%rsp), %rsi
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
callq 0x4f92
movq 0x2768(%rsp), %rdi
testq %rdi, %rdi
je 0x4c74
movq 0x2778(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x2750(%rsp), %rdi
testq %rdi, %rdi
je 0x4c91
movq 0x2760(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x3b30(%rsp), %rdi
testq %rdi, %rdi
je 0x4cae
movq 0x3b40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x3b18(%rsp), %rdi
testq %rdi, %rdi
je 0x4ccb
movq 0x3b28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x4ef8(%rsp), %rdi
testq %rdi, %rdi
je 0x4ce8
movq 0x4f08(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x4ee0(%rsp), %rdi
testq %rdi, %rdi
je 0x4d05
movq 0x4ef0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x8a50(%rsp), %rdi
testq %rdi, %rdi
je 0x4d22
movq 0x8a60(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x8a38(%rsp), %rdi
testq %rdi, %rdi
je 0x4d3f
movq 0x8a48(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x13a0(%rsp), %rdi
testq %rdi, %rdi
je 0x4d5c
movq 0x13b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x1388(%rsp), %rdi
testq %rdi, %rdi
je 0x4d79
movq 0x1398(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x62c0(%rsp), %rdi
testq %rdi, %rdi
je 0x4d96
movq 0x62d0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x62a8(%rsp), %rdi
testq %rdi, %rdi
je 0x4db3
movq 0x62b8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x7688(%rsp), %rdi
testq %rdi, %rdi
je 0x4dd0
movq 0x7698(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x7670(%rsp), %rdi
testq %rdi, %rdi
je 0x4ded
movq 0x7680(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
addq $0x8a78, %rsp           # imm = 0x8A78
popq %rbx
popq %r14
retq
movq %rax, %rbx
jmp 0x4e26
movq %rax, %rbx
jmp 0x4e33
movq %rax, %rbx
jmp 0x4e40
movq %rax, %rbx
jmp 0x4e4d
movq %rax, %rbx
jmp 0x4e55
movq %rax, %rbx
jmp 0x4e62
leaq 0x13c8(%rsp), %rdi
movq %rax, %rbx
callq 0x595e
leaq 0x2790(%rsp), %rdi
callq 0x595e
leaq 0x3b58(%rsp), %rdi
callq 0x595e
leaq 0x76b0(%rsp), %rdi
callq 0x595e
movq %rsp, %rdi
callq 0x595e
leaq 0x4f20(%rsp), %rdi
callq 0x595e
leaq 0x62e8(%rsp), %rdi
callq 0x595e
movq %rbx, %rdi
callq 0x22b0
nop