// File: 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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x40(%rbp)
movq %rdi, %rax
movq %rax, -0x48(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x33f0
movq -0x10(%rbp), %rdi
callq 0x17400
movq -0x40(%rbp), %rdi
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
movq %rdx, %rsi
shrq %rsi
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
subq %rcx, %rax
seta %al
movzbl %al, %eax
addq %rax, %rsi
shlq $0x2, %rsi
callq 0x3470
jmp 0x17fcd
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x17400
cmpq $0x3, %rax
jb 0x1814c
jmp 0x17fea
movq -0x38(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0x17400
movq %rax, %rcx
movq -0x50(%rbp), %rax
subq $0x3, %rcx
cmpq %rcx, %rax
ja 0x1814a
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x1b030
movzbl (%rax), %eax
shrl $0x2, %eax
movl %eax, %esi
leaq 0x5a29(%rip), %rdi      # 0x1da54
callq 0x1b000
movq -0x40(%rbp), %rdi
movsbl (%rax), %esi
callq 0x31c0
jmp 0x1803e
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x1b030
movzbl (%rax), %eax
andl $0x3, %eax
shll $0x4, %eax
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x1b030
movq %rax, %rcx
movl -0x54(%rbp), %eax
movzbl (%rcx), %ecx
shrl $0x4, %ecx
orl %ecx, %eax
movl %eax, %esi
leaq 0x59d6(%rip), %rdi      # 0x1da54
callq 0x1b000
movq -0x40(%rbp), %rdi
movsbl (%rax), %esi
callq 0x31c0
jmp 0x18091
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x1b030
movzbl (%rax), %eax
andl $0xf, %eax
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x2, %rsi
callq 0x1b030
movq %rax, %rcx
movl -0x58(%rbp), %eax
movzbl (%rcx), %edx
shrl $0x6, %edx
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,4), %eax
movl %eax, %esi
leaq 0x597d(%rip), %rdi      # 0x1da54
callq 0x1b000
movq -0x40(%rbp), %rdi
movsbl (%rax), %esi
callq 0x31c0
jmp 0x180ea
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x2, %rsi
callq 0x1b030
movzbl (%rax), %eax
andl $0x3f, %eax
movl %eax, %esi
leaq 0x594a(%rip), %rdi      # 0x1da54
callq 0x1b000
movq -0x40(%rbp), %rdi
movsbl (%rax), %esi
callq 0x31c0
jmp 0x1811d
jmp 0x1811f
movq -0x38(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x38(%rbp)
jmp 0x17fea
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x31b0
jmp 0x18304
jmp 0x1814c
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
callq 0x17400
movq %rax, %rcx
movq -0x60(%rbp), %rax
cmpq %rcx, %rax
jne 0x181f7
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x1b030
movzbl (%rax), %eax
shrl $0x2, %eax
movl %eax, %esi
leaq 0x58c7(%rip), %rdi      # 0x1da54
callq 0x1b000
movq -0x40(%rbp), %rdi
movsbl (%rax), %esi
callq 0x31c0
jmp 0x181a0
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x1b030
movzbl (%rax), %eax
andl $0x3, %eax
shll $0x4, %eax
movl %eax, %esi
leaq 0x5895(%rip), %rdi      # 0x1da54
callq 0x1b000
movq -0x40(%rbp), %rdi
movsbl (%rax), %esi
callq 0x31c0
jmp 0x181d2
movq -0x40(%rbp), %rdi
movl $0x3d, %esi
callq 0x31c0
jmp 0x181e2
movq -0x40(%rbp), %rdi
movl $0x3d, %esi
callq 0x31c0
jmp 0x181f2
jmp 0x182e7
movq -0x38(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
callq 0x17400
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpq %rcx, %rax
jne 0x182e5
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x1b030
movzbl (%rax), %eax
shrl $0x2, %eax
movl %eax, %esi
leaq 0x581c(%rip), %rdi      # 0x1da54
callq 0x1b000
movq -0x40(%rbp), %rdi
movsbl (%rax), %esi
callq 0x31c0
jmp 0x1824b
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x1b030
movzbl (%rax), %eax
andl $0x3, %eax
shll $0x4, %eax
movl %eax, -0x6c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x1b030
movq %rax, %rcx
movl -0x6c(%rbp), %eax
movzbl (%rcx), %ecx
shrl $0x4, %ecx
orl %ecx, %eax
movl %eax, %esi
leaq 0x57c9(%rip), %rdi      # 0x1da54
callq 0x1b000
movq -0x40(%rbp), %rdi
movsbl (%rax), %esi
callq 0x31c0
jmp 0x1829e
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x1b030
movzbl (%rax), %eax
andl $0xf, %eax
shll $0x2, %eax
movl %eax, %esi
leaq 0x5794(%rip), %rdi      # 0x1da54
callq 0x1b000
movq -0x40(%rbp), %rdi
movsbl (%rax), %esi
callq 0x31c0
jmp 0x182d3
movq -0x40(%rbp), %rdi
movl $0x3d, %esi
callq 0x31c0
jmp 0x182e3
jmp 0x182e5
jmp 0x182e7
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x182fa
movq -0x40(%rbp), %rdi
callq 0x31b0
movq -0x48(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x34f0
nopl (%rax)