// File: /workspace/github_c_makefile_star2_O1/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 0x40e8f
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 0x40a05
addq %rcx, %r14
subq %rax, %r14
incq %r14
movq %rbx, %rdi
callq 0x37f8a
cmpl $-0x1, %eax
je 0x40ece
decq %r14
cmpq $0x2, %r14
jge 0x409eb
leaq 0x6138(%rbx), %r14
leaq 0x19278(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0x19280(%rbx), %rax
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
callq 0x47ef4
movl $0x4, %r13d
testl %eax, %eax
jne 0x40e67
movq 0x6078(%rbx), %rax
testq %rax, %rax
je 0x40bab
movq 0x19258(%rbx), %rsi
movq 0x19260(%rbx), %rdx
movq 0x19268(%rbx), %rcx
movq %rbx, %rdi
callq *%rax
movq %rax, %r12
movq %rax, 0x19250(%rbx)
testq %rax, %rax
je 0x40b91
movq 0x19258(%rbx), %rax
movq %rax, 0x10(%rsp)
movq 0x19260(%rbx), %rax
movq %rax, 0x8(%rsp)
movq 0x19268(%rbx), %rax
movq %rax, (%rsp)
movq 0x19230(%rbx), %r15
movq 0x60f0(%rbx), %rdx
movq 0x60f8(%rbx), %r13
subq %rdx, %r13
cmpq %r13, %r15
cmovbq %r15, %r13
movq 0x19250(%rbx), %rsi
addq %r14, %rdx
movq %rbx, %rdi
movq %r13, %rcx
callq *0x6098(%rbx)
movl %eax, 0x19214(%rbx)
testl %eax, %eax
jne 0x40af3
subq %r13, %r15
je 0x40aec
movq %rbx, %rdi
callq 0x37dbb
testl %eax, %eax
je 0x40aa1
jmp 0x40b37
addq %r13, 0x60f0(%rbx)
xorl %r15d, %r15d
subl 0x19230(%rbx), %r15d
andl $0x3, %r15d
je 0x40b1c
incq %r15
movq %rbx, %rdi
callq 0x37f8a
cmpl $-0x1, %eax
je 0x40b37
decq %r15
cmpq $0x2, %r15
jge 0x40b06
testb $0x1, 0x19248(%rbx)
je 0x40b41
movq %rbx, %rdi
callq 0x47ef4
testl %eax, %eax
je 0x40a9a
jmp 0x40b41
movl $0xffffffff, 0x19214(%rbx) # imm = 0xFFFFFFFF
movq 0x6088(%rbx), %rax
testq %rax, %rax
je 0x40b59
movq 0x19250(%rbx), %rsi
movq %rbx, %rdi
callq *%rax
movq $0x0, 0x19230(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x19258(%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x19260(%rbx)
movq (%rsp), %rax
movq %rax, 0x19268(%rbx)
testq %r12, %r12
jne 0x40bce
jmp 0x40c50
cmpl $0x0, 0x19214(%rbx)
je 0x40bab
testq %r12, %r12
jne 0x40a77
movl 0x19214(%rbx), %ebp
jmp 0x40b87
testb $0x1, 0x19248(%rbx)
jne 0x40c5b
movq 0x19230(%rbx), %rsi
movq %rbx, %rdi
callq 0x480d0
movq %rax, 0x19250(%rbx)
movl %ebp, %r15d
movq 0x19230(%rbx), %r8
movq 0x19250(%rbx), %rcx
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x3f886
testq %rax, %rax
je 0x40c41
movq 0x19258(%rbx), %rcx
movq %rcx, 0x18(%rax)
movq 0x19260(%rbx), %rcx
movq %rcx, 0x20(%rax)
movq 0x19268(%rbx), %rcx
movq %rcx, 0x28(%rax)
movl 0x19214(%rbx), %ebp
movl $0x1, %r13d
testl %ebp, %ebp
jne 0x40e67
movq %rbx, %rdi
movq %rax, %rsi
callq 0x40f11
xorl %r13d, %r13d
movl %r15d, %ebp
jmp 0x40e67
movl $0x14, 0x19214(%rbx)
movl $0x14, %ebp
movl $0x1, %r13d
jmp 0x40e67
movq 0x19258(%rbx), %r15
movq 0x19260(%rbx), %r12
movq 0x19268(%rbx), %r13
movl $0x18, %edi
callq 0x3280
testq %rax, %rax
movq %r15, 0x10(%rsp)
movq %r12, 0x8(%rsp)
movq %r13, (%rsp)
je 0x40ca7
movq 0x90(%rbx), %rcx
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rax, 0x90(%rbx)
jmp 0x40cb1
movl $0x14, 0x19214(%rbx)
movl $0x1, %r13d
testq %rax, %rax
je 0x40e49
movq 0x19230(%rbx), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x37937
testq %rax, %rax
je 0x40d8e
movl %ebp, %r13d
movq 0x19230(%rbx), %r15
testq %r15, %r15
je 0x40d3a
movq %rax, %r12
xorl %ebp, %ebp
movq 0x60f0(%rbx), %rax
cmpq 0x60f8(%rbx), %rax
jb 0x40d0f
movq %rbx, %rdi
callq 0x37dbb
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x40d29
movq 0x60f0(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x60f0(%rbx)
movzbl 0x6138(%rbx,%rax), %ecx
cmpl $-0x1, %ecx
je 0x40d9f
movb %cl, (%r12,%rbp)
incq %rbp
cmpq %rbp, %r15
jne 0x40cee
xorl %r15d, %r15d
subl 0x19230(%rbx), %r15d
andl $0x3, %r15d
movl %r13d, %ebp
movl $0x1, %r13d
je 0x40d6c
incq %r15
movq %rbx, %rdi
callq 0x37f8a
cmpl $-0x1, %eax
je 0x40dbb
decq %r15
cmpq $0x2, %r15
jge 0x40d56
movl $0xb, %eax
testb $0x1, 0x19248(%rbx)
je 0x40dcf
movq %rbx, %rdi
callq 0x47ef4
testl %eax, %eax
je 0x40dd9
movl 0x19214(%rbx), %ebp
jmp 0x40dca
movl $0x14, 0x19214(%rbx)
movl $0x14, %ebp
jmp 0x40dca
movl $0xffffffff, 0x19214(%rbx) # imm = 0xFFFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0x1, %eax
movl $0x1, %r13d
jmp 0x40dcf
movl $0xffffffff, 0x19214(%rbx) # imm = 0xFFFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0x1, %eax
testl %eax, %eax
je 0x40cc0
jmp 0x40ddd
xorl %eax, %eax
jmp 0x40dcf
cmpl $0xb, %eax
jne 0x40e50
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 0x3a9f3
movq %rax, 0x19250(%rbx)
testq %rax, %rax
je 0x40e55
movq 0x19230(%rbx), %rcx
movb $0x0, (%rax,%rcx)
movq 0x10(%rsp), %rax
movq %rax, 0x19258(%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x19260(%rbx)
movq (%rsp), %rax
movq %rax, 0x19268(%rbx)
xorl %r13d, %r13d
jmp 0x40e5b
movl $0x14, %ebp
jmp 0x40e5b
movl %eax, %r13d
jmp 0x40e5b
movl 0x19214(%rbx), %ebp
movl %ebp, %r15d
testl %r13d, %r13d
je 0x40bd1
testl %r13d, %r13d
je 0x40a24
cmpl $0x1, %r13d
je 0x40edd
movl 0x19214(%rbx), %ebp
cmpl $0x23, %ebp
jne 0x40edd
movl $0x0, 0x19214(%rbx)
xorl %ebp, %ebp
jmp 0x40edd
movq %rbx, %rdi
callq 0x47ef4
testl %eax, %eax
jne 0x40eee
movq 0x19230(%rbx), %r14
testq %r14, %r14
jle 0x40ec0
incq %r14
movq %rbx, %rdi
callq 0x37f8a
cmpl $-0x1, %eax
je 0x40ece
decq %r14
cmpq $0x2, %r14
jge 0x40eaa
testb $0x1, 0x19248(%rbx)
jne 0x40e8f
jmp 0x409a4
movl $0xffffffff, 0x19214(%rbx) # imm = 0xFFFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x19214(%rbx), %ebp
jmp 0x40edd