// File: /workspace/github_c_makefile_star2_O0/blakemcbride[P]LISP9/ls9.c
// Function: apply
int apply(int tail) {
	int	n, m, pn, pm, i;
	cell	k, e;

	if (!closurep(Acc))
		error("application of non-function", Acc);
	if (tail) {
		Ep = closure_env(Acc);
		Prog = closure_prog(Acc);
		m = fixval(stackref(Sp));
		n = fixval(stackref(Sp-m-4));
		pm = Sp-m;
		pn = Sp-m-n-4;
		if (n == m) {
			for (i=0; i<=m; i++)
				stackset(pn+i, stackref(pm+i));
			Fp = fixval(stackref(Sp-m-1));
			Sp -= n+2;
		}
		else {
			e = stackref(Sp-m-3);
			k = stackref(Sp-m-2);
			Fp = fixval(stackref(Sp-m-1));
			for (i=0; i<=m; i++)
				stackset(pn+i, stackref(pm+i));
			Sp -= n+2;
			stackset(Sp-1, e);
			stackset(Sp,   k);
		}
	}
	else {
		push(Ep);
		push(cons(mkfix(Ip+1), Prog));
		Ep = closure_env(Acc);
		Prog = closure_prog(Acc);
	}
	return fixval(closure_ip(Acc));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x0, 0xd8ee(%rip)      # 0x201c0
jl 0x12906
movq 0xda75(%rip), %rax      # 0x20350
movslq 0xd8de(%rip), %rcx      # 0x201c0
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x12906
movq 0xda4b(%rip), %rcx      # 0x20340
movslq 0xd8c4(%rip), %rdx      # 0x201c0
movl $0xfffffff3, %eax       # imm = 0xFFFFFFF3
cmpl (%rcx,%rdx,4), %eax
je 0x12918
movl 0xd8b4(%rip), %esi      # 0x201c0
leaq 0x93f3(%rip), %rdi      # 0x1bd06
callq 0x26c0
cmpl $0x0, -0x4(%rbp)
je 0x12cba
movq 0xda17(%rip), %rax      # 0x20340
movq 0xda18(%rip), %rcx      # 0x20348
movq 0xda11(%rip), %rdx      # 0x20348
movslq 0xd882(%rip), %rsi      # 0x201c0
movslq (%rdx,%rsi,4), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xd881(%rip)      # 0x201d0
movq 0xd9ea(%rip), %rax      # 0x20340
movq 0xd9eb(%rip), %rcx      # 0x20348
movq 0xd9e4(%rip), %rdx      # 0x20348
movq 0xd9dd(%rip), %rsi      # 0x20348
movslq 0xd84e(%rip), %rdi      # 0x201c0
movslq (%rsi,%rdi,4), %rsi
movslq (%rdx,%rsi,4), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xd835(%rip)      # 0x201bc
movq 0xd9b2(%rip), %rax      # 0x20340
movq 0xd9b3(%rip), %rcx      # 0x20348
movq 0xd9bc(%rip), %rdx      # 0x20358
movq 0xd9a5(%rip), %rsi      # 0x20348
movslq 0xd7b2(%rip), %rdi      # 0x2015c
movslq (%rsi,%rdi,4), %rsi
shlq $0x2, %rsi
addq %rsi, %rdx
movslq 0xd7a4(%rip), %rsi      # 0x20160
movslq (%rdx,%rsi,4), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xc(%rbp)
movq 0xd96f(%rip), %rax      # 0x20340
movq 0xd970(%rip), %rcx      # 0x20348
movq 0xd979(%rip), %rdx      # 0x20358
movq 0xd962(%rip), %rsi      # 0x20348
movslq 0xd76f(%rip), %rdi      # 0x2015c
movslq (%rsi,%rdi,4), %rsi
shlq $0x2, %rsi
addq %rsi, %rdx
movl 0xd762(%rip), %esi      # 0x20160
subl -0xc(%rbp), %esi
subl $0x4, %esi
movslq %esi, %rsi
movslq (%rdx,%rsi,4), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x8(%rbp)
movl 0xd745(%rip), %eax      # 0x20160
subl -0xc(%rbp), %eax
movl %eax, -0x14(%rbp)
movl 0xd739(%rip), %eax      # 0x20160
subl -0xc(%rbp), %eax
subl -0x8(%rbp), %eax
subl $0x4, %eax
movl %eax, -0x10(%rbp)
movl -0x8(%rbp), %eax
cmpl -0xc(%rbp), %eax
jne 0x12b18
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0xc(%rbp), %eax
jg 0x12ab1
movq 0xd903(%rip), %rax      # 0x20358
movq 0xd8ec(%rip), %rcx      # 0x20348
movslq 0xd6f9(%rip), %rdx      # 0x2015c
movslq (%rcx,%rdx,4), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl -0x14(%rbp), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq 0xd8d7(%rip), %rax      # 0x20358
movq 0xd8c0(%rip), %rcx      # 0x20348
movslq 0xd6cd(%rip), %rsi      # 0x2015c
movslq (%rcx,%rsi,4), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl -0x10(%rbp), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x12a46
movq 0xd888(%rip), %rax      # 0x20340
movq 0xd889(%rip), %rcx      # 0x20348
movq 0xd892(%rip), %rdx      # 0x20358
movq 0xd87b(%rip), %rsi      # 0x20348
movslq 0xd688(%rip), %rdi      # 0x2015c
movslq (%rsi,%rdi,4), %rsi
shlq $0x2, %rsi
addq %rsi, %rdx
movl 0xd67b(%rip), %esi      # 0x20160
subl -0xc(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
movslq (%rdx,%rsi,4), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xd6c9(%rip)      # 0x201c8
movl -0x8(%rbp), %ecx
addl $0x2, %ecx
movl 0xd655(%rip), %eax      # 0x20160
subl %ecx, %eax
movl %eax, 0xd64d(%rip)      # 0x20160
jmp 0x12cb5
movq 0xd839(%rip), %rax      # 0x20358
movq 0xd822(%rip), %rcx      # 0x20348
movslq 0xd62f(%rip), %rdx      # 0x2015c
movslq (%rcx,%rdx,4), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl 0xd622(%rip), %ecx      # 0x20160
subl -0xc(%rbp), %ecx
subl $0x3, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x20(%rbp)
movq 0xd804(%rip), %rax      # 0x20358
movq 0xd7ed(%rip), %rcx      # 0x20348
movslq 0xd5fa(%rip), %rdx      # 0x2015c
movslq (%rcx,%rdx,4), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl 0xd5ed(%rip), %ecx      # 0x20160
subl -0xc(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
movq 0xd7b7(%rip), %rax      # 0x20340
movq 0xd7b8(%rip), %rcx      # 0x20348
movq 0xd7c1(%rip), %rdx      # 0x20358
movq 0xd7aa(%rip), %rsi      # 0x20348
movslq 0xd5b7(%rip), %rdi      # 0x2015c
movslq (%rsi,%rdi,4), %rsi
shlq $0x2, %rsi
addq %rsi, %rdx
movl 0xd5aa(%rip), %esi      # 0x20160
subl -0xc(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
movslq (%rdx,%rsi,4), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xd5f8(%rip)      # 0x201c8
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0xc(%rbp), %eax
jg 0x12c42
movq 0xd772(%rip), %rax      # 0x20358
movq 0xd75b(%rip), %rcx      # 0x20348
movslq 0xd568(%rip), %rdx      # 0x2015c
movslq (%rcx,%rdx,4), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl -0x14(%rbp), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq 0xd746(%rip), %rax      # 0x20358
movq 0xd72f(%rip), %rcx      # 0x20348
movslq 0xd53c(%rip), %rsi      # 0x2015c
movslq (%rcx,%rsi,4), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl -0x10(%rbp), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x12bd7
movl -0x8(%rbp), %ecx
addl $0x2, %ecx
movl 0xd512(%rip), %eax      # 0x20160
subl %ecx, %eax
movl %eax, 0xd50a(%rip)      # 0x20160
movl -0x20(%rbp), %edx
movq 0xd6f8(%rip), %rax      # 0x20358
movq 0xd6e1(%rip), %rcx      # 0x20348
movslq 0xd4ee(%rip), %rsi      # 0x2015c
movslq (%rcx,%rsi,4), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl 0xd4e1(%rip), %ecx      # 0x20160
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %edx
movq 0xd6c6(%rip), %rax      # 0x20358
movq 0xd6af(%rip), %rcx      # 0x20348
movslq 0xd4bc(%rip), %rsi      # 0x2015c
movslq (%rcx,%rsi,4), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq 0xd4ae(%rip), %rcx      # 0x20160
movl %edx, (%rax,%rcx,4)
jmp 0x12d69
movl 0xd510(%rip), %edi      # 0x201d0
callq 0x12750
movl 0xdc8d(%rip), %edi      # 0x20958
addl $0x1, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
callq 0x3990
movl %eax, %esi
movl $0xfffffff2, %edi       # imm = 0xFFFFFFF2
movl $0x1, %edx
callq 0x3990
movl %eax, %edi
movl 0xd4c6(%rip), %esi      # 0x201bc
xorl %edx, %edx
callq 0x3990
movl %eax, %edi
callq 0x12750
movq 0xd635(%rip), %rax      # 0x20340
movq 0xd636(%rip), %rcx      # 0x20348
movq 0xd62f(%rip), %rdx      # 0x20348
movslq 0xd4a0(%rip), %rsi      # 0x201c0
movslq (%rdx,%rsi,4), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xd49f(%rip)      # 0x201d0
movq 0xd608(%rip), %rax      # 0x20340
movq 0xd609(%rip), %rcx      # 0x20348
movq 0xd602(%rip), %rdx      # 0x20348
movq 0xd5fb(%rip), %rsi      # 0x20348
movslq 0xd46c(%rip), %rdi      # 0x201c0
movslq (%rsi,%rdi,4), %rsi
movslq (%rdx,%rsi,4), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xd453(%rip)      # 0x201bc
movq 0xd5d0(%rip), %rax      # 0x20340
movq 0xd5d1(%rip), %rcx      # 0x20348
movq 0xd5c2(%rip), %rdx      # 0x20340
movq 0xd5c3(%rip), %rsi      # 0x20348
movslq 0xd434(%rip), %rdi      # 0x201c0
movslq (%rsi,%rdi,4), %rsi
movslq (%rdx,%rsi,4), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)