// File: /workspace/github_c_makefile_star2_O2/markdryan[P]subtilis/frontend/array_type.c
// Function: subtilis_array_type_vector_alloc
void subtilis_array_type_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)
{
	if (e->type.type == SUBTILIS_TYPE_CONST_INTEGER) {
		if (e->exp.ir_op.integer < 0) {
			subtilis_array_type_vector_zero_ref(
			    p, type, loc, store_reg.reg, true, err);
			return;
		}

		e = subtilis_type_if_dup(e, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
		e = subtilis_type_if_exp_to_var(p, e, err);
		if (err->type == SUBTILIS_ERROR_OK)
			prv_1d_static_alloc(p, loc, type, e, store_reg, push,
					    err);
		subtilis_exp_delete(e);
	} else {
		prv_dynamic_vector_alloc(p, loc, type, e, store_reg, push, err);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r14
movq %rcx, %rbp
movq %rdx, %r15
movq %rsi, %rdx
movq %rdi, %r13
movq 0x60(%rsp), %r12
cmpl $0x1, (%rcx)
jne 0x3f6a2
cmpl $0x0, 0x148(%rbp)
js 0x3f815
movl %r9d, %ebx
movq %r15, 0x8(%rsp)
movq %rdx, %r15
movq %rbp, %rdi
movq %r12, %rsi
callq 0x341c4
cmpl $0x0, (%r12)
jne 0x3f806
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x3415f
movq %rax, %rbp
cmpl $0x0, (%r12)
jne 0x3f68c
movq %r12, (%rsp)
movzbl %bl, %r9d
movq %r13, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
movq %rbp, %rcx
movq %r14, %r8
callq 0x3f8c8
movq %rbp, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x29d88
movl %r9d, 0x1c(%rsp)
movq %rdx, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movq 0x48(%r13), %rdi
callq 0x2b774
movq %rax, 0x20(%rsp)
movq 0x48(%r13), %rdi
callq 0x2b774
movq %rax, %r14
movq 0x48(%r13), %rdi
callq 0x2b774
movq %rax, %rbx
movq 0x48(%r13), %rdi
movq 0x148(%rbp), %rdx
pushq $0x3d
popq %rsi
xorl %ecx, %ecx
movq %r12, %r8
callq 0x2a819
cmpl $0x0, (%r12)
jne 0x3f806
movq 0x48(%r13), %rdi
pushq $0x43
popq %rsi
movq %rax, %rdx
movq %r14, %rcx
movq %rbx, %r8
movq %r12, %r9
callq 0x2a8c1
cmpl $0x0, (%r12)
jne 0x3f806
movq 0x48(%r13), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2b781
cmpl $0x0, (%r12)
jne 0x3f806
movq %r13, %rdi
movq %r15, %rsi
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rcx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x3f414
cmpl $0x0, (%r12)
jne 0x3f806
movq 0x48(%r13), %rdi
pushq $0x45
popq %rsi
movq 0x20(%rsp), %rdx
movq %r12, %rcx
callq 0x2a997
cmpl $0x0, (%r12)
jne 0x3f806
movq 0x48(%r13), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2b781
cmpl $0x0, (%r12)
jne 0x3f806
movq 0x10(%rsp), %rax
leal 0x10(%rax), %r8d
movq 0x48(%r13), %rdi
movq 0x148(%rbp), %rdx
pushq $0x17
popq %rsi
movq 0x8(%rsp), %rcx
movq %r12, %r9
callq 0x2a8c1
cmpl $0x0, (%r12)
jne 0x3f806
movq 0x48(%r13), %rdi
movq 0x148(%rbp), %rdx
pushq $0x9
popq %rsi
pushq $0x1
popq %rcx
movq %r12, %r8
callq 0x2a819
cmpl $0x0, (%r12)
jne 0x3f806
movl %eax, %edi
movq %r12, %rsi
callq 0x2a336
cmpl $0x0, (%r12)
jne 0x3f806
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %r12, %rcx
callq 0x33e43
cmpl $0x0, (%r12)
je 0x3f838
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %r8
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rcx
movq %r12, %r9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3f414
movq %rax, %rbx
movq 0x148(%rax), %r8
movq %r12, (%rsp)
movq %r13, %rdi
movq %r15, %rsi
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rcx
xorl %r9d, %r9d
callq 0x4b101
cmpl $0x0, (%r12)
jne 0x3f8c0
movq 0x148(%rbx), %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %r12, %r8
callq 0x3467c
cmpl $0x0, (%r12)
jne 0x3f8c0
movq 0x48(%r13), %rdi
movq 0x20(%rsp), %rsi
movq %r12, %rdx
callq 0x2b781
cmpl $0x0, (%r12)
setne %al
movl 0x1c(%rsp), %ecx
xorb $0x1, %cl
orb %al, %cl
jne 0x3f8c0
movq %r13, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %r12, %r8
callq 0x4a8be
movq %rbx, %rdi
jmp 0x3f68f