// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: nextScaffoldPart
static int FASTCALL
nextScaffoldPart(XML_Parser parser)
{
  DTD * const dtd = _dtd;  /* save one level of indirection */
  CONTENT_SCAFFOLD * me;
  int next;

  if (!dtd->scaffIndex) {
    dtd->scaffIndex = (int *)MALLOC(groupSize * sizeof(int));
    if (!dtd->scaffIndex)
      return -1;
    dtd->scaffIndex[0] = 0;
  }

  if (dtd->scaffCount >= dtd->scaffSize) {
    CONTENT_SCAFFOLD *temp;
    if (dtd->scaffold) {
      temp = (CONTENT_SCAFFOLD *)
        REALLOC(dtd->scaffold, dtd->scaffSize * 2 * sizeof(CONTENT_SCAFFOLD));
      if (temp == NULL)
        return -1;
      dtd->scaffSize *= 2;
    }
    else {
      temp = (CONTENT_SCAFFOLD *)MALLOC(INIT_SCAFFOLD_ELEMENTS
                                        * sizeof(CONTENT_SCAFFOLD));
      if (temp == NULL)
        return -1;
      dtd->scaffSize = INIT_SCAFFOLD_ELEMENTS;
    }
    dtd->scaffold = temp;
  }
  next = dtd->scaffCount++;
  me = &dtd->scaffold[next];
  if (dtd->scaffLevel) {
    CONTENT_SCAFFOLD *parent = &dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel-1]];
    if (parent->lastchild) {
      dtd->scaffold[parent->lastchild].nextsib = next;
    }
    if (!parent->childcnt)
      parent->firstchild = next;
    parent->lastchild = next;
    parent->childcnt++;
  }
  me->firstchild = me->lastchild = me->childcnt = me->nextsib = 0;
  return next;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x290(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x138(%rax)
jne 0x37b3c2
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rsp), %rcx
movl 0x368(%rcx), %ecx
movl %ecx, %edi
shlq $0x2, %rdi
callq *%rax
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x138(%rax)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x138(%rax)
jne 0x37b3b0
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x37b5a1
movq 0x20(%rsp), %rax
movq 0x138(%rax), %rax
movl $0x0, (%rax)
movq 0x20(%rsp), %rax
movl 0x130(%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0x12c(%rcx), %eax
jb 0x37b48f
movq 0x20(%rsp), %rax
cmpq $0x0, 0x120(%rax)
je 0x37b448
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rsp), %rcx
movq 0x120(%rcx), %rdi
movq 0x20(%rsp), %rcx
movl 0x12c(%rcx), %ecx
shll %ecx
movl %ecx, %ecx
movl %ecx, %esi
shlq $0x5, %rsi
callq *%rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x37b433
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x37b5a1
movq 0x20(%rsp), %rax
movl 0x12c(%rax), %ecx
shll %ecx
movl %ecx, 0x12c(%rax)
jmp 0x37b47e
movq 0x28(%rsp), %rax
movl $0x400, %edi            # imm = 0x400
callq *0x18(%rax)
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x37b46f
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x37b5a1
movq 0x20(%rsp), %rax
movl $0x20, 0x12c(%rax)
movq 0x8(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x120(%rax)
movq 0x20(%rsp), %rcx
movl 0x130(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x130(%rcx)
movl %eax, 0x14(%rsp)
movq 0x20(%rsp), %rax
movq 0x120(%rax), %rax
movslq 0x14(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
cmpl $0x0, 0x134(%rax)
je 0x37b569
movq 0x20(%rsp), %rax
movq 0x120(%rax), %rax
movq 0x20(%rsp), %rcx
movq 0x138(%rcx), %rcx
movq 0x20(%rsp), %rdx
movl 0x134(%rdx), %edx
subl $0x1, %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, (%rsp)
movq (%rsp), %rax
cmpl $0x0, 0x14(%rax)
je 0x37b53c
movl 0x14(%rsp), %ecx
movq 0x20(%rsp), %rax
movq 0x120(%rax), %rax
movq (%rsp), %rdx
movslq 0x14(%rdx), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x1c(%rax)
movq (%rsp), %rax
cmpl $0x0, 0x18(%rax)
jne 0x37b551
movl 0x14(%rsp), %ecx
movq (%rsp), %rax
movl %ecx, 0x10(%rax)
movl 0x14(%rsp), %ecx
movq (%rsp), %rax
movl %ecx, 0x14(%rax)
movq (%rsp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movq 0x18(%rsp), %rax
movl $0x0, 0x1c(%rax)
movq 0x18(%rsp), %rax
movl $0x0, 0x18(%rax)
movq 0x18(%rsp), %rax
movl $0x0, 0x14(%rax)
movq 0x18(%rsp), %rax
movl $0x0, 0x10(%rax)
movl 0x14(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw (%rax,%rax)