// File: /workspace/github_c_makefile_star2_O0/rongarret[P]clmm/base64.c
// Function: Base64encode
int Base64encode(char *encoded, const char *string, int len)
{
    int i;
    char *p;

    p = encoded;
    for (i = 0; i < len - 2; i += 3) {
    *p++ = basis_64[(string[i] >> 2) & 0x3F];
    *p++ = basis_64[((string[i] & 0x3) << 4) |
                    ((int) (string[i + 1] & 0xF0) >> 4)];
    *p++ = basis_64[((string[i + 1] & 0xF) << 2) |
                    ((int) (string[i + 2] & 0xC0) >> 6)];
    *p++ = basis_64[string[i + 2] & 0x3F];
    }
    if (i < len) {
    *p++ = basis_64[(string[i] >> 2) & 0x3F];
    if (i == (len - 1)) {
        *p++ = basis_64[((string[i] & 0x3) << 4)];
        *p++ = '=';
    }
    else {
        *p++ = basis_64[((string[i] & 0x3) << 4) |
                        ((int) (string[i + 1] & 0xF0) >> 4)];
        *p++ = basis_64[((string[i + 1] & 0xF) << 2)];
    }
    *p++ = '=';
    }

    *p++ = '\0';
    return p - encoded;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x1e6c
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
sarl $0x2, %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x44d5(%rip), %rax      # 0x6250
movb (%rax,%rcx), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $0x3, %eax
shll $0x4, %eax
movq -0x10(%rbp), %rcx
movl -0x18(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
andl $0xf0, %ecx
sarl $0x4, %ecx
orl %ecx, %eax
movslq %eax, %rcx
leaq 0x4489(%rip), %rax      # 0x6250
movb (%rax,%rcx), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
andl $0xf, %eax
shll $0x2, %eax
movq -0x10(%rbp), %rcx
movl -0x18(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
andl $0xc0, %ecx
sarl $0x6, %ecx
orl %ecx, %eax
movslq %eax, %rcx
leaq 0x4438(%rip), %rax      # 0x6250
movb (%rax,%rcx), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x4406(%rip), %rax      # 0x6250
movb (%rax,%rcx), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movl -0x18(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x18(%rbp)
jmp 0x1d4e
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x1f8f
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
sarl $0x2, %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x43bc(%rip), %rax      # 0x6250
movb (%rax,%rcx), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movl -0x18(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1efc
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $0x3, %eax
shll $0x4, %eax
movslq %eax, %rcx
leaq 0x437f(%rip), %rax      # 0x6250
movb (%rax,%rcx), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x3d, (%rax)
jmp 0x1f7d
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $0x3, %eax
shll $0x4, %eax
movq -0x10(%rbp), %rcx
movl -0x18(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
andl $0xf0, %ecx
sarl $0x4, %ecx
orl %ecx, %eax
movslq %eax, %rcx
leaq 0x431c(%rip), %rax      # 0x6250
movb (%rax,%rcx), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
andl $0xf, %eax
shll $0x2, %eax
movslq %eax, %rcx
leaq 0x42e7(%rip), %rax      # 0x6250
movb (%rax,%rcx), %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x3d, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x0, (%rax)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
popq %rbp
retq
nop