// File: /workspace/github_c_makefile_star2_O0/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_send_fault
SOAP_FMAC2
soap_send_fault(struct soap *soap)
{ register int status = soap->error;
  if (status == SOAP_STOP)
    return status;
  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 0x19214(%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0x3e8, -0x14(%rbp)     # imm = 0x3E8
jne 0x6dabd
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6dcea
movq -0x10(%rbp), %rax
movw $0x0, 0x191cc(%rax)
movq -0x10(%rbp), %rdi
callq 0x6ce90
movq -0x10(%rbp), %rax
cmpl $0xc8, 0x19214(%rax)
jge 0x6daff
movq -0x10(%rbp), %rax
cmpl $0xc, 0x19214(%rax)
je 0x6daff
movq -0x10(%rbp), %rax
movq $0x0, 0x5f30(%rax)
cmpl $-0x1, -0x14(%rbp)
jne 0x6db21
movq -0x10(%rbp), %rax
cmpl $0x0, 0x50(%rax)
jne 0x6dcd1
movq -0x10(%rbp), %rax
cmpl $0x0, 0x54(%rax)
jne 0x6dcd1
movl $0x1, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x6010(%rax)
je 0x6db55
movq -0x10(%rbp), %rax
movq 0x6010(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
cmpl $0x0, %eax
je 0x6db55
movl $0x0, -0x18(%rbp)
jmp 0x6dbd2
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x60d4(%rax)
je 0x6dbd0
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x60d4(%rax), %esi
movl $0x3, %edx
xorl %ecx, %ecx
callq 0x59760
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0x6dbce
movl -0x18(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x6dbc5
movl -0x18(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x6dbcc
movq -0x10(%rbp), %rax
movl 0x60d4(%rax), %edi
movq -0x10(%rbp), %rsi
addq $0x16538, %rsi          # imm = 0x16538
movl $0x1, %edx
movl $0x2, %ecx
callq 0x3040
cmpq $0x0, %rax
jge 0x6dbcc
movl $0x0, -0x18(%rbp)
jmp 0x6dbce
jmp 0x6dbd0
jmp 0x6dbd2
cmpl $0x0, -0x18(%rbp)
jle 0x6dccf
movq -0x10(%rbp), %rax
movl $0x0, 0x19214(%rax)
movq -0x10(%rbp), %rdi
callq 0x3530
movq -0x10(%rbp), %rdi
callq 0x3b40
movq -0x10(%rbp), %rdi
callq 0x5aaa0
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x6dc4a
movq -0x10(%rbp), %rdi
callq 0x6ae90
movq -0x10(%rbp), %rdi
callq 0x3580
movq -0x10(%rbp), %rdi
callq 0x6b510
movq -0x10(%rbp), %rdi
callq 0x3c30
movq -0x10(%rbp), %rdi
callq 0x6b5d0
movq -0x10(%rbp), %rdi
callq 0x6b0c0
movq -0x10(%rbp), %rdi
callq 0x5b080
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x6cac0
cmpl $0x0, %eax
jne 0x6dcb8
movq -0x10(%rbp), %rdi
callq 0x6ae90
cmpl $0x0, %eax
jne 0x6dcb8
movq -0x10(%rbp), %rdi
callq 0x3580
cmpl $0x0, %eax
jne 0x6dcb8
movq -0x10(%rbp), %rdi
callq 0x6b510
cmpl $0x0, %eax
jne 0x6dcb8
movq -0x10(%rbp), %rdi
callq 0x3c30
cmpl $0x0, %eax
jne 0x6dcb8
movq -0x10(%rbp), %rdi
callq 0x6b5d0
cmpl $0x0, %eax
jne 0x6dcb8
movq -0x10(%rbp), %rdi
callq 0x6b0c0
cmpl $0x0, %eax
je 0x6dcc6
movq -0x10(%rbp), %rdi
callq 0x55cf0
movl %eax, -0x4(%rbp)
jmp 0x6dcea
movq -0x10(%rbp), %rdi
callq 0x5cde0
jmp 0x6dcd1
movl -0x14(%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 $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)