// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x6c12c
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x6c167
cmpq $0x0, -0x30(%rbp)
je 0x6c13d
movq -0x30(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x19214(%rax)
je 0x6c157
movq $0x0, -0x8(%rbp)
jmp 0x6c425
leaq 0xe323(%rip), %rax      # 0x7a481
movq %rax, -0x8(%rbp)
jmp 0x6c425
cmpq $0x0, -0x20(%rbp)
jne 0x6c198
movq -0x18(%rbp), %rdi
callq 0x3100
addq $0x3, %rax
shrq $0x2, %rax
imulq $0x3, %rax, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x518f0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x6c1ac
movq $0x0, -0x8(%rbp)
jmp 0x6c425
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x6c1c5
movq -0x30(%rbp), %rax
movl $0x0, (%rax)
jmp 0x6c1c7
movl $0x0, -0x34(%rbp)
cmpl $0x100, -0x34(%rbp)     # imm = 0x100
jge 0x6c40b
movq $0x0, -0x48(%rbp)
movl $0x0, -0x38(%rbp)
cmpl $0x4, -0x38(%rbp)
jge 0x6c36f
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movsbl (%rax), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x3d, -0x3c(%rbp)
je 0x6c219
cmpl $0x0, -0x3c(%rbp)
jne 0x6c2d1
movl -0x34(%rbp), %ecx
movl %ecx, %eax
leal (%rax,%rax,2), %eax
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x58(%rbp)
subl $0x2, %eax
je 0x6c23b
jmp 0x6c231
movl -0x58(%rbp), %eax
subl $0x3, %eax
je 0x6c267
jmp 0x6c2b2
movq -0x48(%rbp), %rax
shrq $0x4, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x6c2b2
movq -0x48(%rbp), %rax
shrq $0xa, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movq -0x48(%rbp), %rax
shrq $0x2, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movl -0x34(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x34(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x6c2c4
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6c425
movl -0x3c(%rbp), %eax
subl $0x2b, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jl 0x6c337
cmpl $0x4f, -0x3c(%rbp)
jg 0x6c337
movslq -0x3c(%rbp), %rcx
leaq 0xe13f(%rip), %rax      # 0x7a430
movsbl (%rax,%rcx), %eax
movl %eax, -0x54(%rbp)
cmpl $0x40, -0x54(%rbp)
jl 0x6c319
movq -0x10(%rbp), %rax
movl $0x4, 0x19214(%rax)
movq $0x0, -0x8(%rbp)
jmp 0x6c425
movq -0x48(%rbp), %rax
shlq $0x6, %rax
movslq -0x54(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x6c36a
movl -0x3c(%rbp), %eax
addl $0x2b, %eax
cmpl $0x0, %eax
jl 0x6c34d
movl -0x3c(%rbp), %eax
addl $0x2b, %eax
cmpl $0x20, %eax
jle 0x6c368
movq -0x10(%rbp), %rax
movl $0x4, 0x19214(%rax)
movq $0x0, -0x8(%rbp)
jmp 0x6c425
jmp 0x6c36a
jmp 0x6c1ea
movq -0x48(%rbp), %rax
shrq $0x10, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movq -0x48(%rbp), %rax
shrq $0x8, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movq -0x48(%rbp), %rax
andq $0xff, %rax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
cmpq $0x3, -0x28(%rbp)
jae 0x6c3f1
cmpq $0x0, -0x30(%rbp)
je 0x6c3e7
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6c425
movq -0x28(%rbp), %rax
subq $0x3, %rax
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x6c1ce
cmpq $0x0, -0x30(%rbp)
je 0x6c420
movq -0x30(%rbp), %rax
movl (%rax), %ecx
addl $0x300, %ecx            # imm = 0x300
movl %ecx, (%rax)
jmp 0x6c1c7
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nop