// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
movl 0x19214(%rdi), %ebp
movl $0x3e8, %eax            # imm = 0x3E8
cmpl $0x3e8, %ebp            # imm = 0x3E8
je 0x4adbc
movq %rdi, %rbx
movw $0x0, 0x191cc(%rdi)
callq 0x4a6b7
movl 0x19214(%rbx), %eax
cmpl $0xc8, %eax
setge %cl
cmpl $0xc, %eax
sete %al
orb %cl, %al
jne 0x4ac4f
movq $0x0, 0x5f30(%rbx)
cmpl $-0x1, %ebp
je 0x4ac9e
movq 0x6010(%rbx), %rax
testq %rax, %rax
je 0x4ac6e
movq %rbx, %rdi
callq *%rax
testl %eax, %eax
je 0x4ac6e
movb $0x1, %r14b
jmp 0x4ac99
movl 0x60d4(%rbx), %esi
cmpl $-0x1, %esi
je 0x4acd9
movq %rbx, %rdi
movl $0x3, %edx
xorl %ecx, %ecx
callq 0x3dfc3
testl %eax, %eax
setle %cl
testb $0x2, %al
sete %dl
orb %cl, %dl
movb $0x1, %r14b
je 0x4acb4
jmp 0x4ada5
cmpl $0x0, 0x50(%rbx)
jne 0x4adaa
cmpl $0x0, 0x54(%rbx)
jne 0x4adaa
jmp 0x4ac54
testb $0x1, %al
je 0x4acd9
movl 0x60d4(%rbx), %edi
leaq 0x16538(%rbx), %rsi
movl $0x1, %edx
movl $0x2, %ecx
callq 0x3040
testq %rax, %rax
js 0x4ac99
movl $0x0, 0x19214(%rbx)
movq %rbx, %rdi
callq 0x350c
movq %rbx, %rdi
callq 0x37df
movq %rbx, %rdi
callq 0x3eb1c
testb $0x8, 0x4(%rbx)
je 0x4ad45
movq %rbx, %rdi
callq 0x49288
movq %rbx, %rdi
callq 0x350e
movq %rbx, %rdi
callq 0x49694
movq %rbx, %rdi
callq 0x3885
leaq 0x7d45(%rip), %rsi      # 0x52a6d
movq %rbx, %rdi
callq 0x3f797
testl %eax, %eax
jne 0x4ad3d
movw $0x7, 0x18590(%rbx)
movq %rbx, %rdi
callq 0x493d0
movq 0x6060(%rbx), %rax
testq %rax, %rax
je 0x4ad5c
movq %rbx, %rdi
callq *%rax
movl %eax, 0x19214(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4a420
testl %eax, %eax
jne 0x4ad9a
movq %rbx, %rdi
callq 0x49288
testl %eax, %eax
jne 0x4ad9a
movq %rbx, %rdi
callq 0x350e
testl %eax, %eax
jne 0x4ad9a
movq %rbx, %rdi
callq 0x49694
testl %eax, %eax
jne 0x4ad9a
movq %rbx, %rdi
callq 0x3885
testl %eax, %eax
je 0x4adc1
movq %rbx, %rdi
callq 0x3ba2e
xorl %r14d, %r14d
testb %r14b, %r14b
je 0x4adbc
movl %ebp, 0x19214(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x3ba2e
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x7ca5(%rip), %rsi      # 0x52a6d
movq %rbx, %rdi
callq 0x3f797
testl %eax, %eax
je 0x4addf
cmpl $0x0, 0x19214(%rbx)
jne 0x4ad9a
jmp 0x4ade8
movw $0x7, 0x18590(%rbx)
movq %rbx, %rdi
callq 0x493d0
testl %eax, %eax
jne 0x4ad9a
movq %rbx, %rdi
callq 0x40148
jmp 0x4ac69