// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: poolGrow
static XML_Bool FASTCALL
poolGrow(STRING_POOL *pool)
{
  if (pool->freeBlocks) {
    if (pool->start == 0) {
      pool->blocks = pool->freeBlocks;
      pool->freeBlocks = pool->freeBlocks->next;
      pool->blocks->next = NULL;
      pool->start = pool->blocks->s;
      pool->end = pool->start + pool->blocks->size;
      pool->ptr = pool->start;
      return XML_TRUE;
    }
    if (pool->end - pool->start < pool->freeBlocks->size) {
      BLOCK *tem = pool->freeBlocks->next;
      pool->freeBlocks->next = pool->blocks;
      pool->blocks = pool->freeBlocks;
      pool->freeBlocks = tem;
      memcpy(pool->blocks->s, pool->start,
             (pool->end - pool->start) * sizeof(XML_Char));
      pool->ptr = pool->blocks->s + (pool->ptr - pool->start);
      pool->start = pool->blocks->s;
      pool->end = pool->start + pool->blocks->size;
      return XML_TRUE;
    }
  }
  if (pool->blocks && pool->start == pool->blocks->s) {
    int blockSize = (int)(pool->end - pool->start)*2;
    pool->blocks = (BLOCK *)
      pool->mem->realloc_fcn(pool->blocks,
                             (offsetof(BLOCK, s)
                              + blockSize * sizeof(XML_Char)));
    if (pool->blocks == NULL)
      return XML_FALSE;
    pool->blocks->size = blockSize;
    pool->ptr = pool->blocks->s + (pool->ptr - pool->start);
    pool->start = pool->blocks->s;
    pool->end = pool->start + blockSize;
  }
  else {
    BLOCK *tem;
    int blockSize = (int)(pool->end - pool->start);
    if (blockSize < INIT_BLOCK_SIZE)
      blockSize = INIT_BLOCK_SIZE;
    else
      blockSize *= 2;
    tem = (BLOCK *)pool->mem->malloc_fcn(offsetof(BLOCK, s)
                                        + blockSize * sizeof(XML_Char));
    if (!tem)
      return XML_FALSE;
    tem->size = blockSize;
    tem->next = pool->blocks;
    pool->blocks = tem;
    if (pool->ptr != pool->start)
      memcpy(tem->s, pool->start,
             (pool->ptr - pool->start) * sizeof(XML_Char));
    pool->ptr = tem->s + (pool->ptr - pool->start);
    pool->start = tem->s;
    pool->end = tem->s + blockSize;
  }
  return XML_TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x257921
movq 0x20(%rbx), %rsi
testq %rsi, %rsi
je 0x2579b6
movq 0x10(%rbx), %rdx
subq %rsi, %rdx
movslq 0x8(%rdi), %rax
cmpq %rax, %rdx
jge 0x257921
movq (%rdi), %rax
movq (%rbx), %rcx
movq %rcx, (%rdi)
movq %rdi, (%rbx)
movq %rax, 0x8(%rbx)
addq $0xc, %rdi
callq 0x17660
movq (%rbx), %rax
movq 0x18(%rbx), %rcx
subq 0x20(%rbx), %rcx
leaq 0xc(%rax), %rdx
addq %rax, %rcx
addq $0xc, %rcx
movq %rcx, 0x18(%rbx)
movq %rdx, 0x20(%rbx)
movslq 0x8(%rax), %rcx
addq %rcx, %rax
addq $0xc, %rax
jmp 0x257a27
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x25793a
movq 0x20(%rbx), %rax
leaq 0xc(%rdi), %rcx
cmpq %rcx, %rax
je 0x2579e4
movl 0x10(%rbx), %eax
subl 0x20(%rbx), %eax
leal (%rax,%rax), %r15d
movl $0x400, %ecx            # imm = 0x400
cmpl %ecx, %eax
cmovll %ecx, %r15d
movq 0x28(%rbx), %rax
leaq 0xc(%r15), %rdi
callq *(%rax)
testq %rax, %rax
je 0x257a2f
movq %rax, %r14
movl %r15d, 0x8(%rax)
movq (%rbx), %rax
movq %rax, (%r14)
movq %r14, (%rbx)
movq 0x18(%rbx), %rdx
movq 0x20(%rbx), %rsi
subq %rsi, %rdx
je 0x257988
leaq 0xc(%r14), %rdi
callq 0x17660
leaq 0xc(%r14), %rax
movq 0x18(%rbx), %rcx
subq 0x20(%rbx), %rcx
addq %r14, %rcx
addq $0xc, %rcx
movq %rcx, 0x18(%rbx)
movq %rax, 0x20(%rbx)
leaq (%r14,%r15), %rax
addq $0xc, %rax
movq %rax, 0x10(%rbx)
testq %r14, %r14
jne 0x257a2b
jmp 0x257a2f
movq %rdi, (%rbx)
movq (%rdi), %rax
movq %rax, 0x8(%rbx)
movq $0x0, (%rdi)
leaq 0xc(%rdi), %rax
movq %rax, 0x20(%rbx)
movslq 0x8(%rdi), %rcx
addq %rdi, %rcx
addq $0xc, %rcx
movq %rcx, 0x10(%rbx)
movq %rax, 0x18(%rbx)
jmp 0x257a2b
movl 0x10(%rbx), %ecx
subl %eax, %ecx
addl %ecx, %ecx
movq 0x28(%rbx), %rax
movslq %ecx, %r14
leaq 0xc(%r14), %rsi
callq *0x8(%rax)
movq %rax, (%rbx)
testq %rax, %rax
je 0x257a2f
movl %r14d, 0x8(%rax)
leaq 0xc(%rax), %rcx
movq 0x18(%rbx), %rdx
subq 0x20(%rbx), %rdx
addq %rax, %rdx
addq $0xc, %rdx
movq %rdx, 0x18(%rbx)
movq %rcx, 0x20(%rbx)
addq %r14, %rax
addq $0xc, %rax
movq %rax, 0x10(%rbx)
movb $0x1, %al
jmp 0x257a31
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq