// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x10(%rbp), %rax
cmpw $0x0, 0x1e5f6(%rax)
je 0x2c7d1
movq -0x10(%rbp), %rax
cmpb $0x0, 0x1c998(%rax)
je 0x2c7cf
movq -0x10(%rbp), %rax
addq $0x1c598, %rax          # imm = 0x1C598
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movb $0x3c, (%rax)
movq -0x58(%rbp), %rax
movb $0x0, 0x3ff(%rax)
movq -0x58(%rbp), %rdi
addq $0x1, %rdi
movq -0x10(%rbp), %rsi
addq $0x1c998, %rsi          # imm = 0x1C998
movl $0x3fe, %edx            # imm = 0x3FE
callq 0x3060
movq -0x58(%rbp), %rdi
callq 0x3100
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq 0x1e5e0(%rax), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x2c75f
movq -0x60(%rbp), %rax
cmpw $0x0, 0x28(%rax)
je 0x2c74d
movq -0x58(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x1c598, %rcx          # imm = 0x1C598
addq $0x400, %rcx            # imm = 0x400
addq $-0x2, %rcx
cmpq %rcx, %rax
jb 0x2c693
jmp 0x2c75f
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
movb $0x20, (%rax)
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
addq $0x2a, %rsi
callq 0x3080
movq -0x58(%rbp), %rdi
callq 0x3100
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x1c598, %rcx          # imm = 0x1C598
addq $0x400, %rcx            # imm = 0x400
addq $-0x2, %rcx
cmpq %rcx, %rax
jb 0x2c6e8
jmp 0x2c75f
movq -0x60(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x2c74b
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
movb $0x3d, (%rax)
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
movb $0x22, (%rax)
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x3080
movq -0x58(%rbp), %rdi
callq 0x3100
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
movb $0x22, (%rax)
jmp 0x2c74d
jmp 0x2c74f
movq -0x60(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x2c655
movq -0x10(%rbp), %rax
cmpw $0x0, 0xc166(%rax)
jne 0x2c77f
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
movb $0x2f, (%rax)
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
movb $0x3e, (%rax)
movq -0x58(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rax
addq $0x1c598, %rax          # imm = 0x1C598
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
cmpw $0x0, 0xc166(%rax)
je 0x2c7bb
movl $0x1, -0x38(%rbp)
movl $0x1, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movw $0x0, 0x1e5f6(%rax)
jmp 0x2c7d1
movq -0x10(%rbp), %rdi
callq 0x1b970
cmpq $0x0, %rax
jne 0x2c7ed
movq $0x0, -0x8(%rbp)
jmp 0x2cb47
jmp 0x2c7ef
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x16ff0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x2c818
movq $0x0, -0x8(%rbp)
jmp 0x2cb47
movl $0x0, -0x34(%rbp)
cmpl $0x100, -0x34(%rbp)     # imm = 0x100
jge 0x2cad1
cmpq $0x0, -0x58(%rbp)
je 0x2c86c
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
movsbl (%rax), %ecx
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x4, %rdx
movq %rdx, -0x30(%rbp)
movl %ecx, (%rax)
movq -0x58(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x2c867
movq $0x0, -0x58(%rbp)
jmp 0x2cac3
movq -0x10(%rbp), %rdi
callq 0x18fe0
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
addl $0x6, %eax
movl %eax, %ecx
movq %rcx, -0x68(%rbp)
subl $0x44, %eax
ja 0x2ca67
movq -0x68(%rbp), %rax
leaq 0xc92c(%rip), %rcx      # 0x391c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, -0x38(%rbp)
jne 0x2c8ac
jmp 0x2cad6
movl -0x38(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl $0x3c, (%rax)
movq -0x10(%rbp), %rax
movl $0x2f, 0xc160(%rax)
jmp 0x2ca89
cmpl $0x0, -0x3c(%rbp)
je 0x2c8ee
cmpl $0x0, -0x38(%rbp)
jne 0x2c8ee
jmp 0x2cad6
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl $0x3c, (%rax)
jmp 0x2ca89
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl $0x3e, (%rax)
jmp 0x2ca89
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl $0x22, (%rax)
jmp 0x2ca89
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl $0x27, (%rax)
jmp 0x2ca89
cmpl $0x0, -0x38(%rbp)
jle 0x2c98d
movq -0x10(%rbp), %rdi
callq 0x18fe0
movl %eax, -0x4c(%rbp)
cmpl $-0x4, -0x4c(%rbp)
jne 0x2c980
movl -0x38(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x38(%rbp)
movl -0x4c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc160(%rax)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl $0x2f, (%rax)
jmp 0x2ca89
cmpl $0x0, -0x14(%rbp)
je 0x2c9c4
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl $0x3c, (%rax)
jmp 0x2c9e4
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl $0x26, (%rax)
leaq 0xd01e(%rip), %rax      # 0x399fe
movq %rax, -0x58(%rbp)
jmp 0x2ca89
cmpl $0x0, -0x14(%rbp)
je 0x2ca06
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl $0x3e, (%rax)
jmp 0x2ca26
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl $0x26, (%rax)
leaq 0xcfe1(%rip), %rax      # 0x39a03
movq %rax, -0x58(%rbp)
jmp 0x2ca89
cmpl $0x0, -0x14(%rbp)
je 0x2ca45
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl $0x22, (%rax)
jmp 0x2ca65
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x30(%rbp)
movl $0x26, (%rax)
leaq 0xcfa7(%rip), %rax      # 0x39a08
movq %rax, -0x58(%rbp)
jmp 0x2ca89
cmpl $-0x1, -0x4c(%rbp)
jne 0x2ca6f
jmp 0x2cad6
movl -0x4c(%rbp), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x4, %rdx
movq %rdx, -0x30(%rbp)
movl %ecx, (%rax)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x28(%rbp)
jl 0x2cac1
movq -0x48(%rbp), %rax
cmpq -0x28(%rbp), %rax
jle 0x2cac1
movq -0x10(%rbp), %rax
movl $0x2d, 0x1f274(%rax)
movq $0x0, -0x8(%rbp)
jmp 0x2cb47
jmp 0x2cac3
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2c81f
jmp 0x2c7ef
movl -0x4c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc160(%rax)
movq -0x30(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rdi
movl -0x34(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x1bf30
movq -0x48(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x2cb29
movq -0x10(%rbp), %rax
movl $0x2d, 0x1f274(%rax)
movq $0x0, -0x8(%rbp)
jmp 0x2cb47
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
movq %rdx, %rsi
callq 0x1c1e0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)