// File: /workspace/github_c_makefile_star2_O3/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_getdime
SOAP_FMAC2
soap_getdime(struct soap *soap)
{ while (soap->dime.flags & SOAP_DIME_CF)
  { if (soap_getdimehdr(soap))
      return soap->error;
    if (soap_move(soap, (long)soap->dime.size))
      return soap->error = SOAP_EOF;
  }
  if (soap_move(soap, (long)(((soap->dime.size+3)&(~3))-soap_tell(soap))))
    return soap->error = SOAP_EOF;
  for (;;)
  { register struct soap_multipart *content;
    if (soap_getdimehdr(soap))
      break;
    if (soap->fdimewriteopen && ((soap->dime.ptr = (char*)soap->fdimewriteopen(soap, soap->dime.id, soap->dime.type, soap->dime.options)) || soap->error))
    { const char *id, *type, *options;
      size_t size, n;
      if (!soap->dime.ptr)
        return soap->error;
      id = soap->dime.id;
      type = soap->dime.type;
      options = soap->dime.options;
      for (;;)
      { size = soap->dime.size;
        for (;;)
        { n = soap->buflen - soap->bufidx;
          if (size < n)
            n = size;
          if ((soap->error = soap->fdimewrite(soap, (void*)soap->dime.ptr, soap->buf + soap->bufidx, n)))
            break;
          size -= n;
          if (!size)
          { soap->bufidx += n;
            break;
          }
          if (soap_recv(soap))
          { soap->error = SOAP_EOF;
            goto end;
          }
        }
        if (soap_move(soap, -(long)soap->dime.size&3))
        { soap->error = SOAP_EOF;
          break;
        }
        if (!(soap->dime.flags & SOAP_DIME_CF))
          break;
        if (soap_getdimehdr(soap))
          break;
      }
end:
      if (soap->fdimewriteclose)
        soap->fdimewriteclose(soap, (void*)soap->dime.ptr);
      soap->dime.size = 0;
      soap->dime.id = id;
      soap->dime.type = type;
      soap->dime.options = options;
    }
    else if (soap->dime.flags & SOAP_DIME_CF)
    { const char *id, *type, *options;
      id = soap->dime.id;
      type = soap->dime.type;
      options = soap->dime.options;
      if (soap_new_block(soap) == NULL)
        return SOAP_EOM;
      for (;;)
      { register soap_wchar c;
        register size_t i;
        register char *s;
        s = (char*)soap_push_block(soap, NULL, soap->dime.size);
        if (!s)
          return soap->error = SOAP_EOM;
        for (i = soap->dime.size; i > 0; i--)
        { if ((int)(c = soap_get1(soap)) == EOF)
            return soap->error = SOAP_EOF;
          *s++ = (char)c;
        }
        if (soap_move(soap, -(long)soap->dime.size&3))
          return soap->error = SOAP_EOF;
        if (!(soap->dime.flags & SOAP_DIME_CF))
          break;
        if (soap_getdimehdr(soap))
          return soap->error;
      }
      soap->dime.size = soap->blist->size++; /* allocate one more for '\0' */
      if (!(soap->dime.ptr = soap_save_block(soap, NULL, NULL, 0)))
        return soap->error;
      soap->dime.ptr[soap->dime.size] = '\0'; /* force 0-terminated */
      soap->dime.id = id;
      soap->dime.type = type;
      soap->dime.options = options;
    }
    else
      soap->dime.ptr = soap_getdimefield(soap, soap->dime.size);
    content = soap_new_multipart(soap, &soap->dime.first, &soap->dime.last, soap->dime.ptr, soap->dime.size);
    if (!content)
      return soap->error = SOAP_EOM;
    content->id = soap->dime.id;
    content->type = soap->dime.type;
    content->options = soap->dime.options;
    if (soap->error)
      return soap->error;
    soap_resolve_attachment(soap, content);
  }
  if (soap->error != SOAP_DIME_END)
    return soap->error;
  return soap->error = SOAP_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
testb $0x1, 0x19248(%rdi)
jne 0x40906
movq 0x19230(%rbx), %r14
addq $0x3, %r14
andq $-0x4, %r14
movq 0x6110(%rbx), %rax
xorl %ecx, %ecx
cmpl $0x0, 0x6100(%rbx)
setne %cl
addq 0x60f8(%rbx), %r14
addq 0x60f0(%rbx), %rax
movq %r14, %rdx
subq %rax, %rdx
addq %rcx, %rdx
testq %rdx, %rdx
jle 0x408da
addq %rcx, %r14
subq %rax, %r14
incq %r14
movq %rbx, %rdi
callq 0x38217
cmpl $-0x1, %eax
je 0x40c8a
decq %r14
cmpq $0x2, %r14
jge 0x408c0
movq %rbx, %rdi
callq 0x47884
testl %eax, %eax
je 0x4094d
movl 0x19214(%rbx), %eax
cmpl $0x23, %eax
jne 0x40c99
movl $0x0, 0x19214(%rbx)
xorl %eax, %eax
jmp 0x40c99
movq %rbx, %rdi
callq 0x47884
testl %eax, %eax
jne 0x40ca8
movq 0x19230(%rbx), %r14
testq %r14, %r14
jle 0x4093f
incq %r14
movq %rbx, %rdi
callq 0x38217
cmpl $-0x1, %eax
je 0x40c8a
decq %r14
cmpq $0x2, %r14
jge 0x40925
testb $0x1, 0x19248(%rbx)
jne 0x40906
jmp 0x40879
leaq 0x6138(%rbx), %r13
leaq 0x19278(%rbx), %r15
leaq 0x19280(%rbx), %rax
movq %rax, 0x20(%rsp)
movq 0x6078(%rbx), %rax
testq %rax, %rax
je 0x40a9f
movq 0x19258(%rbx), %rsi
movq 0x19260(%rbx), %rdx
movq 0x19268(%rbx), %rcx
movq %rbx, %rdi
callq *%rax
movq %rax, 0x19250(%rbx)
testq %rax, %rax
je 0x40a91
movups 0x19258(%rbx), %xmm0
movaps %xmm0, (%rsp)
movq 0x19268(%rbx), %rbp
movq 0x19230(%rbx), %r14
movq 0x60f0(%rbx), %rdx
movq 0x60f8(%rbx), %r12
subq %rdx, %r12
cmpq %r12, %r14
cmovbq %r14, %r12
movq 0x19250(%rbx), %rsi
addq %r13, %rdx
movq %rbx, %rdi
movq %r12, %rcx
callq *0x6098(%rbx)
movl %eax, 0x19214(%rbx)
testl %eax, %eax
jne 0x40a0c
subq %r12, %r14
je 0x40a05
movq %rbx, %rdi
callq 0x38046
testl %eax, %eax
je 0x409ba
jmp 0x40a50
addq %r12, 0x60f0(%rbx)
xorl %r14d, %r14d
subl 0x19230(%rbx), %r14d
andl $0x3, %r14d
je 0x40a35
incq %r14
movq %rbx, %rdi
callq 0x38217
cmpl $-0x1, %eax
je 0x40a50
decq %r14
cmpq $0x2, %r14
jge 0x40a1f
testb $0x1, 0x19248(%rbx)
je 0x40a5a
movq %rbx, %rdi
callq 0x47884
testl %eax, %eax
je 0x409b3
jmp 0x40a5a
movl $0xffffffff, 0x19214(%rbx) # imm = 0xFFFFFFFF
movq 0x6088(%rbx), %rax
testq %rax, %rax
je 0x40a72
movq 0x19250(%rbx), %rsi
movq %rbx, %rdi
callq *%rax
movq $0x0, 0x19230(%rbx)
movaps (%rsp), %xmm0
movups %xmm0, 0x19258(%rbx)
movq %rbp, 0x19268(%rbx)
jmp 0x40ac2
movl 0x19214(%rbx), %eax
testl %eax, %eax
jne 0x40c99
testb $0x1, 0x19248(%rbx)
jne 0x40b2d
movq 0x19230(%rbx), %rsi
movq %rbx, %rdi
callq 0x47a60
movq %rax, 0x19250(%rbx)
movq 0x19230(%rbx), %r8
movq 0x19250(%rbx), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq 0x20(%rsp), %rdx
callq 0x3f7e5
testq %rax, %rax
je 0x40cb0
movq %rax, %rsi
movups 0x19258(%rbx), %xmm0
movups %xmm0, 0x18(%rax)
movq 0x19268(%rbx), %rax
movq %rax, 0x28(%rsi)
movl 0x19214(%rbx), %eax
testl %eax, %eax
jne 0x40c99
movq %rbx, %rdi
callq 0x40cdc
movq %rbx, %rdi
callq 0x47884
testl %eax, %eax
je 0x40967
jmp 0x408e6
movups 0x19258(%rbx), %xmm0
movaps %xmm0, (%rsp)
movq 0x19268(%rbx), %rax
movq %rax, 0x18(%rsp)
movl $0x18, %edi
callq 0x3290
testq %rax, %rax
je 0x40cb0
movq 0x90(%rbx), %rcx
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rax, 0x90(%rbx)
movq 0x19230(%rbx), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x37c1a
testq %rax, %rax
je 0x40cb0
movq 0x19230(%rbx), %r14
testq %r14, %r14
je 0x40bef
movq %rax, %r12
movq %r15, %rbp
xorl %r15d, %r15d
movq 0x60f0(%rbx), %rax
cmpq 0x60f8(%rbx), %rax
jb 0x40bc5
movq %rbx, %rdi
callq 0x38046
testl %eax, %eax
jne 0x40c8a
movq 0x60f0(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x60f0(%rbx)
movb 0x6138(%rbx,%rax), %al
movb %al, (%r12,%r15)
incq %r15
cmpq %r15, %r14
jne 0x40b9e
movq 0x19230(%rbx), %r14
movq %rbp, %r15
jmp 0x40bf2
xorl %r14d, %r14d
negl %r14d
andl $0x3, %r14d
je 0x40c14
incq %r14
movq %rbx, %rdi
callq 0x38217
cmpl $-0x1, %eax
je 0x40c8a
decq %r14
cmpq $0x2, %r14
jge 0x40bfe
testb $0x1, 0x19248(%rbx)
je 0x40c2f
movq %rbx, %rdi
callq 0x47884
testl %eax, %eax
je 0x40b6f
jmp 0x40ca8
movq 0x90(%rbx), %rax
movq 0x10(%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq %rcx, 0x19230(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3ab01
movq %rax, 0x19250(%rbx)
testq %rax, %rax
je 0x40ca8
movq 0x19230(%rbx), %rcx
movb $0x0, (%rax,%rcx)
movaps (%rsp), %xmm0
movups %xmm0, 0x19258(%rbx)
movq 0x18(%rsp), %rax
movq %rax, 0x19268(%rbx)
jmp 0x40ac2
movl $0xffffffff, 0x19214(%rbx) # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x19214(%rbx), %eax
jmp 0x40c99
movl $0x14, 0x19214(%rbx)
movl $0x14, %eax
jmp 0x40c99