// File: /workspace/github_c_makefile_star2_O2/hkshenSmart[P]ONVIF-discovery_cs/stdsoap2.c
// Function: soap_send_fault
SOAP_FMAC2
soap_send_fault(struct soap *soap)
{ register int status = soap->error;
  if (status == SOAP_STOP)
    return soap_closesock(soap);
  DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Sending back fault struct for error code %d\n", soap->error));
  soap->keep_alive = 0; /* to terminate connection */
  soap_set_fault(soap);
  if (soap->error < 200 && soap->error != SOAP_FAULT)
    soap->header = NULL;
  if (status != SOAP_EOF || (!soap->recv_timeout && !soap->send_timeout))
  { int r = 1;
#ifndef WITH_NOIO
    if (soap->fpoll && soap->fpoll(soap))
      r = 0;
#ifndef WITH_LEAN
    else if (soap_valid_socket(soap->socket))
    { r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_SND, 0);
      if (r > 0)
      { if (!(r & SOAP_TCP_SELECT_SND)
         || ((r & SOAP_TCP_SELECT_RCV)
          && recv(soap->socket, soap->tmpbuf, 1, MSG_PEEK) < 0))
          r = 0;
      }
    }
#endif
#endif
    if (r > 0)
    { soap->error = SOAP_OK;
      soap_serializeheader(soap);
      soap_serializefault(soap);
      soap_begin_count(soap);
      if (soap->mode & SOAP_IO_LENGTH)
      { soap_envelope_begin_out(soap);
        soap_putheader(soap);
        soap_body_begin_out(soap);
        soap_putfault(soap);
        soap_body_end_out(soap);
        soap_envelope_end_out(soap);
      }
      soap_end_count(soap);
      if (soap_response(soap, status)
       || soap_envelope_begin_out(soap)
       || soap_putheader(soap)
       || soap_body_begin_out(soap)
       || soap_putfault(soap)
       || soap_body_end_out(soap)
       || soap_envelope_end_out(soap))
        return soap_closesock(soap);
      soap_end_send(soap);
    }
  }
  soap->error = status;
  return soap_closesock(soap);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x1f274(%rdi), %ebp
cmpl $0x3e8, %ebp            # imm = 0x3E8
je 0x1fdf4
andw $0x0, 0x1f22c(%rbx)
movq %rbx, %rdi
callq 0x20f9f
movl 0x1f274(%rbx), %eax
cmpl $0xc8, %eax
setge %cl
cmpl $0xc, %eax
sete %al
orb %cl, %al
jne 0x1fcb0
andq $0x0, 0xbf30(%rbx)
cmpl $-0x1, %ebp
je 0x1fdde
movq 0xc038(%rbx), %rax
testq %rax, %rax
je 0x1fcd2
movq %rbx, %rdi
callq *%rax
testl %eax, %eax
jne 0x1fdee
movl 0xc134(%rbx), %esi
cmpl $-0x1, %esi
je 0x1fd21
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x137d1
testl %eax, %eax
setle %cl
testb $0x2, %al
sete %dl
orb %cl, %dl
jne 0x1fdee
testb $0x1, %al
je 0x1fd21
movl 0xc134(%rbx), %edi
leaq 0x1c598(%rbx), %rsi
pushq $0x1
popq %rdx
pushq $0x2
popq %rcx
callq 0x3040
testq %rax, %rax
js 0x1fdee
andl $0x0, 0x1f274(%rbx)
movq %rbx, %rdi
callq 0x36a0
movq %rbx, %rdi
callq 0x3e62
movq %rbx, %rdi
callq 0x16555
testb $0x8, 0x4(%rbx)
je 0x1fd76
movq %rbx, %rdi
callq 0x20004
movq %rbx, %rdi
callq 0x3712
movq %rbx, %rdi
callq 0x20373
movq %rbx, %rdi
callq 0x3eec
movq %rbx, %rdi
callq 0x203cf
movq %rbx, %rdi
callq 0x20142
movq %rbx, %rdi
callq 0x16898
movq %rbx, %rdi
movl %ebp, %esi
callq 0x15e71
testl %eax, %eax
jne 0x1fdf4
movq %rbx, %rdi
callq 0x20004
testl %eax, %eax
jne 0x1fdf4
movq %rbx, %rdi
callq 0x3712
testl %eax, %eax
jne 0x1fdf4
movq %rbx, %rdi
callq 0x20373
testl %eax, %eax
jne 0x1fdf4
movq %rbx, %rdi
callq 0x3eec
testl %eax, %eax
jne 0x1fdf4
movq %rbx, %rdi
callq 0x203cf
testl %eax, %eax
jne 0x1fdf4
movq %rbx, %rdi
callq 0x20142
testl %eax, %eax
jne 0x1fdf4
movq %rbx, %rdi
callq 0x1773a
jmp 0x1fdee
cmpl $0x0, 0x50(%rbx)
jne 0x1fdee
cmpl $0x0, 0x54(%rbx)
je 0x1fcb9
movl %ebp, 0x1f274(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x13665