// File: /workspace/github_c_makefile_star2_O0/phillbush[P]hoc/code.c
// Function: call
void
call(void)
{
	Symbol *local;
	Frame *f;
	Datum d;
	Name *name, *tmp;
	int nargs;

	name = getnamearg();
	if (name->type != FUNCTION && name->type != PROCEDURE)
		yyerror("%s is not function nor procedure", name->s);
	nargs = getintarg();
	if (!frame.next->next) {
		f = emalloc(sizeof *f);
		f->next = NULL;
		frame.next->next = f;
	}
	frame.curr = f = frame.next;
	frame.tail = frame.next = frame.next->next;
	frame.next->prev = frame.curr;
	if (nargs > name->u.fun->nparams)
		yyerror("function %s called with wrong number of parameters", name->s);
	nargs = name->u.fun->nparams - nargs;
	local = NULL;
	for (tmp = name->u.fun->params; tmp; tmp = tmp->next) {
		if (nargs > 0) {
			d.u.val = 0.0;
			d.isstr = 0;
			nargs--;
		} else {
			d = pop();
		}
		local = installlocalsym(tmp->s, local);
		local->u = d.u;
		local->isstr = d.isstr;
	}
	f->name = name;
	f->retsymtab = currsymtab;
	currsymtab = f->local = local;
	f->retpc = prog.pc;
	execute(name->u.fun->code);
	returning = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
callq 0x3b80
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x115, 0x10(%rax)      # imm = 0x115
je 0x5a41
movq -0x30(%rbp), %rax
cmpl $0x116, 0x10(%rax)      # imm = 0x116
je 0x5a41
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x582e(%rip), %rdi      # 0xb268
movb $0x0, %al
callq 0x26c0
callq 0x5870
movl %eax, -0x3c(%rbp)
movq 0xce48(%rip), %rax      # 0x12898
cmpq $0x0, 0x8(%rax)
jne 0x5a80
movl $0x30, %edi
callq 0x2860
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rcx
movq 0xce1c(%rip), %rax      # 0x12898
movq %rcx, 0x8(%rax)
movq 0xce11(%rip), %rax      # 0x12898
movq %rax, -0x10(%rbp)
movq %rax, 0xcdfe(%rip)      # 0x12890
movq 0xcdff(%rip), %rax      # 0x12898
movq 0x8(%rax), %rax
movq %rax, 0xcdf4(%rip)      # 0x12898
movq %rax, 0xcddd(%rip)      # 0x12888
movq 0xcdde(%rip), %rcx      # 0x12890
movq 0xcddf(%rip), %rax      # 0x12898
movq %rcx, (%rax)
movl -0x3c(%rbp), %eax
movq -0x30(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl 0x10(%rcx), %eax
jle 0x5ae2
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x57ae(%rip), %rdi      # 0xb289
movb $0x0, %al
callq 0x26c0
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x10(%rax), %eax
subl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq $0x0, -0x8(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x5b8b
cmpl $0x0, -0x3c(%rbp)
jle 0x5b32
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x5b53
leaq -0x58(%rbp), %rdi
callq 0x32a0
movq -0x58(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x5bf0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl -0x18(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x5b0b
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq 0xcd12(%rip), %rcx      # 0x128b0
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rax, 0x10(%rcx)
movq %rax, 0xccf7(%rip)      # 0x128b0
movq 0xccb8(%rip), %rcx      # 0x12878
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rdi
callq 0x3120
movl $0x0, 0xccbe(%rip)      # 0x128a0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)