// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x68dd7
movq -0x10(%rbp), %rax
movl $0x23, 0x19214(%rax)
movl $0x23, -0x4(%rbp)
jmp 0x6904c
movq -0x10(%rbp), %rax
cmpq $0x0, 0x19240(%rax)
jne 0x68df3
movq -0x10(%rbp), %rax
cmpq $0x0, 0x19238(%rax)
je 0x68e63
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x19230(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0x50ed0
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdi
subq %rax, %rsi
callq 0x50e80
cmpl $0x0, %eax
je 0x68e42
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x19214(%rax) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6904c
movq -0x10(%rbp), %rdi
callq 0x4fdb0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x6100(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x6904c
leaq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0xc, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jle 0x68ec4
movq -0x10(%rbp), %rdi
callq 0x4fdb0
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
jne 0x68ea3
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x19214(%rax) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6904c
movl -0x14(%rbp), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x68e72
movzbl -0x30(%rbp), %eax
andl $0xf8, %eax
cmpl $0x8, %eax
je 0x68eec
movq -0x10(%rbp), %rax
movl $0x22, 0x19214(%rax)
movl $0x22, -0x4(%rbp)
jmp 0x6904c
movzbl -0x30(%rbp), %eax
andl $0x7, %eax
movzbl -0x2f(%rbp), %ecx
andl $0xf0, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x19248(%rax)
movzbl -0x2e(%rbp), %eax
shll $0x8, %eax
movzbl -0x2d(%rbp), %ecx
orl %ecx, %eax
cltq
movq %rax, -0x38(%rbp)
movzbl -0x2c(%rbp), %eax
shll $0x8, %eax
movzbl -0x2b(%rbp), %ecx
orl %ecx, %eax
cltq
movq %rax, -0x40(%rbp)
movzbl -0x2a(%rbp), %eax
shll $0x8, %eax
movzbl -0x29(%rbp), %ecx
orl %ecx, %eax
cltq
movq %rax, -0x48(%rbp)
movzbl -0x28(%rbp), %eax
shll $0x18, %eax
movzbl -0x27(%rbp), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movzbl -0x26(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movzbl -0x25(%rbp), %ecx
orl %ecx, %eax
movslq %eax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x19230(%rax)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x69060
movq -0x10(%rbp), %rcx
movq %rax, 0x19268(%rcx)
cmpq $0x0, %rax
jne 0x68fae
movq -0x10(%rbp), %rax
cmpl $0x0, 0x19214(%rax)
je 0x68fae
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x6904c
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x69060
movq -0x10(%rbp), %rcx
movq %rax, 0x19258(%rcx)
cmpq $0x0, %rax
jne 0x68fe8
movq -0x10(%rbp), %rax
cmpl $0x0, 0x19214(%rax)
je 0x68fe8
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x6904c
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x69060
movq -0x10(%rbp), %rcx
movq %rax, 0x19260(%rcx)
cmpq $0x0, %rax
jne 0x69022
movq -0x10(%rbp), %rax
cmpl $0x0, 0x19214(%rax)
je 0x69022
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x6904c
movq -0x10(%rbp), %rax
movsbl 0x19248(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x69045
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
movl %ecx, 0x4(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)