// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq %rdx, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, %r13
movq 0x98(%rsp), %rbx
movq 0x80(%rsp), %r14
testb $0x10, 0x8(%rdi)
movq 0x48(%rdi), %rdi
jne 0x4e281
movq %r9, 0x38(%rsp)
movq %r8, 0x28(%rsp)
movq 0x90(%rsp), %r12
callq 0x2d00a
movq %rax, 0x40(%rsp)
movq 0x48(%r13), %rdi
callq 0x2d00a
movq %rax, 0x30(%rsp)
movq 0x48(%r13), %rdi
callq 0x2d00a
movq %rax, 0x20(%rsp)
movq 0x48(%r13), %rdi
movq 0x18(%rdi), %rbp
leaq 0x1(%rbp), %rax
movq %rax, 0x18(%rdi)
cmpq $-0x1, %r12
cmoveq %r14, %r12
movl $0x88, %esi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x2c189
movq $-0x1, %rcx
cmpl $0x0, (%rbx)
jne 0x4e37c
movq 0x40(%rsp), %r14
movq %r15, 0x18(%rsp)
movq 0x48(%r13), %rdi
xorl %esi, %esi
movq 0x38(%rsp), %rdx
movq %rax, %rcx
movq 0x98(%rsp), %rbx
movq %rbx, %r8
callq 0x2c00f
cmpl $0x0, (%rbx)
jne 0x4e375
movq %r13, %r15
movq 0x48(%r13), %rdi
movl $0x33, %esi
movq 0x80(%rsp), %rdx
movq %rax, %rcx
movq 0x98(%rsp), %rbx
movq %rbx, %r8
callq 0x2c00f
cmpl $0x0, (%rbx)
jne 0x4e375
movq 0x48(%r15), %rdi
movl $0x43, %esi
movq %rax, %rdx
movq %r14, %rcx
movq 0x30(%rsp), %r8
movq 0x98(%rsp), %rbx
movq %rbx, %r9
callq 0x2c0c2
cmpl $0x0, (%rbx)
jne 0x4e375
movq 0x48(%r15), %rdi
movq %r14, %rsi
movq 0x98(%rsp), %rbx
movq %rbx, %rdx
callq 0x2d017
cmpl $0x0, (%rbx)
jne 0x4e375
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x4dad1
cmpl $0x0, (%rbx)
jne 0x4e375
movq %rax, %rbx
movq %r15, %rdi
movq %rax, %rsi
movq 0x28(%rsp), %rdx
movq 0x38(%rsp), %rcx
movq 0x98(%rsp), %r14
movq %r14, %r8
callq 0x4d830
cmpl $0x0, (%r14)
jne 0x4e375
movq %r15, %rdi
movq 0x18(%rsp), %rsi
movq 0x98(%rsp), %r14
movq %r14, %rdx
callq 0x4d5af
cmpl $0x0, (%r14)
jne 0x4e375
movq 0x10(%rsp), %r13
leal 0x4(%r13), %r8d
movq 0x48(%r15), %rdi
movl $0x17, %esi
movq %rbx, %rdx
movq 0x8(%rsp), %r12
movq %r12, %rcx
movq 0x98(%rsp), %r14
movq %r14, %r9
callq 0x2c0c2
cmpl $0x0, (%r14)
jne 0x4e375
leal 0x8(%r13), %r8d
movq %r15, %r13
movq 0x48(%r15), %rdi
movl $0x17, %esi
movq %rbx, %rdx
movq %r12, %rcx
movq 0x98(%rsp), %r14
movq %r14, %r9
callq 0x2c0c2
cmpl $0x0, (%r14)
jne 0x4e375
movq 0x48(%r13), %rdi
movl $0x1d, %esi
movq %rbp, %rdx
movq %rbx, %rcx
movq 0x98(%rsp), %rbx
movq %rbx, %r8
callq 0x2c1ac
cmpl $0x0, (%rbx)
jne 0x4e375
movq 0x48(%r13), %rdi
movl $0x45, %esi
movq 0x20(%rsp), %rdx
movq 0x98(%rsp), %rbx
movq %rbx, %rcx
callq 0x2c19f
cmpl $0x0, (%rbx)
jne 0x4e375
movq 0x48(%r13), %rdi
movq 0x30(%rsp), %rsi
movq 0x98(%rsp), %rbx
movq %rbx, %rdx
callq 0x2d017
cmpl $0x0, (%rbx)
jne 0x4e375
movq 0x88(%rsp), %rcx
movq 0x48(%r13), %rdi
movl $0x89, %esi
movq 0x18(%rsp), %rdx
movq 0x98(%rsp), %rbx
movq %rbx, %r8
callq 0x2c1ac
cmpl $0x0, (%rbx)
jne 0x4e375
movq 0x48(%r13), %rdi
movl $0x1d, %esi
movq %rbp, %rdx
movq 0x28(%rsp), %rcx
movq 0x98(%rsp), %rbx
movq %rbx, %r8
callq 0x2c1ac
cmpl $0x0, (%rbx)
jne 0x4e375
movq 0x48(%r13), %rdi
movq 0x20(%rsp), %rsi
movq 0x98(%rsp), %rbx
movq %rbx, %rdx
callq 0x2d017
cmpl $0x0, (%rbx)
jne 0x4e375
movq 0x48(%r13), %rdi
movl 0x10(%rsp), %r8d
movl $0x17, %esi
movq 0x80(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq 0x98(%rsp), %rbx
movq %rbx, %r9
callq 0x2c0c2
cmpl $0x0, (%rbx)
movq $-0x1, %rcx
jne 0x4e37c
movq 0x10(%rsp), %r8
addl $0xc, %r8d
movq 0x48(%r13), %rdi
movl $0x17, %esi
movq 0x80(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq 0x98(%rsp), %r9
callq 0x2c0c2
jmp 0x4e3e6
movq %r14, %rbp
movq 0x18(%rdi), %r14
leaq 0x1(%r14), %rax
movq %rax, 0x18(%rdi)
movl $0x2, %esi
movq %r8, %rdx
movq %r15, %rcx
movq %rbx, %r8
callq 0x2c00f
movq $-0x1, %rcx
cmpl $0x0, (%rbx)
jne 0x4e37c
movq %rax, %r12
movq 0x48(%r13), %rdi
movl $0x77, %esi
movq %r15, %rdx
movq %rbp, %r15
movq %rbp, %rcx
movq %r14, %r8
movq %rbx, %r9
callq 0x2c0c2
cmpl $0x0, (%rbx)
jne 0x4e375
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2b37c
cmpl $0x0, (%rbx)
jne 0x4e375
movq %r15, %rdx
movabsq $-0x100000000, %r15     # imm = 0xFFFFFFFF00000000
andq %r14, %r15
movq 0x48(%r13), %rdi
movq 0x10(%rsp), %rbp
movl %ebp, %r8d
orq %r15, %r8
movl $0x17, %esi
movq 0x8(%rsp), %rcx
movq %rbx, %r9
callq 0x2c0c2
cmpl $0x0, (%rbx)
jne 0x4e375
leal 0xc(%rbp), %r8d
movq 0x48(%r13), %rdi
orq %r15, %r8
movl $0x17, %esi
movq 0x80(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq %rbx, %r9
callq 0x2c0c2
cmpl $0x0, (%rbx)
jne 0x4e375
leal 0x8(%rbp), %r8d
movq 0x48(%r13), %rdi
orq %r15, %r8
movl $0x17, %esi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
movq %rbx, %r9
callq 0x2c0c2
cmpl $0x0, (%rbx)
je 0x4e38e
movq $-0x1, %rcx
movq %rcx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x48(%r13), %rdi
xorl %ebp, %ebp
xorl %esi, %esi
movq %r14, %rdx
movq %r12, %rcx
movq %rbx, %r8
callq 0x2c00f
movq %rbx, %r14
cmpl $0x0, (%rbx)
movq $-0x1, %rcx
jne 0x4e37c
movq %rax, %rbx
movq 0x10(%rsp), %rax
addl $0x4, %eax
movq 0x48(%r13), %rdi
orq %rax, %r15
movl $0x17, %esi
movq %rbx, %rdx
movq 0x8(%rsp), %rcx
movq %r15, %r8
movq %r14, %r9
callq 0x2c0c2
cmpl (%r14), %ebp
sbbq %rbp, %rbp
orq %rbx, %rbp
movq %rbp, %rcx
jmp 0x4e37c