// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl 0x19214(%rdi), %r15d
testl %esi, %esi
setne %al
cmpl $0x6, %r15d
sete %cl
orb %al, %cl
je 0x4a77c
movl $0x0, 0x19214(%rbx)
movq %rbx, %rdi
callq 0x391f
testl %eax, %eax
je 0x4a7d6
testl %ebp, %ebp
je 0x4a792
cmpl $0x3, 0x19214(%rbx)
jne 0x4a792
cmpl $0x2, 0x6108(%rbx)
jne 0x4a792
movl $0x0, 0x19214(%rbx)
xorl %eax, %eax
jmp 0x4a7cb
cmpl $0x3, %r15d
jne 0x4a7c8
movl $0x3, %eax
cmpl $0x2, 0x6108(%rbx)
je 0x4a742
jmp 0x4a7cb
cmpw $0x2, 0x2(%rbx)
leaq 0x83ad(%rip), %rax      # 0x52b4b
leaq 0x83b6(%rip), %r14      # 0x52b5b
cmoveq %rax, %r14
movq %rbx, %rdi
callq 0x397c
movq %r14, (%rax)
movl %r15d, 0x19214(%rbx)
movq %rbx, %rdi
callq 0x49fec
jmp 0x4a8d4
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x397c
movq (%rax), %r14
leaq 0x898c(%rip), %rdx      # 0x53174
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3b608
movl $0x2, %r15d
testl %eax, %eax
je 0x4a88a
leaq 0x897c(%rip), %rdx      # 0x53184
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3b608
testl %eax, %eax
je 0x4a88a
leaq 0x833d(%rip), %rdx      # 0x52b5b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3b608
movl $0x1, %r15d
testl %eax, %eax
je 0x4a88a
leaq 0x8311(%rip), %rdx      # 0x52b4b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3b608
testl %eax, %eax
je 0x4a88a
leaq 0x8396(%rip), %rdx      # 0x52be6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3b608
testl %eax, %eax
je 0x4a884
leaq 0x83da(%rip), %rdx      # 0x52c40
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3b608
testl %eax, %eax
movl $0x27, %eax
movl $0xc, %r15d
cmovel %eax, %r15d
jmp 0x4a88a
movl $0x8, %r15d
cmpw $0x5, 0x18590(%rbx)
jne 0x4a8a0
movl $0x0, 0x19214(%rbx)
jmp 0x4a8bc
movw $0x7, 0x18590(%rbx)
leaq 0x81bd(%rip), %rsi      # 0x52a6d
movq %rbx, %rdi
callq 0x3a563
testl %eax, %eax
jne 0x4a8d4
movw $0x8, 0x18590(%rbx)
leaq 0x818f(%rip), %rsi      # 0x52a5b
movq %rbx, %rdi
callq 0x3a563
movq %rbx, %rdi
callq 0x406e7
movl %r15d, 0x19214(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3baf5