// File: tsoding[P]wcc/src/./aids.hpp
// Function: aids::utf8_get_code(aids::String_View, unsigned long*)
Maybe<uint32_t> utf8_get_code(String_View view, size_t *size)
    {
        const uint8_t UTF8_1BYTE_MASK      = 1 << 7;
        const uint8_t UTF8_2BYTES_MASK     = 1 << 5;
        const uint8_t UTF8_3BYTES_MASK     = 1 << 4;
        const uint8_t UTF8_4BYTES_MASK     = 1 << 3;
        const uint8_t UTF8_EXTRA_BYTE_MASK = 1 << 6;

        if (view.count >= 1 &&
            (*view.data & UTF8_1BYTE_MASK) == 0)
        {
            *size = 1;
            return {true, static_cast<uint32_t>(*view.data)};
        }

        if (view.count >= 2 &&
            (view.data[0] & UTF8_2BYTES_MASK) == 0 &&
            (view.data[1] & UTF8_EXTRA_BYTE_MASK) == 0)
        {
            *size = 2;
            const auto byte1 = static_cast<uint32_t>((view.data[0] & (UTF8_2BYTES_MASK - 1)) << 6);
            const auto byte2 = static_cast<uint32_t>(view.data[1] & (UTF8_EXTRA_BYTE_MASK - 1));
            return {true, byte1 | byte2};
        }

        if (view.count >= 3 &&
            (view.data[0] & UTF8_3BYTES_MASK) == 0 &&
            (view.data[1] & UTF8_EXTRA_BYTE_MASK) == 0 &&
            (view.data[2] & UTF8_EXTRA_BYTE_MASK) == 0)
        {
            *size = 3;
            const auto byte1 = static_cast<uint32_t>((view.data[0] & (UTF8_3BYTES_MASK - 1)) << (6 * 2));
            const auto byte2 = static_cast<uint32_t>((view.data[1] & (UTF8_EXTRA_BYTE_MASK - 1)) << 6);
            const auto byte3 = static_cast<uint32_t>(view.data[2] & (UTF8_EXTRA_BYTE_MASK - 1));
            return {true, byte1 | byte2 | byte3};
        }

        if (view.count >= 4 &&
            (view.data[0] & UTF8_4BYTES_MASK) == 0 &&
            (view.data[1] & UTF8_EXTRA_BYTE_MASK) == 0 &&
            (view.data[2] & UTF8_EXTRA_BYTE_MASK) == 0 &&
            (view.data[3] & UTF8_EXTRA_BYTE_MASK) == 0)
        {
            *size = 4;
            const auto byte1 = static_cast<uint32_t>((view.data[0] & (UTF8_3BYTES_MASK - 1)) << (6 * 3));
            const auto byte2 = static_cast<uint32_t>((view.data[1] & (UTF8_EXTRA_BYTE_MASK - 1)) << (6 * 2));
            const auto byte3 = static_cast<uint32_t>((view.data[2] & (UTF8_EXTRA_BYTE_MASK - 1)) << 6);
            const auto byte4 = static_cast<uint32_t>(view.data[3] & (UTF8_EXTRA_BYTE_MASK - 1));
            return {true, byte1 | byte2 | byte3 | byte4};
        }

        return {};
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x20(%rbp)
movb $-0x80, -0x21(%rbp)
movb $0x20, -0x22(%rbp)
movb $0x10, -0x23(%rbp)
movb $0x8, -0x24(%rbp)
movb $0x40, -0x25(%rbp)
cmpq $0x1, -0x18(%rbp)
jb 0x202a
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x202a
movq -0x20(%rbp), %rax
movq $0x1, (%rax)
movb $0x1, -0x8(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x21cd
cmpq $0x2, -0x18(%rbp)
jb 0x208b
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x208b
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x208b
movq -0x20(%rbp), %rax
movq $0x2, (%rax)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0x1f, %eax
shll $0x6, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
andl $0x3f, %eax
movl %eax, -0x30(%rbp)
movb $0x1, -0x8(%rbp)
movl -0x2c(%rbp), %eax
orl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x21cd
cmpq $0x3, -0x18(%rbp)
jb 0x2110
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x2110
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x2110
movq -0x10(%rbp), %rax
movsbl 0x2(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x2110
movq -0x20(%rbp), %rax
movq $0x3, (%rax)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0xf, %eax
shll $0xc, %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
andl $0x3f, %eax
shll $0x6, %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x2(%rax), %eax
andl $0x3f, %eax
movl %eax, -0x3c(%rbp)
movb $0x1, -0x8(%rbp)
movl -0x34(%rbp), %eax
orl -0x38(%rbp), %eax
orl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x21cd
cmpq $0x4, -0x18(%rbp)
jb 0x21c2
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x21c2
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x21c2
movq -0x10(%rbp), %rax
movsbl 0x2(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x21c2
movq -0x10(%rbp), %rax
movsbl 0x3(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x21c2
movq -0x20(%rbp), %rax
movq $0x4, (%rax)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0xf, %eax
shll $0x12, %eax
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
andl $0x3f, %eax
shll $0xc, %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x2(%rax), %eax
andl $0x3f, %eax
shll $0x6, %eax
movl %eax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x3(%rax), %eax
andl $0x3f, %eax
movl %eax, -0x4c(%rbp)
movb $0x1, -0x8(%rbp)
movl -0x40(%rbp), %eax
orl -0x44(%rbp), %eax
orl -0x48(%rbp), %eax
orl -0x4c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x21cd
movb $0x0, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)