// File: /workspace/github_c_makefile_star2_O2/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 0x42f99
testl %eax, %eax
jne 0x43540
movzbl (%r14), %eax
testl %eax, %eax
je 0x4349d
cmpl $0x2d, %eax
jne 0x43549
cmpb $0x2d, 0x16139(%rbx)
jne 0x43549
movq %r14, %rdi
callq 0x3110
addq %rbx, %rax
addq $0x16139, %rax          # imm = 0x16139
cmpb $0x21, -0x2(%rax)
leaq -0x1(%rax), %rax
jb 0x434e0
movb $0x0, (%rax)
movq 0x19288(%rbx), %rsi
leaq 0x1613a(%rbx), %rax
testq %rsi, %rsi
je 0x4351a
movq %rax, %rdi
callq 0x3210
testl %eax, %eax
je 0x4352c
movl $0x24, 0x19214(%rbx)
pushq $0x24
jmp 0x43574
movq %rbx, %rdi
movq %rax, %rsi
callq 0x37284
movq %rax, 0x19288(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x42f99
testl %eax, %eax
je 0x43549
movl 0x19214(%rbx), %r15d
jmp 0x43576
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 0x436d2
testl %eax, %eax
je 0x43588
movl $0x14, 0x19214(%rbx)
pushq $0x14
popq %r15
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x192a8(%rbx), %r12
pushq $0x3a
popq %rbp
xorl %r15d, %r15d
cmpb $0x0, (%r14)
je 0x43576
movq %r14, %rdi
movl %ebp, %esi
callq 0x3130
testq %rax, %rax
je 0x43691
movq %rax, %r13
movb $0x0, (%rax)
movb 0x1(%r13), %al
incq %r13
testb %al, %al
je 0x435c3
cmpb $0x21, %al
jl 0x435b4
movq %r14, %rdi
leaq 0xa2aa(%rip), %rsi      # 0x4d877
callq 0x3507f
testl %eax, %eax
je 0x43655
movq %r14, %rdi
leaq 0xa2a2(%rip), %rsi      # 0x4d882
callq 0x3507f
testl %eax, %eax
je 0x4365d
movq %r14, %rdi
leaq 0xa2a0(%rip), %rsi      # 0x4d893
callq 0x3507f
testl %eax, %eax
je 0x4366f
movq %r14, %rdi
leaq 0xa2a1(%rip), %rsi      # 0x4d8a7
callq 0x3507f
testl %eax, %eax
je 0x436ae
movq %r14, %rdi
leaq 0xa297(%rip), %rsi      # 0x4d8b4
callq 0x3507f
testl %eax, %eax
je 0x436c0
movq %r14, %rdi
leaq 0xa294(%rip), %rsi      # 0x4d8c8
callq 0x3507f
testl %eax, %eax
jne 0x43691
leaq 0x2be4c(%rip), %rdi     # 0x6f490
movq %r13, %rsi
xorl %edx, %edx
callq 0x35041
movl %eax, 0x30(%r12)
jmp 0x43691
movq %rbx, %rdi
movq %r13, %rsi
jmp 0x43687
movq %rbx, %rdi
movq %r13, %rsi
callq 0x37284
movq %rax, 0x38(%r12)
jmp 0x43691
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x8f87(%rip), %rdx      # 0x4c603
callq 0x43766
movq %rbx, %rdi
movq %rax, %rsi
callq 0x37284
movq %rax, 0x18(%r12)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x42f99
testl %eax, %eax
je 0x43595
jmp 0x43540
movq %rbx, %rdi
movq %r13, %rsi
callq 0x37284
movq %rax, 0x20(%r12)
jmp 0x43691
movq %rbx, %rdi
movq %r13, %rsi
callq 0x37284
movq %rax, 0x40(%r12)
jmp 0x43691