// File: /workspace/github_cpp_makefile_star2_O3/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 0xee61(%rip), %rsi      # 0x1b1d1
movq %r12, %rdi
callq 0x30b0
testl %eax, %eax
jne 0xc8f8
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc399
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 0x16942
testb %r13b, %r13b
je 0xc42c
cmpb $0x0, -0x34(%rbp)
je 0xc54a
leaq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
movq %rax, (%rdi)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
callq 0x16942
leaq 0x1009e(%rip), %rsi     # 0x1c480
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 0xc49d
movq %rdx, -0x198(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x188(%rbp)
jmp 0xc4a4
cmpb $0x0, -0x34(%rbp)
je 0xc54a
leaq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
movq %rax, (%rdi)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
callq 0x16942
leaq 0x10029(%rip), %rsi     # 0x1c480
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 0xc4e4
movq %rdx, -0x178(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x168(%rbp)
jmp 0xc4eb
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 0x4d40
movq -0x198(%rbp), %rdi
cmpq %r15, %rdi
je 0xc531
movq -0x188(%rbp), %rsi
jmp 0xc529
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 0x4d40
movq -0x178(%rbp), %rdi
cmpq %r15, %rdi
je 0xc531
movq -0x168(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xc54a
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 0xc5be
leaq -0x128(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq -0x138(%rbp), %r14
movq %r14, %rdi
leaq 0xfefc(%rip), %rdx      # 0x1c481
movq %rdx, %rsi
callq 0x169e0
movl $0x1, %edi
xorl %esi, %esi
movq %r14, %rdx
callq 0x4d40
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xc5be
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x31d0
callq 0x572d
leaq -0x108(%rbp), %rax
movq %rax, -0x118(%rbp)
leaq -0x118(%rbp), %r14
movq %r14, %rdi
leaq 0xec2d(%rip), %rsi      # 0x1b20f
leaq 0xec27(%rip), %rdx      # 0x1b210
callq 0x169e0
leaq -0x1b8(%rbp), %rdi
movq %r14, %rsi
movl 0x10(%rbp), %edx
movl -0x38(%rbp), %ecx
callq 0x8d9d
movq -0x1b8(%rbp), %rdi
leaq -0x1a8(%rbp), %rax
cmpq %rax, %rdi
je 0xc625
movq -0x1a8(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xc647
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x31d0
movq %r13, %r14
movq 0x8(%rbx), %rdx
decq %rdx
movq %r15, %rdi
movq %rbx, %rsi
movq $-0x1, %rcx
callq 0x31f0
movq %r15, %rdi
leaq 0xeb64(%rip), %rsi      # 0x1b1d1
callq 0x30b0
movl %eax, %r13d
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xc68e
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x31d0
testl %r13d, %r13d
movq %r14, %r13
je 0xc6a4
leaq 0xf175(%rip), %rdi      # 0x1b812
xorl %eax, %eax
callq 0x1546f
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 0xc6dc
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 0x16942
leaq -0x78(%rbp), %rdi
callq 0xc2cc
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xc719
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x31d0
cmpb $0x0, -0x34(%rbp)
je 0xc82b
leaq -0xe8(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0xf8(%rbp), %r12
movq %r12, %rdi
leaq 0xfd3f(%rip), %rdx      # 0x1c481
movq %rdx, %rsi
callq 0x169e0
movl $0xd, %edi
xorl %esi, %esi
movq %r12, %rdx
callq 0x4d40
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xc77b
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq -0xc8(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0xd8(%rbp), %r12
movq %r12, %rdi
leaq 0xfce7(%rip), %rdx      # 0x1c481
movq %rdx, %rsi
callq 0x169e0
movl $0x1, %edi
xorl %esi, %esi
movq %r12, %rdx
callq 0x4d40
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xc7d3
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0xb8(%rbp), %r12
movq %r12, %rdi
leaq 0xfc8f(%rip), %rdx      # 0x1c481
movq %rdx, %rsi
callq 0x169e0
movl $0xb, %edi
xorl %esi, %esi
movq %r12, %rdx
callq 0x4d40
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xc82b
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x31d0
movq %r13, -0x158(%rbp)
leaq -0x158(%rbp), %rdi
leaq 0xe9cb(%rip), %rsi      # 0x1b20b
leaq 0xe9c5(%rip), %rdx      # 0x1b20c
callq 0x169e0
leaq -0x88(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x98(%rbp), %r12
movq %r12, %rdi
leaq 0xf2f4(%rip), %rsi      # 0x1bb5f
leaq 0xf2ee(%rip), %rdx      # 0x1bb60
callq 0x169e0
leaq -0x158(%rbp), %rdi
movq %r12, %rsi
callq 0x5c40
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xc8a8
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x158(%rbp), %rdi
cmpq %r13, %rdi
je 0xc8c3
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x31d0
callq 0x572d
leaq 0x169d1(%rip), %rdi     # 0x232a0
leaq 0xf289(%rip), %rsi      # 0x1bb5f
callq 0x30b0
testl %eax, %eax
je 0xc560
movq %rbx, %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xee94(%rip), %rdi      # 0x1b793
leaq 0xeb2e(%rip), %rsi      # 0x1b434
leaq 0xeec2(%rip), %rcx      # 0x1b7cf
movl $0x2e0, %edx            # imm = 0x2E0
callq 0x3130
movq %rax, %r13
movq -0x178(%rbp), %rdi
cmpq %r15, %rdi
je 0xc958
movq -0x168(%rbp), %rsi
jmp 0xc945
movq %rax, %r13
movq -0x198(%rbp), %rdi
cmpq %r15, %rdi
je 0xc958
movq -0x188(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0xc958
jmp 0xc955
jmp 0xc955
jmp 0xc955
movq %rax, %r13
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xcac0
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0xcac0
jmp 0xc97c
movq %rax, %r13
jmp 0xcac0
jmp 0xcab9
jmp 0xcab9
jmp 0xcab9
movq %rax, %r13
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xcabc
movq -0x128(%rbp), %rsi
jmp 0xcaab
movq %rax, %r13
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xcabc
movq -0xe8(%rbp), %rsi
jmp 0xcaab
movq %rax, %r13
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xcabc
movq -0xc8(%rbp), %rsi
jmp 0xcaab
movq %rax, %r13
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xcabc
movq -0xa8(%rbp), %rsi
jmp 0xcaab
jmp 0xcab9
jmp 0xcab9
movq %rax, %r13
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xcabc
movq -0x68(%rbp), %rsi
jmp 0xcaab
jmp 0xcab9
movq %rax, %r13
jmp 0xca77
movq %rax, %r13
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xca77
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0xcabc
movq -0x148(%rbp), %rsi
jmp 0xcaab
jmp 0xcab9
movq %rax, %r13
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xcabc
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0xcabc
jmp 0xcab9
jmp 0xcab9
movq %rax, %r13
movq -0x30(%rbp), %r12
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0xcad4
movq (%r12), %rsi
incq %rsi
callq 0x31d0
movq %r13, %rdi
callq 0x3320