// File: /workspace/github_c_makefile_star2_O0/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_wstring_out
SOAP_FMAC2
soap_wstring_out(struct soap *soap, const wchar_t *s, int flag)
{ const char *t;
  char tmp;
  register soap_wchar c;
#ifdef WITH_DOM
  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
  { wchar_t *r = (wchar_t*)s;
    int n = 1;
    while (*r++)
      n++;
    soap->dom->wide = r = (wchar_t*)soap_malloc(soap, n * sizeof(wchar_t));
    while (n--)
      *r++ = *s++;
    return SOAP_OK;
  }
#endif
  while ((c = *s++))
  { switch (c)
    { 
    case 0x09:
      if (flag)
        t = "&#x9;";
      else
        t = "\t";
      break;
    case 0x0A:
      if (flag || !(soap->mode & SOAP_XML_CANONICAL))
        t = "&#xA;";
      else
        t = "\n";
      break;
    case 0x0D:
      t = "&#xD;";
      break;
    case '&':
      t = "&amp;";
      break;
    case '<':
      t = "&lt;";
      break;
    case '>':
      if (flag)
        t = ">";
      else
        t = "&gt;";
      break;
    case '"':
      if (flag)
        t = "&quot;";
      else
        t = "\"";
      break;
    default:
      if (c >= 0x20 && c < 0x80)
      { tmp = (char)c;
        if (soap_send_raw(soap, &tmp, 1))
          return soap->error;
      }
      else if (soap_pututf8(soap, (unsigned long)c))
        return soap->error;
      continue;
    }
    if (soap_send(soap, t))
      return soap->error;
  }
  return SOAP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x18(%rbp)
movl (%rax), %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
je 0x6358e
movl -0x30(%rbp), %eax
addl $-0x9, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x35, %eax
ja 0x63503
movq -0x38(%rbp), %rax
leaq 0x16db4(%rip), %rcx     # 0x7a1e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, -0x1c(%rbp)
je 0x6344c
leaq 0x17655(%rip), %rax     # 0x7aa9b
movq %rax, -0x28(%rbp)
jmp 0x63457
leaq 0x17685(%rip), %rax     # 0x7aad8
movq %rax, -0x28(%rbp)
jmp 0x63568
cmpl $0x0, -0x1c(%rbp)
jne 0x63473
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
jne 0x63480
leaq 0x17627(%rip), %rax     # 0x7aaa1
movq %rax, -0x28(%rbp)
jmp 0x6348b
leaq 0x1743b(%rip), %rax     # 0x7a8c2
movq %rax, -0x28(%rbp)
jmp 0x63568
leaq 0x17610(%rip), %rax     # 0x7aaa7
movq %rax, -0x28(%rbp)
jmp 0x63568
leaq 0x17606(%rip), %rax     # 0x7aaad
movq %rax, -0x28(%rbp)
jmp 0x63568
leaq 0x175fc(%rip), %rax     # 0x7aab3
movq %rax, -0x28(%rbp)
jmp 0x63568
cmpl $0x0, -0x1c(%rbp)
je 0x634d3
leaq 0x17500(%rip), %rax     # 0x7a9cd
movq %rax, -0x28(%rbp)
jmp 0x634de
leaq 0x175de(%rip), %rax     # 0x7aab8
movq %rax, -0x28(%rbp)
jmp 0x63568
cmpl $0x0, -0x1c(%rbp)
je 0x634f6
leaq 0x175cd(%rip), %rax     # 0x7aabd
movq %rax, -0x28(%rbp)
jmp 0x63501
leaq 0x17698(%rip), %rax     # 0x7ab95
movq %rax, -0x28(%rbp)
jmp 0x63568
cmpl $0x20, -0x30(%rbp)
jl 0x63540
cmpl $0x80, -0x30(%rbp)
jge 0x63540
movl -0x30(%rbp), %eax
movb %al, -0x29(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x29(%rbp), %rsi
movl $0x1, %edx
callq 0x4eeb0
cmpl $0x0, %eax
je 0x6353e
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x63595
jmp 0x63563
movq -0x10(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x50f20
cmpl $0x0, %eax
je 0x63561
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x63595
jmp 0x63563
jmp 0x633f3
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4f310
cmpl $0x0, %eax
je 0x63589
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x63595
jmp 0x633f3
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop