// File: /workspace/github_c_makefile_star2_O1/hkshenSmart[P]ONVIF-discovery_cs/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 at level %u tag '%s'\n", soap->level, soap->tag));
    *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 0x1f274(%rdi), %ebp
testl %esi, %esi
setne %al
cmpl $0x6, %ebp
sete %cl
orb %al, %cl
je 0x24407
movl $0x0, 0x1f274(%rbx)
movq %rbx, %rdi
callq 0x3fe7
testl %eax, %eax
je 0x24451
testl %r14d, %r14d
je 0x2441c
cmpl $0x3, 0x1f274(%rbx)
jne 0x2441c
cmpl $0x2, 0xc168(%rbx)
jne 0x2441c
movl $0x0, 0x1f274(%rbx)
xorl %ebp, %ebp
jmp 0x24415
cmpl $0x3, %ebp
jne 0x24415
cmpl $0x2, 0xc168(%rbx)
je 0x243cc
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
cmpw $0x2, 0x2(%rbx)
leaq 0x25e3(%rip), %rax      # 0x26a0b
leaq 0x25ec(%rip), %r14      # 0x26a1b
cmoveq %rax, %r14
movq %rbx, %rdi
callq 0x4044
movq %r14, (%rax)
movl %ebp, 0x1f274(%rbx)
movq %rbx, %rdi
callq 0x23e58
jmp 0x2454a
movq %rbx, %rdi
callq 0x4044
movq (%rax), %r14
leaq 0x2bd0(%rip), %rdx      # 0x27033
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1432a
movl $0x2, %ebp
testl %eax, %eax
je 0x24500
leaq 0x2bc1(%rip), %rdx      # 0x27043
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1432a
testl %eax, %eax
je 0x24500
leaq 0x2583(%rip), %rdx      # 0x26a1b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1432a
movl $0x1, %ebp
testl %eax, %eax
je 0x24500
leaq 0x2558(%rip), %rdx      # 0x26a0b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1432a
testl %eax, %eax
je 0x24500
leaq 0x25dd(%rip), %rdx      # 0x26aa6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1432a
testl %eax, %eax
je 0x244fb
leaq 0x2621(%rip), %rdx      # 0x26b00
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1432a
testl %eax, %eax
movl $0x27, %eax
movl $0xc, %ebp
cmovel %eax, %ebp
jmp 0x24500
movl $0x8, %ebp
cmpw $0x5, 0x1e5f0(%rbx)
jne 0x24516
movl $0x0, 0x1f274(%rbx)
jmp 0x24532
movw $0x7, 0x1e5f0(%rbx)
leaq 0x23f7(%rip), %rsi      # 0x2691d
movq %rbx, %rdi
callq 0x131c3
testl %eax, %eax
jne 0x2454a
movw $0x8, 0x1e5f0(%rbx)
leaq 0x23c9(%rip), %rsi      # 0x2690b
movq %rbx, %rdi
callq 0x131c3
movq %rbx, %rdi
callq 0x19ad3
movl %ebp, 0x1f274(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1495d