// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: copyEntityTable
static int
copyEntityTable(HASH_TABLE *newTable,
                STRING_POOL *newPool,
                const HASH_TABLE *oldTable)
{
  HASH_TABLE_ITER iter;
  const XML_Char *cachedOldBase = NULL;
  const XML_Char *cachedNewBase = NULL;

  hashTableIterInit(&iter, oldTable);

  for (;;) {
    ENTITY *newE;
    const XML_Char *name;
    const ENTITY *oldE = (ENTITY *)hashTableIterNext(&iter);
    if (!oldE)
      break;
    name = poolCopyString(newPool, oldE->name);
    if (!name)
      return 0;
    newE = (ENTITY *)lookup(newTable, name, sizeof(ENTITY));
    if (!newE)
      return 0;
    if (oldE->systemId) {
      const XML_Char *tem = poolCopyString(newPool, oldE->systemId);
      if (!tem)
        return 0;
      newE->systemId = tem;
      if (oldE->base) {
        if (oldE->base == cachedOldBase)
          newE->base = cachedNewBase;
        else {
          cachedOldBase = oldE->base;
          tem = poolCopyString(newPool, cachedOldBase);
          if (!tem)
            return 0;
          cachedNewBase = newE->base = tem;
        }
      }
      if (oldE->publicId) {
        tem = poolCopyString(newPool, oldE->publicId);
        if (!tem)
          return 0;
        newE->publicId = tem;
      }
    }
    else {
      const XML_Char *tem = poolCopyStringN(newPool, oldE->textPtr,
                                            oldE->textLen);
      if (!tem)
        return 0;
      newE->textPtr = tem;
      newE->textLen = oldE->textLen;
    }
    if (oldE->notation) {
      const XML_Char *tem = poolCopyString(newPool, oldE->notation);
      if (!tem)
        return 0;
      newE->notation = tem;
    }
    newE->is_param = oldE->is_param;
    newE->is_internal = oldE->is_internal;
  }
  return 1;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x58(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x37fe50
leaq 0x48(%rsp), %rdi
callq 0x37fe90
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x381560
jmp 0x381782
movq 0x60(%rsp), %rdi
movq 0x20(%rsp), %rax
movq (%rax), %rsi
callq 0x373d60
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x38158c
movl $0x0, 0x74(%rsp)
jmp 0x38178a
movq 0x68(%rsp), %rdi
movq 0x28(%rsp), %rsi
movl $0x40, %edx
callq 0x37ade0
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x3815ba
movl $0x0, 0x74(%rsp)
jmp 0x38178a
movq 0x20(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x3816c6
movq 0x60(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rsi
callq 0x373d60
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x3815f7
movl $0x0, 0x74(%rsp)
jmp 0x38178a
movq 0x18(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x38167d
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
cmpq 0x40(%rsp), %rax
jne 0x381631
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x38167b
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x60(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x373d60
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x381668
movl $0x0, 0x74(%rsp)
jmp 0x38178a
movq 0x18(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rax, 0x20(%rcx)
movq %rax, 0x38(%rsp)
jmp 0x38167d
movq 0x20(%rsp), %rax
cmpq $0x0, 0x28(%rax)
je 0x3816c4
movq 0x60(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rsi
callq 0x373d60
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x3816b6
movl $0x0, 0x74(%rsp)
jmp 0x38178a
movq 0x18(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x28(%rax)
jmp 0x381719
movq 0x60(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rsp), %rax
movl 0x10(%rax), %edx
callq 0x3817a0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x3816fb
movl $0x0, 0x74(%rsp)
jmp 0x38178a
movq 0x10(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x20(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x30(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x38175d
movq 0x60(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rsi
callq 0x373d60
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x38174f
movl $0x0, 0x74(%rsp)
jmp 0x38178a
movq 0x8(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x20(%rsp), %rax
movb 0x39(%rax), %cl
movq 0x30(%rsp), %rax
movb %cl, 0x39(%rax)
movq 0x20(%rsp), %rax
movb 0x3a(%rax), %cl
movq 0x30(%rsp), %rax
movb %cl, 0x3a(%rax)
jmp 0x381544
movl $0x1, 0x74(%rsp)
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)