// File: evincarofautumn[P]protodata/vendor/utf8/checked.h
// Function: unsigned char* utf8::append<unsigned char*>(unsigned int, unsigned char*)
octet_iterator append(uint32_t cp, octet_iterator result)
    {
        if (!utf8::internal::is_code_point_valid(cp))
            throw invalid_code_point(cp);

        if (cp < 0x80)                        // one octet
            *(result++) = static_cast<uint8_t>(cp);
        else if (cp < 0x800) {                // two octets
            *(result++) = static_cast<uint8_t>((cp >> 6)            | 0xc0);
            *(result++) = static_cast<uint8_t>((cp & 0x3f)          | 0x80);
        }
        else if (cp < 0x10000) {              // three octets
            *(result++) = static_cast<uint8_t>((cp >> 12)           | 0xe0);
            *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f)   | 0x80);
            *(result++) = static_cast<uint8_t>((cp & 0x3f)          | 0x80);
        }
        else {                                // four octets
            *(result++) = static_cast<uint8_t>((cp >> 18)           | 0xf0);
            *(result++) = static_cast<uint8_t>(((cp >> 12) & 0x3f)  | 0x80);
            *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f)   | 0x80);
            *(result++) = static_cast<uint8_t>((cp & 0x3f)          | 0x80);
        }
        return result;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x4(%rbp), %edi
callq 0xa6e0
testb $0x1, %al
jne 0x916a
movl $0x10, %edi
callq 0x4150
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x28(%rbp)
movl -0x4(%rbp), %esi
callq 0xa720
jmp 0x9139
movq -0x28(%rbp), %rdi
leaq 0x1c99c(%rip), %rsi     # 0x25ae0
leaq 0x1615(%rip), %rdx      # 0xa760
callq 0x44b0
movq -0x28(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x4200
jmp 0x92cc
cmpl $0x80, -0x4(%rbp)
jae 0x918e
movl -0x4(%rbp), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
jmp 0x92c2
cmpl $0x800, -0x4(%rbp)      # imm = 0x800
jae 0x91d8
movl -0x4(%rbp), %eax
shrl $0x6, %eax
orl $0xc0, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movl -0x4(%rbp), %eax
andl $0x3f, %eax
orl $0x80, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
jmp 0x92c0
cmpl $0x10000, -0x4(%rbp)    # imm = 0x10000
jae 0x9240
movl -0x4(%rbp), %eax
shrl $0xc, %eax
orl $0xe0, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movl -0x4(%rbp), %eax
shrl $0x6, %eax
andl $0x3f, %eax
orl $0x80, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movl -0x4(%rbp), %eax
andl $0x3f, %eax
orl $0x80, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
jmp 0x92be
movl -0x4(%rbp), %eax
shrl $0x12, %eax
orl $0xf0, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movl -0x4(%rbp), %eax
shrl $0xc, %eax
andl $0x3f, %eax
orl $0x80, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movl -0x4(%rbp), %eax
shrl $0x6, %eax
andl $0x3f, %eax
orl $0x80, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movl -0x4(%rbp), %eax
andl $0x3f, %eax
orl $0x80, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
jmp 0x92c0
jmp 0x92c2
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x44d0
nopw %cs:(%rax,%rax)
nop