// File: /workspace/github_c_makefile_star2_O0/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_putbase64
SOAP_FMAC2
soap_putbase64(struct soap *soap, const unsigned char *s, int n)
{ register int i;
  register unsigned long m;
  char d[4];
  if (!s)
    return SOAP_OK;
#ifdef WITH_DOM
  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
  { if (!(soap->dom->data = soap_s2base64(soap, s, NULL, n)))
      return soap->error;
    return SOAP_OK;
  }
#endif
  for (; n > 2; n -= 3, s += 3)
  { m = s[0];
    m = (m << 8) | s[1];
    m = (m << 8) | s[2];
    for (i = 4; i > 0; m >>= 6)
      d[--i] = soap_base64o[m & 0x3F];
    if (soap_send_raw(soap, d, 4))
      return soap->error;
  }
  if (n > 0)
  { m = 0;
    for (i = 0; i < n; i++)
      m = (m << 8) | *s++;
    for (; i < 3; i++)
      m <<= 8;
    for (i++; i > 0; m >>= 6)
      d[--i] = soap_base64o[m & 0x3F];
    for (i = 3; i > n; i--)
      d[i] = '=';
    if (soap_send_raw(soap, d, 4))
      return soap->error;
  }
  return SOAP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x51a46
movl $0x0, -0x4(%rbp)
jmp 0x51c08
jmp 0x51a48
cmpl $0x2, -0x1c(%rbp)
jle 0x51b0c
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
shlq $0x8, %rax
movq -0x18(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
orq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
shlq $0x8, %rax
movq -0x18(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
orq %rcx, %rax
movq %rax, -0x28(%rbp)
movl $0x4, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jle 0x51ac7
movq -0x28(%rbp), %rcx
andq $0x3f, %rcx
leaq 0x28939(%rip), %rax     # 0x7a3e0
movb (%rax,%rcx), %cl
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
cltq
movb %cl, -0x2c(%rbp,%rax)
movq -0x28(%rbp), %rax
shrq $0x6, %rax
movq %rax, -0x28(%rbp)
jmp 0x51a92
movq -0x10(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
movl $0x4, %edx
callq 0x4eeb0
cmpl $0x0, %eax
je 0x51af0
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x51c08
jmp 0x51af2
movl -0x1c(%rbp), %eax
subl $0x3, %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x18(%rbp)
jmp 0x51a48
cmpl $0x0, -0x1c(%rbp)
jle 0x51c01
movq $0x0, -0x28(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x51b59
movq -0x28(%rbp), %rax
shlq $0x8, %rax
movq -0x18(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movzbl (%rcx), %ecx
orq %rcx, %rax
movq %rax, -0x28(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x51b25
jmp 0x51b5b
cmpl $0x3, -0x20(%rbp)
jge 0x51b78
movq -0x28(%rbp), %rax
shlq $0x8, %rax
movq %rax, -0x28(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x51b5b
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jle 0x51bb6
movq -0x28(%rbp), %rcx
andq $0x3f, %rcx
leaq 0x2884a(%rip), %rax     # 0x7a3e0
movb (%rax,%rcx), %cl
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
cltq
movb %cl, -0x2c(%rbp,%rax)
movq -0x28(%rbp), %rax
shrq $0x6, %rax
movq %rax, -0x28(%rbp)
jmp 0x51b81
movl $0x3, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jle 0x51bd9
movslq -0x20(%rbp), %rax
movb $0x3d, -0x2c(%rbp,%rax)
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x51bbd
movq -0x10(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
movl $0x4, %edx
callq 0x4eeb0
cmpl $0x0, %eax
je 0x51bff
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x51c08
jmp 0x51c01
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)