// File: /workspace/github_c_makefile_star2_O0/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_puthttphdr
SOAP_FMAC2
soap_puthttphdr(struct soap *soap, int status, size_t count)
{ if (soap->status != SOAP_GET)
  { register const char *s = "text/xml; charset=utf-8";
    register int err = SOAP_OK;
#ifndef WITH_LEANER
    register const char *r = NULL;
#endif
    if ((status == SOAP_FILE || soap->status == SOAP_POST_FILE) && soap->http_content)
      s = soap->http_content;
    else if (status == SOAP_HTML)
      s = "text/html; charset=utf-8";
    else if (count || ((soap->omode & SOAP_IO) == SOAP_IO_CHUNK))
    { if (soap->version == 2)
        s = "application/soap+xml; charset=utf-8";
    }
#ifndef WITH_LEANER
    if (soap->mode & (SOAP_ENC_DIME | SOAP_ENC_MTOM))
    { if (soap->mode & SOAP_ENC_MTOM)
      { if (soap->version == 2)
          r = "application/soap+xml";
	else
          r = "text/xml";
        s = "application/xop+xml";
      }
      else
        s = "application/dime";
    }
    if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary && strlen(soap->mime.boundary) + strlen(soap->mime.start ? soap->mime.start : SOAP_STR_EOS) < sizeof(soap->tmpbuf) - 80)
    { register const char *t = strchr(s, ';');
      sprintf(soap->tmpbuf, "multipart/related; charset=utf-8; boundary=\"%s\"; type=\"", soap->mime.boundary);
      if (t)
      { strncat(soap->tmpbuf, s, t - s);
        soap->tmpbuf[sizeof(soap->tmpbuf)-1] = '\0';
      }
      else
        strcat(soap->tmpbuf, s);
      if (soap->mime.start)
      { strcat(soap->tmpbuf, "\"; start=\"");
        strcat(soap->tmpbuf, soap->mime.start);
      }
      strcat(soap->tmpbuf, "\"");
      if (r)
      { strcat(soap->tmpbuf, "; start-info=\"");
        strcat(soap->tmpbuf, r);
        strcat(soap->tmpbuf, "\"");
      }
      s = soap->tmpbuf;
    }
#endif
    if (s && (err = soap->fposthdr(soap, "Content-Type", s)))
      return err;
#ifdef WITH_ZLIB
    if ((soap->omode & SOAP_ENC_ZLIB))
    { 
#ifdef WITH_GZIP
      err = soap->fposthdr(soap, "Content-Encoding", soap->zlib_out == SOAP_ZLIB_DEFLATE ? "deflate" : "gzip");
#else
      err = soap->fposthdr(soap, "Content-Encoding", "deflate");
#endif
      if (err)
        return err;
    }
#endif
#ifndef WITH_LEANER
    if ((soap->omode & SOAP_IO) == SOAP_IO_CHUNK)
      err = soap->fposthdr(soap, "Transfer-Encoding", "chunked");
    else
#endif
    if (s)
    { sprintf(soap->tmpbuf, "%lu", (unsigned long)count);
      err = soap->fposthdr(soap, "Content-Length", soap->tmpbuf);
    }
    if (err)
      return err;
  }
  return soap->fposthdr(soap, "Connection", soap->keep_alive ? "keep-alive" : "close");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x7d2, 0x19210(%rax)   # imm = 0x7D2
