// File: /workspace/github_c_makefile_star2_O0/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_putdimehdr
SOAP_FMAC2
soap_putdimehdr(struct soap *soap)
{ unsigned char tmp[12];
  size_t optlen = 0, idlen = 0, typelen = 0;
  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Put DIME header id='%s'\n", soap->dime.id?soap->dime.id:SOAP_STR_EOS));
  if (soap->dime.options)
    optlen = (((unsigned char)soap->dime.options[2] << 8) | ((unsigned char)soap->dime.options[3])) + 4;
  if (soap->dime.id)
  { idlen = strlen(soap->dime.id);
    if (idlen > 0x0000FFFF)
      idlen = 0x0000FFFF;
  }
  if (soap->dime.type)
  { typelen = strlen(soap->dime.type);
    if (typelen > 0x0000FFFF)
      typelen = 0x0000FFFF;
  }
  tmp[0] = SOAP_DIME_VERSION | (soap->dime.flags & 0x7);
  tmp[1] = soap->dime.flags & 0xF0;
  tmp[2] = (char)(optlen >> 8);
  tmp[3] = (char)(optlen & 0xFF);
  tmp[4] = (char)(idlen >> 8);
  tmp[5] = (char)(idlen & 0xFF);
  tmp[6] = (char)(typelen >> 8);
  tmp[7] = (char)(typelen & 0xFF);
  tmp[8] = (char)(soap->dime.size >> 24);
  tmp[9] = (char)((soap->dime.size >> 16) & 0xFF);
  tmp[10] = (char)((soap->dime.size >> 8) & 0xFF);
  tmp[11] = (char)(soap->dime.size & 0xFF);
  if (soap_send_raw(soap, (char*)tmp, 12)
   || soap_putdimefield(soap, soap->dime.options, optlen)
   || soap_putdimefield(soap, soap->dime.id, idlen)
   || soap_putdimefield(soap, soap->dime.type, typelen))
    return soap->error;
  return SOAP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x19268(%rax)
je 0x68b6e
movq -0x10(%rbp), %rax
movq 0x19268(%rax), %rax
movzbl 0x2(%rax), %eax
shll $0x8, %eax
movq -0x10(%rbp), %rcx
movq 0x19268(%rcx), %rcx
movzbl 0x3(%rcx), %ecx
orl %ecx, %eax
addl $0x4, %eax
cltq
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x19258(%rax)
je 0x68ba4
movq -0x10(%rbp), %rax
movq 0x19258(%rax), %rdi
callq 0x3100
movq %rax, -0x30(%rbp)
cmpq $0xffff, -0x30(%rbp)    # imm = 0xFFFF
jbe 0x68ba2
movq $0xffff, -0x30(%rbp)    # imm = 0xFFFF
jmp 0x68ba4
movq -0x10(%rbp), %rax
cmpq $0x0, 0x19260(%rax)
je 0x68bda
movq -0x10(%rbp), %rax
movq 0x19260(%rax), %rdi
callq 0x3100
movq %rax, -0x38(%rbp)
cmpq $0xffff, -0x38(%rbp)    # imm = 0xFFFF
jbe 0x68bd8
movq $0xffff, -0x38(%rbp)    # imm = 0xFFFF
jmp 0x68bda
movq -0x10(%rbp), %rax
movsbl 0x19248(%rax), %eax
andl $0x7, %eax
orl $0x8, %eax
movb %al, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x19248(%rax), %eax
andl $0xf0, %eax
movb %al, -0x1b(%rbp)
movq -0x28(%rbp), %rax
shrq $0x8, %rax
movb %al, -0x1a(%rbp)
movq -0x28(%rbp), %rax
andq $0xff, %rax
movb %al, -0x19(%rbp)
movq -0x30(%rbp), %rax
shrq $0x8, %rax
movb %al, -0x18(%rbp)
movq -0x30(%rbp), %rax
andq $0xff, %rax
movb %al, -0x17(%rbp)
movq -0x38(%rbp), %rax
shrq $0x8, %rax
movb %al, -0x16(%rbp)
movq -0x38(%rbp), %rax
andq $0xff, %rax
movb %al, -0x15(%rbp)
movq -0x10(%rbp), %rax
movq 0x19230(%rax), %rax
shrq $0x18, %rax
movb %al, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x19230(%rax), %rax
shrq $0x10, %rax
andq $0xff, %rax
movb %al, -0x13(%rbp)
movq -0x10(%rbp), %rax
movq 0x19230(%rax), %rax
shrq $0x8, %rax
andq $0xff, %rax
movb %al, -0x12(%rbp)
movq -0x10(%rbp), %rax
movq 0x19230(%rax), %rax
andq $0xff, %rax
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
movl $0xc, %edx
callq 0x4eeb0
cmpl $0x0, %eax
jne 0x68d0d
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x19268(%rax), %rsi
movq -0x28(%rbp), %rdx
callq 0x68d30
cmpl $0x0, %eax
jne 0x68d0d
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x19258(%rax), %rsi
movq -0x30(%rbp), %rdx
callq 0x68d30
cmpl $0x0, %eax
jne 0x68d0d
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x19260(%rax), %rsi
movq -0x38(%rbp), %rdx
callq 0x68d30
cmpl $0x0, %eax
je 0x68d1c
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x68d23
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)