// File: /workspace/github_cpp_makefile_star2_O1/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 0x17d3d(%rip), %rdi     # 0x1c300
movl %r14d, %edx
xorl %eax, %eax
callq 0x1559d
movq 0x1fd84(%rip), %r13     # 0x24358
cmpq %r13, 0x1fd75(%rip)     # 0x24350
je 0x46b8
movslq -0x40(%r13), %rax
movq 0x1fd24(%rip), %rcx     # 0x24310
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 0x16d2e
movl %r14d, 0x20(%r12)
movq %rbx, 0x28(%r12)
leaq -0x108(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x16696
addq $-0x38, %r13
leaq -0x108(%rbp), %rsi
movq %r13, %rdi
callq 0x17f9c
leaq -0xd8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4670
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq -0xf8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x468f
movq -0xf8(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x46b1
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x31d0
xorl %eax, %eax
jmp 0x47ac
movq 0x1fc71(%rip), %rbx     # 0x24330
subq 0x1fc62(%rip), %rbx     # 0x24328
leaq -0x78(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x16d2e
leaq -0x58(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x16d2e
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x18d70(%rip), %rdx     # 0x1d481
leaq -0x48(%rbp), %rdi
movq %rdx, %rsi
callq 0x16dc8
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 0x425f
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x475c
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x4771
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x4789
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq 0x1fb98(%rip), %rdi     # 0x24328
movq 0x1fb99(%rip), %rsi     # 0x24330
subq 0x1fb8a(%rip), %rsi     # 0x24328
sarq $0x2, %rsi
addq %r14, %rsi
callq 0x156ba
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 0x47de
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x47de
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x47f8
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x47f8
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x4840
movq -0x78(%rbp), %rsi
jmp 0x4838
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
callq 0x156f2
jmp 0x481e
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x4840
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x31d0
movq %rbx, %rdi
callq 0x3320