// File: /workspace/github_c_makefile_star2_O0/hkshenSmart[P]ONVIF-discovery_cs/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 0x354cc
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x35507
cmpq $0x0, -0x30(%rbp)
je 0x354dd
movq -0x30(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1f274(%rax)
je 0x354f7
movq $0x0, -0x8(%rbp)
jmp 0x357c5
leaq 0x3e83(%rip), %rax      # 0x39381
movq %rax, -0x8(%rbp)
jmp 0x357c5
cmpq $0x0, -0x20(%rbp)
jne 0x35538
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 0x19790
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x3554c
movq $0x0, -0x8(%rbp)
jmp 0x357c5
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x35565
movq -0x30(%rbp), %rax
movl $0x0, (%rax)
jmp 0x35567
movl $0x0, -0x34(%rbp)
cmpl $0x100, -0x34(%rbp)     # imm = 0x100
jge 0x357ab
movq $0x0, -0x48(%rbp)
movl $0x0, -0x38(%rbp)
cmpl $0x4, -0x38(%rbp)
jge 0x3570f
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 0x355b9
cmpl $0x0, -0x3c(%rbp)
jne 0x35671
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 0x355db
jmp 0x355d1
movl -0x58(%rbp), %eax
subl $0x3, %eax
je 0x35607
jmp 0x35652
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 0x35652
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 0x35664
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x357c5
movl -0x3c(%rbp), %eax
subl $0x2b, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jl 0x356d7
cmpl $0x4f, -0x3c(%rbp)
jg 0x356d7
movslq -0x3c(%rbp), %rcx
leaq 0x3c9f(%rip), %rax      # 0x39330
movsbl (%rax,%rcx), %eax
movl %eax, -0x54(%rbp)
cmpl $0x40, -0x54(%rbp)
jl 0x356b9
movq -0x10(%rbp), %rax
movl $0x4, 0x1f274(%rax)
movq $0x0, -0x8(%rbp)
jmp 0x357c5
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 0x3570a
movl -0x3c(%rbp), %eax
addl $0x2b, %eax
cmpl $0x0, %eax
jl 0x356ed
movl -0x3c(%rbp), %eax
addl $0x2b, %eax
cmpl $0x20, %eax
jle 0x35708
movq -0x10(%rbp), %rax
movl $0x4, 0x1f274(%rax)
movq $0x0, -0x8(%rbp)
jmp 0x357c5
jmp 0x3570a
jmp 0x3558a
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 0x35791
cmpq $0x0, -0x30(%rbp)
je 0x35787
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x357c5
movq -0x28(%rbp), %rax
subq $0x3, %rax
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x3556e
cmpq $0x0, -0x30(%rbp)
je 0x357c0
movq -0x30(%rbp), %rax
movl (%rax), %ecx
addl $0x300, %ecx            # imm = 0x300
movl %ecx, (%rax)
jmp 0x35567
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nop