// File: /workspace/github_c_makefile_star2_O1/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_base642s
SOAP_FMAC1
const char*
SOAP_FMAC2
soap_base642s(struct soap *soap, const char *s, char *t, size_t l, int *n)
{ register int i, j, c;
  register unsigned long m;
  register const char *p;
  if (!s || !*s)
  { if (n)
      *n = 0;
    if (soap->error)
      return NULL;
    return SOAP_NON_NULL;
  }
  if (!t)
  { l = (strlen(s) + 3) / 4 * 3;
    t = (char*)soap_malloc(soap, l);
  }
  if (!t)
    return NULL;
  p = t;
  if (n)
    *n = 0;
  for (;;)
  { for (i = 0; i < SOAP_BLKLEN; i++)
    { m = 0;
      j = 0;
      while (j < 4)
      { c = *s++;
        if (c == '=' || !c)
        { i *= 3;
          switch (j)
          { case 2:
              *t++ = (char)((m >> 4) & 0xFF);
              i++;
              break;
            case 3:
              *t++ = (char)((m >> 10) & 0xFF);
              *t++ = (char)((m >> 2) & 0xFF);
              i += 2;
          }
          if (n)
            *n += i;
          return p;
        }
        c -= '+';
        if (c >= 0 && c <= 79)
        { int b = soap_base64i[c];
          if (b >= 64)
          { soap->error = SOAP_TYPE;
            return NULL;  
          }
          m = (m << 6) + b;
          j++;
        }
        else if (!soap_blank(c + '+'))
        { soap->error = SOAP_TYPE;
          return NULL;  
        }
      }
      *t++ = (char)((m >> 16) & 0xFF);
      *t++ = (char)((m >> 8) & 0xFF);
      *t++ = (char)(m & 0xFF);
      if (l < 3)
      { if (n)
          *n += i;
        return p;
      }
      l -= 3;
    }
    if (n)
      *n += 3 * SOAP_BLKLEN;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x49f4b
movq %rsi, %r15
cmpb $0x0, (%rsi)
je 0x49f4b
movq %rcx, %r12
movq %rdx, %rax
testq %rdx, %rdx
jne 0x49e77
movq %r15, %rdi
callq 0x3110
addq $0x3, %rax
shrq $0x2, %rax
leaq (%rax,%rax,2), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x39095
testq %rax, %rax
je 0x49fba
testq %rbx, %rbx
je 0x49e8b
movl $0x0, (%rbx)
leaq 0x827e(%rip), %rcx      # 0x52110
movq %rax, %rsi
movq %r12, %r8
addq $-0x300, %r12           # imm = 0xFD00
xorl %edi, %edi
xorl %edx, %edx
xorl %r9d, %r9d
movzbl (%r15), %r10d
cmpl $0x3d, %r10d
je 0x49f6d
testl %r10d, %r10d
je 0x49f6d
leal -0x2b(%r10), %r11d
cmpb $0x4f, %r11b
ja 0x49ee2
movzbl %r11b, %r10d
movsbq (%r10,%rcx), %r10
cmpq $0x40, %r10
jge 0x49eed
shlq $0x6, %rdx
addq %r10, %rdx
incl %r9d
jmp 0x49ef8
cmpb $0x21, %r10b
jb 0x49f02
jmp 0x49faf
movl $0x4, 0x19214(%r14)
cmpb $0x40, %r10b
jge 0x49fba
incq %r15
cmpl $0x4, %r9d
jl 0x49ea6
movl %edx, %r9d
shrl $0x10, %r9d
movb %r9b, (%rsi)
movb %dh, 0x1(%rsi)
movb %dl, 0x2(%rsi)
subq $0x3, %r8
jb 0x49fc8
addq $0x3, %rsi
incl %edi
cmpl $0x100, %edi            # imm = 0x100
jne 0x49ea1
testq %rbx, %rbx
je 0x49e95
addl $0x300, (%rbx)          # imm = 0x300
jmp 0x49e95
testq %rbx, %rbx
je 0x49f56
movl $0x0, (%rbx)
xorl %eax, %eax
cmpl $0x0, 0x19214(%r14)
leaq 0x81fa(%rip), %rcx      # 0x52161
cmoveq %rcx, %rax
jmp 0x49fbc
leal (%rdi,%rdi,2), %edi
cmpl $0x2, %r9d
je 0x49f93
cmpl $0x3, %r9d
jne 0x49fa6
movl %edx, %ecx
shrl $0xa, %ecx
movb %cl, (%rsi)
incq %rsi
movl $0x2, %r8d
movl $0x2, %ecx
jmp 0x49f9e
movl $0x1, %r8d
movl $0x4, %ecx
shrq %cl, %rdx
movb %dl, (%rsi)
addl %r8d, %edi
testq %rbx, %rbx
je 0x49fbc
addl %edi, (%rbx)
jmp 0x49fbc
movl $0x4, 0x19214(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
testq %rbx, %rbx
je 0x49fbc
addl %edi, (%rbx)
jmp 0x49fbc