// File: /workspace/github_cpp_makefile_star2_O3/zhengwangsun[P]pas2c/semantics.cpp
// Function: procedure_call_statement1(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void  procedure_call_statement1(int k, string idValue)
{
	TreeNode tNode= tree.node[k];
	TreeNode childNode;
    if(lookahead(k) == 102)//102是(
    {
        int flag = 0;//标志作用
    	code[currentLine].append("(");
        expression_list(tree.node[k].child[1],3, idValue);
        code[currentLine].append(")");
        
        for(vector<subTableItem>::iterator it = subTable.begin(); it != subTable.end();it++)
        {
            if (it->name == idValue)
            {
                if (procArgument.size() != it->argument.size())
                {
                    cout<<"argument num wrong where procedure_call_statement1! line:"<<tree.node[k].row<<endl;
                    exit(1);
                }
                else
                {
                    int i = 1;//计数作用
                    for(vector<Tuple>::iterator it1 = it->argument.begin(); it1 != it->argument.end();it1++)
                    {
                        if (it1->type != procArgument[i-1])
                        {
                            cout<<"the argument no."<<i<<" type wrong where procedure_call_statement1! line:"<<tree.node[k].row<<endl;
                            cout<<"error in:"<<it->name<<endl;
                            exit(1);
                        }
                        i++;
                    }
                    procArgument.clear();//每用一次procA，就清空一次
                    flag = 1;
                    break;
                }
            }
        }
        if (flag == 0) {
            cout<<"this func/proc("<<idValue<<") is not define where pro_call! "<<tree.node[k].row<<endl;
            exit(1);
        }
    }
    else if(lookahead(k) == 106)//106是e
    {
        code[currentLine].append("(");//张英哲加的
        code[currentLine].append(")");
    }
    else
        cout<<"procedure_call_statement1 error!"<<endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rsi, %r14
movslq %edi, %rax
imulq $0xa8, %rax, %rax
leaq 0xacbab(%rip), %r15     # 0xb90c8
leaq (%r15,%rax), %rbx
addq $0x8, %rbx
leaq 0x28(%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 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x60(%rbx), %rsi
movq 0x68(%rbx), %rdx
addq %rsi, %rdx
callq 0x7666
leaq 0xa8(%rsp), %rdi
leaq 0xb8(%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, 0xc8(%rsp)
leaq 0x140(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x160(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
cmpl $0x0, (%rbx)
jle 0xc718
movslq 0x4(%rbx), %rax
imulq $0xa8, %rax, %rax
movl 0x5c(%r15,%rax), %eax
cmpl $0x6a, %eax
je 0xc763
cmpl $0x66, %eax
jne 0xc718
movslq 0xa6fbb(%rip), %rdi     # 0xb35b0
shlq $0x5, %rdi
leaq 0xa6330(%rip), %r15     # 0xb2930
addq %r15, %rdi
leaq 0x7d49(%rip), %rsi      # 0x14353
callq 0x23d0
movl 0x8(%rbx), %ebp
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x7666
movl %ebp, %edi
movl $0x3, %esi
callq 0xc19b
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc653
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
movslq 0xa6f56(%rip), %rax     # 0xb35b0
shlq $0x5, %rax
addq %rax, %r15
leaq 0x7eb1(%rip), %rsi      # 0x14519
movq %r15, %rdi
callq 0x23d0
movq 0xa6261(%rip), %rbp     # 0xb28d8
movq 0xa6262(%rip), %r12     # 0xb28e0
cmpq %r12, %rbp
je 0xc6b6
movq 0x8(%r14), %r15
cmpq %r15, 0x38(%rbp)
jne 0xc6ad
testq %r15, %r15
je 0xc7a3
movq (%r14), %rsi
movq 0x30(%rbp), %rdi
movq %r15, %rdx
callq 0x2240
testl %eax, %eax
je 0xc7a3
addq $0x60, %rbp
cmpq %r12, %rbp
jne 0xc687
movq 0xc913(%rip), %rdi      # 0x18fd0
leaq 0x7312(%rip), %rsi      # 0x139d6
movl $0xf, %edx
callq 0x2280
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0xc8f4(%rip), %rdi      # 0x18fd0
callq 0x2280
movq %rax, %r14
leaq 0x72fb(%rip), %rsi      # 0x139e6
movl $0x20, %edx
movq %rax, %rdi
callq 0x2280
movl 0xa4(%rbx), %esi
movq %r14, %rdi
callq 0x2390
movq %rax, %rdi
callq 0x20f0
movl $0x1, %edi
callq 0x2290
movq 0xc8b1(%rip), %rbx      # 0x18fd0
leaq 0x72e1(%rip), %rsi      # 0x13a07
movl $0x20, %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 0xc87f(%rip), %rdi      # 0x18fd0
callq 0x2030
movq %rax, %rdi
callq 0x2150
jmp 0xc811
movslq 0xa6e46(%rip), %rdi     # 0xb35b0
shlq $0x5, %rdi
leaq 0xa61bb(%rip), %rbx     # 0xb2930
addq %rbx, %rdi
leaq 0x7bd4(%rip), %rsi      # 0x14353
callq 0x23d0
movslq 0xa6e25(%rip), %rax     # 0xb35b0
shlq $0x5, %rax
addq %rax, %rbx
leaq 0x7d80(%rip), %rsi      # 0x14519
movq %rbx, %rdi
callq 0x23d0
jmp 0xc811
movq 0xa614e(%rip), %rcx     # 0xb28f8
movq 0xa613f(%rip), %rax     # 0xb28f0
movq %rcx, %rdi
subq %rax, %rdi
sarq $0x2, %rdi
movq 0x18(%rbp), %rdx
movq 0x20(%rbp), %rsi
movq %rsi, %r8
subq %rdx, %r8
sarq $0x4, %r8
movabsq $-0x3333333333333333, %r9 # imm = 0xCCCCCCCCCCCCCCCD
imulq %r8, %r9
cmpq %r9, %rdi
jne 0xc93f
cmpq %rsi, %rdx
je 0xc805
xorl %r14d, %r14d
movl 0x20(%rdx), %edi
cmpl (%rax,%r14,4), %edi
jne 0xc8af
addq $0x50, %rdx
incq %r14
cmpq %rsi, %rdx
jne 0xc7ec
cmpq %rax, %rcx
je 0xc811
movq %rax, 0xa60e7(%rip)     # 0xb28f8
movq 0x150(%rsp), %rdi
cmpq %r13, %rdi
je 0xc82e
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0xc853
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0xc878
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xc89d
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2230
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xc71a(%rip), %rdi      # 0x18fd0
leaq 0x70cb(%rip), %rsi      # 0x13988
movl $0x10, %edx
callq 0x2280
incl %r14d
movq 0xc6ff(%rip), %rdi      # 0x18fd0
movl %r14d, %esi
callq 0x2390
movq %rax, %r14
leaq 0x70b6(%rip), %rsi      # 0x13999
movl $0x32, %edx
movq %rax, %rdi
callq 0x2280
movl 0xa4(%rbx), %esi
movq %r14, %rdi
callq 0x2390
movq %rax, %rdi
callq 0x20f0
movq 0xc6c3(%rip), %rdi      # 0x18fd0
leaq 0x70b8(%rip), %rsi      # 0x139cc
movl $0x9, %edx
callq 0x2280
movq 0x30(%rbp), %rsi
movq 0x38(%rbp), %rdx
movq 0xc6a3(%rip), %rdi      # 0x18fd0
callq 0x2280
movq %rax, %rdi
callq 0x20f0
jmp 0xc70e
movq 0xc68a(%rip), %rdi      # 0x18fd0
leaq 0x7001(%rip), %rsi      # 0x1394e
movl $0x39, %edx
callq 0x2280
movl 0xa4(%rbx), %esi
movq 0xc66c(%rip), %rdi      # 0x18fd0
callq 0x2390
movq %rax, %rdi
callq 0x20f0
jmp 0xc70e
jmp 0xc9c2
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc9c5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0xc9c5
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xc9dc
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0xc9dc
jmp 0xc9c2
jmp 0xc9c2
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0xf396
leaq 0x28(%rsp), %rdi
callq 0xf396
movq %rbx, %rdi
callq 0x23a0