// File: /workspace/github_cpp_makefile_star2_O3/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 (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
xorl %r12d, %r12d
cmpq $0x3, %rcx
jb 0xc800
leaq 0x2244(%rip), %r13      # 0xe9b0
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
leaq -0x3(%rcx), %rdx
cmpq %rdx, %r12
jbe 0xc76c
leaq 0x1(%r12), %r13
cmpq %rcx, %r13
jne 0xc846
movzbl (%rax,%r12), %eax
shrl $0x2, %eax
leaq 0x2197(%rip), %r13      # 0xe9b0
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 0xc8a0
leaq 0x2(%r12), %rdx
cmpq %rcx, %rdx
jne 0xc8b9
movzbl (%rax,%r12), %eax
shrl $0x2, %eax
leaq 0x2151(%rip), %rbp      # 0xe9b0
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 0xc8cf
jmp 0xc8cf
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0xc8e5
movq (%r15), %rsi
incq %rsi
callq 0x21f0
movq %r14, %rdi
callq 0x2380