// File: /workspace/github_cpp_makefile_star2_O1/yanlinlin82[P]icpp/icpp.cpp
// Function: parse_pointer_derefer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, bool, bool, int)
string parse_pointer_derefer(string name, string symbol_type_name,
		int offset, bool is_global, bool generate_code, int depth)
{
	assert(symbol_type_name.substr(symbol_type_name.size() - 1) == "*");
	string type_name = symbol_type_name;
	if (is_global) {
		if (generate_code) add_assembly_code(GET, offset, name + "\t" + type_name);
	} else {
		if (generate_code) add_assembly_code(LGET, offset, name + "\t" + type_name);
	}
	for (size_t i = 0; ; ++i) {
		if (generate_code) add_assembly_code(PUSH);
		next();
		parse_expression(";", depth, generate_code);
		if (type_name.substr(type_name.size() - 1) != "*") {
			err("too many level of dereferencing on a pointer!\n");
		}
		type_name = type_name.substr(0, type_name.size() - 1);
		int element_size = get_type_size(type_name);
		if (element_size != sizeof(int)) {
			if (generate_code) add_assembly_code(PUSH);
			if (generate_code) add_assembly_code(MOV, element_size / sizeof(int));
			if (generate_code) add_assembly_code(MUL);
		}
		if (generate_code) add_assembly_code(ADD);
		if (generate_code) add_assembly_code(PUSH);
		if (generate_code) add_assembly_code(SGET);
		expect_token("]", "[");
		next();
		if (token != "[") break;
	}
	return type_name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movl %r9d, -0x34(%rbp)
movl %r8d, %r13d
movl %ecx, -0x38(%rbp)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdx), %rdx
decq %rdx
leaq -0x58(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x31f0
leaq 0xfd5e(%rip), %rsi      # 0x1c1d1
movq %r12, %rdi
callq 0x30b0
testl %eax, %eax
jne 0xca0b
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc49c
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq 0x10(%rbx), %r12
movq %r12, (%rbx)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x16d2e
testb %r13b, %r13b
je 0xc52f
cmpb $0x0, -0x34(%rbp)
je 0xc64d
leaq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
movq %rax, (%rdi)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
callq 0x16d2e
leaq 0x10f9b(%rip), %rsi     # 0x1d480
leaq -0x58(%rbp), %rdi
callq 0x3360
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
leaq -0x58(%rbp), %rdi
callq 0x30c0
leaq -0x188(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc5a0
movq %rdx, -0x198(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x188(%rbp)
jmp 0xc5a7
cmpb $0x0, -0x34(%rbp)
je 0xc64d
leaq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
movq %rax, (%rdi)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
callq 0x16d2e
leaq 0x10f26(%rip), %rsi     # 0x1d480
leaq -0x58(%rbp), %rdi
callq 0x3360
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
leaq -0x58(%rbp), %rdi
callq 0x30c0
leaq -0x168(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc5e7
movq %rdx, -0x178(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x168(%rbp)
jmp 0xc5ee
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rsi
leaq -0x198(%rbp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl $0x6, %edi
movl -0x38(%rbp), %esi
callq 0x4d8b
movq -0x198(%rbp), %rdi
cmpq %r15, %rdi
je 0xc634
movq -0x188(%rbp), %rsi
jmp 0xc62c
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rsi
leaq -0x178(%rbp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl $0x9, %edi
movl -0x38(%rbp), %esi
callq 0x4d8b
movq -0x178(%rbp), %rdi
cmpq %r15, %rdi
je 0xc634
movq -0x168(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xc64d
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x31d0
movq %r12, -0x30(%rbp)
leaq -0x148(%rbp), %r13
movzbl -0x34(%rbp), %eax
movl %eax, -0x38(%rbp)
leaq -0x58(%rbp), %r15
cmpb $0x0, -0x34(%rbp)
je 0xc6c1
leaq -0x128(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq -0x138(%rbp), %r12
movq %r12, %rdi
leaq 0x10df9(%rip), %rdx     # 0x1d481
movq %rdx, %rsi
callq 0x16dc8
movl $0x1, %edi
xorl %esi, %esi
movq %r12, %rdx
callq 0x4d8b
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xc6c1
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x31d0
callq 0x5790
leaq -0x108(%rbp), %rax
movq %rax, -0x118(%rbp)
leaq -0x118(%rbp), %r12
movq %r12, %rdi
leaq 0xfb2a(%rip), %rsi      # 0x1c20f
leaq 0xfb24(%rip), %rdx      # 0x1c210
callq 0x16dc8
leaq -0x1b8(%rbp), %rdi
movq %r12, %rsi
movl 0x10(%rbp), %edx
movl -0x38(%rbp), %ecx
callq 0x8e88
movq -0x1b8(%rbp), %rdi
leaq -0x1a8(%rbp), %rax
cmpq %rax, %rdi
je 0xc728
movq -0x1a8(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xc74a
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x31d0
movq %r13, %r12
movq 0x8(%rbx), %rdx
decq %rdx
movq %r15, %rdi
movq %rbx, %rsi
movq $-0x1, %rcx
callq 0x31f0
movq %r15, %rdi
leaq 0xfa61(%rip), %rsi      # 0x1c1d1
callq 0x30b0
movl %eax, %r13d
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xc791
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x31d0
testl %r13d, %r13d
movq %r12, %r13
je 0xc7a7
leaq 0x10072(%rip), %rdi     # 0x1c812
xorl %eax, %eax
callq 0x1585f
movq 0x8(%rbx), %rcx
decq %rcx
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x31f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3240
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xc7df
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x78(%rbp), %rdi
callq 0x16d2e
leaq -0x78(%rbp), %rdi
callq 0xc3cf
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xc81c
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x31d0
cmpb $0x0, -0x34(%rbp)
je 0xc93e
leaq -0xe8(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0xf8(%rbp), %r14
movq %r14, %rdi
leaq 0x10c3c(%rip), %rdx     # 0x1d481
movq %rdx, %rsi
callq 0x16dc8
movl $0xd, %edi
xorl %esi, %esi
movq %r14, %rdx
callq 0x4d8b
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xc87e
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x31d0
cmpb $0x0, -0x34(%rbp)
je 0xc93e
leaq -0xc8(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0xd8(%rbp), %r14
movq %r14, %rdi
leaq 0x10bda(%rip), %rdx     # 0x1d481
movq %rdx, %rsi
callq 0x16dc8
movl $0x1, %edi
xorl %esi, %esi
movq %r14, %rdx
callq 0x4d8b
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xc8e0
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x31d0
cmpb $0x0, -0x34(%rbp)
je 0xc93e
leaq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0xb8(%rbp), %r14
movq %r14, %rdi
leaq 0x10b7c(%rip), %rdx     # 0x1d481
movq %rdx, %rsi
callq 0x16dc8
movl $0xb, %edi
xorl %esi, %esi
movq %r14, %rdx
callq 0x4d8b
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xc93e
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x31d0
movq %r13, -0x158(%rbp)
leaq -0x158(%rbp), %rdi
leaq 0xf8b8(%rip), %rsi      # 0x1c20b
leaq 0xf8b2(%rip), %rdx      # 0x1c20c
callq 0x16dc8
leaq -0x88(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x98(%rbp), %r14
movq %r14, %rdi
leaq 0x101e1(%rip), %rsi     # 0x1cb5f
leaq 0x101db(%rip), %rdx     # 0x1cb60
callq 0x16dc8
leaq -0x158(%rbp), %rdi
movq %r14, %rsi
callq 0x5d07
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xc9bb
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x158(%rbp), %rdi
cmpq %r13, %rdi
je 0xc9d6
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x31d0
callq 0x5790
leaq 0x178be(%rip), %rdi     # 0x242a0
leaq 0x10176(%rip), %rsi     # 0x1cb5f
callq 0x30b0
testl %eax, %eax
je 0xc663
movq %rbx, %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xfd81(%rip), %rdi      # 0x1c793
leaq 0xfa1b(%rip), %rsi      # 0x1c434
leaq 0xfdaf(%rip), %rcx      # 0x1c7cf
movl $0x2e0, %edx            # imm = 0x2E0
callq 0x3130
movq %rax, %r14
movq -0x178(%rbp), %rdi
cmpq %r15, %rdi
je 0xca6b
movq -0x168(%rbp), %rsi
jmp 0xca58
movq %rax, %r14
movq -0x198(%rbp), %rdi
cmpq %r15, %rdi
je 0xca6b
movq -0x188(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0xca6b
jmp 0xca68
jmp 0xca68
jmp 0xca68
movq %rax, %r14
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xcbd0
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0xcbd0
jmp 0xca8f
movq %rax, %r14
jmp 0xcbd0
movq %rax, %r14
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xcbcc
movq -0xa8(%rbp), %rsi
jmp 0xcbbd
jmp 0xcbc9
movq %rax, %r14
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xcbcc
movq -0xc8(%rbp), %rsi
jmp 0xcbbd
jmp 0xcbc9
movq %rax, %r14
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xcbcc
movq -0xe8(%rbp), %rsi
jmp 0xcbbd
jmp 0xcbc9
jmp 0xcbc9
movq %rax, %r14
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xcbcc
movq -0x128(%rbp), %rsi
jmp 0xcbbd
jmp 0xcbc9
movq %rax, %r14
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xcbcc
movq -0x68(%rbp), %rsi
jmp 0xcbbd
jmp 0xcbc9
movq %rax, %r14
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xcbcc
movq -0x108(%rbp), %rsi
jmp 0xcbbd
jmp 0xcbc9
jmp 0xcbc9
movq %rax, %r14
jmp 0xcbaa
movq %rax, %r14
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xcbaa
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x158(%rbp), %rdi
cmpq %r12, %rdi
je 0xcbcc
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0xcbcc
jmp 0xcbc9
movq %rax, %r14
movq -0x30(%rbp), %r12
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0xcbe4
movq (%r12), %rsi
incq %rsi
callq 0x31d0
movq %r14, %rdi
callq 0x3320