// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdx, %r12
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1a951(%rip), %rdx     # 0x298d9
leaq 0x50(%rsp), %rdi
movq %rdx, %rsi
callq 0x6ef6
leaq 0x50(%rsp), %rdx
movq %rbx, %rdi
movl $0x4, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xe4d0
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0xefc6
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5240
leaq 0x2557b(%rip), %rax     # 0x34548
movq %rax, (%rbx)
leaq 0xa0(%rbx), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0xa0(%rbx)
movq $0x0, 0xb0(%rbx)
leaq 0xc0(%rbx), %r15
leaq 0xd0(%rbx), %r13
movq %r13, 0xc0(%rbx)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x124aa
leaq 0x80(%rsp), %rbp
leaq 0x60(%rsp), %rax
movq %rax, -0x30(%rbp)
xorl %eax, %eax
movq %rax, -0x28(%rbp)
movb %al, -0x20(%rbp)
movq %rbp, -0x10(%rbp)
movq %rax, -0x8(%rbp)
movb %al, (%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbp)
movups %xmm0, 0x28(%rbp)
movups %xmm0, 0x38(%rbp)
leaq 0x50(%rsp), %rsi
movq %r15, %rdi
callq 0x14f6c
testb %al, %al
je 0xf0d1
movq 0x8(%rsp), %rdi
cmpb $0x1, 0x90(%rsp)
jne 0xf0f8
testq %rdi, %rdi
je 0xf1ca
leaq 0x8(%rsp), %r12
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0xa8(%rbx), %rsi
cmpq 0xb0(%rbx), %rsi
je 0xf0ae
movq 0x8(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0xa8(%rbx)
jmp 0xf0b9
movq %r14, %rdi
movq %r12, %rdx
callq 0x12958
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rdi
movq %rdi, 0x8(%rsp)
testq %rdi, %rdi
jne 0xf07b
jmp 0xf1ca
leaq 0x199ac(%rip), %rsi     # 0x28a84
leaq 0x30(%rsp), %rdi
movq %r15, %rdx
callq 0x11eb4
leaq 0x199a5(%rip), %rsi     # 0x28a91
leaq 0x30(%rsp), %rdi
callq 0x5510
jmp 0xf126
testq %rdi, %rdi
je 0xf1b2
leaq 0x1997c(%rip), %rsi     # 0x28a84
leaq 0x30(%rsp), %rdi
movq %r15, %rdx
callq 0x11eb4
leaq 0x19986(%rip), %rsi     # 0x28aa2
leaq 0x30(%rsp), %rdi
callq 0x5510
leaq 0x20(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xf14d
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0xf153
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf186
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x10(%rsp), %rdi
leaq 0x2611e(%rip), %rax     # 0x352b0
movl (%rax), %esi
callq 0x81dc
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0xf1d3
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0xf1d3
movl $0x1, 0x98(%rbx)
leaq 0x70(%rbx), %rdi
leaq 0x50(%rsp), %rsi
callq 0x5140
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0xf1f0
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x5240
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
leaq 0x60(%rsp), %rbx
je 0xf212
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x5240
movq 0x70(%rsp), %rdi
cmpq %rbp, %rdi
je 0xf22c
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x50(%rsp), %rdi
cmpq %rbx, %rdi
je 0xf243
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5240
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xf259
jmp 0xf2a3
movq %rax, %r12
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf2a6
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0xf2a6
jmp 0xf2a3
movq %rax, %r12
jmp 0xf2c4
movq %rax, %r12
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0xf2e3
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0xf2e3
movq %rax, %r12
jmp 0xf2e3
jmp 0xf2a3
movq %rax, %r12
leaq 0x50(%rsp), %rdi
callq 0x11f96
movq (%r15), %rdi
cmpq %r13, %rdi
je 0xf2c4
movq (%r13), %rsi
incq %rsi
callq 0x5240
movq (%r14), %rdi
testq %rdi, %rdi
je 0xf2db
movq 0xb0(%rbx), %rsi
subq %rdi, %rsi
callq 0x5240
movq %rbx, %rdi
callq 0x12252
movq %r12, %rdi
callq 0x54c0
nop