// File: /workspace/github_c_makefile_star2_O1/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_begin_count
SOAP_FMAC2
soap_begin_count(struct soap *soap)
{ soap_free_ns(soap);
#ifndef WITH_LEANER
  if ((soap->mode & SOAP_ENC_DIME) || (soap->omode & SOAP_ENC_DIME))
    soap->mode = soap->omode | SOAP_IO_LENGTH | SOAP_ENC_DIME;
  else
#endif
  { soap->mode = soap->omode;
    if ((soap->mode & SOAP_IO_UDP))
      soap->mode |= SOAP_ENC_XML;
    if ((soap->mode & SOAP_IO) == SOAP_IO_STORE
     || (((soap->mode & SOAP_IO) == SOAP_IO_CHUNK || (soap->mode & SOAP_ENC_XML))
#ifndef WITH_LEANER
      && !soap->fpreparesend
#endif
      ))
      soap->mode &= ~SOAP_IO_LENGTH;
    else
      soap->mode |= SOAP_IO_LENGTH;
  }
#ifdef WITH_ZLIB
  if ((soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) == SOAP_IO_FLUSH)
  { if (!(soap->mode & SOAP_ENC_DIME))
      soap->mode &= ~SOAP_IO_LENGTH;
    if (soap->mode & SOAP_ENC_XML)
      soap->mode |= SOAP_IO_BUFFER;
    else
      soap->mode |= SOAP_IO_STORE;
  }
#endif
  if (!soap->encodingStyle && !(soap->mode & SOAP_XML_GRAPH))
    soap->mode |= SOAP_XML_TREE;
#ifndef WITH_LEANER
  if ((soap->mode & SOAP_ENC_MTOM) && (soap->mode & SOAP_ENC_DIME))
    soap->mode |= SOAP_ENC_MIME;
  else if (!(soap->mode & SOAP_ENC_MIME))
    soap->mode &= ~SOAP_ENC_MTOM;
  if (soap->mode & SOAP_ENC_MIME)
    soap_select_mime_boundary(soap);
  soap->dime.list = soap->dime.last;	/* keep track of last DIME attachment */
#endif
  soap->count = 0;
  soap->ns = 0;
  soap->null = 0;
  soap->position = 0;
  soap->mustUnderstand = 0;
  soap->encoding = 0;
  soap->part = SOAP_BEGIN;
  soap->idnum = 0;
  soap_clr_attr(soap);
  soap_set_local_namespaces(soap);
  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin count phase (socket=%d mode=0x%x count=%lu)\n", soap->socket, (unsigned int)soap->mode, (unsigned long)soap->count));
#ifndef WITH_LEANER
  soap->dime.count = 0; /* count # of attachments */
  soap->dime.size = 0; /* accumulate total size of attachments */
  if (soap->fprepareinitsend && (soap->mode & SOAP_IO) != SOAP_IO_STORE)
    return soap->error = soap->fprepareinitsend(soap);   
#endif
  return SOAP_OK;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x88(%rdi), %rdi
testq %rdi, %rdi
je 0x3eb3f
movq (%rdi), %r14
callq 0x3030
movq %r14, %rdi
testq %r14, %r14
jne 0x3eb2f
movq $0x0, 0x88(%rbx)
testb $-0x80, 0x4(%rbx)
jne 0x3eb8c
movl 0xc(%rbx), %ecx
testb %cl, %cl
js 0x3eb8c
movl %ecx, %eax
shll $0x4, %eax
andl $0x40, %eax
orl %ecx, %eax
movl %eax, 0x4(%rbx)
andl $0x3, %ecx
cmpl $0x2, %ecx
je 0x3ec64
cmpl $0x3, %ecx
je 0x3eb79
testb $0x40, %al
je 0x3eb87
cmpq $0x0, 0x6050(%rbx)
je 0x3ec64
orl $0x8, %eax
jmp 0x3eb94
movl $0x88, %eax
orl 0xc(%rbx), %eax
movl %eax, 0x4(%rbx)
cmpq $0x0, 0x38(%rbx)
jne 0x3ebaf
movl 0x4(%rbx), %eax
btl $0x12, %eax
jb 0x3ebaf
orl $0x20000, %eax          # imm = 0x20000
movl %eax, 0x4(%rbx)
movl 0x4(%rbx), %eax
movl %eax, %ecx
notl %ecx
testl $0x280, %ecx            # imm = 0x280
jne 0x3ebc5
orl $0x100, %eax            # imm = 0x100
jmp 0x3ebd0
btl $0x8, %eax
jb 0x3ebd3
andl $0xfffffcff, %eax       # imm = 0xFFFFFCFF
movl %eax, 0x4(%rbx)
testb $0x1, 0x5(%rbx)
je 0x3ebe1
movq %rbx, %rdi
callq 0x3ec6e
movq 0x19280(%rbx), %rax
movq %rax, 0x19270(%rbx)
xorl %r14d, %r14d
movq %r14, 0x6110(%rbx)
movw %r14w, 0x1853a(%rbx)
movl $0x0, 0x5f40(%rbx)
movq %r14, 0x18588(%rbx)
movw %r14w, 0x18590(%rbx)
movq %rbx, %rdi
callq 0x3eda4
movq %rbx, %rdi
callq 0x3edff
xorps %xmm0, %xmm0
movups %xmm0, 0x19228(%rbx)
movq 0x6040(%rbx), %rax
testq %rax, %rax
je 0x3ec59
movl 0x4(%rbx), %ecx
andl $0x3, %ecx
cmpl $0x2, %ecx
je 0x3ec59
movq %rbx, %rdi
callq *%rax
movl %eax, %r14d
movl %eax, 0x19214(%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
andl $0xffffff77, %eax       # imm = 0xFFFFFF77
jmp 0x3eb94