// File: /workspace/github_c_makefile_star2_O3/hkshenSmart[P]ONVIF-discovery_cs/stdsoap2.c
// Function: soap_wstring_in
SOAP_FMAC1
wchar_t *
SOAP_FMAC2
soap_wstring_in(struct soap *soap, int flag, long minlen, long maxlen)
{ wchar_t *s;
  register int i, n = 0, f = 0;
  register long l = 0;
  register soap_wchar c;
  char *t = NULL;
  DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Reading wide string content\n"));
  if (soap->peeked)
  { if (*soap->tag)
    {
#ifndef WITH_LEAN
      struct soap_attribute *tp;
      t = soap->tmpbuf;
      *t = '<';
      t[sizeof(soap->tmpbuf)-1] = '\0';
      strncpy(t + 1, soap->tag, sizeof(soap->tmpbuf) - 2);
      t += strlen(t);
      for (tp = soap->attributes; tp; tp = tp->next)
      { if (tp->visible)
        { if (t >= soap->tmpbuf + sizeof(soap->tmpbuf) - 2)
            break;
          *t++ = ' ';
          strcpy(t, tp->name);
          t += strlen(t);
          if (t >= soap->tmpbuf + sizeof(soap->tmpbuf) - 2)
            break;
          if (tp->value)
          { *t++ = '=';
            *t++ = '"';
            strcpy(t, tp->value);
            t += strlen(t);
            *t++ = '"';
          }
        }
      }
      if (!soap->body)
        *t++ = '/';
      *t++ = '>';
      *t = '\0';
      t = soap->tmpbuf;
#endif
      if (soap->body)
        n = 1;
      f = 1;
      soap->peeked = 0;
    }
  }
  if (soap_new_block(soap) == NULL)
    return NULL;
  for (;;)
  { if (!(s = (wchar_t*)soap_push_block(soap, NULL, sizeof(wchar_t)*SOAP_BLKLEN)))
      return NULL;
    for (i = 0; i < SOAP_BLKLEN; i++)
    { if (t)
      { *s++ = (wchar_t)*t++;
        if (!*t)
          t = NULL;
        continue;
      }
      c = soap_getutf8(soap);
      switch (c)
      {
      case SOAP_TT:
        if (n == 0)
          goto end;
        n--;
        *s++ = '<';
        soap_unget(soap, '/');
        break;
      case SOAP_LT:
        if (f && n == 0)
          goto end;
        n++;
        *s++ = '<';
        break;
      case SOAP_GT:
        *s++ = '>';
        break;
      case SOAP_QT:
        *s++ = '"';
        break;
      case SOAP_AP:
        *s++ = '\'';
        break;
      case '/':
        if (n > 0)
        { c = soap_getutf8(soap);
          if (c == SOAP_GT)
            n--;
          soap_unget(soap, c);
        }
        *s++ = '/';
        break;
      case '<':
        if (flag)
          *s++ = (soap_wchar)'<';
        else
        { *s++ = (soap_wchar)'&';
          t = (char*)"lt;";
        }
        break;
      case '>':
        if (flag)
          *s++ = (soap_wchar)'>';
        else
        { *s++ = (soap_wchar)'&';
          t = (char*)"gt;";
        }
        break;
      case '"':
        if (flag)
          *s++ = (soap_wchar)'"';
        else
        { *s++ = (soap_wchar)'&';
          t = (char*)"quot;";
        }
        break;
      default:
        if ((int)c == EOF)
          goto end;
        if (sizeof(wchar_t) < 4 && c > 0xFFFF)
        { wchar_t c1, c2;
          /* http://unicode.org/faq/utf_bom.html#utf16-2 */
          c1 = 0xD800 - (0x10000 >> 10) + (c >> 10);
          c2 = 0xDC00 + (c & 0x3FF);
          c = c1;
          soap_unget(soap, c2);
        }
        *s++ = (wchar_t)c & 0x7FFFFFFF;
      }
      l++;
      if (maxlen >= 0 && l > maxlen)
      { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen));
        soap->error = SOAP_LENGTH;
        return NULL;
      }
    }
  }
