// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl 0x1f274(%rax), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x36b2d
movq -0x10(%rbp), %rax
cmpl $0x6, 0x1f274(%rax)
je 0x36b2b
movq -0x10(%rbp), %rax
cmpl $0x3, 0x1f274(%rax)
jne 0x36b19
movq -0x10(%rbp), %rax
cmpl $0x2, 0xc168(%rax)
je 0x36b2b
movq -0x10(%rbp), %rax
movl 0x1f274(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x36ce8
jmp 0x36b2d
movq -0x10(%rbp), %rax
movl $0x0, 0x1f274(%rax)
movq -0x10(%rbp), %rdi
callq 0x44a0
cmpl $0x0, %eax
je 0x36bd3
cmpl $0x0, -0x14(%rbp)
je 0x36b87
movq -0x10(%rbp), %rax
cmpl $0x3, 0x1f274(%rax)
jne 0x36b87
movq -0x10(%rbp), %rax
cmpl $0x2, 0xc168(%rax)
jne 0x36b87
movq -0x10(%rbp), %rax
movl $0x0, 0x1f274(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x36ce8
movq -0x10(%rbp), %rax
movswl 0x2(%rax), %edx
leaq 0x32ba(%rip), %rax      # 0x39e50
leaq 0x32a3(%rip), %rcx      # 0x39e40
cmpl $0x2, %edx
cmoveq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4550
movq -0x28(%rbp), %rcx
movq %rcx, (%rax)
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1f274(%rax)
movq -0x10(%rbp), %rdi
callq 0x35ed0
jmp 0x36cc6
movq -0x10(%rbp), %rdi
callq 0x4550
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x3876(%rip), %rdx      # 0x3a468
callq 0x1d4c0
cmpl $0x0, %eax
je 0x36c15
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x386d(%rip), %rdx      # 0x3a478
callq 0x1d4c0
cmpl $0x0, %eax
jne 0x36c21
movl $0x2, -0x18(%rbp)
jmp 0x36cad
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x3220(%rip), %rdx      # 0x39e50
callq 0x1d4c0
cmpl $0x0, %eax
je 0x36c53
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x31f7(%rip), %rdx      # 0x39e40
callq 0x1d4c0
cmpl $0x0, %eax
jne 0x36c5c
movl $0x1, -0x18(%rbp)
jmp 0x36cab
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x3270(%rip), %rdx      # 0x39edb
callq 0x1d4c0
cmpl $0x0, %eax
jne 0x36c7e
movl $0x8, -0x18(%rbp)
jmp 0x36ca9
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x32a8(%rip), %rdx      # 0x39f35
callq 0x1d4c0
cmpl $0x0, %eax
jne 0x36ca0
movl $0x27, -0x18(%rbp)
jmp 0x36ca7
movl $0xc, -0x18(%rbp)
jmp 0x36ca9
jmp 0x36cab
jmp 0x36cad
movq -0x10(%rbp), %rdi
callq 0x34ab0
cmpl $0x0, %eax
jne 0x36cc4
movq -0x10(%rbp), %rdi
callq 0x34990
jmp 0x36cc6
movq -0x10(%rbp), %rdi
callq 0x26230
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1f274(%rax)
movq -0x10(%rbp), %rdi
callq 0x1de40
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)