// File: /workspace/github_c_makefile_star2_O3/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_getdimehdr
SOAP_FMAC2
soap_getdimehdr(struct soap *soap)
{ register soap_wchar c;
  register char *s;
  register int i;
  unsigned char tmp[12];
  size_t optlen, idlen, typelen;
  if (!(soap->mode & SOAP_ENC_DIME))
    return soap->error = SOAP_DIME_END;
  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get DIME header\n"));
  if (soap->dime.buflen || soap->dime.chunksize)
  { if (soap_move(soap, (long)(soap->dime.size - soap_tell(soap))))
      return soap->error = SOAP_EOF;
    soap_unget(soap, soap_getchar(soap)); /* skip padding and get hdr */
    DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... From chunked\n"));
    return SOAP_OK;
  }
  s = (char*)tmp;
  for (i = 12; i > 0; i--)
  { if ((int)(c = soap_getchar(soap)) == EOF)
      return soap->error = SOAP_EOF;
    *s++ = (char)c;
  }
  if ((tmp[0] & 0xF8) != SOAP_DIME_VERSION)
    return soap->error = SOAP_DIME_MISMATCH;
  soap->dime.flags = (tmp[0] & 0x7) | (tmp[1] & 0xF0);
  optlen = (tmp[2] << 8) | tmp[3];
  idlen = (tmp[4] << 8) | tmp[5];
  typelen = (tmp[6] << 8) | tmp[7];
  soap->dime.size = (tmp[8] << 24) | (tmp[9] << 16) | (tmp[10] << 8) | tmp[11];
  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME size=%lu flags=0x%X\n", (unsigned long)soap->dime.size, soap->dime.flags));
  if (!(soap->dime.options = soap_getdimefield(soap, optlen)) && soap->error)
    return soap->error;
  if (!(soap->dime.id = soap_getdimefield(soap, idlen)) && soap->error)
    return soap->error;
  if (!(soap->dime.type = soap_getdimefield(soap, typelen)) && soap->error)
    return soap->error;
  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME id=%s, type=%s, options=%s\n", soap->dime.id?soap->dime.id:SOAP_STR_EOS, soap->dime.type?soap->dime.type:"", soap->dime.options?soap->dime.options+4:SOAP_STR_EOS));
  if (soap->dime.flags & SOAP_DIME_ME)
    soap->mode &= ~SOAP_ENC_DIME;
  return SOAP_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
testb $-0x80, 0x4(%rdi)
jne 0x478a9
movl $0x23, 0x19214(%rbx)
movl $0x23, %eax
jmp 0x47a22
cmpq $0x0, 0x19240(%rbx)
jne 0x478bd
cmpq $0x0, 0x19238(%rbx)
je 0x4792b
movq 0x60f8(%rbx), %r14
movq 0x6110(%rbx), %rax
xorl %ecx, %ecx
cmpl $0x0, 0x6100(%rbx)
setne %cl
addq 0x19230(%rbx), %r14
addq 0x60f0(%rbx), %rax
movq %r14, %rdx
subq %rax, %rdx
addq %rcx, %rdx
testq %rdx, %rdx
jle 0x47916
addq %rcx, %r14
subq %rax, %r14
incq %r14
movq %rbx, %rdi
callq 0x38217
cmpl $-0x1, %eax
je 0x47a13
decq %r14
cmpq $0x2, %r14
jge 0x478fc
movq %rbx, %rdi
callq 0x38217
movl %eax, 0x6100(%rbx)
xorl %eax, %eax
jmp 0x47a22
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x38217
cmpl $-0x1, %eax
je 0x47a13
movb %al, 0x4(%rsp,%r14)
incq %r14
cmpq $0xc, %r14
jne 0x4792e
movb 0x4(%rsp), %al
movl %eax, %ecx
andb $-0x8, %cl
cmpb $0x8, %cl
jne 0x47a2b
andb $0x7, %al
movb 0x5(%rsp), %cl
andb $-0x10, %cl
orb %al, %cl
movb %cl, 0x19248(%rbx)
movzwl 0x6(%rsp), %eax
movzwl 0x8(%rsp), %r14d
rolw $0x8, %ax
movzwl %ax, %esi
movzwl 0xa(%rsp), %ebp
movzbl 0xc(%rsp), %eax
shll $0x18, %eax
movzbl 0xd(%rsp), %ecx
shll $0x10, %ecx
cltq
orq %rcx, %rax
movzbl 0xe(%rsp), %ecx
shll $0x8, %ecx
orq %rax, %rcx
movzbl 0xf(%rsp), %eax
orq %rcx, %rax
movq %rax, 0x19230(%rbx)
movq %rbx, %rdi
callq 0x47a60
movq %rax, 0x19268(%rbx)
testq %rax, %rax
je 0x47a3c
rolw $0x8, %r14w
movzwl %r14w, %esi
movq %rbx, %rdi
callq 0x47a60
movq %rax, 0x19258(%rbx)
testq %rax, %rax
je 0x47a48
rolw $0x8, %bp
movzwl %bp, %esi
movq %rbx, %rdi
callq 0x47a60
movq %rax, 0x19260(%rbx)
testq %rax, %rax
je 0x47a54
xorl %eax, %eax
testb $0x2, 0x19248(%rbx)
je 0x47a22
andb $0x7f, 0x4(%rbx)
jmp 0x47a22
movl $0xffffffff, 0x19214(%rbx) # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl $0x22, 0x19214(%rbx)
movl $0x22, %eax
jmp 0x47a22
movl 0x19214(%rbx), %eax
testl %eax, %eax
jne 0x47a22
jmp 0x479ca
movl 0x19214(%rbx), %eax
testl %eax, %eax
jne 0x47a22
jmp 0x479e7
movl 0x19214(%rbx), %eax
testl %eax, %eax
jne 0x47a22
jmp 0x47a02