// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x1f274(%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0x3e8, -0x14(%rbp)     # imm = 0x3E8
jne 0x33ec3
movq -0x10(%rbp), %rdi
callq 0x1de40
movl %eax, -0x4(%rbp)
jmp 0x340f0
movq -0x10(%rbp), %rax
movw $0x0, 0x1f22c(%rax)
movq -0x10(%rbp), %rdi
callq 0x35ed0
movq -0x10(%rbp), %rax
cmpl $0xc8, 0x1f274(%rax)
jge 0x33f05
movq -0x10(%rbp), %rax
cmpl $0xc, 0x1f274(%rax)
je 0x33f05
movq -0x10(%rbp), %rax
movq $0x0, 0xbf30(%rax)
cmpl $-0x1, -0x14(%rbp)
jne 0x33f27
movq -0x10(%rbp), %rax
cmpl $0x0, 0x50(%rax)
jne 0x340d7
movq -0x10(%rbp), %rax
cmpl $0x0, 0x54(%rax)
jne 0x340d7
movl $0x1, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xc038(%rax)
je 0x33f5b
movq -0x10(%rbp), %rax
movq 0xc038(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
cmpl $0x0, %eax
je 0x33f5b
movl $0x0, -0x18(%rbp)
jmp 0x33fd8
movq -0x10(%rbp), %rax
cmpl $-0x1, 0xc134(%rax)
je 0x33fd6
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xc134(%rax), %esi
movl $0x3, %edx
xorl %ecx, %ecx
callq 0x1e0d0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0x33fd4
movl -0x18(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x33fcb
movl -0x18(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x33fd2
movq -0x10(%rbp), %rax
movl 0xc134(%rax), %edi
movq -0x10(%rbp), %rsi
addq $0x1c598, %rsi          # imm = 0x1C598
movl $0x1, %edx
movl $0x2, %ecx
callq 0x3040
cmpq $0x0, %rax
jge 0x33fd2
movl $0x0, -0x18(%rbp)
jmp 0x33fd4
jmp 0x33fd6
jmp 0x33fd8
cmpl $0x0, -0x18(%rbp)
jle 0x340d5
movq -0x10(%rbp), %rax
movl $0x0, 0x1f274(%rax)
movq -0x10(%rbp), %rdi
callq 0x3770
movq -0x10(%rbp), %rdi
callq 0x42c0
movq -0x10(%rbp), %rdi
callq 0x23720
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x34050
movq -0x10(%rbp), %rdi
callq 0x343b0
movq -0x10(%rbp), %rdi
callq 0x3840
movq -0x10(%rbp), %rdi
callq 0x349c0
movq -0x10(%rbp), %rdi
callq 0x43b0
movq -0x10(%rbp), %rdi
callq 0x34a60
movq -0x10(%rbp), %rdi
callq 0x345e0
movq -0x10(%rbp), %rdi
callq 0x23d10
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x22910
cmpl $0x0, %eax
jne 0x340be
movq -0x10(%rbp), %rdi
callq 0x343b0
cmpl $0x0, %eax
jne 0x340be
movq -0x10(%rbp), %rdi
callq 0x3840
cmpl $0x0, %eax
jne 0x340be
movq -0x10(%rbp), %rdi
callq 0x349c0
cmpl $0x0, %eax
jne 0x340be
movq -0x10(%rbp), %rdi
callq 0x43b0
cmpl $0x0, %eax
jne 0x340be
movq -0x10(%rbp), %rdi
callq 0x34a60
cmpl $0x0, %eax
jne 0x340be
movq -0x10(%rbp), %rdi
callq 0x345e0
cmpl $0x0, %eax
je 0x340cc
movq -0x10(%rbp), %rdi
callq 0x1de40
movl %eax, -0x4(%rbp)
jmp 0x340f0
movq -0x10(%rbp), %rdi
callq 0x257a0
jmp 0x340d7
movl -0x14(%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 $0x20, %rsp
popq %rbp
retq
nopl (%rax)