// File: /workspace/github_c_makefile_star2_O1/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 %rcx, %rbp
movq %rdx, %r15
movq %rsi, %rdx
movq %rdi, %r13
movq 0x60(%rsp), %r12
cmpl $0x1, (%rcx)
jne 0x41d38
cmpl $0x0, 0x148(%rbp)
js 0x41eb7
movl %r9d, %ebx
movq %r15, %r14
movq %rdx, %r15
movq %r8, 0x8(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
callq 0x362d2
cmpl $0x0, (%r12)
jne 0x41ea8
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x36269
movq %rax, %rbp
cmpl $0x0, (%r12)
jne 0x41d22
movq %r12, (%rsp)
movzbl %bl, %r9d
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq 0x8(%rsp), %r8
callq 0x41f6c
movq %rbp, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2b4c3
movl %r9d, 0x1c(%rsp)
movq %rdx, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movq 0x48(%r13), %rdi
callq 0x2d00a
movq %rax, 0x20(%rsp)
movq 0x48(%r13), %rdi
callq 0x2d00a
movq %rax, %r14
movq 0x48(%r13), %rdi
callq 0x2d00a
movq %rax, %rbx
movq 0x48(%r13), %rdi
movq 0x148(%rbp), %rdx
movl $0x3d, %esi
xorl %ecx, %ecx
movq %r12, %r8
callq 0x2c00f
cmpl $0x0, (%r12)
jne 0x41ea8
movq 0x48(%r13), %rdi
movl $0x43, %esi
movq %rax, %rdx
movq %r14, %rcx
movq %rbx, %r8
movq %r12, %r9
callq 0x2c0c2
cmpl $0x0, (%r12)
jne 0x41ea8
movq 0x48(%r13), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2d017
cmpl $0x0, (%r12)
jne 0x41ea8
movq %r13, %rdi
movq %r15, %rsi
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rcx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x41aa2
cmpl $0x0, (%r12)
jne 0x41ea8
movq 0x48(%r13), %rdi
movl $0x45, %esi
movq 0x20(%rsp), %rdx
movq %r12, %rcx
callq 0x2c19f
cmpl $0x0, (%r12)
jne 0x41ea8
movq 0x48(%r13), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2d017
cmpl $0x0, (%r12)
jne 0x41ea8
movq 0x10(%rsp), %rax
leal 0x10(%rax), %r8d
movq 0x48(%r13), %rdi
movq 0x148(%rbp), %rdx
movl $0x17, %esi
movq 0x8(%rsp), %rcx
movq %r12, %r9
callq 0x2c0c2
cmpl $0x0, (%r12)
jne 0x41ea8
movq 0x48(%r13), %rdi
movq 0x148(%rbp), %rdx
movl $0x1, %ecx
movl $0x9, %esi
movq %r12, %r8
callq 0x2c00f
cmpl $0x0, (%r12)
jne 0x41ea8
movl %eax, %edi
movq %r12, %rsi
callq 0x2ba99
cmpl $0x0, (%r12)
jne 0x41ea8
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %r12, %rcx
callq 0x35f2b
cmpl $0x0, (%r12)
je 0x41edc
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
movq %r15, %rsi
movq %r8, %rcx
movl $0x1, %r8d
movq %r12, %r9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x41aa2
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 0x4ddee
cmpl $0x0, (%r12)
jne 0x41f64
movq 0x148(%rbx), %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %r12, %r8
callq 0x367bc
cmpl $0x0, (%r12)
jne 0x41f64
movq 0x48(%r13), %rdi
movq 0x20(%rsp), %rsi
movq %r12, %rdx
callq 0x2d017
cmpl $0x0, (%r12)
setne %al
movl 0x1c(%rsp), %ecx
xorb $0x1, %cl
orb %al, %cl
jne 0x41f64
movq %r13, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %r12, %r8
callq 0x4d4ea
movq %rbx, %rdi
jmp 0x41d25