// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/ma.c
// Function: gt_realloc_mem
void* gt_realloc_mem(void *ptr, size_t size, const char *src_file, int src_line)
{
  MAInfo *mainfo;
  void *mem;
  gt_assert(ma);
  if (ma->bookkeeping) {
    gt_mutex_lock(bookkeeping_lock);
    ma->mallocevents++;
    if (ptr) {
      mainfo = gt_hashmap_get(ma->allocated_pointer, ptr);
      gt_assert(mainfo);
      subtract_size(ma, mainfo->size);
      gt_hashmap_remove(ma->allocated_pointer, ptr);
    }
    mainfo = xmalloc(sizeof *mainfo, ma->current_size, src_file, src_line);
    mainfo->size = size;
    mainfo->src_file = src_file;
    mainfo->src_line = src_line;
    mem = xrealloc(ptr, size, ma->current_size, src_file, src_line);
    gt_hashmap_add(ma->allocated_pointer, mem, mainfo);
    add_size(ma, size);
    gt_mutex_unlock(bookkeeping_lock);
    return mem;
  }
  return xrealloc(ptr, size, ma->current_size, src_file, src_line);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movl %ecx, 0x14(%rsp)
cmpq $0x0, 0x1a8b81(%rip)    # 0x1b62d0
jne 0xd789
movq 0x1a6880(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x150904(%rip), %rsi    # 0x15e066
leaq 0x150d38(%rip), %rdx    # 0x15e4a1
leaq 0x150d7a(%rip), %rcx    # 0x15e4ea
leaq 0x150d38(%rip), %r8     # 0x15e4af
movl $0xb7, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xd78b
movq 0x1a8b3e(%rip), %rax    # 0x1b62d0
testb $0x1, 0x8(%rax)
je 0xd8fc
movq 0x1a8b35(%rip), %rdi    # 0x1b62d8
callq 0x1c340
movq 0x1a8b21(%rip), %rax    # 0x1b62d0
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
cmpq $0x0, 0x28(%rsp)
je 0xd84a
movq 0x1a8b02(%rip), %rax    # 0x1b62d0
movq (%rax), %rdi
movq 0x28(%rsp), %rsi
callq 0x86470
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0xd820
movq 0x1a67e9(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x15086d(%rip), %rsi    # 0x15e066
leaq 0x150cf9(%rip), %rdx    # 0x15e4f9
leaq 0x150ce3(%rip), %rcx    # 0x15e4ea
leaq 0x150ca1(%rip), %r8     # 0x15e4af
movl $0xbd, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xd822
movq 0x1a8aa7(%rip), %rdi    # 0x1b62d0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
callq 0xd930
movq 0x1a8a93(%rip), %rax    # 0x1b62d0
movq (%rax), %rdi
movq 0x28(%rsp), %rsi
callq 0x86580
movq 0x1a8a7f(%rip), %rax    # 0x1b62d0
movq 0x18(%rax), %rsi
movq 0x18(%rsp), %rdx
movl 0x14(%rsp), %ecx
movl $0x18, %edi
callq 0xd450
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
movl 0x14(%rsp), %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x1a8a2b(%rip), %rax    # 0x1b62d0
movq 0x18(%rax), %rdx
movq 0x18(%rsp), %rcx
movl 0x14(%rsp), %r8d
callq 0xda00
movq %rax, (%rsp)
movq 0x1a8a0d(%rip), %rax    # 0x1b62d0
movq (%rax), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x86510
movq 0x1a89f5(%rip), %rdi    # 0x1b62d0
movq 0x20(%rsp), %rsi
callq 0xd500
movq 0x1a89ec(%rip), %rdi    # 0x1b62d8
callq 0x1c3e0
movq (%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0xd925
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x1a89c3(%rip), %rax    # 0x1b62d0
movq 0x18(%rax), %rdx
movq 0x18(%rsp), %rcx
movl 0x14(%rsp), %r8d
callq 0xda00
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nop