// File: /workspace/github_c_makefile_star2_O1/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 0x47c35
testl %eax, %eax
jne 0x48234
movzbl (%r14), %eax
testl %eax, %eax
je 0x481b1
cmpl $0x2d, %eax
jne 0x4823f
cmpb $0x2d, 0x16139(%rbx)
jne 0x4823f
movq %r14, %rdi
callq 0x3110
addq %rbx, %rax
addq $0x16139, %rax          # imm = 0x16139
cmpb $0x21, -0x2(%rax)
leaq -0x1(%rax), %rax
jb 0x481ec
movb $0x0, (%rax)
movq 0x19288(%rbx), %rsi
leaq 0x1613a(%rbx), %rax
testq %rsi, %rsi
je 0x48417
movq %rax, %rdi
callq 0x3200
testl %eax, %eax
je 0x48429
movl $0x24, 0x19214(%rbx)
movl $0x24, %ebp
jmp 0x48443
movl 0x19214(%rbx), %ebp
jmp 0x48451
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 0x48462
testl %eax, %eax
je 0x48272
movl $0x14, 0x19214(%rbx)
movl $0x14, %ebp
jmp 0x48451
movq 0x192a8(%rbx), %r12
leaq 0xa5f7(%rip), %r15      # 0x52877
cmpb $0x0, (%r14)
je 0x48369
movq %r14, %rdi
movl $0x3a, %esi
callq 0x3130
testq %rax, %rax
je 0x483ac
movq %rax, %r13
movb $0x0, (%rax)
movb 0x1(%r13), %al
incq %r13
testb %al, %al
je 0x482b5
cmpb $0x21, %al
jl 0x482a6
movq %r14, %rdi
movq %r15, %rsi
callq 0x3806c
testl %eax, %eax
je 0x48370
movq %r14, %rdi
leaq 0xa5b0(%rip), %rsi      # 0x52882
callq 0x3806c
testl %eax, %eax
je 0x48378
movq %r14, %rdi
leaq 0xa5aa(%rip), %rsi      # 0x52893
callq 0x3806c
testl %eax, %eax
je 0x4838a
movq %r14, %rdi
leaq 0xa5a7(%rip), %rsi      # 0x528a7
callq 0x3806c
testl %eax, %eax
je 0x483d9
movq %r14, %rdi
leaq 0xa59d(%rip), %rsi      # 0x528b4
callq 0x3806c
testl %eax, %eax
je 0x483eb
movq %r14, %rdi
leaq 0xa59a(%rip), %rsi      # 0x528c8
callq 0x3806c
testl %eax, %eax
jne 0x483ac
leaq 0xb495(%rip), %rsi      # 0x537d3
leaq 0x2914b(%rip), %r15     # 0x71490
movq %r13, %rdi
callq 0x3806c
testl %eax, %eax
je 0x483fd
movq 0x18(%r15), %rsi
addq $0x10, %r15
testq %rsi, %rsi
jne 0x48345
xorl %eax, %eax
jmp 0x48400
movl $0x6, %eax
jmp 0x483cf
movq %rbx, %rdi
movq %r13, %rsi
jmp 0x483a2
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3a567
movq %rax, 0x38(%r12)
jmp 0x483ac
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x926c(%rip), %rdx      # 0x51603
callq 0x484f8
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3a567
movq %rax, 0x18(%r12)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x47c35
testl %eax, %eax
je 0x483cd
movl 0x19214(%rbx), %ebp
movl $0x1, %eax
jmp 0x483cf
xorl %eax, %eax
testl %eax, %eax
je 0x48280
jmp 0x4840e
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3a567
movq %rax, 0x20(%r12)
jmp 0x483ac
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3a567
movq %rax, 0x40(%r12)
jmp 0x483ac
movl (%r15), %eax
movl %eax, 0x30(%r12)
leaq 0xa46b(%rip), %r15      # 0x52877
jmp 0x483ac
cmpl $0x6, %eax
jne 0x48451
xorl %ebp, %ebp
jmp 0x48451
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3a567
movq %rax, 0x19288(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x47c35
testl %eax, %eax
je 0x48447
movl 0x19214(%rbx), %ebp
xorl %eax, %eax
jmp 0x48449
movb $0x1, %al
testb %al, %al
jne 0x4823f
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq