// File: /workspace/github_cpp_makefile_star2_O3/zhengwangsun[P]pas2c/semantics.cpp
// Function: identifier_list(int, int, int)
void identifier_list(int type, int k, int useFlag)
{
	TreeNode tNode= tree.node[k];
	TreeNode childNode;
    if(lookahead(k) == 101)//101是id
    {
        int id_position = tree.node[k].child[0];//将id节点在树中的下标值赋给id_position
        if (useFlag == 1)
        {
            //判断放入主符号表还是子符号表
            if(currentTable == "main")
                enterMain(id_position, type);
            else
                enterSub(id_position, type, currentTable, 0);//是子程序内定义的标识符，0代表放入item
        	
        	childNode=tree.node[tNode.child[0]];
            if(isArray==1) //修改 array
            {
                code[currentLine].insert(3, " ");
                code[currentLine++].insert(4, childNode.value.c_str());
                
                identifier_list1(type, tree.node[k].child[1], 1);
                isArray=0;
            }
            else
            {
                code[currentLine].append(childNode.value);
                identifier_list1(type, tree.node[k].child[1], 1);
            }
        }
        else if (useFlag == 2)//parameter
        {
            enterSub(id_position, type, currentTable, 1);//是子程序参数标识符

			childNode=tree.node[tNode.child[0]];
			code[currentLine].append(childNode.value);
            
            identifier_list1(type, tree.node[k].child[1], 2);
        }
        else if (useFlag == 3)
        { 
            if(isDefined(id_position) != 0)
			{
			//查看是否声明，张英哲改动
                int idType = checkIdType(id_position);
            	addReadType(idType);
            	childNode=tree.node[tNode.child[0]];
				code[currentLine].append(childNode.value);
				code[currentLine++].append(");\n ");
                identifier_list1(-1, tree.node[k].child[1], 3);
                
        	}
			else
                cout<<"the id is not defined where identifier_list"<<endl;
        }
    }
    else
        cout<<"identifier_list error!"<<endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movl %edx, %r14d
movl %edi, 0x4(%rsp)
movslq %esi, %rax
imulq $0xa8, %rax, %rax
leaq 0xb15d9(%rip), %r15     # 0xb90c8
leaq (%r15,%rax), %rbx
addq $0x8, %rbx
leaq 0xf0(%rsp), %rax
movl $0xb, %ecx
movq %rax, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movb 0x58(%rbx), %cl
movb %cl, 0x58(%rax)
leaq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x60(%rbx), %rsi
movq 0x68(%rbx), %rdx
addq %rsi, %rdx
callq 0x7666
leaq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x80(%rbx), %rsi
movq 0x88(%rbx), %rdx
addq %rsi, %rdx
callq 0x7666
movq 0xa0(%rbx), %rax
movq %rax, 0x190(%rsp)
leaq 0xb8(%rsp), %r12
movq %r12, -0x10(%r12)
xorl %eax, %eax
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq 0xd8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq %rax, -0x8(%rbp)
movb %al, (%rbp)
cmpl $0x0, (%rbx)
jle 0x7c50
movslq 0x4(%rbx), %r13
imulq $0xa8, %r13, %rax
cmpl $0x65, 0x5c(%r15,%rax)
jne 0x7c50
cmpl $0x3, %r14d
je 0x7e05
cmpl $0x2, %r14d
je 0x7d2c
cmpl $0x1, %r14d
jne 0x7c96
leaq 0xaad28(%rip), %rdi     # 0xb2908
leaq 0xb969(%rip), %rsi      # 0x13550
callq 0x2090
testl %eax, %eax
je 0x7e3b
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0xaad04(%rip), %rsi     # 0xb2908
movq 0xaad05(%rip), %rdx     # 0xb2910
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x7666
leaq 0x28(%rsp), %rdx
movl %r13d, %edi
movl 0x4(%rsp), %esi
xorl %ecx, %ecx
callq 0x8274
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x7e47
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x7e47
movq 0x11379(%rip), %rbx     # 0x18fd0
leaq 0xb961(%rip), %rsi      # 0x135bf
movl $0x16, %edx
movq %rbx, %rdi
callq 0x2280
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq 0x11347(%rip), %rdi     # 0x18fd0
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq 0xc8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7cb3
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0x7cd0
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x7cf5
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x7d1a
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x2230
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0xaabcc(%rip), %rsi     # 0xb2908
movq 0xaabcd(%rip), %rdx     # 0xb2910
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x7666
leaq 0x8(%rsp), %rdx
movl %r13d, %edi
movl 0x4(%rsp), %esi
movl $0x1, %ecx
callq 0x8274
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x7d82
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
movslq 0xf4(%rsp), %rax
imulq $0xa8, %rax, %rdx
leaq (%r15,%rdx), %r13
addq $0x8, %r13
leaq 0x48(%rsp), %rax
movl $0xb, %ecx
movq %rax, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movb 0x58(%r13), %cl
movb %cl, 0x58(%rax)
leaq (%r15,%rdx), %rsi
addq $0x68, %rsi
leaq 0xa8(%rsp), %rdi
callq 0x2110
leaq 0x80(%r13), %rsi
leaq 0xc8(%rsp), %rdi
callq 0x2110
movq 0xa0(%r13), %rax
movq %rax, 0xe8(%rsp)
movslq 0xab7be(%rip), %rax     # 0xb35b0
shlq $0x5, %rax
leaq 0xaab33(%rip), %rdi     # 0xb2930
addq %rax, %rdi
jmp 0x7f43
movl %r13d, %edi
callq 0x8b17
testl %eax, %eax
je 0x7f6c
movl %r13d, %edi
callq 0x8ea2
cmpl $0x1, %eax
je 0x7fb7
cmpl $0x2, %eax
jne 0x7fd8
leaq 0xb7c2(%rip), %rsi      # 0x135f8
jmp 0x7fbe
movl %r13d, %edi
movl 0x4(%rsp), %esi
callq 0x8132
movslq 0xf4(%rsp), %rax
imulq $0xa8, %rax, %rdx
leaq (%r15,%rdx), %r13
addq $0x8, %r13
leaq 0x48(%rsp), %rax
movl $0xb, %ecx
movq %rax, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movb 0x58(%r13), %cl
movb %cl, 0x58(%rax)
leaq (%r15,%rdx), %rsi
addq $0x68, %rsi
leaq 0xa8(%rsp), %rdi
callq 0x2110
leaq 0x80(%r13), %rsi
leaq 0xc8(%rsp), %rdi
callq 0x2110
movq 0xa0(%r13), %rax
movq %rax, 0xe8(%rsp)
movslq 0xab6f9(%rip), %rdi     # 0xb35b0
shlq $0x5, %rdi
leaq 0xaaa6e(%rip), %r15     # 0xb2930
addq %r15, %rdi
cmpl $0x1, 0xaaa5c(%rip)     # 0xb2928
jne 0x7f43
leaq 0xb6bc(%rip), %rcx      # 0x13591
movl $0x3, %esi
movl $0x1, %r8d
xorl %edx, %edx
callq 0x2260
movslq 0xab6c2(%rip), %rax     # 0xb35b0
leal 0x1(%rax), %ecx
movl %ecx, 0xab6b9(%rip)     # 0xb35b0
shlq $0x5, %rax
addq %rax, %r15
movq 0xc8(%rsp), %r14
movq %r14, %rdi
callq 0x20e0
movl $0x4, %esi
movq %r15, %rdi
xorl %edx, %edx
movq %r14, %rcx
movq %rax, %r8
callq 0x2260
movl 0x8(%rbx), %esi
movl 0x4(%rsp), %edi
movl $0x1, %edx
callq 0x84e4
movl $0x0, 0xaa9ea(%rip)     # 0xb2928
jmp 0x7c96
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
callq 0x20a0
movl 0x8(%rbx), %esi
movl 0x4(%rsp), %edi
movl %r14d, %edx
callq 0x84e4
jmp 0x7c96
movq 0x1105d(%rip), %rbx     # 0x18fd0
leaq 0xb619(%rip), %rsi      # 0x13593
movl $0x2b, %edx
movq %rbx, %rdi
callq 0x2280
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq 0x1102b(%rip), %rdi     # 0x18fd0
callq 0x2030
movq %rax, %rdi
callq 0x2150
jmp 0x7c96
leaq 0xb62d(%rip), %rsi      # 0x135eb
movslq 0xab5eb(%rip), %rax     # 0xb35b0
shlq $0x5, %rax
leaq 0xaa960(%rip), %rdi     # 0xb2930
addq %rax, %rdi
callq 0x23d0
movslq 0xf4(%rsp), %rax
imulq $0xa8, %rax, %rdx
leaq (%r15,%rdx), %r14
addq $0x8, %r14
leaq 0x48(%rsp), %rax
movl $0xb, %ecx
movq %rax, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movb 0x58(%r14), %cl
movb %cl, 0x58(%rax)
leaq (%r15,%rdx), %rsi
addq $0x68, %rsi
leaq 0xa8(%rsp), %rdi
callq 0x2110
leaq 0x80(%r14), %rsi
leaq 0xc8(%rsp), %rdi
callq 0x2110
movq 0xa0(%r14), %rax
movq %rax, 0xe8(%rsp)
movslq 0xab568(%rip), %rdi     # 0xb35b0
shlq $0x5, %rdi
leaq 0xaa8dd(%rip), %r14     # 0xb2930
addq %r14, %rdi
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
callq 0x20a0
movslq 0xab53e(%rip), %rax     # 0xb35b0
leal 0x1(%rax), %ecx
movl %ecx, 0xab535(%rip)     # 0xb35b0
shlq $0x5, %rax
addq %rax, %r14
leaq 0xb505(%rip), %rsi      # 0x1358e
movq %r14, %rdi
callq 0x23d0
movl 0x8(%rbx), %esi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0x3, %edx
callq 0x84e4
jmp 0x7c96
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x8113
movq 0x38(%rsp), %rsi
jmp 0x80d8
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x8113
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x8113
jmp 0x8110
movq %rax, %rbx
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x812a
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x812a
jmp 0x8110
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xf396
leaq 0xf0(%rsp), %rdi
callq 0xf396
movq %rbx, %rdi
callq 0x23a0