// File: /workspace/github_c_makefile_star2_O3/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_set_fault
SOAP_FMAC2
soap_set_fault(struct soap *soap)
{ const char **c = soap_faultcode(soap);
  const char **s = soap_faultstring(soap);
  if (soap->fseterror)
    soap->fseterror(soap, c, s);
  if (!*c)
  { if (soap->version == 2)
      *c = "SOAP-ENV:Sender";
    else
      *c = "SOAP-ENV:Client";
  }
  if (*s)
    return;
  switch (soap->error)
  {
#ifndef WITH_LEAN
    case SOAP_CLI_FAULT:
      *s = "Client fault";
      break;
    case SOAP_SVR_FAULT:
      *s = "Server fault";
      break;
    case SOAP_TAG_MISMATCH:
      *s = soap_set_validation_fault(soap, "tag name or namespace mismatch", NULL);
      break;
    case SOAP_TYPE:
      *s = soap_set_validation_fault(soap, "data type mismatch ", soap->type);
      break;
    case SOAP_SYNTAX_ERROR:
      *s = "Well-formedness violation";
      break;
    case SOAP_NO_TAG:
      *s = "No XML root element";
      break;
    case SOAP_MUSTUNDERSTAND:
      *c = "SOAP-ENV:MustUnderstand";
      sprintf(soap->msgbuf, "The data in element '%s' must be understood but cannot be handled", soap->tag);
      *s = soap->msgbuf;
      break;
    case SOAP_VERSIONMISMATCH:
      *c = "SOAP-ENV:VersionMismatch";
      *s = "Invalid SOAP message or SOAP version mismatch";
      break;
    case SOAP_DATAENCODINGUNKNOWN:
      *c = "SOAP-ENV:DataEncodingUnknown";
      *s = "Unsupported SOAP data encoding";
      break;
    case SOAP_NAMESPACE:
      *s = soap_set_validation_fault(soap, "namespace error", NULL);
      break;
    case SOAP_USER_ERROR:
      *s = "User error";
      break;
    case SOAP_FATAL_ERROR:
      *s = "Fatal error";
      break;
    case SOAP_NO_METHOD:
      sprintf(soap->msgbuf, "Method '%s' not implemented: method name or namespace not recognized", soap->tag);
      *s = soap->msgbuf;
      break;
    case SOAP_NO_DATA:
      *s = "Data required for operation";
      break;
    case SOAP_GET_METHOD:
      *s = "HTTP GET method not implemented";
      break;
    case SOAP_PUT_METHOD:
      *s = "HTTP PUT method not implemented";
      break;
    case SOAP_HEAD_METHOD:
      *s = "HTTP HEAD method not implemented";
      break;
    case SOAP_HTTP_METHOD:
      *s = "HTTP method not implemented";
      break;
    case SOAP_EOM:
      *s = "Out of memory";
      break;
    case SOAP_MOE:
      *s = "Memory overflow or memory corruption error";
      break;
    case SOAP_HDR:
      *s = "Header line too long";
      break;
    case SOAP_IOB:
      *s = "Array index out of bounds";
      break;
    case SOAP_NULL:
      *s = soap_set_validation_fault(soap, "nil not allowed", NULL);
      break;
    case SOAP_DUPLICATE_ID:
      *s = soap_set_validation_fault(soap, "multiple definitions of id ", soap->id);
      if (soap->version == 2)
        *soap_faultsubcode(soap) = "SOAP-ENC:DuplicateID";
      break;
    case SOAP_MISSING_ID:
      *s = soap_set_validation_fault(soap, "missing id for ref ", soap->id);
      if (soap->version == 2)
        *soap_faultsubcode(soap) = "SOAP-ENC:MissingID";
      break;
    case SOAP_HREF:
      *s = soap_set_validation_fault(soap, "incompatible object type ref/id pair ", soap->id);
      break;
    case SOAP_FAULT:
      break;
#ifndef WITH_NOIO
    case SOAP_UDP_ERROR:
      *s = "Message too large for UDP packet";
      break;
    case SOAP_TCP_ERROR:
      *s = tcp_error(soap);
      break;
#endif
    case SOAP_HTTP_ERROR:
      *s = "An HTTP processing error occurred";
      break;
    case SOAP_SSL_ERROR:
#ifdef WITH_OPENSSL
      *s = "SSL error";
#else
      *s = "OpenSSL not installed: recompile with -DWITH_OPENSSL";
#endif
      break;
    case SOAP_PLUGIN_ERROR:
      *s = "Plugin registry error";
      break;
    case SOAP_DIME_ERROR:
      *s = "DIME format error";
      break;
    case SOAP_DIME_HREF:
      *s = "DIME href to missing attachment";
      break;
    case SOAP_DIME_MISMATCH:
      *s = "DIME version/transmission error";
      break;
    case SOAP_DIME_END:
      *s = "End of DIME error";
      break;
    case SOAP_MIME_ERROR:
      *s = "MIME format error";
      break;
    case SOAP_MIME_HREF:
      *s = "MIME href to missing attachment";
      break;
    case SOAP_MIME_END:
      *s = "End of MIME error";
      break;
    case SOAP_ZLIB_ERROR:
#ifdef WITH_ZLIB
      sprintf(soap->msgbuf, "Zlib/gzip error: '%s'", soap->d_stream->msg?soap->d_stream->msg:SOAP_STR_EOS);
      *s = soap->msgbuf;
#else
      *s = "Zlib/gzip not installed for (de)compression: recompile with -DWITH_GZIP";
#endif
      break;
    case SOAP_REQUIRED:
      *s = soap_set_validation_fault(soap, "missing required attribute", NULL);
      break;
    case SOAP_PROHIBITED:
      *s = soap_set_validation_fault(soap, "prohibited attribute present", NULL);
      break;
    case SOAP_OCCURS:
      *s = soap_set_validation_fault(soap, "occurrence violation", NULL);
      break;
    case SOAP_LENGTH:
      *s = soap_set_validation_fault(soap, "content range or length violation", NULL);
      break;
    case SOAP_FD_EXCEEDED:
      *s = "Maximum number of open connections was reached (no define HAVE_POLL): increase FD_SETSIZE";
      break;
    case SOAP_STOP:
      *s = "Stopped: no response to be sent or received (informative)";
      break;
#endif
    case SOAP_EOF:
#ifndef WITH_NOIO
      strcpy(soap->msgbuf, soap_strerror(soap));
#ifndef WITH_LEAN
      if (strlen(soap->msgbuf) + 25 < sizeof(soap->msgbuf))
      { memmove(soap->msgbuf + 25, soap->msgbuf, strlen(soap->msgbuf) + 1);
        memcpy(soap->msgbuf, "End of file or no input: ", 25);
      }
#endif
      *s = soap->msgbuf;
      break;
#else
      *s = "End of file or no input";
      break;
#endif
    default:
#ifndef WITH_NOHTTP
#ifndef WITH_LEAN
      if (soap->error > 200 && soap->error < 600)
      { sprintf(soap->msgbuf, "HTTP Error: %d %s", soap->error, http_error(soap, soap->error));
        *s = soap->msgbuf;
      }
      else
#endif
#endif
      { sprintf(soap->msgbuf, "Error %d", soap->error);
        *s = soap->msgbuf;
      }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x397c
movq %rax, %r15
movq %r14, %rdi
callq 0x39fa
movq %rax, %rbx
movq 0x6018(%r14), %rax
testq %rax, %rax
je 0x4a01e
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq *%rax
cmpq $0x0, (%r15)
jne 0x4a03f
cmpw $0x2, 0x2(%r14)
leaq 0x8b1a(%rip), %rax      # 0x52b4b
leaq 0x8b23(%rip), %rcx      # 0x52b5b
cmoveq %rax, %rcx
movq %rcx, (%r15)
cmpq $0x0, (%rbx)
jne 0x4a35e
movl 0x19214(%r14), %edx
leal 0x1(%rdx), %eax
cmpl $0x2f, %eax
ja 0x4a0cf
leaq 0x7fe1(%rip), %rcx      # 0x52040
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x16138(%r14), %r15
movq %r14, %rdi
callq 0x4a45a
movq %r15, %rdi
movq %rax, %rsi
callq 0x3090
movq %r15, %rdi
callq 0x3110
leaq 0x19(%rax), %rcx
cmpq $0x3ff, %rcx            # imm = 0x3FF
ja 0x4a386
addq $0x16151, %r14          # imm = 0x16151
incq %rax
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3310
movups 0x9085(%rip), %xmm0     # 0x5313f
movups %xmm0, (%r15)
movups 0x9083(%rip), %xmm0     # 0x53148
movups %xmm0, 0x9(%r15)
jmp 0x4a386
cmpl $0x3e8, %edx            # imm = 0x3E8
jne 0x4a0e3
leaq 0x9027(%rip), %rax      # 0x53105
jmp 0x4a35b
leal -0xc9(%rdx), %eax
addq $0x16138, %r14          # imm = 0x16138
cmpl $0x18e, %eax            # imm = 0x18E
ja 0x4a3c1
leaq 0x27a7e(%rip), %rcx     # 0x71b80
leaq 0x27cd7(%rip), %rax     # 0x71de0
cmpq $0x0, 0x8(%rcx)
je 0x4a3d4
leaq 0x10(%rcx), %rsi
cmpq %rdx, 0x10(%rcx)
movq %rsi, %rcx
jne 0x4a109
jmp 0x4a3d7
leaq 0x8f47(%rip), %rsi      # 0x53074
jmp 0x4a351
leaq 0x8f50(%rip), %rsi      # 0x53089
jmp 0x4a351
leaq 0x8ef7(%rip), %rsi      # 0x5303c
jmp 0x4a351
leaq 0x8e0d(%rip), %rax      # 0x52f5e
jmp 0x4a35b
leaq 0x8e21(%rip), %rax      # 0x52f7e
jmp 0x4a35b
leaq 0x8ad7(%rip), %rax      # 0x52c40
movq %rax, (%r15)
leaq 0x8ae6(%rip), %rax      # 0x52c59
jmp 0x4a35b
leaq 0x8ed8(%rip), %rsi      # 0x53057
jmp 0x4a351
leaq 0x16d38(%r14), %rdx
leaq 0x8d06(%rip), %rsi      # 0x52e98
jmp 0x4a2d9
leaq 0x8ae9(%rip), %rax      # 0x52c87
movq %rax, (%r15)
leaq 0x8afc(%rip), %rax      # 0x52ca4
jmp 0x4a35b
leaq 0x16d38(%r14), %rdx
leaq 0x8cb6(%rip), %rsi      # 0x52e71
movq %r14, %rdi
callq 0x4a402
movq %rax, (%rbx)
cmpw $0x2, 0x2(%r14)
jne 0x4a35e
movq %r14, %rdi
callq 0x399f
leaq 0x8ca4(%rip), %rcx      # 0x52e85
jmp 0x4a287
leaq 0x8df5(%rip), %rax      # 0x52fe2
jmp 0x4a35b
leaq 0x8eb2(%rip), %rax      # 0x530ab
jmp 0x4a35b
leaq 0x8b2a(%rip), %rax      # 0x52d2f
jmp 0x4a35b
leaq 0x8cce(%rip), %rax      # 0x52edf
jmp 0x4a35b
leaq 0x8bb9(%rip), %rax      # 0x52dd6
jmp 0x4a35b
movq %r14, %rdi
callq 0x3deb7
jmp 0x4a35b
leaq 0x8b76(%rip), %rax      # 0x52dac
jmp 0x4a35b
leaq 0x8db2(%rip), %rax      # 0x52ff4
jmp 0x4a35b
leaq 0x8afd(%rip), %rax      # 0x52d4b
jmp 0x4a35b
leaq 0x16d38(%r14), %rdx
leaq 0x8bdf(%rip), %rsi      # 0x52e40
movq %r14, %rdi
callq 0x4a402
movq %rax, (%rbx)
cmpw $0x2, 0x2(%r14)
jne 0x4a35e
movq %r14, %rdi
callq 0x399f
leaq 0x8bd5(%rip), %rcx      # 0x52e5c
movq %rcx, (%rax)
jmp 0x4a35e
leaq 0x8950(%rip), %rax      # 0x52be6
movq %rax, (%r15)
leaq 0x16138(%r14), %r15
addq $0x16938, %r14          # imm = 0x16938
leaq 0x8950(%rip), %rsi      # 0x52bfe
jmp 0x4a379
leaq 0x8a19(%rip), %rax      # 0x52cd3
jmp 0x4a35b
leaq 0x88a5(%rip), %rax      # 0x52b6b
jmp 0x4a35b
leaq 0x17538(%r14), %rdx
leaq 0x88cb(%rip), %rsi      # 0x52ba4
movq %r14, %rdi
jmp 0x4a356
leaq 0x8893(%rip), %rax      # 0x52b78
jmp 0x4a35b
leaq 0x89f0(%rip), %rax      # 0x52cde
jmp 0x4a35b
leaq 0x888e(%rip), %rsi      # 0x52b85
jmp 0x4a351
leaq 0x88d2(%rip), %rax      # 0x52bd2
jmp 0x4a35b
leaq 0x8bf8(%rip), %rax      # 0x52f01
jmp 0x4a35b
leaq 0x8c24(%rip), %rax      # 0x52f36
jmp 0x4a35b
leaq 0x8c31(%rip), %rax      # 0x52f4c
jmp 0x4a35b
leaq 0x8add(%rip), %rax      # 0x52e01
jmp 0x4a35b
leaq 0x888b(%rip), %rax      # 0x52bb8
jmp 0x4a35b
leaq 0x8ae0(%rip), %rax      # 0x52e16
jmp 0x4a35b
leaq 0x8c71(%rip), %rax      # 0x52fb0
jmp 0x4a35b
leaq 0x897b(%rip), %rsi      # 0x52cc3
jmp 0x4a351
leaq 0x8adf(%rip), %rsi      # 0x52e30
movq %r14, %rdi
xorl %edx, %edx
callq 0x4a402
movq %rax, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x16138(%r14), %r15
addq $0x16938, %r14          # imm = 0x16938
leaq 0x8971(%rip), %rsi      # 0x52cea
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x3360
movq %r15, (%rbx)
jmp 0x4a35e
leaq 0x8a36(%rip), %rax      # 0x52dc8
jmp 0x4a35b
leaq 0x89d0(%rip), %rax      # 0x52d6b
jmp 0x4a35b
leaq 0x8b1a(%rip), %rax      # 0x52ebe
jmp 0x4a35b
leaq 0x89de(%rip), %rax      # 0x52d8b
jmp 0x4a35b
leaq 0x8c0c(%rip), %rax      # 0x52fc2
jmp 0x4a35b
leaq 0x8bdf(%rip), %rax      # 0x52f9e
jmp 0x4a35b
leaq 0x8da3(%rip), %rsi      # 0x5316b
movq %r14, %rdi
xorl %eax, %eax
callq 0x3360
jmp 0x4a3fa
movq %rax, %rsi
movq 0x8(%rsi), %rax
testq %rax, %rax
leaq 0x7d7c(%rip), %rcx      # 0x52161
cmovneq %rax, %rcx
leaq 0x8d69(%rip), %rsi      # 0x53159
movq %r14, %rdi
xorl %eax, %eax
callq 0x3360
movq %r14, (%rbx)
jmp 0x4a35e