// File: /workspace/github_c_makefile_star2_O2/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_recv_fault
SOAP_FMAC2
soap_recv_fault(struct soap *soap, int check)
{ register int status = soap->error;
  DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Check if receiving SOAP Fault\n"));
  if (!check)
  { /* try getfault when no tag or tag mismatched at level 2, otherwise ret */
    if (soap->error != SOAP_NO_TAG
     && (soap->error != SOAP_TAG_MISMATCH || soap->level != 2))
      return soap->error;
  }
  soap->error = SOAP_OK;
  if (soap_getfault(soap))
  { /* check flag set: check if SOAP Fault is present, if not just return */
    if (check && soap->error == SOAP_TAG_MISMATCH && soap->level == 2)
      return soap->error = SOAP_OK;
    DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Error: soap_get_soapfault() failed. Is this a SOAP message at all?\n"));
    *soap_faultcode(soap) = (soap->version == 2 ? "SOAP-ENV:Sender" : "SOAP-ENV:Client");
    soap->error = status;
    soap_set_fault(soap);
  }
  else
  { register const char *s = *soap_faultcode(soap);
    if (!soap_match_tag(soap, s, "SOAP-ENV:Server") || !soap_match_tag(soap, s, "SOAP-ENV:Receiver"))
      status = SOAP_SVR_FAULT; 
    else if (!soap_match_tag(soap, s, "SOAP-ENV:Client") || !soap_match_tag(soap, s, "SOAP-ENV:Sender"))
      status = SOAP_CLI_FAULT;
    else if (!soap_match_tag(soap, s, "SOAP-ENV:MustUnderstand"))
      status = SOAP_MUSTUNDERSTAND;
    else if (!soap_match_tag(soap, s, "SOAP-ENV:VersionMismatch"))
      status = SOAP_VERSIONMISMATCH;
    else
    { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Received SOAP Fault code %s\n", s));
      status = SOAP_FAULT;
    }
    if (!soap_body_end_in(soap))
      soap_envelope_end_in(soap);
  }
  soap_end_recv(soap);
  soap->error = status;
  return soap_closesock(soap);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movl 0x19214(%rdi), %ebp
testl %esi, %esi
setne %al
cmpl $0x6, %ebp
sete %cl
orb %al, %cl
je 0x45df2
andl $0x0, 0x19214(%rbx)
movq %rbx, %rdi
callq 0x38f7
testl %eax, %eax
je 0x45e3f
testl %r14d, %r14d
je 0x45e0a
cmpl $0x3, 0x19214(%rbx)
jne 0x45e0a
cmpl $0x2, 0x6108(%rbx)
jne 0x45e0a
andl $0x0, 0x19214(%rbx)
xorl %ebp, %ebp
jmp 0x45e03
cmpl $0x3, %ebp
jne 0x45e03
cmpl $0x2, 0x6108(%rbx)
je 0x45dbd
pushq $0x3
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
cmpw $0x2, 0x2(%rbx)
leaq 0x7d35(%rip), %rax      # 0x4db4b
leaq 0x7d3e(%rip), %r14      # 0x4db5b
cmoveq %rax, %r14
movq %rbx, %rdi
callq 0x3954
movq %r14, (%rax)
movl %ebp, 0x19214(%rbx)
movq %rbx, %rdi
callq 0x456ad
jmp 0x45ef4
movq %rbx, %rdi
callq 0x3954
movq (%rax), %r14
leaq 0x8323(%rip), %rdx      # 0x4e174
movq %rbx, %rdi
movq %r14, %rsi
callq 0x380f0
pushq $0x2
popq %rbp
testl %eax, %eax
je 0x45ee0
leaq 0x831a(%rip), %rdx      # 0x4e184
movq %rbx, %rdi
movq %r14, %rsi
callq 0x380f0
testl %eax, %eax
je 0x45ee0
leaq 0x7cdb(%rip), %rdx      # 0x4db5b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x380f0
pushq $0x1
popq %rbp
testl %eax, %eax
je 0x45ee0
leaq 0x7cb2(%rip), %rdx      # 0x4db4b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x380f0
testl %eax, %eax
je 0x45ee0
leaq 0x7d37(%rip), %rdx      # 0x4dbe6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x380f0
testl %eax, %eax
je 0x45edd
leaq 0x7d7b(%rip), %rdx      # 0x4dc40
movq %rbx, %rdi
movq %r14, %rsi
callq 0x380f0
testl %eax, %eax
pushq $0x27
popq %rax
pushq $0xc
popq %rbp
cmovel %eax, %ebp
jmp 0x45ee0
pushq $0x8
popq %rbp
movq %rbx, %rdi
callq 0x448d1
testl %eax, %eax
jne 0x45ef4
movq %rbx, %rdi
callq 0x447de
movq %rbx, %rdi
callq 0x3c8c4
movl %ebp, 0x19214(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x3858f