// File: /workspace/github_c_makefile_star2_O0/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: http_parse_header
static int
http_parse_header(struct soap *soap, const char *key, const char *val)
{ if (!soap_tag_cmp(key, "Host"))
  { 
#ifdef WITH_OPENSSL
    if (soap->imode & SOAP_ENC_SSL)
      strcpy(soap->endpoint, "https://");
    else
#endif
      strcpy(soap->endpoint, "http://");
    strncat(soap->endpoint, val, sizeof(soap->endpoint) - 8);
    soap->endpoint[sizeof(soap->endpoint) - 1] = '\0';
  }
#ifndef WITH_LEANER
  else if (!soap_tag_cmp(key, "Content-Type"))
  { const char *action;
    soap->http_content = soap_strdup(soap, val);
    if (soap_get_header_attribute(soap, val, "application/dime"))
      soap->imode |= SOAP_ENC_DIME;
    else if (soap_get_header_attribute(soap, val, "multipart/related")
          || soap_get_header_attribute(soap, val, "multipart/form-data"))
    { soap->mime.boundary = soap_strdup(soap, soap_get_header_attribute(soap, val, "boundary"));
      soap->mime.start = soap_strdup(soap, soap_get_header_attribute(soap, val, "start"));
      soap->imode |= SOAP_ENC_MIME;
    }
    action = soap_get_header_attribute(soap, val, "action");
    if (action)
    { if (*action == '"')
      { soap->action = soap_strdup(soap, action + 1);
        soap->action[strlen(soap->action) - 1] = '\0';
      }
      else
        soap->action = soap_strdup(soap, action);
    }
  }
#endif
  else if (!soap_tag_cmp(key, "Content-Length"))
  { soap->length = soap_strtoul(val, NULL, 10);
  }
  else if (!soap_tag_cmp(key, "Content-Encoding"))
  { if (!soap_tag_cmp(val, "deflate"))
#ifdef WITH_ZLIB
      soap->zlib_in = SOAP_ZLIB_DEFLATE;
#else
      return SOAP_ZLIB_ERROR;
#endif
    else if (!soap_tag_cmp(val, "gzip"))
#ifdef WITH_GZIP
      soap->zlib_in = SOAP_ZLIB_GZIP;
#else
      return SOAP_ZLIB_ERROR;
#endif
  }
#ifdef WITH_ZLIB
  else if (!soap_tag_cmp(key, "Accept-Encoding"))
  {
#ifdef WITH_GZIP
    if (strchr(val, '*') || soap_get_header_attribute(soap, val, "gzip"))
      soap->zlib_out = SOAP_ZLIB_GZIP;
    else
#endif
    if (strchr(val, '*') || soap_get_header_attribute(soap, val, "deflate"))
      soap->zlib_out = SOAP_ZLIB_DEFLATE;
    else
      soap->zlib_out = SOAP_ZLIB_NONE;
  }
#endif
  else if (!soap_tag_cmp(key, "Transfer-Encoding"))
  { soap->imode &= ~SOAP_IO;
    if (!soap_tag_cmp(val, "chunked"))
      soap->imode |= SOAP_IO_CHUNK;
  }
  else if (!soap_tag_cmp(key, "Connection"))
  { if (!soap_tag_cmp(val, "keep-alive"))
      soap->keep_alive = -soap->keep_alive;
    else if (!soap_tag_cmp(val, "close"))
      soap->keep_alive = 0;
  }
#ifndef WITH_LEAN
  else if (!soap_tag_cmp(key, "Authorization"))
  { if (!soap_tag_cmp(val, "Basic *"))
    { int n;
      char *s;
      soap_base642s(soap, val + 6, soap->tmpbuf, sizeof(soap->tmpbuf) - 1, &n);
      soap->tmpbuf[n] = '\0';
      if ((s = strchr(soap->tmpbuf, ':')))
      { *s = '\0';
        soap->userid = soap_strdup(soap, soap->tmpbuf);
        soap->passwd = soap_strdup(soap, s + 1);
      }
    }
  }
  else if (!soap_tag_cmp(key, "WWW-Authenticate"))
  { soap->authrealm = soap_strdup(soap, soap_get_header_attribute(soap, val + 6, "realm"));
  }
  else if (!soap_tag_cmp(key, "Expect"))
  { if (!soap_tag_cmp(val, "100-continue"))
    { if ((soap->error = soap->fposthdr(soap, "HTTP/1.1 100 Continue", NULL))
       || (soap->error = soap->fposthdr(soap, NULL, NULL)))
        return soap->error;
    }
  }
#endif
  else if (!soap_tag_cmp(key, "SOAPAction"))
  { if (*val == '"')
    { soap->action = soap_strdup(soap, val + 1);
      soap->action[strlen(soap->action) - 1] = '\0';
    }
    else
      soap->action = soap_strdup(soap, val);
  }
  else if (!soap_tag_cmp(key, "Location"))
  { strncpy(soap->endpoint, val, sizeof(soap->endpoint));
    soap->endpoint[sizeof(soap->endpoint) - 1] = '\0';
  }
  else if (!soap_tag_cmp(key, "X-Forwarded-For"))
  { soap->proxy_from = soap_strdup(soap, val);
  }
#ifdef WITH_COOKIES
  else if (!soap_tag_cmp(key, "Cookie")
   || !soap_tag_cmp(key, "Cookie2")
   || !soap_tag_cmp(key, "Set-Cookie")
   || !soap_tag_cmp(key, "Set-Cookie2"))
  { soap_getcookies(soap, val);
  }
#endif
  return SOAP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x24983(%rip), %rsi     # 0x7bc22
callq 0x4ff40
cmpl $0x0, %eax
jne 0x572e9
movq -0x10(%rbp), %rdi
addq $0x185a8, %rdi          # imm = 0x185A8
leaq 0x2496c(%rip), %rsi     # 0x7bc27
callq 0x3090
movq -0x10(%rbp), %rdi
addq $0x185a8, %rdi          # imm = 0x185A8
movq -0x20(%rbp), %rsi
movl $0x3f8, %edx            # imm = 0x3F8
callq 0x31b0
movq -0x10(%rbp), %rax
movb $0x0, 0x189a7(%rax)
jmp 0x578ba
movq -0x18(%rbp), %rdi
leaq 0x2395a(%rip), %rsi     # 0x7ac4e
callq 0x4ff40
cmpl $0x0, %eax
jne 0x57497
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x538b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x239c6(%rip), %rdx     # 0x7acef
callq 0x696a0
cmpq $0x0, %rax
je 0x57349
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
orl $0x80, %ecx
movl %ecx, 0x8(%rax)
jmp 0x573fb
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x248d7(%rip), %rdx     # 0x7bc2f
callq 0x696a0
cmpq $0x0, %rax
jne 0x5737d
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x248cf(%rip), %rdx     # 0x7bc41
callq 0x696a0
cmpq $0x0, %rax
je 0x573f9
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x248c1(%rip), %rdx     # 0x7bc55
callq 0x696a0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x538b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x19288(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x25053(%rip), %rdx     # 0x7c41d
callq 0x696a0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x538b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x19290(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x8(%rax)
jmp 0x573fb
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x2230e(%rip), %rdx     # 0x79718
callq 0x696a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x57492
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x57475
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x1, %rsi
callq 0x538b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x191a8(%rax)
movq -0x10(%rbp), %rax
movq 0x191a8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x191a8(%rax), %rdi
callq 0x3100
movq %rax, %rcx
movq -0x50(%rbp), %rax
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
jmp 0x57490
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x538b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x191a8(%rax)
jmp 0x57492
jmp 0x578b8
movq -0x18(%rbp), %rdi
leaq 0x23a25(%rip), %rsi     # 0x7aec7
callq 0x4ff40
cmpl $0x0, %eax
jne 0x574d1
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x3350
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x6118(%rax)
jmp 0x578b6
movq -0x18(%rbp), %rdi
leaq 0x24782(%rip), %rsi     # 0x7bc5e
callq 0x4ff40
cmpl $0x0, %eax
jne 0x5752f
movq -0x20(%rbp), %rdi
leaq 0x2477e(%rip), %rsi     # 0x7bc6f
callq 0x4ff40
cmpl $0x0, %eax
jne 0x57507
movl $0x1f, -0x4(%rbp)
jmp 0x578c1
movq -0x20(%rbp), %rdi
leaq 0x24765(%rip), %rsi     # 0x7bc77
callq 0x4ff40
cmpl $0x0, %eax
jne 0x57528
movl $0x1f, -0x4(%rbp)
jmp 0x578c1
jmp 0x5752a
jmp 0x578b4
movq -0x18(%rbp), %rdi
leaq 0x2373d(%rip), %rsi     # 0x7ac77
callq 0x4ff40
cmpl $0x0, %eax
jne 0x57578
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
andl $-0x4, %ecx
movl %ecx, 0x8(%rax)
movq -0x20(%rbp), %rdi
leaq 0x23963(%rip), %rsi     # 0x7aebf
callq 0x4ff40
cmpl $0x0, %eax
jne 0x57573
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
orl $0x3, %ecx
movl %ecx, 0x8(%rax)
jmp 0x578b2
movq -0x18(%rbp), %rdi
leaq 0x23953(%rip), %rsi     # 0x7aed6
callq 0x4ff40
cmpl $0x0, %eax
jne 0x575ea
movq -0x20(%rbp), %rdi
leaq 0x23949(%rip), %rsi     # 0x7aee1
callq 0x4ff40
cmpl $0x0, %eax
jne 0x575c1
movq -0x10(%rbp), %rax
movswl 0x191cc(%rax), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x191cc(%rax)
jmp 0x575e5
movq -0x20(%rbp), %rdi
leaq 0x23920(%rip), %rsi     # 0x7aeec
callq 0x4ff40
cmpl $0x0, %eax
jne 0x575e3
movq -0x10(%rbp), %rax
movw $0x0, 0x191cc(%rax)
jmp 0x575e5
jmp 0x578b0
movq -0x18(%rbp), %rdi
leaq 0x24757(%rip), %rsi     # 0x7bd4c
callq 0x4ff40
cmpl $0x0, %eax
jne 0x576bf
movq -0x20(%rbp), %rdi
leaq 0x2466e(%rip), %rsi     # 0x7bc7c
callq 0x4ff40
cmpl $0x0, %eax
jne 0x576ba
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x6, %rsi
movq -0x10(%rbp), %rdx
addq $0x16538, %rdx          # imm = 0x16538
movl $0x3ff, %ecx            # imm = 0x3FF
leaq -0x2c(%rbp), %r8
callq 0x6c100
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb $0x0, 0x16538(%rax,%rcx)
movq -0x10(%rbp), %rdi
addq $0x16538, %rdi          # imm = 0x16538
movl $0x3a, %esi
callq 0x3130
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x576b8
movq -0x38(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x16538, %rsi          # imm = 0x16538
callq 0x538b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x5f58(%rax)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x1, %rsi
callq 0x538b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x5f60(%rax)
jmp 0x576ba
jmp 0x578ae
movq -0x18(%rbp), %rdi
leaq 0x245ba(%rip), %rsi     # 0x7bc84
callq 0x4ff40
cmpl $0x0, %eax
jne 0x57713
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x6, %rsi
leaq 0x245a6(%rip), %rdx     # 0x7bc95
callq 0x696a0
movq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x538b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x191b0(%rax)
jmp 0x578ac
movq -0x18(%rbp), %rdi
leaq 0x2457d(%rip), %rsi     # 0x7bc9b
callq 0x4ff40
cmpl $0x0, %eax
jne 0x577ac
movq -0x20(%rbp), %rdi
leaq 0x2456b(%rip), %rsi     # 0x7bca2
callq 0x4ff40
cmpl $0x0, %eax
jne 0x577a7
movq -0x10(%rbp), %rax
movq 0x5f98(%rax), %rax
movq -0x10(%rbp), %rdi
leaq 0x24558(%rip), %rsi     # 0x7bcaf
xorl %ecx, %ecx
movl %ecx, %edx
callq *%rax
movq -0x10(%rbp), %rcx
movl %eax, 0x19214(%rcx)
cmpl $0x0, %eax
jne 0x57793
movq -0x10(%rbp), %rax
movq 0x5f98(%rax), %rax
movq -0x10(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
movq %rdx, %rsi
callq *%rax
movq -0x10(%rbp), %rcx
movl %eax, 0x19214(%rcx)
cmpl $0x0, %eax
je 0x577a5
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x578c1
jmp 0x577a7
jmp 0x578aa
movq -0x18(%rbp), %rdi
leaq 0x2450e(%rip), %rsi     # 0x7bcc5
callq 0x4ff40
cmpl $0x0, %eax
jne 0x57839
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x5781c
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x1, %rsi
callq 0x538b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x191a8(%rax)
movq -0x10(%rbp), %rax
movq 0x191a8(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x191a8(%rax), %rdi
callq 0x3100
movq %rax, %rcx
movq -0x60(%rbp), %rax
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
jmp 0x57837
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x538b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x191a8(%rax)
jmp 0x578a8
movq -0x18(%rbp), %rdi
leaq 0x233ed(%rip), %rsi     # 0x7ac31
callq 0x4ff40
cmpl $0x0, %eax
jne 0x57874
movq -0x10(%rbp), %rdi
addq $0x185a8, %rdi          # imm = 0x185A8
movq -0x20(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x3070
movq -0x10(%rbp), %rax
movb $0x0, 0x189a7(%rax)
jmp 0x578a6
movq -0x18(%rbp), %rdi
leaq 0x24451(%rip), %rsi     # 0x7bcd0
callq 0x4ff40
cmpl $0x0, %eax
jne 0x578a4
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x538b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x19208(%rax)
jmp 0x578a6
jmp 0x578a8
jmp 0x578aa
jmp 0x578ac
jmp 0x578ae
jmp 0x578b0
jmp 0x578b2
jmp 0x578b4
jmp 0x578b6
jmp 0x578b8
jmp 0x578ba
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)