// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x6dd5d
movq -0x10(%rbp), %rax
cmpl $0x6, 0x19214(%rax)
je 0x6dd5b
movq -0x10(%rbp), %rax
cmpl $0x3, 0x19214(%rax)
jne 0x6dd49
movq -0x10(%rbp), %rax
cmpl $0x2, 0x6108(%rax)
je 0x6dd5b
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x6df18
jmp 0x6dd5d
movq -0x10(%rbp), %rax
movl $0x0, 0x19214(%rax)
movq -0x10(%rbp), %rdi
callq 0x3d20
cmpl $0x0, %eax
je 0x6de03
cmpl $0x0, -0x14(%rbp)
je 0x6ddb7
movq -0x10(%rbp), %rax
cmpl $0x3, 0x19214(%rax)
jne 0x6ddb7
movq -0x10(%rbp), %rax
cmpl $0x2, 0x6108(%rax)
jne 0x6ddb7
movq -0x10(%rbp), %rax
movl $0x0, 0x19214(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x6df18
movq -0x10(%rbp), %rax
movswl 0x2(%rax), %edx
leaq 0xd13c(%rip), %rax      # 0x7af02
leaq 0xd125(%rip), %rcx      # 0x7aef2
cmpl $0x2, %edx
cmoveq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3dd0
movq -0x28(%rbp), %rcx
movq %rcx, (%rax)
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x19214(%rax)
movq -0x10(%rbp), %rdi
callq 0x6ce90
jmp 0x6def6
movq -0x10(%rbp), %rdi
callq 0x3dd0
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0xd6f9(%rip), %rdx      # 0x7b51b
callq 0x55510
cmpl $0x0, %eax
je 0x6de45
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0xd6f0(%rip), %rdx      # 0x7b52b
callq 0x55510
cmpl $0x0, %eax
jne 0x6de51
movl $0x2, -0x18(%rbp)
jmp 0x6dedd
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0xd0a2(%rip), %rdx      # 0x7af02
callq 0x55510
cmpl $0x0, %eax
je 0x6de83
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0xd079(%rip), %rdx      # 0x7aef2
callq 0x55510
cmpl $0x0, %eax
jne 0x6de8c
movl $0x1, -0x18(%rbp)
jmp 0x6dedb
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0xd0f2(%rip), %rdx      # 0x7af8d
callq 0x55510
cmpl $0x0, %eax
jne 0x6deae
movl $0x8, -0x18(%rbp)
jmp 0x6ded9
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0xd12a(%rip), %rdx      # 0x7afe7
callq 0x55510
cmpl $0x0, %eax
jne 0x6ded0
movl $0x27, -0x18(%rbp)
jmp 0x6ded7
movl $0xc, -0x18(%rbp)
jmp 0x6ded9
jmp 0x6dedb
jmp 0x6dedd
movq -0x10(%rbp), %rdi
callq 0x6b690
cmpl $0x0, %eax
jne 0x6def4
movq -0x10(%rbp), %rdi
callq 0x6b4e0
jmp 0x6def6
movq -0x10(%rbp), %rdi
callq 0x5d870
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x19214(%rax)
movq -0x10(%rbp), %rdi
callq 0x55cf0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)