// File: /workspace/github_c_makefile_star2_O3/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_getmimehdr
SOAP_FMAC2
soap_getmimehdr(struct soap *soap)
{ struct soap_multipart *content;
  do
  { if (soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf)))
      return soap->error;
  }
  while (!*soap->msgbuf);
  if (soap->msgbuf[0] == '-' && soap->msgbuf[1] == '-')
  { char *s = soap->msgbuf + strlen(soap->msgbuf) - 1;
    /* remove white space */
    while (soap_blank(*s))
      s--;
    s[1] = '\0';
    if (soap->mime.boundary)
    { if (strcmp(soap->msgbuf + 2, soap->mime.boundary))
        return soap->error = SOAP_MIME_ERROR;
    }
    else
      soap->mime.boundary = soap_strdup(soap, soap->msgbuf + 2);
    if (soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf)))
      return soap->error;
  }
  if (soap_set_mime_attachment(soap, NULL, 0, SOAP_MIME_NONE, NULL, NULL, NULL, NULL))
    return soap->error = SOAP_EOM;
  content = soap->mime.last;
  for (;;)
  { register char *key = soap->msgbuf;
    register char *val;
    if (!*key)
      break;
    DBGLOG(TEST,SOAP_MESSAGE(fdebug, "MIME header: %s\n", key));
    val = strchr(soap->msgbuf, ':');
    if (val)
    { *val = '\0';
      do val++;
      while (*val && *val <= 32);
      if (!soap_tag_cmp(key, "Content-ID"))
        content->id = soap_strdup(soap, val);
      else if (!soap_tag_cmp(key, "Content-Location"))
        content->location = soap_strdup(soap, val);
      else if (!soap_tag_cmp(key, "Content-Disposition"))
        content->id = soap_strdup(soap, soap_get_header_attribute(soap, val, "name"));
      else if (!soap_tag_cmp(key, "Content-Type"))
        content->type = soap_strdup(soap, val);
      else if (!soap_tag_cmp(key, "Content-Description"))
        content->description = soap_strdup(soap, val);
      else if (!soap_tag_cmp(key, "Content-Transfer-Encoding"))
        content->encoding = (enum soap_mime_encoding)soap_code_int(mime_codes, val, (long)SOAP_MIME_NONE);
    }
    if (soap_getline(soap, key, sizeof(soap->msgbuf)))
      return soap->error;
  }
  return SOAP_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x16138(%rdi), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x475d7
testl %eax, %eax
jne 0x47be4
movzbl (%r14), %eax
testl %eax, %eax
je 0x47b37
cmpl $0x2d, %eax
jne 0x47bef
cmpb $0x2d, 0x16139(%rbx)
jne 0x47bef
movq %r14, %rdi
callq 0x3110
addq %rbx, %rax
addq $0x16139, %rax          # imm = 0x16139
cmpb $0x21, -0x2(%rax)
leaq -0x1(%rax), %rax
jb 0x47b7e
movb $0x0, (%rax)
movq 0x19288(%rbx), %rsi
leaq 0x1613a(%rbx), %rax
testq %rsi, %rsi
je 0x47bbe
movq %rax, %rdi
callq 0x3210
testl %eax, %eax
je 0x47bd0
movl $0x24, 0x19214(%rbx)
movl $0x24, %eax
jmp 0x47da5
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3a6c4
movq %rax, 0x19288(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x475d7
testl %eax, %eax
je 0x47bef
movl 0x19214(%rbx), %eax
jmp 0x47da5
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x47db4
testl %eax, %eax
je 0x47c22
movl $0x14, 0x19214(%rbx)
movl $0x14, %eax
jmp 0x47da5
movq 0x192a8(%rbx), %r13
leaq 0xac47(%rip), %r15      # 0x52877
leaq 0xac4b(%rip), %r12      # 0x52882
cmpb $0x0, (%r14)
je 0x47da3
movq %r14, %rdi
movl $0x3a, %esi
callq 0x3130
testq %rax, %rax
je 0x47d53
movq %rax, %rbp
movb $0x0, (%rax)
movb 0x1(%rbp), %al
incq %rbp
testb %al, %al
je 0x47c6b
cmpb $0x21, %al
jl 0x47c5d
movq %r14, %rdi
movq %r15, %rsi
callq 0x382f9
testl %eax, %eax
je 0x47d19
movq %r14, %rdi
movq %r12, %rsi
callq 0x382f9
testl %eax, %eax
je 0x47d21
movq %r14, %rdi
leaq 0xabf8(%rip), %rsi      # 0x52893
callq 0x382f9
testl %eax, %eax
je 0x47d32
movq %r14, %rdi
leaq 0xabf5(%rip), %rsi      # 0x528a7
callq 0x382f9
testl %eax, %eax
je 0x47d70
movq %r14, %rdi
leaq 0xabeb(%rip), %rsi      # 0x528b4
callq 0x382f9
testl %eax, %eax
je 0x47d81
movq %r14, %rdi
leaq 0xabe8(%rip), %rsi      # 0x528c8
callq 0x382f9
testl %eax, %eax
jne 0x47d53
leaq 0xbae3(%rip), %rsi      # 0x537d3
leaq 0x29799(%rip), %r12     # 0x71490
movq %rbp, %rdi
callq 0x382f9
testl %eax, %eax
je 0x47d92
movq 0x18(%r12), %rsi
addq $0x10, %r12
testq %rsi, %rsi
jne 0x47cf7
xorl %eax, %eax
jmp 0x47d96
movq %rbx, %rdi
movq %rbp, %rsi
jmp 0x47d4a
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3a6c4
movq %rax, 0x38(%r13)
jmp 0x47d53
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0x98c4(%rip), %rdx      # 0x51603
callq 0x47e4a
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3a6c4
movq %rax, 0x18(%r13)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x475d7
testl %eax, %eax
je 0x47c37
jmp 0x47be4
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3a6c4
movq %rax, 0x20(%r13)
jmp 0x47d53
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3a6c4
movq %rax, 0x40(%r13)
jmp 0x47d53
movl (%r12), %eax
movl %eax, 0x30(%r13)
leaq 0xaae1(%rip), %r12      # 0x52882
jmp 0x47d53
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq