// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0xb3e5(%rip), %rax      # 0x102e8
movq (%rax), %rcx
movq 0x10(%rax), %r14
movq %rcx, 0xb3d7(%rip)      # 0x102e8
movl $0xfffffeeb, %eax       # imm = 0xFFFFFEEB
addl 0x10(%r14), %eax
cmpl $0x2, %eax
jb 0x4f31
movq 0x8(%r14), %rsi
leaq 0x42e6(%rip), %rdi      # 0x9210
xorl %eax, %eax
callq 0x27e6
movq 0xb3b0(%rip), %rax      # 0x102e8
movl 0x10(%rax), %ebp
movq (%rax), %rax
movq %rax, 0xb3a3(%rip)      # 0x102e8
movq 0xb3bc(%rip), %rax      # 0x10308
cmpq $0x0, 0x8(%rax)
jne 0x4f86
movl $0x30, %edi
callq 0x2230
movq %rax, %rbx
testq %rax, %rax
jne 0x4f73
leaq 0x419c(%rip), %rdi      # 0x9108
xorl %eax, %eax
callq 0x27e6
movq $0x0, 0x8(%rbx)
movq 0xb386(%rip), %rax      # 0x10308
movq %rbx, 0x8(%rax)
movq 0xb37b(%rip), %r15      # 0x10308
movq %r15, 0xb36c(%rip)      # 0x10300
movq 0x8(%r15), %rax
movq %rax, 0xb369(%rip)      # 0x10308
movq %rax, 0xb352(%rip)      # 0x102f8
movq %r15, (%rax)
movq 0x18(%r14), %rax
cmpl 0x10(%rax), %ebp
jle 0x4fc4
movq 0x8(%r14), %rsi
leaq 0x4274(%rip), %rdi      # 0x9231
xorl %eax, %eax
callq 0x27e6
movq %r14, 0x8(%rsp)
movq 0x18(%r14), %rax
movq 0x8(%rax), %r12
testq %r12, %r12
je 0x503a
movl 0x10(%rax), %r13d
subl %ebp, %r13d
xorl %ebp, %ebp
leaq 0x10(%rsp), %rbx
testl %r13d, %r13d
jle 0x4ff9
decl %r13d
xorps %xmm0, %xmm0
movsd %xmm0, (%rsp)
xorl %r14d, %r14d
jmp 0x5011
movq %rbx, %rdi
callq 0x2e41
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rsp)
movl 0x20(%rsp), %r14d
movq 0x8(%r12), %rdi
callq 0x51ba
movq %rbp, (%rax)
movsd (%rsp), %xmm0
movsd %xmm0, 0x8(%rax)
movl %r14d, 0x18(%rax)
movq (%r12), %r12
movq %rax, %rbp
testq %r12, %r12
jne 0x4fe4
jmp 0x503c
xorl %eax, %eax
movq 0x8(%rsp), %rdx
movq %rdx, 0x20(%r15)
movq 0xb2d4(%rip), %rcx      # 0x10320
movq %rcx, 0x18(%r15)
movq %rax, 0x10(%r15)
movq %rax, 0xb2c5(%rip)      # 0x10320
movq 0xb286(%rip), %rax      # 0x102e8
movq %rax, 0x28(%r15)
movq 0x18(%rdx), %rax
movq (%rax), %rdi
callq 0x2d73
movb $0x0, 0xb297(%rip)      # 0x10310
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq