// File: /workspace/github_c_makefile_star2_O2/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_recv
SOAP_FMAC2
soap_recv(struct soap *soap)
{ 
#ifndef WITH_LEANER
  if (soap->mode & SOAP_ENC_DIME)
  { if (soap->dime.buflen)
    { char *s;
      int i;
      unsigned char tmp[12];
      DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME hdr for chunked DIME is in buffer\n"));
      soap->count += soap->dime.buflen - soap->buflen;
      soap->buflen = soap->dime.buflen;
      DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Skip padding (%ld bytes)\n", -(long)soap->dime.size&3));
      for (i = -(long)soap->dime.size&3; i > 0; i--)
      { soap->bufidx++;
        if (soap->bufidx >= soap->buflen)
          if (soap_recv_raw(soap))
            return EOF;
      }
      DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get DIME hdr for next chunk\n"));
      s = (char*)tmp;
      for (i = 12; i > 0; i--)
      { *s++ = soap->buf[soap->bufidx++];
        if (soap->bufidx >= soap->buflen)
          if (soap_recv_raw(soap))
            return EOF;
      }
      soap->dime.flags = tmp[0] & 0x7;
      soap->dime.size = ((size_t)tmp[8] << 24) | ((size_t)tmp[9] << 16) | ((size_t)tmp[10] << 8) | ((size_t)tmp[11]);
      DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get DIME chunk (%u bytes)\n", (unsigned int)soap->dime.size));
      if (soap->dime.flags & SOAP_DIME_CF)
      { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "More chunking\n"));
        soap->dime.chunksize = soap->dime.size;
        if (soap->buflen - soap->bufidx >= soap->dime.size)
        { soap->dime.buflen = soap->buflen;
          soap->buflen = soap->bufidx + soap->dime.chunksize;
        }
        else
          soap->dime.chunksize -= soap->buflen - soap->bufidx;
      }
      else
      { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Last chunk\n"));
        soap->dime.buflen = 0;
        soap->dime.chunksize = 0;
      }
      soap->count = soap->buflen - soap->bufidx;
      DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%u bytes remaining\n", (unsigned int)soap->count));
      return SOAP_OK;
    }
    if (soap->dime.chunksize)
    { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get next DIME hdr for chunked DIME (%u bytes chunk)\n", (unsigned int)soap->dime.chunksize));
      if (soap_recv_raw(soap))
        return EOF;
      if (soap->buflen - soap->bufidx >= soap->dime.chunksize)
      { soap->dime.buflen = soap->buflen;
        soap->count -= soap->buflen - soap->bufidx - soap->dime.chunksize;
        soap->buflen = soap->bufidx + soap->dime.chunksize;
      }
      else
        soap->dime.chunksize -= soap->buflen - soap->bufidx;
      DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%lu bytes remaining, count=%u\n", (unsigned long)(soap->buflen-soap->bufidx), (unsigned int)soap->count));
      return SOAP_OK;
    }
  }
#endif
  return soap_recv_raw(soap);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
testb $-0x80, 0x4(%rdi)
jne 0x34df6
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x34ae5
movq 0x19240(%rbx), %rax
testq %rax, %rax
je 0x34ea8
movq %rax, %rcx
subq 0x60f8(%rbx), %rcx
addq %rcx, 0x6110(%rbx)
movq %rax, 0x60f8(%rbx)
xorl %r14d, %r14d
subl 0x19230(%rbx), %r14d
andl $0x3, %r14d
pushq $-0x1
popq %rbp
testl %r14d, %r14d
jle 0x34e63
movq 0x60f0(%rbx), %rax
incq %rax
movq %rax, 0x60f0(%rbx)
cmpq 0x60f8(%rbx), %rax
jb 0x34e5e
movq %rbx, %rdi
callq 0x34ae5
testl %eax, %eax
jne 0x34f7b
decl %r14d
jmp 0x34e2f
xorl %r14d, %r14d
cmpl $0xc, %r14d
je 0x34eca
movq 0x60f0(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x60f0(%rbx)
movb 0x6138(%rbx,%rax), %al
movb %al, 0x4(%rsp,%r14)
cmpq 0x60f8(%rbx), %rcx
jb 0x34ea3
movq %rbx, %rdi
callq 0x34ae5
testl %eax, %eax
jne 0x34f7b
incq %r14
jmp 0x34e66
cmpq $0x0, 0x19238(%rbx)
je 0x34de6
movq %rbx, %rdi
callq 0x34ae5
testl %eax, %eax
je 0x34f2f
pushq $-0x1
popq %rbp
jmp 0x34f7b
movb 0x4(%rsp), %al
movl %eax, %ecx
andb $0x7, %cl
movb %cl, 0x19248(%rbx)
movl 0xc(%rsp), %ecx
bswapl %ecx
movq %rcx, 0x19230(%rbx)
leaq 0x19238(%rbx), %rsi
testb $0x1, %al
jne 0x34f07
xorps %xmm0, %xmm0
movups %xmm0, (%rsi)
movq 0x60f0(%rbx), %rax
movq 0x60f8(%rbx), %rdx
jmp 0x34f6f
movq %rcx, 0x19238(%rbx)
movq 0x60f0(%rbx), %rax
movq 0x60f8(%rbx), %rdx
movq %rdx, %r8
subq %rax, %r8
movq %rcx, %rdi
subq %r8, %rdi
jbe 0x34f5b
movq %rdi, (%rsi)
jmp 0x34f6f
movq 0x60f0(%rbx), %rcx
movq 0x60f8(%rbx), %rax
movq %rax, %rdi
subq %rcx, %rdi
movq 0x19238(%rbx), %rdx
movq %rdx, %rsi
subq %rdi, %rsi
jbe 0x34f86
movq %rsi, 0x19238(%rbx)
jmp 0x34f79
movq %rdx, 0x19240(%rbx)
addq %rax, %rcx
movq %rcx, 0x60f8(%rbx)
movq %rcx, %rdx
subq %rax, %rdx
movq %rdx, 0x6110(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, 0x19240(%rbx)
addq %rcx, %rdx
movq %rdx, %rcx
subq %rax, %rcx
addq %rcx, 0x6110(%rbx)
movq %rdx, 0x60f8(%rbx)
jmp 0x34f79