// File: /workspace/github_c_makefile_star2_O0/hkshenSmart[P]ONVIF-discovery_cs/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 /* check UTF16 encoding when wchar_t is too small to hold UCS */
      { if (sizeof(wchar_t) < 4 && (c & 0xD800) == 0xD800)
        { /* http://unicode.org/faq/utf_bom.html#utf16-2 */
          if ((*s & 0xD800) == 0xD800)
            c = (c << 10) + *s++ + 0x10000 - (0xD800 << 10) - 0xDC00;
          else
            c = 0xFFFD; /* Malformed */
        }
        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 0x2c58e
movl -0x30(%rbp), %eax
addl $-0x9, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x35, %eax
ja 0x2c503
movq -0x38(%rbp), %rax
leaq 0xccbc(%rip), %rcx      # 0x390ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, -0x1c(%rbp)
je 0x2c44c
leaq 0xd59f(%rip), %rax      # 0x399e5
movq %rax, -0x28(%rbp)
jmp 0x2c457
leaq 0xd5cf(%rip), %rax      # 0x39a22
movq %rax, -0x28(%rbp)
jmp 0x2c568
cmpl $0x0, -0x1c(%rbp)
jne 0x2c473
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
jne 0x2c480
leaq 0xd571(%rip), %rax      # 0x399eb
movq %rax, -0x28(%rbp)
jmp 0x2c48b
leaq 0xd371(%rip), %rax      # 0x397f8
movq %rax, -0x28(%rbp)
jmp 0x2c568
leaq 0xd55a(%rip), %rax      # 0x399f1
movq %rax, -0x28(%rbp)
jmp 0x2c568
leaq 0xd550(%rip), %rax      # 0x399f7
movq %rax, -0x28(%rbp)
jmp 0x2c568
leaq 0xd546(%rip), %rax      # 0x399fd
movq %rax, -0x28(%rbp)
jmp 0x2c568
cmpl $0x0, -0x1c(%rbp)
je 0x2c4d3
leaq 0xd44a(%rip), %rax      # 0x39917
movq %rax, -0x28(%rbp)
jmp 0x2c4de
leaq 0xd528(%rip), %rax      # 0x39a02
movq %rax, -0x28(%rbp)
jmp 0x2c568
cmpl $0x0, -0x1c(%rbp)
je 0x2c4f6
leaq 0xd517(%rip), %rax      # 0x39a07
movq %rax, -0x28(%rbp)
jmp 0x2c501
leaq 0xd5d5(%rip), %rax      # 0x39ad2
movq %rax, -0x28(%rbp)
jmp 0x2c568
cmpl $0x20, -0x30(%rbp)
jl 0x2c540
cmpl $0x80, -0x30(%rbp)
jge 0x2c540
movl -0x30(%rbp), %eax
movb %al, -0x29(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x29(%rbp), %rsi
movl $0x1, %edx
callq 0x16bc0
cmpl $0x0, %eax
je 0x2c53e
movq -0x10(%rbp), %rax
movl 0x1f274(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2c595
jmp 0x2c563
movq -0x10(%rbp), %rdi
movslq -0x30(%rbp), %rsi
callq 0x18dc0
cmpl $0x0, %eax
je 0x2c561
movq -0x10(%rbp), %rax
movl 0x1f274(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2c595
jmp 0x2c563
jmp 0x2c3f3
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x170a0
cmpl $0x0, %eax
je 0x2c589
movq -0x10(%rbp), %rax
movl 0x1f274(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x2c595
jmp 0x2c3f3
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop