// File: /workspace/github_cpp_makefile_star2_O1/occivink[P]pyct/pyct.cpp
// Function: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> to_base_64<std::vector<unsigned char, std::allocator<unsigned char>>>(std::vector<unsigned char, std::allocator<unsigned char>> const&)
string to_base_64(const T& bytes)
{
    static const array<char, 64> table = {
        'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
        'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
        '0','1','2','3','4','5','6','7','8','9','+','-',
    };
    string ret;
    auto s = bytes.size();
    ret.reserve(4 * (s / 3 + (s % 3 > 0 ? 1 : 0)));
    size_t i = 0;
    if (bytes.size() >= 3) {
        for (; i <= bytes.size() - 3; i += 3) {
            ret += table[(bytes[i]   & 0b11111100) >> 2];
            ret += table[(bytes[i]   & 0b00000011) << 4 |
                         (bytes[i+1] & 0b11110000) >> 4];
            ret += table[(bytes[i+1] & 0b00001111) << 2 |
                         (bytes[i+2] & 0b11000000) >> 6];
            ret += table[(bytes[i+2] & 0b00111111)];
        }
    }
    if (i + 1 == bytes.size()) {
        ret += table[(bytes[i] & 0b11111100) >> 2];
        ret += table[(bytes[i] & 0b00000011) << 4];
        ret += '=';
        ret += '=';
    } else if ((i + 2) == bytes.size()) {
        ret += table[(bytes[i]   & 0b11111100) >> 2];
        ret += table[(bytes[i]   & 0b00000011) << 4 |
                     (bytes[i+1] & 0b11110000) >> 4];
        ret += table[(bytes[i+1] & 0b00001111) << 2];
        ret += '=';
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq 0x8(%rsi), %rax
subq (%rsi), %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
shrq %rdx
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
xorl %esi, %esi
cmpq %rcx, %rax
seta %sil
addq %rdx, %rsi
shlq $0x2, %rsi
callq 0x2320
movq 0x8(%r14), %rax
subq (%r14), %rax
cmpq $0x3, %rax
jb 0xc736
movq (%r14), %rax
xorl %r12d, %r12d
leaq 0x2300(%rip), %r13      # 0xe9a0
movzbl (%rax,%r12), %eax
shrl $0x2, %eax
movsbl (%rax,%r13), %esi
movq %rbx, %rdi
callq 0x2180
movq (%r14), %rax
movzbl (%rax,%r12), %ecx
shll $0x4, %ecx
andl $0x30, %ecx
movzbl 0x1(%rax,%r12), %eax
shrl $0x4, %eax
orl %ecx, %eax
movsbl (%rax,%r13), %esi
movq %rbx, %rdi
callq 0x2180
movq (%r14), %rax
movzbl 0x1(%rax,%r12), %ecx
andl $0xf, %ecx
movzbl 0x2(%rax,%r12), %eax
shrl $0x6, %eax
leal (%rax,%rcx,4), %eax
movsbl (%rax,%r13), %esi
movq %rbx, %rdi
callq 0x2180
movq (%r14), %rax
movzbl 0x2(%rax,%r12), %eax
andl $0x3f, %eax
movsbl (%rax,%r13), %esi
movq %rbx, %rdi
callq 0x2180
addq $0x3, %r12
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
addq $-0x3, %rcx
cmpq %rcx, %r12
jbe 0xc6a0
jmp 0xc739
xorl %r12d, %r12d
leaq 0x1(%r12), %r13
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
cmpq %rcx, %r13
jne 0xc789
movzbl (%rax,%r12), %eax
shrl $0x2, %eax
leaq 0x2244(%rip), %r13      # 0xe9a0
movsbl (%rax,%r13), %esi
movq %rbx, %rdi
callq 0x2180
movq (%r14), %rax
movzbl (%rax,%r12), %eax
shll $0x4, %eax
andl $0x30, %eax
movsbl (%rax,%r13), %esi
movb $0x3d, %bpl
movq %rbx, %rdi
callq 0x2180
jmp 0xc7e3
leaq 0x2(%r12), %rdx
cmpq %rcx, %rdx
jne 0xc7fc
movzbl (%rax,%r12), %eax
shrl $0x2, %eax
leaq 0x21fe(%rip), %rbp      # 0xe9a0
movsbl (%rax,%rbp), %esi
movq %rbx, %rdi
callq 0x2180
movq (%r14), %rax
movzbl (%rax,%r12), %ecx
shll $0x4, %ecx
andl $0x30, %ecx
movzbl 0x1(%rax,%r12), %eax
shrl $0x4, %eax
orl %ecx, %eax
movsbl (%rax,%rbp), %esi
movq %rbx, %rdi
callq 0x2180
movq (%r14), %rax
movzbl (%rax,%r13), %eax
andl $0xf, %eax
movb (%rbp,%rax,4), %bpl
movsbl %bpl, %esi
movq %rbx, %rdi
callq 0x2180
movq %rbx, %rdi
movl $0x3d, %esi
callq 0x2180
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc812
jmp 0xc812
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0xc828
movq (%r15), %rsi
incq %rsi
callq 0x21f0
movq %r14, %rdi
callq 0x2380