// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: base64_encode
static void base64_encode(const unsigned char *src, int src_len, char *dst) {
  static const char *b64 =
    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  int i, j, a, b, c;

  for (i = j = 0; i < src_len; i += 3) {
    a = src[i];
    b = i + 1 >= src_len ? 0 : src[i + 1];
    c = i + 2 >= src_len ? 0 : src[i + 2];

    dst[j++] = b64[a >> 2];
    dst[j++] = b64[((a & 3) << 4) | (b >> 4)];
    if (i + 1 < src_len) {
      dst[j++] = b64[(b & 15) << 2 | (c >> 6)];
    }
    if (i + 2 < src_len) {
      dst[j++] = b64[c & 63];
    }
  }
  while (j % 4 != 0) {
    dst[j++] = '=';
  }
  dst[j++] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0xbaa2c
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
cmpl -0xc(%rbp), %eax
jl 0xba90a
xorl %eax, %eax
movl %eax, -0x30(%rbp)
jmp 0xba91e
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
addl $0x2, %eax
cmpl -0xc(%rbp), %eax
jl 0xba936
xorl %eax, %eax
movl %eax, -0x34(%rbp)
jmp 0xba94a
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq 0x34521(%rip), %rax     # 0xeee78
movl -0x24(%rbp), %ecx
sarl $0x2, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq 0x344f9(%rip), %rax     # 0xeee78
movl -0x24(%rbp), %ecx
andl $0x3, %ecx
shll $0x4, %ecx
movl -0x28(%rbp), %edx
sarl $0x4, %edx
orl %edx, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
cmpl -0xc(%rbp), %eax
jge 0xba9e9
movq 0x344bb(%rip), %rax     # 0xeee78
movl -0x28(%rbp), %ecx
andl $0xf, %ecx
shll $0x2, %ecx
movl -0x2c(%rbp), %edx
sarl $0x6, %edx
orl %edx, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x2, %eax
cmpl -0xc(%rbp), %eax
jge 0xbaa1c
movq 0x3447d(%rip), %rax     # 0xeee78
movl -0x2c(%rbp), %ecx
andl $0x3f, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0xbaa1e
movl -0x1c(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x1c(%rbp)
jmp 0xba8dd
jmp 0xbaa2e
movl -0x20(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0xbaa56
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movslq %ecx, %rcx
movb $0x3d, (%rax,%rcx)
jmp 0xbaa2e
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
popq %rbp
retq
nop