// File: /workspace/github_cpp_makefile_star2_O1/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 0xad942(%rip), %r15     # 0xba0c8
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 0x768e
leaq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x80(%rbx), %rsi
movq 0x88(%rbx), %rdx
addq %rsi, %rdx
callq 0x768e
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)
movl (%rbx), %eax
testl %eax, %eax
jle 0xc9d1
movslq 0x4(%rbx), %rcx
imulq $0xa8, %rcx, %rcx
cmpl $0x66, 0x5c(%r15,%rcx)
jne 0xc977
movslq 0xa7d5c(%rip), %rdi     # 0xb45b0
shlq $0x5, %rdi
leaq 0xa70d1(%rip), %r15     # 0xb3930
addq %r15, %rdi
leaq 0x8aca(%rip), %rsi      # 0x15333
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 0x768e
movl %ebp, %edi
movl $0x3, %esi
callq 0xc3f7
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc8b2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
movslq 0xa7cf7(%rip), %rax     # 0xb45b0
shlq $0x5, %rax
addq %rax, %r15
leaq 0x8c32(%rip), %rsi      # 0x154f9
movq %r15, %rdi
callq 0x23d0
movq 0xa7002(%rip), %r15     # 0xb38d8
movq 0xa7003(%rip), %rbp     # 0xb38e0
cmpq %rbp, %r15
je 0xc915
movq 0x8(%r14), %r12
movq 0x38(%r15), %rdx
cmpq %r12, %rdx
jne 0xc90c
testq %rdx, %rdx
je 0xca19
movq (%r14), %rsi
movq 0x30(%r15), %rdi
callq 0x2240
testl %eax, %eax
je 0xca19
addq $0x60, %r15
cmpq %rbp, %r15
jne 0xc8e6
movq 0xd6b4(%rip), %rdi      # 0x19fd0
leaq 0x8083(%rip), %rsi      # 0x149a6
movl $0xf, %edx
callq 0x2280
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0xd695(%rip), %rdi      # 0x19fd0
callq 0x2280
movq %rax, %r14
leaq 0x806c(%rip), %rsi      # 0x149b6
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
testl %eax, %eax
jle 0xc9d1
movslq 0x4(%rbx), %rax
imulq $0xa8, %rax, %rax
cmpl $0x6a, 0x5c(%r15,%rax)
jne 0xc9d1
movslq 0xa7c1b(%rip), %rdi     # 0xb45b0
shlq $0x5, %rdi
leaq 0xa6f90(%rip), %rbx     # 0xb3930
addq %rbx, %rdi
leaq 0x8989(%rip), %rsi      # 0x15333
callq 0x23d0
movslq 0xa7bfa(%rip), %rax     # 0xb45b0
shlq $0x5, %rax
addq %rax, %rbx
leaq 0x8b35(%rip), %rsi      # 0x154f9
movq %rbx, %rdi
callq 0x23d0
jmp 0xca87
movq 0xd5f8(%rip), %rbx      # 0x19fd0
leaq 0x7ff8(%rip), %rsi      # 0x149d7
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 0xd5c6(%rip), %rdi      # 0x19fd0
callq 0x2030
movq %rax, %rdi
callq 0x2150
jmp 0xca87
movq 0xa6ed8(%rip), %rcx     # 0xb38f8
movq 0xa6ec9(%rip), %rax     # 0xb38f0
movq %rcx, %rdi
subq %rax, %rdi
sarq $0x2, %rdi
movq 0x18(%r15), %rdx
movq 0x20(%r15), %rsi
movq %rsi, %r8
subq %rdx, %r8
sarq $0x4, %r8
movabsq $-0x3333333333333333, %r9 # imm = 0xCCCCCCCCCCCCCCCD
imulq %r8, %r9
cmpq %r9, %rdi
jne 0xcbb5
cmpq %rsi, %rdx
je 0xca7b
xorl %r14d, %r14d
movl 0x20(%rdx), %edi
cmpl (%rax,%r14,4), %edi
jne 0xcb25
addq $0x50, %rdx
incq %r14
cmpq %rsi, %rdx
jne 0xca62
cmpq %rax, %rcx
je 0xca87
movq %rax, 0xa6e71(%rip)     # 0xb38f8
movq 0x150(%rsp), %rdi
cmpq %r13, %rdi
je 0xcaa4
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0xcac9
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0xcaee
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xcb13
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 0xd4a4(%rip), %rdi      # 0x19fd0
leaq 0x7e25(%rip), %rsi      # 0x14958
movl $0x10, %edx
callq 0x2280
incl %r14d
movq 0xd489(%rip), %rdi      # 0x19fd0
movl %r14d, %esi
callq 0x2390
movq %rax, %r14
leaq 0x7e10(%rip), %rsi      # 0x14969
movl $0x32, %edx
movq %rax, %rdi
callq 0x2280
movl 0xa4(%rbx), %esi
movq %r14, %rdi
callq 0x2390
movq %rax, %rdi
callq 0x20f0
movq 0xd44d(%rip), %rdi      # 0x19fd0
leaq 0x7e12(%rip), %rsi      # 0x1499c
movl $0x9, %edx
callq 0x2280
movq 0x30(%r15), %rsi
movq 0x38(%r15), %rdx
movq 0xd42d(%rip), %rdi      # 0x19fd0
callq 0x2280
movq %rax, %rdi
callq 0x20f0
jmp 0xc96d
movq 0xd414(%rip), %rdi      # 0x19fd0
leaq 0x7d5b(%rip), %rsi      # 0x1491e
movl $0x39, %edx
callq 0x2280
movl 0xa4(%rbx), %esi
movq 0xd3f6(%rip), %rdi      # 0x19fd0
callq 0x2390
movq %rax, %rdi
callq 0x20f0
jmp 0xc96d
jmp 0xcc38
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xcc3b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0xcc3b
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xcc52
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0xcc52
jmp 0xcc38
jmp 0xcc38
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0xf7a8
leaq 0x28(%rsp), %rdi
callq 0xf7a8
movq %rbx, %rdi
callq 0x23a0