// File: /workspace/github_c_makefile_star2_O3/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 0x41c0b
cmpl $0x0, 0x148(%rbp)
js 0x41d8a
movl %r9d, %ebx
movq %r15, %r14
movq %rdx, %r15
movq %r8, 0x8(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
callq 0x36182
cmpl $0x0, (%r12)
jne 0x41d7b
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x36119
movq %rax, %rbp
cmpl $0x0, (%r12)
jne 0x41bf5
movq %r12, (%rsp)
movzbl %bl, %r9d
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq 0x8(%rsp), %r8
callq 0x41e3f
movq %rbp, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2b166
movl %r9d, 0x1c(%rsp)
movq %rdx, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movq 0x48(%r13), %rdi
callq 0x2cc99
movq %rax, 0x20(%rsp)
movq 0x48(%r13), %rdi
callq 0x2cc99
movq %rax, %r14
movq 0x48(%r13), %rdi
callq 0x2cc99
movq %rax, %rbx
movq 0x48(%r13), %rdi
movq 0x148(%rbp), %rdx
movl $0x3d, %esi
xorl %ecx, %ecx
movq %r12, %r8
callq 0x2bc8f
cmpl $0x0, (%r12)
jne 0x41d7b
movq 0x48(%r13), %rdi
movl $0x43, %esi
movq %rax, %rdx
movq %r14, %rcx
movq %rbx, %r8
movq %r12, %r9
callq 0x2bd42
cmpl $0x0, (%r12)
jne 0x41d7b
movq 0x48(%r13), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2cca6
cmpl $0x0, (%r12)
jne 0x41d7b
movq %r13, %rdi
movq %r15, %rsi
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rcx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x41975
cmpl $0x0, (%r12)
jne 0x41d7b
movq 0x48(%r13), %rdi
movl $0x45, %esi
movq 0x20(%rsp), %rdx
movq %r12, %rcx
callq 0x2be1f
cmpl $0x0, (%r12)
jne 0x41d7b
movq 0x48(%r13), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2cca6
cmpl $0x0, (%r12)
jne 0x41d7b
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 0x2bd42
cmpl $0x0, (%r12)
jne 0x41d7b
movq 0x48(%r13), %rdi
movq 0x148(%rbp), %rdx
movl $0x1, %ecx
movl $0x9, %esi
movq %r12, %r8
callq 0x2bc8f
cmpl $0x0, (%r12)
jne 0x41d7b
movl %eax, %edi
movq %r12, %rsi
callq 0x2b71f
cmpl $0x0, (%r12)
jne 0x41d7b
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %r12, %rcx
callq 0x35ddb
cmpl $0x0, (%r12)
je 0x41daf
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 0x41975
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 0x4ddaa
cmpl $0x0, (%r12)
jne 0x41e37
movq 0x148(%rbx), %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %r12, %r8
callq 0x3666c
cmpl $0x0, (%r12)
jne 0x41e37
movq 0x48(%r13), %rdi
movq 0x20(%rsp), %rsi
movq %r12, %rdx
callq 0x2cca6
cmpl $0x0, (%r12)
setne %al
movl 0x1c(%rsp), %ecx
xorb $0x1, %cl
orb %al, %cl
jne 0x41e37
movq %r13, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %r12, %r8
callq 0x4d4a6
movq %rbx, %rdi
jmp 0x41bf8