// File: /workspace/github_c_makefile_star2_O2/loversmile[P]sugarcrm/sugar_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 not insignificant 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;
  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End element found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag?tag:SOAP_STR_EOS));
#ifndef WITH_LEAN
  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 name does not match\n"));
      return soap->error = SOAP_SYNTAX_ERROR;
    }
  }
#endif
  soap->level--;
  return SOAP_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0x3715c
xorl %eax, %eax
cmpb $0x2d, (%r14)
je 0x371e4
cmpl $0x6, 0x19214(%rbx)
jne 0x3716c
andl $0x0, 0x19214(%rbx)
cmpw $0x0, 0x18594(%rbx)
je 0x3718e
xorl %r15d, %r15d
cmpb $0x0, 0x16938(%rbx)
setne %r15b
andw $0x0, 0x18594(%rbx)
jmp 0x371be
xorl %r15d, %r15d
jmp 0x371be
movq %rbx, %rdi
callq 0x352a1
cmpl $-0x4, %eax
je 0x371bb
movl %eax, 0x6100(%rbx)
jmp 0x371be
leal -0x1(%r15), %eax
testl %r15d, %r15d
movl %eax, %r15d
jne 0x371be
jmp 0x371ee
incl %r15d
jmp 0x371be
decl %r15d
movq %rbx, %rdi
callq 0x352a1
cmpl $0x2f, %eax
je 0x37193
cmpl $-0x3, %eax
je 0x371a8
cmpl $-0x2, %eax
je 0x371b6
cmpl $-0x1, %eax
jne 0x371be
orl $-0x1, 0x19214(%rbx)
pushq $-0x1
popq %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x16938(%rbx), %r15
movl $0x400, %ecx            # imm = 0x400
movq %r15, %r12
movl %ecx, %r13d
movq %rbx, %rdi
callq 0x352a1
cmpl $0x21, %eax
jl 0x37223
leal -0x1(%r13), %ecx
cmpl $0x2, %r13d
movl %ecx, %r13d
jl 0x37200
movb %al, (%r12)
incq %r12
jmp 0x371fd
movb $0x0, (%r12)
cmpl $-0x1, %eax
jne 0x37237
jmp 0x371da
movq %rbx, %rdi
callq 0x352a1
cmpl $0x20, %eax
jbe 0x3722f
cmpl $-0x4, %eax
jne 0x37266
testq %r14, %r14
je 0x37277
testb $0x10, 0x5(%rbx)
je 0x37277
movq %rbx, %rdi
callq 0x37ef0
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x380f0
testl %eax, %eax
je 0x37277
movl $0x5, 0x19214(%rbx)
pushq $0x5
jmp 0x371e3
decl 0x6108(%rbx)
xorl %eax, %eax
jmp 0x371e4