// File: /workspace/github_cpp_makefile_star2_O3/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, %r13
movq %rsi, %r12
movq %rdi, %rbx
movq %rsi, (%rsp)
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1ac93(%rip), %rdx     # 0x29931
leaq 0x50(%rsp), %rdi
movq %rdx, %rsi
callq 0x6d8a
leaq 0x50(%rsp), %rdx
movq %rbx, %rdi
movl $0x4, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xe1ee
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0xecdc
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5240
leaq 0x2589d(%rip), %rax     # 0x34580
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), %rax
movq %rax, 0x28(%rsp)
movq %rax, 0xc0(%rbx)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x121f8
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 0x151f8
testb %al, %al
je 0xede4
cmpb $0x0, 0x90(%rsp)
je 0xee0b
testq %r12, %r12
je 0xeee3
movq %rsp, %r13
movq (%r12), %rax
movq %r12, %rdi
callq *0x18(%rax)
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0xa8(%rbx), %rsi
cmpq 0xb0(%rbx), %rsi
je 0xedc3
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0xa8(%rbx)
jmp 0xedd2
movq %r14, %rdi
movq %r13, %rdx
callq 0x12a2a
movq (%rsp), %rax
movq 0x40(%rax), %r12
movq %r12, (%rsp)
testq %r12, %r12
jne 0xed8e
jmp 0xeee3
leaq 0x19cd0(%rip), %rsi     # 0x28abb
leaq 0x30(%rsp), %rdi
movq %r15, %rdx
callq 0x11c02
leaq 0x19cc9(%rip), %rsi     # 0x28ac8
leaq 0x30(%rsp), %rdi
callq 0x5510
jmp 0xee39
testq %r12, %r12
je 0xeecb
leaq 0x19ca0(%rip), %rsi     # 0x28abb
leaq 0x30(%rsp), %rdi
movq %r15, %rdx
callq 0x11c02
leaq 0x19caa(%rip), %rsi     # 0x28ad9
leaq 0x30(%rsp), %rdi
callq 0x5510
leaq 0x18(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdi
je 0xee60
movq %rdi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0xee69
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq %rbx, %rdi
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x40(%rsp), %rcx
movq -0x10(%rcx), %rax
cmpq %rcx, %rax
je 0xeea4
movq 0x40(%rsp), %rsi
incq %rsi
movq %rax, %rdi
callq 0x5240
movq 0x8(%rsp), %rdi
leaq 0x26405(%rip), %rax     # 0x352b0
movl (%rax), %esi
callq 0x8030
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0xeeec
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0xeeec
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 0xef09
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x5240
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
leaq 0x60(%rsp), %rbx
je 0xef2b
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x5240
movq 0x70(%rsp), %rdi
cmpq %rbp, %rdi
je 0xef45
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x50(%rsp), %rdi
cmpq %rbx, %rdi
je 0xef5c
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 0xef72
jmp 0xefbc
movq %rax, %r12
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xefbf
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0xefbf
jmp 0xefbc
movq %rax, %r12
jmp 0xefe3
movq %rax, %r12
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0xf002
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0xf002
movq %rax, %r12
jmp 0xf002
jmp 0xefbc
movq %rax, %r12
leaq 0x50(%rsp), %rdi
callq 0x11ce4
movq (%r15), %rdi
cmpq 0x28(%rsp), %rdi
je 0xefe3
movq 0x28(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x5240
movq (%r14), %rdi
testq %rdi, %rdi
je 0xeffa
movq 0xb0(%rbx), %rsi
subq %rdi, %rsi
callq 0x5240
movq %rbx, %rdi
callq 0x11fa0
movq %r12, %rdi
callq 0x54c0