// File: /workspace/github_cpp_makefile_star2_O3/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, 0xc(%rsp)
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %rbx
callq 0x14bb6
testb %al, %al
je 0x14da0
leaq 0x13dc5(%rip), %rsi     # 0x28abb
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rdx
callq 0x11c02
leaq 0x14201(%rip), %rsi     # 0x28f0e
movq %rbp, %rdi
callq 0x5510
leaq 0x60(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x14d3c
movq %rdx, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0x14d43
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x58(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14d76
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x50(%rsp), %rdi
leaq 0x2052e(%rip), %rax     # 0x352b0
movl (%rax), %esi
callq 0x8030
movq 0x50(%rsp), %rdi
cmpq %rbp, %rdi
je 0x14da0
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5240
movq %rbx, (%rsp)
movzbl %r13b, %esi
movzbl %r12b, %edx
movzbl 0xc(%rsp), %ebp
leaq 0x50(%rsp), %rdi
movl %ebp, %ecx
movq %r15, %r8
movq %r14, %r9
callq 0x135e8
testb %bpl, %bpl
je 0x14e43
movl 0x2060d(%rip), %r14d    # 0x353dc
leal 0x1(%r14), %eax
movl %eax, 0x20603(%rip)     # 0x353dc
movl %r14d, %r15d
negl %r15d
cmovsl %r14d, %r15d
movl $0x1, %r12d
cmpl $0xa, %r15d
jb 0x14f12
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0x14f09
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x14f0f
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x14f12
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x14e01
addl $-0x3, %r12d
jmp 0x14f12
movq (%rbx), %rax
cmpb $0x23, (%rax)
jne 0x14e91
leaq 0x10(%rsp), %rdi
movl $0x1, %edx
movq %rbx, %rsi
movq $-0x1, %rcx
callq 0x5260
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x5310
movq (%r14), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x15040
movq 0x20(%rsp), %rsi
jmp 0x15038
movl 0x20548(%rip), %r14d    # 0x353e0
leal 0x1(%r14), %eax
movl %eax, 0x2053e(%rip)     # 0x353e0
movl %r14d, %r15d
negl %r15d
cmovsl %r14d, %r15d
movl $0x1, %r12d
cmpl $0xa, %r15d
jb 0x14f6d
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0x14f64
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x14f6a
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x14f6d
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x14eca
addl $-0x3, %r12d
jmp 0x14f6d
addl $-0x2, %r12d
jmp 0x14f12
decl %r12d
shrl $0x1f, %r14d
leal (%r12,%r14), %esi
leaq 0x40(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x30(%rsp), %rdi
movl $0x2d, %edx
callq 0x52b0
leaq 0x30(%rsp), %r13
addq (%r13), %r14
movq %r14, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x1205c
leaq 0x13fd4(%rip), %rcx     # 0x28f24
movl $0x1, %r8d
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5290
jmp 0x14fbd
addl $-0x2, %r12d
jmp 0x14f6d
decl %r12d
shrl $0x1f, %r14d
leal (%r12,%r14), %esi
leaq 0x40(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x30(%rsp), %rdi
movl $0x2d, %edx
callq 0x52b0
leaq 0x30(%rsp), %r13
addq (%r13), %r14
movq %r14, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x1205c
leaq 0x13f7b(%rip), %rcx     # 0x28f26
movl $0x1, %r8d
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5290
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x14fe4
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x14feb
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x10(%rsp), %r14
movq %rdx, 0x8(%r14)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
callq 0x5310
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x15029
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0x15040
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5240
cmpl $0x0, 0x20391(%rip)     # 0x353d8
je 0x15098
leaq 0x20330(%rip), %rdi     # 0x35380
leaq 0x20361(%rip), %rsi     # 0x353b8
callq 0x1313a
addq $0x38, %rax
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x155dc
cmpb $0x0, 0xc(%rsp)
je 0x15098
leaq 0x20305(%rip), %rdi     # 0x35380
leaq 0x20336(%rip), %rsi     # 0x353b8
callq 0x1313a
addq $0x20, %rax
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x155dc
movslq 0x20339(%rip), %rax     # 0x353d8
imulq $0x38, %rax, %rdi
addq 0x202be(%rip), %rdi     # 0x35368
movq %rbx, %rsi
callq 0x16348
movq %rax, %rbx
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x5140
leaq 0x20(%rbx), %rdi
leaq 0x70(%rsp), %rsi
callq 0x5140
leaq 0x98(%rsp), %rsi
movb -0x6(%rsi), %al
movb %al, 0x42(%rbx)
movzwl -0x8(%rsi), %eax
movw %ax, 0x40(%rbx)
leaq 0x48(%rbx), %rdi
callq 0x154f8
addq $0x60, %rbx
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x154f8
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x15120
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x5240
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x1513d
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x5240
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1515e
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x5240
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15179
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 0x15191
jmp 0x151e3
jmp 0x151e3
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0x151e6
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x151e6
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %rbp, %rdi
je 0x151f0
movq 0x60(%rsp), %rsi
jmp 0x151d9
jmp 0x151e3
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x151f0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x151f0
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x11ce4
movq %rbx, %rdi
callq 0x54c0