// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5ad20
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x5aad7
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x5aaf3
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
orl $0x8, %ecx
orl $0x80, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x5ab76
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x5ab1d
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x40, %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x3, %eax
cmpl $0x2, %eax
je 0x5ab58
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x3, %eax
cmpl $0x3, %eax
je 0x5ab4a
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x5ab67
movq -0x10(%rbp), %rax
cmpq $0x0, 0x6050(%rax)
jne 0x5ab67
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
andl $-0x9, %ecx
movl %ecx, 0x4(%rax)
jmp 0x5ab74
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x8, %ecx
movl %ecx, 0x4(%rax)
jmp 0x5ab76
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x5aba2
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
jne 0x5aba2
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x20000, %ecx          # imm = 0x20000
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x5abd6
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x5abd6
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x4(%rax)
jmp 0x5abf9
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0x5abf7
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0xfffffdff, %ecx       # imm = 0xFFFFFDFF
movl %ecx, 0x4(%rax)
jmp 0x5abf9
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x5ac13
movq -0x10(%rbp), %rdi
callq 0x5ad80
movq -0x10(%rbp), %rax
movq 0x19280(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x19270(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x6110(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x1858e(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x1858c(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x1853a(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x1858a(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x18588(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x18590(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x5f40(%rax)
movq -0x10(%rbp), %rdi
callq 0x5aed0
movq -0x10(%rbp), %rdi
callq 0x5af90
movq -0x10(%rbp), %rax
movq $0x0, 0x19228(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x19230(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x6040(%rax)
je 0x5ad01
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x3, %eax
cmpl $0x2, %eax
je 0x5ad01
movq -0x10(%rbp), %rax
movq 0x6040(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq -0x10(%rbp), %rcx
movl %eax, 0x19214(%rcx)
movl %eax, -0x4(%rbp)
jmp 0x5ad08
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)