// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/expat-2.0.1/lib/xmltok_impl.c
// Function: little2_getAtts
static int PTRCALL
PREFIX(getAtts)(const ENCODING *enc, const char *ptr,
                int attsMax, ATTRIBUTE *atts)
{
  enum { other, inName, inValue } state = inName;
  int nAtts = 0;
  int open = 0; /* defined when state == inValue;
                   initialization just to shut up compilers */

  for (ptr += MINBPC(enc);; ptr += MINBPC(enc)) {
    switch (BYTE_TYPE(enc, ptr)) {
#define START_NAME \
      if (state == other) { \
        if (nAtts < attsMax) { \
          atts[nAtts].name = ptr; \
          atts[nAtts].normalized = 1; \
        } \
        state = inName; \
      }
#define LEAD_CASE(n) \
    case BT_LEAD ## n: START_NAME ptr += (n - MINBPC(enc)); break;
    LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4)
#undef LEAD_CASE
    case BT_NONASCII:
    case BT_NMSTRT:
    case BT_HEX:
      START_NAME
      break;
#undef START_NAME
    case BT_QUOT:
      if (state != inValue) {
        if (nAtts < attsMax)
          atts[nAtts].valuePtr = ptr + MINBPC(enc);
        state = inValue;
        open = BT_QUOT;
      }
      else if (open == BT_QUOT) {
        state = other;
        if (nAtts < attsMax)
          atts[nAtts].valueEnd = ptr;
        nAtts++;
      }
      break;
    case BT_APOS:
      if (state != inValue) {
        if (nAtts < attsMax)
          atts[nAtts].valuePtr = ptr + MINBPC(enc);
        state = inValue;
        open = BT_APOS;
      }
      else if (open == BT_APOS) {
        state = other;
        if (nAtts < attsMax)
          atts[nAtts].valueEnd = ptr;
        nAtts++;
      }
      break;
    case BT_AMP:
      if (nAtts < attsMax)
        atts[nAtts].normalized = 0;
      break;
    case BT_S:
      if (state == inName)
        state = other;
      else if (state == inValue
               && nAtts < attsMax
               && atts[nAtts].normalized
               && (ptr == atts[nAtts].valuePtr
                   || BYTE_TO_ASCII(enc, ptr) != ASCII_SPACE
                   || BYTE_TO_ASCII(enc, ptr + MINBPC(enc)) == ASCII_SPACE
                   || BYTE_TYPE(enc, ptr + MINBPC(enc)) == open))
        atts[nAtts].normalized = 0;
      break;
    case BT_CR: case BT_LF:
      /* This case ensures that the first attribute name is counted
         Apart from that we could just change state on the quote. */
      if (state == inName)
        state = other;
      else if (state == inValue && nAtts < attsMax)
        atts[nAtts].normalized = 0;
      break;
    case BT_GT:
    case BT_SOL:
      if (state != inValue)
        return nAtts;
      break;
    default:
      break;
    }
  }
  /* not reached */
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movl %edx, 0x34(%rsp)
movq %rcx, 0x28(%rsp)
movl $0x1, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x38(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x38d3c6
movq 0x40(%rsp), %rax
movq 0x38(%rsp), %rcx
movzbl (%rcx), %ecx
movzbl 0x88(%rax,%rcx), %eax
movl %eax, 0x18(%rsp)
jmp 0x38d3e2
movq 0x38(%rsp), %rax
movb 0x1(%rax), %cl
movq 0x38(%rsp), %rax
movsbl %cl, %edi
movsbl (%rax), %esi
callq 0x38e510
movl %eax, 0x18(%rsp)
movl 0x18(%rsp), %eax
addl $-0x3, %eax
movl %eax, %ecx
movq %rcx, 0x10(%rsp)
subl $0x1a, %eax
ja 0x38d81b
movq 0x10(%rsp), %rax
leaq 0x212be3(%rip), %rcx    # 0x59ffe8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x24(%rsp)
jne 0x38d455
movl 0x20(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x38d44d
movq 0x38(%rsp), %rcx
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movb $0x1, 0x18(%rax)
movl $0x1, 0x24(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x38(%rsp)
jmp 0x38d81d
cmpl $0x0, 0x24(%rsp)
jne 0x38d4ab
movl 0x20(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x38d4a3
movq 0x38(%rsp), %rcx
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movb $0x1, 0x18(%rax)
movl $0x1, 0x24(%rsp)
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x38d81d
cmpl $0x0, 0x24(%rsp)
jne 0x38d505
movl 0x20(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x38d4fd
movq 0x38(%rsp), %rcx
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movb $0x1, 0x18(%rax)
movl $0x1, 0x24(%rsp)
movq 0x38(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x38(%rsp)
jmp 0x38d81d
cmpl $0x0, 0x24(%rsp)
jne 0x38d55f
movl 0x20(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x38d557
movq 0x38(%rsp), %rcx
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movb $0x1, 0x18(%rax)
movl $0x1, 0x24(%rsp)
jmp 0x38d81d
cmpl $0x2, 0x24(%rsp)
je 0x38d5a5
movl 0x20(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x38d593
movq 0x38(%rsp), %rcx
addq $0x2, %rcx
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl $0x2, 0x24(%rsp)
movl $0xc, 0x1c(%rsp)
jmp 0x38d5e5
cmpl $0xc, 0x1c(%rsp)
jne 0x38d5e3
movl $0x0, 0x24(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x38d5d8
movq 0x38(%rsp), %rcx
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x38d5e5
jmp 0x38d81d
cmpl $0x2, 0x24(%rsp)
je 0x38d62b
movl 0x20(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x38d619
movq 0x38(%rsp), %rcx
addq $0x2, %rcx
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl $0x2, 0x24(%rsp)
movl $0xd, 0x1c(%rsp)
jmp 0x38d66b
cmpl $0xd, 0x1c(%rsp)
jne 0x38d669
movl $0x0, 0x24(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x38d65e
movq 0x38(%rsp), %rcx
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x38d66b
jmp 0x38d81d
movl 0x20(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x38d68f
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movb $0x0, 0x18(%rax)
jmp 0x38d81d
cmpl $0x1, 0x24(%rsp)
jne 0x38d6a8
movl $0x0, 0x24(%rsp)
jmp 0x38d7cc
cmpl $0x2, 0x24(%rsp)
jne 0x38d7ca
movl 0x20(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x38d7ca
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movsbl 0x18(%rax), %eax
cmpl $0x0, %eax
je 0x38d7ca
movq 0x38(%rsp), %rax
movq 0x28(%rsp), %rcx
movslq 0x20(%rsp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
je 0x38d7b5
movq 0x38(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x38d71b
movq 0x38(%rsp), %rax
movsbl (%rax), %eax
movl %eax, 0xc(%rsp)
jmp 0x38d726
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0xc(%rsp)
jmp 0x38d726
movl 0xc(%rsp), %eax
cmpl $0x20, %eax
jne 0x38d7b5
movq 0x38(%rsp), %rax
movsbl 0x3(%rax), %eax
cmpl $0x0, %eax
jne 0x38d750
movq 0x38(%rsp), %rax
movsbl 0x2(%rax), %eax
movl %eax, 0x8(%rsp)
jmp 0x38d75b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x8(%rsp)
jmp 0x38d75b
movl 0x8(%rsp), %eax
cmpl $0x20, %eax
je 0x38d7b5
movq 0x38(%rsp), %rax
movsbl 0x3(%rax), %eax
cmpl $0x0, %eax
jne 0x38d78e
movq 0x40(%rsp), %rax
movq 0x38(%rsp), %rcx
movzbl 0x2(%rcx), %ecx
movzbl 0x88(%rax,%rcx), %eax
movl %eax, 0x4(%rsp)
jmp 0x38d7ab
movq 0x38(%rsp), %rax
movb 0x3(%rax), %cl
movq 0x38(%rsp), %rax
movsbl %cl, %edi
movsbl 0x2(%rax), %esi
callq 0x38e510
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jne 0x38d7ca
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movb $0x0, 0x18(%rax)
jmp 0x38d7cc
jmp 0x38d81d
cmpl $0x1, 0x24(%rsp)
jne 0x38d7df
movl $0x0, 0x24(%rsp)
jmp 0x38d807
cmpl $0x2, 0x24(%rsp)
jne 0x38d805
movl 0x20(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x38d805
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movb $0x0, 0x18(%rax)
jmp 0x38d807
jmp 0x38d81d
cmpl $0x2, 0x24(%rsp)
je 0x38d819
movl 0x20(%rsp), %eax
addq $0x48, %rsp
retq
jmp 0x38d81d
jmp 0x38d81d
jmp 0x38d81f
movq 0x38(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x38(%rsp)
jmp 0x38d39d
nopw %cs:(%rax,%rax)