// File: /workspace/github_cpp_makefile_star2_O1/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 0x89c2(%rip), %rdi      # 0xd422
callq 0x2270
leaq 0x89d7(%rip), %rdi      # 0xd443
callq 0x2270
leaq 0x8(%rbx), %r14
leaq 0x62e8(%rsp), %rdi
movq %r14, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3ecc
leaq 0x4f20(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3ecc
movq %rsp, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x3ecc
leaq 0x76b0(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x3ecc
leaq 0x3b58(%rsp), %rdi
movq %r14, %rsi
movl $0x1, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3ecc
leaq 0x2790(%rsp), %rdi
movq %r14, %rsi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x3ecc
leaq 0x13c8(%rsp), %rdi
movq %r14, %rsi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x3ecc
movq (%rbx), %rsi
leaq 0x8693(%rip), %rdi      # 0xd1ea
xorl %eax, %eax
callq 0x2050
leaq 0x869d(%rip), %rdi      # 0xd202
callq 0x2270
leaq 0x62e8(%rsp), %rsi
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
callq 0x4f72
leaq 0x8695(%rip), %rdi      # 0xd21b
callq 0x2270
leaq 0x4f20(%rsp), %rsi
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
callq 0x4f72
leaq 0x8691(%rip), %rdi      # 0xd238
callq 0x2270
movq %rsp, %rsi
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
callq 0x4f72
leaq 0x8692(%rip), %rdi      # 0xd255
callq 0x2270
movq %rsp, %rsi
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
callq 0x4f72
leaq 0x8693(%rip), %rdi      # 0xd272
callq 0x2270
leaq 0x3b58(%rsp), %rsi
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
callq 0x4f72
leaq 0x868c(%rip), %rdi      # 0xd28c
callq 0x2270
leaq 0x2790(%rsp), %rsi
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
callq 0x4f72
leaq 0x868a(%rip), %rdi      # 0xd2ab
callq 0x2270
leaq 0x13c8(%rsp), %rsi
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
callq 0x4f72
movq 0x2768(%rsp), %rdi
testq %rdi, %rdi
je 0x4c58
movq 0x2778(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x2750(%rsp), %rdi
testq %rdi, %rdi
je 0x4c75
movq 0x2760(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x3b30(%rsp), %rdi
testq %rdi, %rdi
je 0x4c92
movq 0x3b40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x3b18(%rsp), %rdi
testq %rdi, %rdi
je 0x4caf
movq 0x3b28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x4ef8(%rsp), %rdi
testq %rdi, %rdi
je 0x4ccc
movq 0x4f08(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x4ee0(%rsp), %rdi
testq %rdi, %rdi
je 0x4ce9
movq 0x4ef0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x8a50(%rsp), %rdi
testq %rdi, %rdi
je 0x4d06
movq 0x8a60(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x8a38(%rsp), %rdi
testq %rdi, %rdi
je 0x4d23
movq 0x8a48(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x13a0(%rsp), %rdi
testq %rdi, %rdi
je 0x4d40
movq 0x13b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x1388(%rsp), %rdi
testq %rdi, %rdi
je 0x4d5d
movq 0x1398(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x62c0(%rsp), %rdi
testq %rdi, %rdi
je 0x4d7a
movq 0x62d0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x62a8(%rsp), %rdi
testq %rdi, %rdi
je 0x4d97
movq 0x62b8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x7688(%rsp), %rdi
testq %rdi, %rdi
je 0x4db4
movq 0x7698(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x7670(%rsp), %rdi
testq %rdi, %rdi
je 0x4dd1
movq 0x7680(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
addq $0x8a78, %rsp           # imm = 0x8A78
popq %rbx
popq %r14
retq
movq %rax, %rbx
jmp 0x4e0a
movq %rax, %rbx
jmp 0x4e17
movq %rax, %rbx
jmp 0x4e24
movq %rax, %rbx
jmp 0x4e31
movq %rax, %rbx
jmp 0x4e39
movq %rax, %rbx
jmp 0x4e46
movq %rax, %rbx
leaq 0x13c8(%rsp), %rdi
callq 0x593e
leaq 0x2790(%rsp), %rdi
callq 0x593e
leaq 0x3b58(%rsp), %rdi
callq 0x593e
leaq 0x76b0(%rsp), %rdi
callq 0x593e
movq %rsp, %rdi
callq 0x593e
leaq 0x4f20(%rsp), %rdi
callq 0x593e
leaq 0x62e8(%rsp), %rdi
callq 0x593e
movq %rbx, %rdi
callq 0x22b0
nop