je 0x6ca74
leaq 0xe68e(%rip), %rax      # 0x7ad9c
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
cmpl $0x3eb, -0x14(%rbp)     # imm = 0x3EB
je 0x6c73a
movq -0x10(%rbp), %rax
cmpl $0x7d1, 0x19210(%rax)   # imm = 0x7D1
jne 0x6c753
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x6c753
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x6c79d
cmpl $0x3ea, -0x14(%rbp)     # imm = 0x3EA
jne 0x6c769
leaq 0xe6bf(%rip), %rax      # 0x7ae22
movq %rax, -0x28(%rbp)
jmp 0x6c79b
cmpq $0x0, -0x20(%rbp)
jne 0x6c77f
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x3, %eax
cmpl $0x3, %eax
jne 0x6c799
movq -0x10(%rbp), %rax
movswl 0x2(%rax), %eax
cmpl $0x2, %eax
jne 0x6c797
leaq 0xe5b1(%rip), %rax      # 0x7ad44
movq %rax, -0x28(%rbp)
jmp 0x6c799
jmp 0x6c79b
jmp 0x6c79d
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x280, %eax            # imm = 0x280
cmpl $0x0, %eax
je 0x6c7fe
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x6c7f1
movq -0x10(%rbp), %rax
movswl 0x2(%rax), %eax
cmpl $0x2, %eax
jne 0x6c7d9
leaq 0xe668(%rip), %rax      # 0x7ae3b
movq %rax, -0x38(%rbp)
jmp 0x6c7e4
leaq 0xe670(%rip), %rax      # 0x7ae50
movq %rax, -0x38(%rbp)
leaq 0xe66e(%rip), %rax      # 0x7ae59
movq %rax, -0x28(%rbp)
jmp 0x6c7fc
leaq 0xe4f7(%rip), %rax      # 0x7acef
movq %rax, -0x28(%rbp)
jmp 0x6c7fe
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x6c9af
movq -0x10(%rbp), %rax
cmpq $0x0, 0x19288(%rax)
je 0x6c9af
movq -0x10(%rbp), %rax
movq 0x19288(%rax), %rdi
callq 0x3100
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x19290(%rax)
je 0x6c858
movq -0x10(%rbp), %rax
movq 0x19290(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x6c865
leaq 0xdc22(%rip), %rax      # 0x7a481
movq %rax, -0x50(%rbp)
jmp 0x6c865
movq -0x50(%rbp), %rdi
callq 0x3100
movq %rax, %rcx
movq -0x48(%rbp), %rax
addq %rcx, %rax
cmpq $0x3b0, %rax            # imm = 0x3B0
jae 0x6c9af
movq -0x28(%rbp), %rdi
movl $0x3b, %esi
callq 0x3130
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
addq $0x16538, %rdi          # imm = 0x16538
movq -0x10(%rbp), %rax
movq 0x19288(%rax), %rdx
leaq 0xe5ba(%rip), %rsi      # 0x7ae6d
movb $0x0, %al
callq 0x3370
cmpq $0x0, -0x40(%rbp)
je 0x6c8ed
movq -0x10(%rbp), %rdi
addq $0x16538, %rdi          # imm = 0x16538
movq -0x28(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x28(%rbp), %rax
subq %rax, %rdx
callq 0x31b0
movq -0x10(%rbp), %rax
movb $0x0, 0x16937(%rax)
jmp 0x6c901
movq -0x10(%rbp), %rdi
addq $0x16538, %rdi          # imm = 0x16538
movq -0x28(%rbp), %rsi
callq 0x3360
movq -0x10(%rbp), %rax
cmpq $0x0, 0x19290(%rax)
je 0x6c941
movq -0x10(%rbp), %rdi
addq $0x16538, %rdi          # imm = 0x16538
leaq 0xe584(%rip), %rsi      # 0x7aea5
callq 0x3360
movq -0x10(%rbp), %rdi
addq $0x16538, %rdi          # imm = 0x16538
movq -0x10(%rbp), %rax
movq 0x19290(%rax), %rsi
callq 0x3360
movq -0x10(%rbp), %rdi
addq $0x16538, %rdi          # imm = 0x16538
leaq 0xe242(%rip), %rsi      # 0x7ab95
callq 0x3360
cmpq $0x0, -0x38(%rbp)
je 0x6c9a1
movq -0x10(%rbp), %rdi
addq $0x16538, %rdi          # imm = 0x16538
leaq 0xe53f(%rip), %rsi      # 0x7aeb0
callq 0x3360
movq -0x10(%rbp), %rdi
addq $0x16538, %rdi          # imm = 0x16538
movq -0x38(%rbp), %rsi
callq 0x3360
movq -0x10(%rbp), %rdi
addq $0x16538, %rdi          # imm = 0x16538
leaq 0xe1f9(%rip), %rsi      # 0x7ab95
callq 0x3360
movq -0x10(%rbp), %rax
addq $0x16538, %rax          # imm = 0x16538
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x6c9e5
movq -0x10(%rbp), %rax
movq 0x5f98(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0xe27e(%rip), %rsi      # 0x7ac4e
callq *%rax
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
je 0x6c9e5
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6caaf
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x3, %eax
cmpl $0x3, %eax
jne 0x6ca18
movq -0x10(%rbp), %rax
movq 0x5f98(%rax), %rax
movq -0x10(%rbp), %rdi
leaq 0xe26d(%rip), %rsi      # 0x7ac77
leaq 0xe4ae(%rip), %rdx      # 0x7aebf
callq *%rax
movl %eax, -0x2c(%rbp)
jmp 0x6ca64
cmpq $0x0, -0x28(%rbp)
je 0x6ca62
movq -0x10(%rbp), %rdi
addq $0x16538, %rdi          # imm = 0x16538
movq -0x20(%rbp), %rdx
leaq 0xe148(%rip), %rsi      # 0x7ab7d
movb $0x0, %al
callq 0x3370
movq -0x10(%rbp), %rax
movq 0x5f98(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x16538, %rdx          # imm = 0x16538
leaq 0xe46a(%rip), %rsi      # 0x7aec7
callq *%rax
movl %eax, -0x2c(%rbp)
jmp 0x6ca64
cmpl $0x0, -0x2c(%rbp)
je 0x6ca72
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6caaf
jmp 0x6ca74
movq -0x10(%rbp), %rax
movq 0x5f98(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rcx
movswl 0x191cc(%rcx), %esi
leaq 0xe457(%rip), %rdx      # 0x7aeec
leaq 0xe445(%rip), %rcx      # 0x7aee1
cmpl $0x0, %esi
cmovneq %rcx, %rdx
leaq 0xe42c(%rip), %rsi      # 0x7aed6
callq *%rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)