// File: /workspace/github_cpp_makefile_star2_O2/lhydave[P]SysYCompilerLab/front/node.cpp
// Function: sysY_AST::array_exp_node::array_exp_node(sysY_AST::exp_node*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
array_exp_node::array_exp_node(
	exp_node *first_dim, const string &_sysy_array_name) :
	exp_node(EXP_ARRAY),
	sysy_array_name(_sysy_array_name)
{
	var_entry query;
	if (!find_var(sysy_array_name, query)) // not defined
	{
		string msg = "identifier '" + sysy_array_name + "' is not defined";
		yyerror(msg.c_str());
		return;
	}
	if (!query.is_array) // not an array
	{
		if (first_dim) // should not be indexed!
		{
			string msg = "identifier '" + sysy_array_name + "' is not an array";
			yyerror(msg.c_str());
			return;
		}
		exp_type = EXP_VAR;
		eeyore_name = query.eeyore_name;
	}
	else
		while (first_dim) // an array
		{
			first_dim->reduce();
			first_dim->new_temp();
			assert(exp_type != EXP_INITVAL);
			sysy_idx.push_back(first_dim);
			first_dim = first_dim->next;
		}
	reduce();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc0, %rsp
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %rbx
movq %rsi, (%rsp)
leaq 0x15060(%rip), %rsi     # 0x1f91c
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x68d2
pushq $0x4
popq %rsi
leaq 0x48(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xa466
leaq 0x48(%rsp), %rdi
callq 0x5548
leaq 0x22c84(%rip), %rax     # 0x2d578
movq %rax, (%rbx)
leaq 0xa0(%rbx), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0xa0(%rbx)
andq $0x0, 0xb0(%rbx)
leaq 0xc0(%rbx), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x5380
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x38(%rax)
leaq 0x48(%rsp), %rsi
movq %r15, %rdi
callq 0xe814
testb %al, %al
je 0xa9a7
cmpb $0x1, 0x88(%rsp)
jne 0xa9d3
movq %rsp, %r13
testq %r12, %r12
je 0xaa44
movq (%r12), %rax
movq %r12, %rdi
callq *0x18(%rax)
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq %r14, %rdi
movq %r13, %rsi
callq 0xc754
movq (%rsp), %rax
movq 0x40(%rax), %r12
movq %r12, (%rsp)
jmp 0xa971
leaq 0x140d6(%rip), %rsi     # 0x1ea84
leaq 0x8(%rsp), %rdi
movq %r15, %rdx
callq 0xc598
leaq 0x140cf(%rip), %rdx     # 0x1ea91
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc579
jmp 0xaa02
testq %r12, %r12
je 0xaa2c
leaq 0x140a5(%rip), %rsi     # 0x1ea84
leaq 0x8(%rsp), %rdi
movq %r15, %rdx
callq 0xc598
leaq 0x140af(%rip), %rdx     # 0x1eaa2
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc579
leaq 0x8(%rsp), %rdi
callq 0x5548
leaq 0x28(%rsp), %rbx
movq (%rbx), %rdi
leaq 0x2389d(%rip), %rax     # 0x2e2b8
movl (%rax), %esi
callq 0x79c8
movq %rbx, %rdi
callq 0x5548
jmp 0xaa4d
movl $0x1, 0x98(%rbx)
leaq 0x70(%rbx), %rdi
leaq 0x48(%rsp), %rsi
callq 0x5150
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
leaq 0x48(%rsp), %rdi
callq 0xc72c
addq $0xc0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0xaa6c
jmp 0xaa98
movq %rax, %r12
leaq 0x8(%rsp), %rdi
callq 0x5548
jmp 0xaa9b
jmp 0xaa98
movq %rax, %r12
jmp 0xaaad
movq %rax, %r12
leaq 0x48(%rsp), %rdi
callq 0x5548
jmp 0xaabd
movq %rax, %r12
jmp 0xaabd
jmp 0xaa98
movq %rax, %r12
leaq 0x48(%rsp), %rdi
callq 0xc72c
movq %r15, %rdi
callq 0x5548
movq %r14, %rdi
callq 0xcbde
movq %rbx, %rdi
callq 0xc984
movq %r12, %rdi
callq 0x54c0
nop