// File: /workspace/github_c_makefile_star2_O3/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 0x3eacb
movq (%rdi), %r14
callq 0x3030
movq %r14, %rdi
testq %r14, %r14
jne 0x3eabb
movq $0x0, 0x88(%rbx)
movl 0xc(%rbx), %ecx
movb 0x4(%rbx), %al
orb %cl, %al
js 0x3eb0a
movl %ecx, %eax
shll $0x4, %eax
andl $0x40, %eax
orl %ecx, %eax
andl $0x3, %ecx
cmpl $0x2, %ecx
je 0x3eb14
cmpl $0x3, %ecx
je 0x3eafb
testb $0x40, %al
je 0x3eb05
cmpq $0x0, 0x6050(%rbx)
je 0x3eb14
orl $0x8, %eax
jmp 0x3eb19
orl $0x88, %ecx
movl %ecx, %eax
jmp 0x3eb19
andl $0xffffff77, %eax       # imm = 0xFFFFFF77
movl %eax, 0x4(%rbx)
cmpq $0x0, 0x38(%rbx)
jne 0x3eb35
movl %eax, %ecx
andl $0x40000, %ecx          # imm = 0x40000
jne 0x3eb35
orl $0x20000, %eax          # imm = 0x20000
movl %eax, 0x4(%rbx)
movl %eax, %ecx
notl %ecx
testl $0x280, %ecx            # imm = 0x280
jne 0x3eb48
orl $0x100, %eax            # imm = 0x100
jmp 0x3eb53
btl $0x8, %eax
jb 0x3eb56
andl $0xfffffcff, %eax       # imm = 0xFFFFFCFF
movl %eax, 0x4(%rbx)
btl $0x8, %eax
jae 0x3eb64
movq %rbx, %rdi
callq 0x3ebe7
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 0x3ed1f
movq %rbx, %rdi
callq 0x3ed80
xorps %xmm0, %xmm0
movups %xmm0, 0x19228(%rbx)
movq 0x6040(%rbx), %rax
testq %rax, %rax
je 0x3ebdc
movl 0x4(%rbx), %ecx
andl $0x3, %ecx
cmpl $0x2, %ecx
je 0x3ebdc
movq %rbx, %rdi
callq *%rax
movl %eax, %r14d
movl %eax, 0x19214(%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq