// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8a78, %rsp           # imm = 0x8A78
movq %rdi, %rbx
pushq $0xa
popq %rdi
callq 0x21f0
leaq 0x7ccb(%rip), %rdi      # 0xc3e8
callq 0x2240
leaq 0x7ce0(%rip), %rdi      # 0xc409
callq 0x2240
leaq 0x8(%rbx), %r15
leaq 0x13c8(%rsp), %rdi
pushq $0x1
popq %rbp
movq %r15, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3d1c
leaq 0x76b0(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3d1c
movq %rsp, %rdi
pushq $0x1
popq %r8
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x3d1c
leaq 0x62e8(%rsp), %rdi
pushq $0x1
popq %r9
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3d1c
leaq 0x4f20(%rsp), %rdi
pushq $0x1
popq %rcx
movq %r15, %rsi
movl %ecx, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3d1c
leaq 0x3b58(%rsp), %rdi
pushq $0x1
popq %rcx
movq %r15, %rsi
movl %ecx, %edx
movl %ecx, %r8d
xorl %r9d, %r9d
callq 0x3d1c
leaq 0x2790(%rsp), %rdi
pushq $0x1
popq %rcx
movq %r15, %rsi
movl %ecx, %edx
movl %ecx, %r8d
movl %ecx, %r9d
callq 0x3d1c
movq (%rbx), %rsi
leaq 0x79bb(%rip), %rdi      # 0xc1b0
xorl %eax, %eax
callq 0x2040
leaq 0x79c5(%rip), %rdi      # 0xc1c8
callq 0x2240
leaq 0x13c8(%rsp), %rsi
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
callq 0x4a30
leaq 0x79bd(%rip), %rdi      # 0xc1e1
callq 0x2240
leaq 0x76b0(%rsp), %r12
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4a30
leaq 0x79b6(%rip), %rdi      # 0xc1fe
callq 0x2240
movl $0x2710, %edx           # imm = 0x2710
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x4a30
leaq 0x79b7(%rip), %rdi      # 0xc21b
callq 0x2240
movl $0x2710, %edx           # imm = 0x2710
movq %rsp, %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4a30
leaq 0x79b5(%rip), %rdi      # 0xc238
callq 0x2240
leaq 0x4f20(%rsp), %rbp
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4a30
leaq 0x79ab(%rip), %rdi      # 0xc252
callq 0x2240
leaq 0x3b58(%rsp), %r14
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4a30
leaq 0x79a6(%rip), %rdi      # 0xc271
callq 0x2240
leaq 0x2790(%rsp), %r15
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4a30
movl $0x1388, %ebx           # imm = 0x1388
addq %rbx, %r15
movq %r15, %rdi
callq 0x654c
addq %rbx, %r14
movq %r14, %rdi
callq 0x654c
addq %rbx, %rbp
movq %rbp, %rdi
callq 0x654c
leaq 0x62e8(%rsp), %rdi
addq %rbx, %rdi
callq 0x654c
addq %rbx, %r13
movq %r13, %rdi
callq 0x654c
addq %rbx, %r12
movq %r12, %rdi
callq 0x654c
leaq 0x13c8(%rsp), %rdi
addq %rbx, %rdi
callq 0x654c
addq $0x8a78, %rsp           # imm = 0x8A78
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4984
movq %rax, %rbx
jmp 0x4991
movq %rax, %rbx
jmp 0x499e
movq %rax, %rbx
jmp 0x49ab
movq %rax, %rbx
jmp 0x49b8
movq %rax, %rbx
jmp 0x49c5
leaq 0x3b18(%rsp), %rdi
movq %rax, %rbx
callq 0x654c
leaq 0x4ee0(%rsp), %rdi
callq 0x654c
leaq 0x62a8(%rsp), %rdi
callq 0x654c
leaq 0x7670(%rsp), %rdi
callq 0x654c
leaq 0x1388(%rsp), %rdi
callq 0x654c
leaq 0x8a38(%rsp), %rdi
callq 0x654c
leaq 0x2750(%rsp), %rdi
callq 0x654c
movq %rbx, %rdi
callq 0x22a0