// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x2c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x53696
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x53696
movl $0x0, -0x4(%rbp)
jmp 0x538a3
movq -0x10(%rbp), %rax
cmpl $0x6, 0x19214(%rax)
jne 0x536b1
movq -0x10(%rbp), %rax
movl $0x0, 0x19214(%rax)
movq -0x10(%rbp), %rax
cmpw $0x0, 0x18594(%rax)
je 0x536e2
movq -0x10(%rbp), %rax
cmpb $0x0, 0x16938(%rax)
je 0x536d5
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movw $0x0, 0x18594(%rax)
jmp 0x536e4
jmp 0x536e6
movq -0x10(%rbp), %rdi
callq 0x503c0
movl %eax, -0x1c(%rbp)
cmpl $-0x3, %eax
je 0x5375e
cmpl $-0x1, -0x1c(%rbp)
jne 0x53717
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x19214(%rax) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x538a3
cmpl $-0x2, -0x1c(%rbp)
jne 0x53728
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5375c
cmpl $0x2f, -0x1c(%rbp)
jne 0x5375a
movq -0x10(%rbp), %rdi
callq 0x503c0
movl %eax, -0x1c(%rbp)
cmpl $-0x4, -0x1c(%rbp)
jne 0x5374b
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x53758
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x6100(%rax)
jmp 0x5375a
jmp 0x5375c
jmp 0x536e6
jmp 0x53760
movl -0x2c(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x2c(%rbp)
cmpl $0x0, %eax
jne 0x536e4
movq -0x10(%rbp), %rax
addq $0x16938, %rax          # imm = 0x16938
movq %rax, -0x28(%rbp)
movl $0x400, -0x2c(%rbp)     # imm = 0x400
movq -0x10(%rbp), %rdi
callq 0x503c0
movl %eax, -0x1c(%rbp)
cmpl $0x20, %eax
jle 0x537c0
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
jle 0x537be
movl -0x1c(%rbp), %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, (%rax)
jmp 0x53789
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
cmpl $-0x1, -0x1c(%rbp)
jne 0x537e7
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x19214(%rax) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x538a3
jmp 0x537e9
xorl %eax, %eax
cmpl $0x0, -0x1c(%rbp)
movb %al, -0x2d(%rbp)
jl 0x537fe
cmpl $0x20, -0x1c(%rbp)
setle %al
movb %al, -0x2d(%rbp)
movb -0x2d(%rbp), %al
testb $0x1, %al
jne 0x53807
jmp 0x53815
movq -0x10(%rbp), %rdi
callq 0x503c0
movl %eax, -0x1c(%rbp)
jmp 0x537e9
cmpl $-0x4, -0x1c(%rbp)
je 0x53832
movq -0x10(%rbp), %rax
movl $0x5, 0x19214(%rax)
movl $0x5, -0x4(%rbp)
jmp 0x538a3
cmpq $0x0, -0x18(%rbp)
je 0x53889
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x53889
movq -0x10(%rbp), %rdi
callq 0x55110
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x16938, %rsi          # imm = 0x16938
movq -0x18(%rbp), %rdx
callq 0x55510
cmpl $0x0, %eax
je 0x53887
movq -0x10(%rbp), %rax
movl $0x5, 0x19214(%rax)
movl $0x5, -0x4(%rbp)
jmp 0x538a3
jmp 0x53889
movq -0x10(%rbp), %rax
movl 0x6108(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x6108(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)