end:
  soap_unget(soap, c);
  *s = '\0';
  soap_size_block(soap, NULL, sizeof(wchar_t) * (i + 1));
  if (l < minlen)
  { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "String too short: %ld chars, minlen=%ld\n", l, minlen));
    soap->error = SOAP_LENGTH;
    return NULL;
  }
  s = (wchar_t*)soap_save_block(soap, NULL, NULL, 0);
#ifdef WITH_DOM
  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
    soap->dom->wide = s;
#endif
  return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x20(%rsp)
movq %rdx, %rbp
movl %esi, 0xc(%rsp)
movq %rdi, %rbx
cmpw $0x0, 0x1e5f6(%rdi)
je 0x1d074
cmpb $0x0, 0x1c998(%rbx)
je 0x1d074
leaq 0x1c998(%rbx), %rsi
movl $0x1c598, %r14d         # imm = 0x1C598
leaq (%rbx,%r14), %r12
movb $0x3c, 0x1c598(%rbx)
movb $0x0, 0x1c997(%rbx)
leaq 0x1c599(%rbx), %rdi
movl $0x3fe, %edx            # imm = 0x3FE
callq 0x3060
movq %r12, %rdi
callq 0x3110
movq %rax, %r13
addq %rbx, %rax
addq $0x1c598, %rax          # imm = 0x1C598
movq 0x1e5e0(%rbx), %r15
testq %r15, %r15
je 0x1d08b
addq %r14, %r13
cmpw $0x0, 0x28(%r15)
je 0x1d062
cmpq $0x1c995, %r13          # imm = 0x1C995
jg 0x1d08b
leaq (%rbx,%r13), %r14
incq %r14
movb $0x20, (%rax)
leaq 0x2a(%r15), %rsi
movq %r14, %rdi
callq 0x3080
movq %r14, %rdi
callq 0x3110
addq %rax, %r13
incq %r13
cmpq $0x1c995, %r13          # imm = 0x1C995
jg 0x1d085
cmpq $0x0, 0x10(%r15)
je 0x1d062
leaq (%rbx,%r13), %r14
addq $0x2, %r14
movw $0x223d, -0x2(%r14)     # imm = 0x223D
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x3080
movq %r14, %rdi
callq 0x3110
leaq (%rax,%r13), %rcx
addq $0x2, %rcx
addq %rax, %r13
addq $0x3, %r13
movb $0x22, (%rbx,%rcx)
leaq (%rbx,%r13), %rax
movq (%r15), %r15
testq %r15, %r15
jne 0x1cfe3
jmp 0x1d08b
xorl %r15d, %r15d
movq $0x0, 0x10(%rsp)
xorl %r12d, %r12d
jmp 0x1d0bf
addq %rbx, %r13
movq %r13, %rax
cmpw $0x0, 0xc166(%rbx)
jne 0x1d09b
movb $0x2f, (%rax)
incq %rax
movw $0x3e, (%rax)
xorl %r15d, %r15d
cmpw $0x0, 0xc166(%rbx)
setne %r15b
movw $0x0, 0x1e5f6(%rbx)
movb $0x1, %al
movq %rax, 0x10(%rsp)
movl $0x18, %edi
callq 0x3240
testq %rax, %rax
je 0x1d303
movq %rax, %r14
movq %r15, (%rsp)
movq %rbp, 0x18(%rsp)
movq 0x90(%rbx), %rax
movq %rax, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movq %r14, 0x90(%rbx)
movl $0x410, %edi            # imm = 0x410
callq 0x3240
testq %rax, %rax
je 0x1d303
movq %rax, %r13
xorl %ebp, %ebp
movl $0x400, %ecx            # imm = 0x400
movq 0x8(%r14), %rax
movq %rax, (%r13)
movq %rcx, 0x8(%r13)
movq %r13, 0x8(%r14)
addq %rcx, 0x10(%r14)
movq $-0x4, %r14
xorl %r15d, %r15d
testq %r12, %r12
je 0x1d15b
movsbl (%r12), %eax
movl %eax, 0x10(%r13,%r15,4)
cmpb $0x0, 0x1(%r12)
leaq 0x1(%r12), %rax
movl $0x0, %r12d
cmovneq %rax, %r12
jmp 0x1d2a7
movq %rbx, %rdi
callq 0x11794
cmpl $0x21, %eax
jg 0x1d192
leal 0x6(%rax), %ecx
cmpl $0x5, %ecx
ja 0x1d258
leaq 0x8cc1(%rip), %rdx      # 0x25e3c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl $0x27, 0x10(%r13,%r15,4)
jmp 0x1d288
cmpl $0x3b, %eax
jg 0x1d1dd
cmpl $0x22, %eax
je 0x1d229
cmpl $0x2f, %eax
jne 0x1d258
movq (%rsp), %r12
testl %r12d, %r12d
jle 0x1d1cf
movq %rbx, %rdi
callq 0x11794
xorl %ecx, %ecx
cmpl $-0x4, %eax
sete %cl
subl %ecx, %r12d
movq %r12, (%rsp)
movl %eax, 0xc160(%rbx)
movl $0x2f, 0x10(%r13,%r15,4)
jmp 0x1d288
cmpl $0x3c, %eax
je 0x1d23f
cmpl $0x3e, %eax
jne 0x1d258
cmpl $0x0, 0xc(%rsp)
je 0x1d2cf
movl $0x3e, 0x10(%r13,%r15,4)
jmp 0x1d288
cmpl $0x0, (%rsp)
je 0x1d30f
movq (%rsp), %rax
decl %eax
movq %rax, (%rsp)
movl $0x3c, 0x10(%r13,%r15,4)
movl $0x2f, 0xc160(%rbx)
jmp 0x1d288
cmpl $0x0, 0xc(%rsp)
je 0x1d2bd
movl $0x22, 0x10(%r13,%r15,4)
jmp 0x1d288
cmpl $0x0, 0xc(%rsp)
jne 0x1d27f
movl $0x26, 0x10(%r13,%r15,4)
leaq 0x9379(%rip), %r12      # 0x265cf
jmp 0x1d28b
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, 0x10(%r13,%r15,4)
jmp 0x1d288
cmpl $0x0, (%rsp)
sete %cl
testb %cl, 0x10(%rsp)
jne 0x1d30f
movq (%rsp), %rax
incl %eax
movq %rax, (%rsp)
movl $0x3c, 0x10(%r13,%r15,4)
xorl %r12d, %r12d
movq 0x20(%rsp), %rcx
testq %rcx, %rcx
sets %al
cmpq %rcx, %rbp
setl %cl
orb %al, %cl
je 0x1d34b
incq %rbp
addq $-0x4, %r14
incq %r15
cmpl $0x100, %r15d           # imm = 0x100
jne 0x1d132
jmp 0x1d2e1
movl $0x26, 0x10(%r13,%r15,4)
leaq 0x930c(%rip), %r12      # 0x265d9
jmp 0x1d28b
movl $0x26, 0x10(%r13,%r15,4)
leaq 0x92f5(%rip), %r12      # 0x265d4
jmp 0x1d28b
movq 0x90(%rbx), %r14
movl $0x410, %edi            # imm = 0x410
callq 0x3240
movq %rax, %r13
testq %rax, %rax
movl $0x400, %ecx            # imm = 0x400
jne 0x1d114
movl $0x14, 0x1f274(%rbx)
jmp 0x1d355
movl %eax, 0xc160(%rbx)
movl $0x0, 0x10(%r13,%r15,4)
movq 0x90(%rbx), %rax
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x1d344
movq 0x10(%rax), %rdx
subq 0x8(%rcx), %rdx
subq %r14, %rdx
negq %r14
movq %rdx, 0x10(%rax)
movq %r14, 0x8(%rcx)
cmpq 0x18(%rsp), %rbp
jge 0x1d366
movl $0x2d, 0x1f274(%rbx)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x135d6