// File: /workspace/github_c_makefile_star2_O0/sszllzss[P]webSocket_Libevent_ThreadPool/ev_websocket.c
// Function: base64_encode(unsigned char const*, char*, int)
int base64_encode( const unsigned char *bindata, char *base64, int binlength)
{
    int i, j;
    unsigned char current;
    for ( i = 0, j = 0 ; i < binlength ; i += 3 )
    {
        current = (bindata[i] >> 2) ;
        current &= (unsigned char)0x3F;
        base64[j++] = base64char[(int)current];
        current = ( (unsigned char)(bindata[i] << 4 ) ) & ( (unsigned char)0x30 ) ;
        if ( i + 1 >= binlength )
        {
            base64[j++] = base64char[(int)current];
            base64[j++] = '=';
            base64[j++] = '=';
            break;
        }
        current |= ( (unsigned char)(bindata[i+1] >> 4) ) & ( (unsigned char) 0x0F );
        base64[j++] = base64char[(int)current];
        current = ( (unsigned char)(bindata[i+1] << 2) ) & ( (unsigned char)0x3C ) ;
        if ( i + 2 >= binlength )
        {
            base64[j++] = base64char[(int)current];
            base64[j++] = '=';
            break;
        }
        current |= ( (unsigned char)(bindata[i+2] >> 6) ) & ( (unsigned char) 0x03 );
        base64[j++] = base64char[(int)current];
        current = ( (unsigned char)bindata[i+2] ) & ( (unsigned char)0x3F ) ;
        base64[j++] = base64char[(int)current];
    }
    base64[j] = '\0';
    return j;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x4ddb
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movzbl (%rax,%rcx), %eax
sarl $0x2, %eax
movb %al, -0x1d(%rbp)
movzbl -0x1d(%rbp), %eax
andl $0x3f, %eax
movb %al, -0x1d(%rbp)
movzbl -0x1d(%rbp), %eax
movslq %eax, %rcx
leaq 0xf40d(%rip), %rax      # 0x14010
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movzbl (%rax,%rcx), %eax
shll $0x4, %eax
movzbl %al, %eax
andl $0x30, %eax
movb %al, -0x1d(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl -0x14(%rbp), %eax
jl 0x4c95
movzbl -0x1d(%rbp), %eax
movslq %eax, %rcx
leaq 0xf3c4(%rip), %rax      # 0x14010
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x3d, (%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x3d, (%rax,%rcx)
jmp 0x4ddb
movq -0x8(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
sarl $0x4, %eax
movzbl %al, %ecx
andl $0xf, %ecx
movzbl -0x1d(%rbp), %eax
orl %ecx, %eax
movb %al, -0x1d(%rbp)
movzbl -0x1d(%rbp), %eax
movslq %eax, %rcx
leaq 0xf34a(%rip), %rax      # 0x14010
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
shll $0x2, %eax
movzbl %al, %eax
andl $0x3c, %eax
movb %al, -0x1d(%rbp)
movl -0x18(%rbp), %eax
addl $0x2, %eax
cmpl -0x14(%rbp), %eax
jl 0x4d47
movzbl -0x1d(%rbp), %eax
movslq %eax, %rcx
leaq 0xf2fc(%rip), %rax      # 0x14010
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x3d, (%rax,%rcx)
jmp 0x4ddb
movq -0x8(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
sarl $0x6, %eax
movzbl %al, %ecx
andl $0x3, %ecx
movzbl -0x1d(%rbp), %eax
orl %ecx, %eax
movb %al, -0x1d(%rbp)
movzbl -0x1d(%rbp), %eax
movslq %eax, %rcx
leaq 0xf298(%rip), %rax      # 0x14010
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
andl $0x3f, %eax
movb %al, -0x1d(%rbp)
movzbl -0x1d(%rbp), %eax
movslq %eax, %rcx
leaq 0xf25b(%rip), %rax      # 0x14010
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x18(%rbp)
jmp 0x4bcd
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x1c(%rbp), %eax
popq %rbp
retq
nopl (%rax)