// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/array_type.c
// Function: prv_dynamic_vector_alloc
static void prv_dynamic_vector_alloc(subtilis_parser_t *p, size_t loc,
				     const subtilis_type_t *type,
				     subtilis_exp_t *e,
				     subtilis_ir_operand_t store_reg, bool push,
				     subtilis_error_t *err)
{
	subtilis_ir_operand_t neg_label;
	subtilis_ir_operand_t non_neg_label;
	subtilis_ir_operand_t op1;
	subtilis_ir_operand_t condee;
	subtilis_ir_operand_t zero;
	subtilis_ir_operand_t one;
	subtilis_ir_operand_t end_label;
	subtilis_ir_operand_t size;
	size_t data;
	subtilis_exp_t *sizee = NULL;

	end_label.label = subtilis_ir_section_new_label(p->current);
	neg_label.label = subtilis_ir_section_new_label(p->current);
	non_neg_label.label = subtilis_ir_section_new_label(p->current);

	zero.integer = 0;
	condee.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_LTI_I32, e->exp.ir_op, zero, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_JMPC,
					  condee, neg_label, non_neg_label,
					  err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_ir_section_add_label(p->current, neg_label.label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_array_type_vector_zero_ref(p, type, loc, store_reg.reg, false,
					    err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_ir_section_add_instr_no_reg(p->current, SUBTILIS_OP_INSTR_JMP,
					     end_label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	subtilis_ir_section_add_label(p->current, non_neg_label.label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	op1.integer = ((int32_t)loc) + SUBTIILIS_ARRAY_DIMS_OFF;
	subtilis_ir_section_add_instr_reg(p->current,
					  SUBTILIS_OP_INSTR_STOREO_I32,
					  e->exp.ir_op, store_reg, op1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	one.integer = 1;
	size.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_ADDI_I32, e->exp.ir_op, one, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	sizee = subtilis_exp_new_int32_var(size.reg, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	sizee = subtilis_type_if_data_size(p, type, sizee, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return;

	data = subtilis_reference_type_alloc(p, type, loc, store_reg.reg,
					     sizee->exp.ir_op.reg, false, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	prv_clear_new_array(p, type, loc, sizee->exp.ir_op.reg, store_reg, data,
			    err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	subtilis_ir_section_add_label(p->current, end_label.label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	if (push)
		subtilis_reference_type_push_reference(p, type, store_reg.reg,
						       loc, err);

cleanup:

	subtilis_exp_delete(sizee);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movb %r9b, %al
movq 0x10(%rbp), %r9
movq %r8, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
movq $0x0, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x40(%rbp)
movl $0x0, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rbp), %r8
movq 0x148(%rax), %rdx
movq -0x58(%rbp), %rcx
movl $0x3d, %esi
callq 0x38230
movq %rax, -0x50(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c7f4
jmp 0x5ca3e
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq 0x10(%rbp), %r9
movq -0x50(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
movl $0x43, %esi
callq 0x38360
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c824
jmp 0x5ca3e
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x38(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x39960
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c847
jmp 0x5ca3e
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rcx
movq 0x10(%rbp), %r9
xorl %r8d, %r8d
callq 0x5c230
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c871
jmp 0x5ca3e
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq 0x10(%rbp), %rcx
movq -0x68(%rbp), %rdx
movl $0x45, %esi
callq 0x38540
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c899
jmp 0x5ca3e
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x40(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x39960
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c8bc
jmp 0x5ca3e
movq -0x18(%rbp), %rax
addl $0x10, %eax
movl %eax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rbp), %r9
movq 0x148(%rax), %rdx
movq -0x8(%rbp), %rcx
movq -0x48(%rbp), %r8
movl $0x17, %esi
callq 0x38360
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c8fd
jmp 0x5ca3e
movl $0x1, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rbp), %r8
movq 0x148(%rax), %rdx
movq -0x60(%rbp), %rcx
movl $0x9, %esi
callq 0x38230
movq %rax, -0x70(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c93b
jmp 0x5ca3e
movq -0x70(%rbp), %rax
movl %eax, %edi
movq 0x10(%rbp), %rsi
callq 0x37770
movq %rax, -0x80(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c95c
jmp 0x5ca3e
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq 0x10(%rbp), %rcx
callq 0x474f0
movq %rax, -0x80(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c983
jmp 0x5ca3e
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rcx
movq -0x80(%rbp), %rax
movq 0x148(%rax), %r8
movq 0x10(%rbp), %rax
xorl %r9d, %r9d
movq %rax, (%rsp)
callq 0x6e3e0
movq %rax, -0x78(%rbp)
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c9bd
jmp 0x5ca35
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x80(%rbp), %rax
movq 0x148(%rax), %rcx
movq -0x78(%rbp), %r9
movq 0x10(%rbp), %rax
movq -0x8(%rbp), %r8
movq %rax, (%rsp)
callq 0x5ce40
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5c9f4
jmp 0x5ca35
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x68(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x39960
movq 0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5ca14
jmp 0x5ca35
testb $0x1, -0x29(%rbp)
je 0x5ca33
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x8(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq 0x10(%rbp), %r8
callq 0x6d540
jmp 0x5ca35
movq -0x80(%rbp), %rdi
callq 0x36ee0
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)