// File: /workspace/github_cpp_makefile_star2_O2/zhengwangsun[P]pas2c/semantics.cpp
// Function: identifier_list1(int, int, int)
void identifier_list1(int type, int k, int useFlag)
{
    TreeNode tNode= tree.node[k];
	TreeNode childNode;
	if (lookahead(k) == 105)//105是,
    {
        int id_position = tree.node[k].child[1];//将id节点在树中的下标值赋给id_position
        if (useFlag == 1)
        {
            //判断放入主符号表还是子符号表
            if(currentTable == "main")
                enterMain(id_position, type);
            else
                enterSub(id_position, type, currentTable, 0);//是子程序内定义的标识符
                
            code[currentLine].append(",");
			childNode=tree.node[tNode.child[1]];
			code[currentLine].append(childNode.value);
            identifier_list1(type, tree.node[k].child[2], 1);
        }
        else if (useFlag == 2)
        {
            enterSub(id_position, type, currentTable, 1);//是子程序参数标识符
            
            code[currentLine].append(",");
			appendIDType(type);
			childNode=tree.node[tNode.child[1]];
			code[currentLine].append(childNode.value);
            identifier_list1(type, tree.node[k].child[2], 2);
        }
        else if (useFlag == 3)
        {
            if(isDefined(id_position) != 0)//查看是否声明
             {
                int idType = checkIdType(id_position);
             	addReadType(idType);
            	childNode=tree.node[tNode.child[1]];
				code[currentLine].append(childNode.value);
				code[currentLine++].append(");\n ");
				identifier_list1(-1, tree.node[k].child[2], 3);
        	 	
			 }
        	 
			else
                cout<<"the id is not defined where identifier_list1"<<endl;
        }
    }
    else if (lookahead(k) == 106)//e
    {}
    else
        cout<<"identifier_list1 error!"<<endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movl %edx, %ebp
movl %edi, %r15d
movslq %esi, %r14
imulq $0xa8, %r14, %rax
leaq 0xad8b4(%rip), %r13     # 0xb4098
leaq (%rax,%r13), %rbx
addq $0x8, %rbx
leaq 0xf0(%rsp), %rdi
movq %rbx, %rsi
callq 0xa562
leaq 0xb8(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0xd8(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
movl %r14d, %edi
callq 0x603d
cmpl $0x6a, %eax
je 0x6a33
cmpl $0x69, %eax
jne 0x6888
leaq 0xc8(%rsp), %r14
movl 0x8(%rbx), %r12d
cmpl $0x3, %ebp
je 0x6904
cmpl $0x2, %ebp
je 0x68a8
cmpl $0x1, %ebp
jne 0x6a33
leaq 0xa7074(%rip), %rdi     # 0xad8d8
leaq 0x7d15(%rip), %rsi      # 0xe580
callq 0x5f92
testb %al, %al
je 0x699a
movl %r12d, %edi
movl %r15d, %esi
callq 0x6525
jmp 0x69c7
movq 0xd741(%rip), %rdi      # 0x13fd0
leaq 0x7dcc(%rip), %rsi      # 0xe662
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
jmp 0x6a33
leaq 0xa7029(%rip), %rsi     # 0xad8d8
leaq 0x8(%rsp), %rdi
callq 0x2250
leaq 0x8(%rsp), %rdx
pushq $0x1
popq %rcx
movl %r12d, %edi
movl %r15d, %esi
callq 0x6618
leaq 0x8(%rsp), %rdi
callq 0x2388
movslq 0xa7ca3(%rip), %rax     # 0xae580
shlq $0x5, %rax
leaq 0xa7018(%rip), %rdi     # 0xad900
addq %rax, %rdi
leaq 0x81df(%rip), %rsi      # 0xead1
callq 0x2350
movl %r15d, %edi
callq 0x6ee7
jmp 0x69e8
movl %r12d, %edi
callq 0x6ab8
testl %eax, %eax
je 0x6a5c
movl %r12d, %edi
callq 0x6cc0
movl %eax, %edi
callq 0x6eb2
movslq 0xf8(%rsp), %rax
imulq $0xa8, %rax, %rax
leaq (%rax,%r13), %rsi
addq $0x8, %rsi
leaq 0x48(%rsp), %rdi
callq 0xa5ba
movslq 0xa7c35(%rip), %rdi     # 0xae580
shlq $0x5, %rdi
leaq 0xa6faa(%rip), %r15     # 0xad900
addq %r15, %rdi
movq %r14, %rsi
callq 0x2370
movslq 0xa7c18(%rip), %rax     # 0xae580
leal 0x1(%rax), %ecx
movl %ecx, 0xa7c0f(%rip)     # 0xae580
shlq $0x5, %rax
addq %rax, %r15
leaq 0x7c3f(%rip), %rsi      # 0xe5be
movq %r15, %rdi
callq 0x2350
movl 0xc(%rbx), %esi
pushq $-0x1
popq %rdi
pushq $0x3
popq %rdx
callq 0x67bd
jmp 0x6a33
leaq 0xa6f37(%rip), %rsi     # 0xad8d8
leaq 0x28(%rsp), %rdi
callq 0x2250
leaq 0x28(%rsp), %rdx
movl %r12d, %edi
movl %r15d, %esi
xorl %ecx, %ecx
callq 0x6618
leaq 0x28(%rsp), %rdi
callq 0x2388
movslq 0xa7bb2(%rip), %rax     # 0xae580
shlq $0x5, %rax
leaq 0xa6f27(%rip), %rdi     # 0xad900
addq %rax, %rdi
leaq 0x80ee(%rip), %rsi      # 0xead1
callq 0x2350
movslq 0xf8(%rsp), %rax
imulq $0xa8, %rax, %rax
leaq (%rax,%r13), %rsi
addq $0x8, %rsi
leaq 0x48(%rsp), %rdi
callq 0xa5ba
movslq 0xa7b70(%rip), %rax     # 0xae580
shlq $0x5, %rax
leaq 0xa6ee5(%rip), %rdi     # 0xad900
addq %rax, %rdi
movq %r14, %rsi
callq 0x2370
movl 0xc(%rbx), %esi
movl %r15d, %edi
movl %ebp, %edx
callq 0x67bd
leaq 0x48(%rsp), %rdi
callq 0xa600
leaq 0xf0(%rsp), %rdi
callq 0xa600
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xd56d(%rip), %rdi      # 0x13fd0
leaq 0x7bcb(%rip), %rsi      # 0xe635
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
jmp 0x6a33
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
jmp 0x6a8b
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2388
jmp 0x6a99
jmp 0x6a96
jmp 0x6a96
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xa600
leaq 0xf0(%rsp), %rdi
callq 0xa600
movq %rbx, %rdi
callq 0x2330