// File: /workspace/github_c_makefile_star2_O2/markdryan[P]subtilis/frontend/reference_type.c
// Function: subtilis_reference_type_realloc
size_t subtilis_reference_type_realloc(subtilis_parser_t *p, size_t loc,
				       size_t store_reg, size_t heap_reg,
				       size_t data_reg, size_t old_size_reg,
				       size_t new_size_reg, size_t delta_reg,
				       size_t alloc_size_reg,
				       subtilis_error_t *err)
{
	if (p->backend.caps & SUBTILIS_BACKEND_HAVE_ALLOC)
		return prv_resize_with_realloc(p, loc, store_reg, heap_reg,
					       data_reg, new_size_reg, err);

	return prv_resize_with_malloc(p, loc, store_reg, heap_reg, data_reg,
				      old_size_reg, new_size_reg, delta_reg,
				      alloc_size_reg, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %rbp
movq %rdx, %r12
movq %rsi, 0x10(%rsp)
movq %rdi, %r13
movq 0x98(%rsp), %rbx
movq 0x80(%rsp), %r14
testb $0x10, 0x8(%rdi)
movq 0x48(%rdi), %rdi
jne 0x4b561
movq %r9, 0x18(%rsp)
movq %r8, 0x30(%rsp)
movq %r12, 0x8(%rsp)
movq 0x90(%rsp), %r12
callq 0x2b774
movq %rax, 0x40(%rsp)
movq 0x48(%r13), %rdi
callq 0x2b774
movq %rax, 0x38(%rsp)
movq 0x48(%r13), %rdi
callq 0x2b774
movq %rax, 0x28(%rsp)
movq 0x48(%r13), %rdi
movq 0x18(%rdi), %r15
leaq 0x1(%r15), %rax
movq %rax, 0x18(%rdi)
cmpq $-0x1, %r12
cmoveq %r14, %r12
movl $0x88, %esi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x2a981
pushq $-0x1
popq %rcx
cmpl $0x0, (%rbx)
jne 0x4b645
movq 0x40(%rsp), %r14
movq %rbp, 0x20(%rsp)
movq 0x48(%r13), %rdi
xorl %esi, %esi
movq 0x18(%rsp), %rdx
movq %rax, %rcx
movq 0x98(%rsp), %rbx
movq %rbx, %r8
callq 0x2a819
cmpl $0x0, (%rbx)
jne 0x4b642
movq 0x48(%r13), %rdi
pushq $0x33
popq %rsi
movq 0x80(%rsp), %rdx
movq %rax, %rcx
movq 0x98(%rsp), %rbx
movq %rbx, %r8
callq 0x2a819
cmpl $0x0, (%rbx)
jne 0x4b642
movq 0x48(%r13), %rdi
pushq $0x43
popq %rsi
movq %rax, %rdx
movq %r14, %rcx
movq 0x38(%rsp), %r8
movq 0x98(%rsp), %rbx
movq %rbx, %r9
callq 0x2a8c1
cmpl $0x0, (%rbx)
jne 0x4b642
movq 0x48(%r13), %rdi
movq %r14, %rsi
movq 0x98(%rsp), %rbx
movq %rbx, %rdx
callq 0x2b781
cmpl $0x0, (%rbx)
jne 0x4b642
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x4ae20
cmpl $0x0, (%rbx)
jne 0x4b642
movq %rax, %rbx
movq %r13, %rdi
movq %rax, %rsi
movq 0x30(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x98(%rsp), %r14
movq %r14, %r8
callq 0x4abdd
cmpl $0x0, (%r14)
jne 0x4b642
movq %r13, %rdi
movq 0x20(%rsp), %rsi
movq 0x98(%rsp), %r14
movq %r14, %rdx
callq 0x4a982
cmpl $0x0, (%r14)
jne 0x4b642
movq 0x10(%rsp), %rbp
leal 0x4(%rbp), %r8d
movq 0x48(%r13), %rdi
pushq $0x17
popq %rsi
movq %rbx, %rdx
movq 0x8(%rsp), %r12
movq %r12, %rcx
movq 0x98(%rsp), %r14
movq %r14, %r9
callq 0x2a8c1
cmpl $0x0, (%r14)
jne 0x4b642
leal 0x8(%rbp), %r8d
movq %r13, %rbp
movq 0x48(%r13), %rdi
pushq $0x17
popq %rsi
movq %rbx, %rdx
movq %r12, %rcx
movq 0x98(%rsp), %r14
movq %r14, %r9
callq 0x2a8c1
cmpl $0x0, (%r14)
jne 0x4b642
movq 0x48(%rbp), %rdi
pushq $0x1d
popq %rsi
movq %r15, %rdx
movq %rbx, %rcx
movq 0x98(%rsp), %rbx
movq %rbx, %r8
callq 0x2a9a4
cmpl $0x0, (%rbx)
jne 0x4b642
movq 0x48(%rbp), %rdi
pushq $0x45
popq %rsi
movq 0x28(%rsp), %rdx
movq 0x98(%rsp), %rbx
movq %rbx, %rcx
callq 0x2a997
cmpl $0x0, (%rbx)
jne 0x4b642
movq 0x48(%rbp), %rdi
movq 0x38(%rsp), %rsi
movq 0x98(%rsp), %rbx
movq %rbx, %rdx
callq 0x2b781
cmpl $0x0, (%rbx)
jne 0x4b642
movq 0x88(%rsp), %rcx
movq 0x48(%rbp), %rdi
movl $0x89, %esi
movq 0x20(%rsp), %rdx
movq 0x98(%rsp), %rbx
movq %rbx, %r8
callq 0x2a9a4
cmpl $0x0, (%rbx)
jne 0x4b642
movq 0x48(%rbp), %rdi
pushq $0x1d
popq %rsi
movq %r15, %rdx
movq 0x30(%rsp), %rcx
movq 0x98(%rsp), %rbx
movq %rbx, %r8
callq 0x2a9a4
cmpl $0x0, (%rbx)
jne 0x4b642
movq 0x48(%rbp), %rdi
movq 0x28(%rsp), %rsi
movq 0x98(%rsp), %rbx
movq %rbx, %rdx
callq 0x2b781
cmpl $0x0, (%rbx)
jne 0x4b642
movq 0x48(%rbp), %rdi
movl 0x10(%rsp), %r8d
pushq $0x17
popq %rsi
movq 0x80(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq 0x98(%rsp), %rbx
movq %rbx, %r9
callq 0x2a8c1
cmpl $0x0, (%rbx)
pushq $-0x1
popq %rcx
jne 0x4b645
movq 0x10(%rsp), %r8
addl $0xc, %r8d
movq 0x48(%rbp), %rdi
pushq $0x17
popq %rsi
movq 0x80(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq 0x98(%rsp), %r9
callq 0x2a8c1
movq %r15, %rcx
jmp 0x4b645
movq %r14, %r15
movq 0x18(%rdi), %r14
leaq 0x1(%r14), %rax
movq %rax, 0x18(%rdi)
pushq $0x2
popq %rsi
movq %r8, %rdx
movq %rbp, %rcx
movq %rbx, %r8
callq 0x2a819
pushq $-0x1
popq %rcx
cmpl $0x0, (%rbx)
jne 0x4b645
movq %rax, 0x18(%rsp)
movq 0x48(%r13), %rdi
pushq $0x77
popq %rsi
movq %rbp, %rdx
movq %r15, %rbp
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
callq 0x2a8c1
cmpl $0x0, (%rbx)
jne 0x4b642
movq %r13, %rdi
movq %rbx, %rsi
callq 0x29c49
cmpl $0x0, (%rbx)
jne 0x4b642
movq %r12, %r15
movabsq $-0x100000000, %r12     # imm = 0xFFFFFFFF00000000
andq %r14, %r12
movq 0x48(%r13), %rdi
movq %rbp, %rdx
movq 0x10(%rsp), %rbp
movl %ebp, %r8d
orq %r12, %r8
pushq $0x17
popq %rsi
movq %r15, %rcx
movq %rbx, %r9
callq 0x2a8c1
cmpl $0x0, (%rbx)
jne 0x4b642
leal 0xc(%rbp), %r8d
movq 0x48(%r13), %rdi
orq %r12, %r8
pushq $0x17
popq %rsi
movq 0x80(%rsp), %rdx
movq %r15, %rcx
movq %rbx, %r9
callq 0x2a8c1
cmpl $0x0, (%rbx)
jne 0x4b642
leal 0x8(%rbp), %r8d
movq 0x48(%r13), %rdi
orq %r12, %r8
pushq $0x17
popq %rsi
movq %r14, %rdx
movq %r15, %rcx
movq %rbx, %r9
callq 0x2a8c1
cmpl $0x0, (%rbx)
je 0x4b657
pushq $-0x1
popq %rcx
movq %rcx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, 0x8(%rsp)
movq 0x48(%r13), %rdi
xorl %ebp, %ebp
xorl %esi, %esi
movq %r14, %rdx
movq 0x18(%rsp), %rcx
movq %rbx, %r8
callq 0x2a819
movq %rbx, %r14
cmpl $0x0, (%rbx)
pushq $-0x1
popq %rcx
jne 0x4b645
movq %rax, %rbx
movq 0x10(%rsp), %rax
addl $0x4, %eax
movq 0x48(%r13), %rdi
orq %rax, %r12
pushq $0x17
popq %rsi
movq %rbx, %rdx
movq 0x8(%rsp), %rcx
movq %r12, %r8
movq %r14, %r9
callq 0x2a8c1
cmpl (%r14), %ebp
sbbq %rbp, %rbp
orq %rbx, %rbp
movq %rbp, %rcx
jmp 0x4b645