// File: /workspace/github_c_makefile_star2_O3/hkshenSmart[P]ONVIF-discovery_cs/stdsoap2.c
// Function: soap_element_end_in
SOAP_FMAC2
soap_element_end_in(struct soap *soap, const char *tag)
{ register soap_wchar c;
  register char *s;
  register int n = 0;
  if (tag && *tag == '-')
    return SOAP_OK;
  if (soap->error == SOAP_NO_TAG)
    soap->error = SOAP_OK;
#ifdef WITH_DOM
  /* this whitespace or mixed content is significant for DOM */
  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
  { if (!soap->peeked && !soap_string_in(soap, 3, -1, -1))
      return soap->error;
    if (soap->dom->prnt)
      soap->dom = soap->dom->prnt;
  }
#endif
  if (soap->peeked)
  { if (*soap->tag)
      n++;
    soap->peeked = 0;
  }
  do
  { while (((c = soap_get(soap)) != SOAP_TT))
    { if ((int)c == EOF)
        return soap->error = SOAP_EOF;
      if (c == SOAP_LT)
        n++;
      else if (c == '/')
      { c = soap_get(soap);
        if (c == SOAP_GT)
          n--;
        else
          soap_unget(soap, c);
      }
    }
  } while (n--);
  s = soap->tag;
  n = sizeof(soap->tag);
  while (soap_notblank(c = soap_get(soap)))
  { if (--n > 0)
      *s++ = (char)c;
  }
  *s = '\0';
  if ((int)c == EOF)
    return soap->error = SOAP_EOF;
  while (soap_blank(c))
    c = soap_get(soap);
  if (c != SOAP_GT)
    return soap->error = SOAP_SYNTAX_ERROR;
#ifndef WITH_LEAN
#ifdef WITH_DOM
  if (soap->feltendin)
  { soap->level--;
    return soap->error = soap->feltendin(soap, soap->tag, tag);
  }
#endif
  if (tag && (soap->mode & SOAP_XML_STRICT))
  { soap_pop_namespace(soap);
    if (soap_match_tag(soap, soap->tag, tag))
    { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End element tag '%s' does not match '%s'\n", soap->tag, tag?tag:SOAP_STR_EOS));
      return soap->error = SOAP_SYNTAX_ERROR;
    }
  }
#endif
  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End element found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag?tag:SOAP_STR_EOS));
  soap->level--;
  return SOAP_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0x13057
xorl %eax, %eax
cmpb $0x2d, (%r14)
je 0x130ed
cmpl $0x6, 0x1f274(%rbx)
jne 0x1306a
movl $0x0, 0x1f274(%rbx)
cmpw $0x0, 0x1e5f6(%rbx)
je 0x1308d
xorl %r15d, %r15d
cmpb $0x0, 0x1c998(%rbx)
setne %r15b
movw $0x0, 0x1e5f6(%rbx)
jmp 0x130a8
xorl %r15d, %r15d
jmp 0x130a8
incl %r15d
jmp 0x130a8
leal -0x1(%r15), %eax
testl %r15d, %r15d
movl %eax, %r15d
jne 0x130a8
jmp 0x130f6
decl %r15d
movq %rbx, %rdi
callq 0x10f85
cmpl $0x2e, %eax
jle 0x130cf
cmpl $0x2f, %eax
jne 0x130a8
movq %rbx, %rdi
callq 0x10f85
cmpl $-0x4, %eax
je 0x130a5
movl %eax, 0xc160(%rbx)
jmp 0x130a8
cmpl $-0x3, %eax
je 0x13097
cmpl $-0x2, %eax
je 0x13092
cmpl $-0x1, %eax
jne 0x130a8
movl $0xffffffff, 0x1f274(%rbx) # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c998(%rbx), %r15
movq %rbx, %rdi
callq 0x10f85
cmpl $0x21, %eax
jl 0x1312f
movl $0x400, %ebp            # imm = 0x400
movq %r15, %r12
cmpl $0x2, %ebp
jl 0x1311e
movb %al, (%r12)
incq %r12
movq %rbx, %rdi
callq 0x10f85
decl %ebp
cmpl $0x20, %eax
jg 0x13112
jmp 0x13132
movq %r15, %r12
movb $0x0, (%r12)
cmpl $-0x1, %eax
je 0x130de
cmpl $0x20, %eax
ja 0x1314e
movq %rbx, %rdi
callq 0x10f85
cmpl $0x21, %eax
jb 0x13141
cmpl $-0x4, %eax
jne 0x13178
testq %r14, %r14
je 0x1318c
testb $0x10, 0x5(%rbx)
je 0x1318c
movq %rbx, %rdi
callq 0x13ec3
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x140fd
testl %eax, %eax
je 0x1318c
movl $0x5, 0x1f274(%rbx)
movl $0x5, %eax
jmp 0x130ed
decl 0xc168(%rbx)
xorl %eax, %eax
jmp 0x130ed