// File: /workspace/github_cpp_makefile_star2_O2/lhydave[P]SysYCompilerLab/front/symtab.cpp
// Function: sysY_AST::reg_var(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, bool, bool, std::vector<int, std::allocator<int>> const&, std::vector<int, std::allocator<int>> const&)
void reg_var(const string &name, bool is_const, bool is_array, bool is_param,
	const vector<int> &dim, const vector<int> &val)
{
	assert(!name.empty());
	if (defined(name))
	{
		string msg = "identifier '" + name + "' was already defined";
		yyerror(msg.c_str());
	}
	var_entry new_entry(is_array, is_const, is_param, dim, val, name);
	if (is_param)
		new_entry.eeyore_name = "p" + to_string(param_id++);
	else if (name[0] != '#')
		new_entry.eeyore_name = "T" + to_string(var_id++);
	else
		new_entry.eeyore_name = name.substr(1);
	if (blk_id) // defined in the function!
	{
		assert(!now_func_name.empty());
		func_table[now_func_name].func_var_table.push_back(new_entry);
		if (is_param) // a parameter!
			func_table[now_func_name].params.push_back(new_entry);
	}
	var_stack[blk_id][name] = new_entry;
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %r9, %r14
movq %r8, %r15
movl %ecx, %ebx
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %rbp
callq 0xe4df
testb %al, %al
je 0xe651
leaq 0x10488(%rip), %rsi     # 0x1ea84
movq %rbp, %rdx
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
movq %rdx, 0x28(%rsp)
callq 0xc598
leaq 0x108b0(%rip), %rdx     # 0x1eec8
leaq 0x50(%rsp), %rdi
movq %rbp, %rsi
callq 0xc579
leaq 0x8(%rsp), %rdi
callq 0x5548
movq 0x50(%rsp), %rdi
leaq 0x1fc7d(%rip), %rax     # 0x2e2b8
movl (%rax), %esi
callq 0x79c8
leaq 0x50(%rsp), %rdi
callq 0x5548
movq 0x28(%rsp), %rbp
movq %rbp, (%rsp)
movzbl %r13b, %esi
movzbl %r12b, %edx
movq %rbp, %r12
movzbl %bl, %ebp
leaq 0x50(%rsp), %rdi
movl %ebp, %ecx
movq %r15, %r8
movq %r14, %r9
callq 0xdae8
testb %bpl, %bpl
je 0xe6ae
movq %r12, %r15
movl 0x1fd61(%rip), %esi     # 0x2e3e4
leal 0x1(%rsi), %eax
movl %eax, 0x1fd58(%rip)     # 0x2e3e4
leaq 0x30(%rsp), %rdi
callq 0xc6d2
leaq 0x10841(%rip), %rsi     # 0x1eede
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0xc95f
jmp 0xe713
movq (%r12), %rax
cmpb $0x23, (%rax)
movq %r12, %r15
jne 0xe6e4
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rdx
pushq $-0x1
popq %rcx
movq %r15, %rsi
callq 0x5270
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x5300
movq %r14, %rdi
jmp 0xe732
movl 0x1fcfe(%rip), %esi     # 0x2e3e8
leal 0x1(%rsi), %eax
movl %eax, 0x1fcf5(%rip)     # 0x2e3e8
leaq 0x30(%rsp), %rdi
callq 0xc6d2
leaq 0x107dc(%rip), %rsi     # 0x1eee0
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0xc95f
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x5300
movq %r14, %rdi
callq 0x5548
leaq 0x30(%rsp), %rdi
callq 0x5548
cmpl $0x0, 0x1fca2(%rip)     # 0x2e3e0
je 0xe78c
leaq 0x1fc41(%rip), %rdi     # 0x2e388
leaq 0x1fc72(%rip), %rsi     # 0x2e3c0
callq 0xd5da
addq $0x38, %rax
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0xeb4a
testb %bl, %bl
je 0xe78c
leaq 0x1fc19(%rip), %rdi     # 0x2e388
leaq 0x1fc4a(%rip), %rsi     # 0x2e3c0
callq 0xd5da
addq $0x20, %rax
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0xeb4a
movslq 0x1fc4d(%rip), %rax     # 0x2e3e0
imulq $0x38, %rax, %rdi
addq 0x1fbd2(%rip), %rdi     # 0x2e370
movq %r15, %rsi
callq 0xf9c4
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0xebde
leaq 0x50(%rsp), %rdi
callq 0xc72c
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe7d5
jmp 0xe7ff
jmp 0xe7ff
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x5548
jmp 0xe802
jmp 0xe7ff
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0xe7f8
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5548
jmp 0xe80c
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xc72c
movq %rbx, %rdi
callq 0x54c0