// File: /workspace/github_c_makefile_star2_O2/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(%rbx)
je 0x3ca39
movq %rbx, %rdi
callq 0x43228
testl %eax, %eax
jne 0x3cd47
movq 0x19230(%rbx), %rsi
movq %rbx, %rdi
callq 0x358ee
testl %eax, %eax
je 0x3ca0b
jmp 0x3ca62
movq 0x19230(%rbx), %r14
addq $0x3, %r14
andq $-0x4, %r14
movq %rbx, %rdi
callq 0x35920
subq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x358ee
testl %eax, %eax
je 0x3ca71
orl $-0x1, 0x19214(%rbx)
pushq $-0x1
popq %rax
jmp 0x3cd4d
leaq 0x6138(%rbx), %r13
leaq 0x19278(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0x19280(%rbx), %rax
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
callq 0x43228
testl %eax, %eax
jne 0x3cd6d
movq 0x6078(%rbx), %rax
testq %rax, %rax
je 0x3cbc0
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 0x3cbb2
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 0x3cb45
subq %r12, %r14
je 0x3cb3e
movq %rbx, %rdi
callq 0x34dd5
testl %eax, %eax
je 0x3caf3
jmp 0x3cb77
addq %r12, 0x60f0(%rbx)
xorl %esi, %esi
subl 0x19230(%rbx), %esi
andl $0x3, %esi
movq %rbx, %rdi
callq 0x358ee
testl %eax, %eax
jne 0x3cb77
testb $0x1, 0x19248(%rbx)
je 0x3cb7e
movq %rbx, %rdi
callq 0x43228
testl %eax, %eax
je 0x3caec
jmp 0x3cb7e
orl $-0x1, 0x19214(%rbx)
movq 0x6088(%rbx), %rax
testq %rax, %rax
je 0x3cb96
movq 0x19250(%rbx), %rsi
movq %rbx, %rdi
callq *%rax
andq $0x0, 0x19230(%rbx)
movaps (%rsp), %xmm0
movups %xmm0, 0x19258(%rbx)
movq %rbp, 0x19268(%rbx)
jmp 0x3cbdf
movl 0x19214(%rbx), %eax
testl %eax, %eax
jne 0x3cd4d
testb $0x1, 0x19248(%rbx)
jne 0x3cc3c
movq 0x19230(%rbx), %rsi
movq %rbx, %rdi
callq 0x433cf
movq %rax, 0x19250(%rbx)
movq 0x19230(%rbx), %r8
movq 0x19250(%rbx), %rcx
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x3bb26
testq %rax, %rax
je 0x3cd5c
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 0x3cd4d
movq %rbx, %rdi
callq 0x3cd9e
jmp 0x3ca90
movups 0x19258(%rbx), %xmm0
movaps %xmm0, (%rsp)
movq 0x19268(%rbx), %rbp
movq %rbx, %rdi
callq 0x3730e
testq %rax, %rax
je 0x3cd66
movq 0x19230(%rbx), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x349eb
testq %rax, %rax
je 0x3cd5c
movq %rax, %r12
movq 0x19230(%rbx), %r14
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x3cccd
movq 0x60f0(%rbx), %rax
cmpq 0x60f8(%rbx), %rax
jb 0x3ccb2
movq %rbx, %rdi
callq 0x34dd5
testl %eax, %eax
jne 0x3ca62
movq 0x60f0(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x60f0(%rbx)
movb 0x6138(%rbx,%rax), %al
movb %al, (%r12,%r15)
incq %r15
jmp 0x3cc86
xorl %esi, %esi
subl 0x19230(%rbx), %esi
andl $0x3, %esi
movq %rbx, %rdi
callq 0x358ee
testl %eax, %eax
jne 0x3ca62
testb $0x1, 0x19248(%rbx)
je 0x3cd03
movq %rbx, %rdi
callq 0x43228
testl %eax, %eax
je 0x3cc5f
jmp 0x3cd47
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 0x376b0
movq %rax, 0x19250(%rbx)
testq %rax, %rax
je 0x3cd47
movq 0x19230(%rbx), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x3cb9e
movl 0x19214(%rbx), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x14, 0x19214(%rbx)
pushq $0x14
jmp 0x3ca6b
movl 0x19214(%rbx), %eax
cmpl $0x23, %eax
jne 0x3cd4d
andl $0x0, 0x19214(%rbx)
xorl %eax, %eax
jmp 0x3cd4d