// File: /workspace/github_cpp_makefile_star2_O3/yanlinlin82[P]icpp/icpp.cpp
// Function: add_variable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
auto add_variable(string name, int size, string type) -> pair<bool, size_t> // { is-global, offset }
{
	log<3>("[DEBUG] add variable '%s', size = %d, type = '%s'\n",
			name.c_str(), size, type.c_str());
	if (stack_frame_table.empty()) {
		size_t offset = data_sec.size();
		add_symbol(name, false, offset, size, type, "", 0);
		data_sec.resize(data_sec.size() + size);
		return make_pair(true, offset);
	} else {
		size_t stack_frame_offset = stack_frame_table.back().first;
		code_sec[stack_frame_offset] += size;
		size_t symbol_offset = -code_sec[stack_frame_offset];
		stack_frame_table.back().second.insert(make_pair(name, make_tuple(symbol_offset, size, type)));
		return make_pair(false, symbol_offset);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdx, %r12
movl %esi, %r14d
movq %rdi, %r15
movq (%rdi), %rsi
movq (%rdx), %rcx
leaq 0x16d3a(%rip), %rdi     # 0x1b300
movl %r14d, %edx
xorl %eax, %eax
callq 0x151ad
movq 0x1ed81(%rip), %r13     # 0x23358
cmpq %r13, 0x1ed72(%rip)     # 0x23350
je 0x46bb
movslq -0x40(%r13), %rax
movq 0x1ed21(%rip), %rcx     # 0x23310
movslq (%rcx,%rax,4), %rdx
movslq %r14d, %rbx
addq %rdx, %rbx
movl %ebx, (%rcx,%rax,4)
negq %rbx
leaq -0xa8(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %r12
movq %r12, %rdi
callq 0x16942
movl %r14d, 0x20(%r12)
movq %rbx, 0x28(%r12)
leaq -0x108(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x162ae
addq $-0x38, %r13
leaq -0x108(%rbp), %rsi
movq %r13, %rdi
callq 0x17b4a
leaq -0xd8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4673
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq -0xf8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4692
movq -0xf8(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x46b4
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x31d0
xorl %eax, %eax
jmp 0x47af
movq 0x1ec6e(%rip), %rbx     # 0x23330
subq 0x1ec5f(%rip), %rbx     # 0x23328
leaq -0x78(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x16942
leaq -0x58(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x16942
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x17d6d(%rip), %rdx     # 0x1c481
leaq -0x48(%rbp), %rdi
movq %rdx, %rsi
callq 0x169e0
sarq $0x2, %rbx
movslq %r14d, %r14
movl $0x0, (%rsp)
leaq -0x88(%rbp), %rdi
leaq -0x68(%rbp), %r8
leaq -0x48(%rbp), %r9
xorl %esi, %esi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x4262
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x475f
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x4774
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x478c
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq 0x1eb95(%rip), %rdi     # 0x23328
movq 0x1eb96(%rip), %rsi     # 0x23330
subq 0x1eb87(%rip), %rsi     # 0x23328
sarq $0x2, %rsi
addq %r14, %rsi
callq 0x152ca
movb $0x1, %al
movq %rbx, %rdx
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x47e1
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x47e1
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x47fb
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x47fb
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x4843
movq -0x78(%rbp), %rsi
jmp 0x483b
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
callq 0x15302
jmp 0x4821
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x4843
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x31d0
movq %rbx, %rdi
callq 0x3320