// File: /workspace/github_c_makefile_star2_O2/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 0x43247
movl $0x23, 0x19214(%rbx)
pushq $0x23
jmp 0x43285
cmpq $0x0, 0x19240(%rbx)
jne 0x4325b
cmpq $0x0, 0x19238(%rbx)
je 0x432a1
movq 0x19230(%rbx), %r14
movq %rbx, %rdi
callq 0x35920
subq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x358ee
testl %eax, %eax
je 0x4328f
orl $-0x1, 0x19214(%rbx)
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
callq 0x34fa6
movl %eax, 0x6100(%rbx)
xorl %eax, %eax
jmp 0x43286
xorl %r14d, %r14d
cmpl $0xc, %r14d
je 0x432c1
movq %rbx, %rdi
callq 0x34fa6
cmpl $-0x1, %eax
je 0x4327c
movb %al, 0x4(%rsp,%r14)
incq %r14
jmp 0x432a4
movb 0x4(%rsp), %al
movl %eax, %ecx
andb $-0x8, %cl
cmpb $0x8, %cl
jne 0x4338e
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 0x433cf
movq %rax, 0x19268(%rbx)
testq %rax, %rax
je 0x4339f
rolw $0x8, %r14w
movzwl %r14w, %esi
movq %rbx, %rdi
callq 0x433cf
movq %rax, 0x19258(%rbx)
testq %rax, %rax
je 0x433af
rolw $0x8, %bp
movzwl %bp, %esi
movq %rbx, %rdi
callq 0x433cf
movq %rax, 0x19260(%rbx)
testq %rax, %rax
je 0x433bf
xorl %eax, %eax
testb $0x2, 0x19248(%rbx)
je 0x43286
andb $0x7f, 0x4(%rbx)
jmp 0x43286
movl $0x22, 0x19214(%rbx)
pushq $0x22
jmp 0x43285
movl 0x19214(%rbx), %eax
testl %eax, %eax
jne 0x43286
jmp 0x4333e
movl 0x19214(%rbx), %eax
testl %eax, %eax
jne 0x43286
jmp 0x4335b
movl 0x19214(%rbx), %eax
testl %eax, %eax
jne 0x43286
jmp 0x43376