// File: andrakis[P]alisp/tests.cpp
// Function: test()
void test() {
	Cell one(IntCell(1)), two(IntCell(2));
	Cell three(one);
	three += two;

	std::cout << "One: " << one << std::endl;
	std::cout << "Two: " << two << std::endl;
	std::cout << "Three: " << three << std::endl;

	std::cout << "Nil: " << Nil << std::endl;
	std::cout << "True: " << True << std::endl;
	std::cout << "False: " << False << std::endl;

	ListType args;
	args.push_back(one);
	args.push_back(two);
	args.push_back(three);
	Stdlib::print(args);

	ListCell args2;
	args2.push(three);
	args2.push(two);
	args2.push(one);
	std::cout << " At 0: " << args2.index(0) << std::endl;
	std::cout << " At 1: " << args2.index(1) << std::endl;
	std::cout << " At 2: " << args2.index(2) << std::endl;
	std::cout << " At 3: " << args2.index(3) << std::endl;
	std::cout << "Args: " << args2 << std::endl;
	Stdlib::print(ListType(args2.cbegin(), args2.cend()));

	ProcCell print(Stdlib::print);
	print.proc()(ListType(args2.cbegin(), args2.cend()));

	test_eval();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x200, %rsp            # imm = 0x200
leaq -0x10(%rbp), %rdi
movq %rdi, -0x100(%rbp)
movl $0x1, %esi
callq 0x2d380
movq -0x100(%rbp), %rsi
leaq -0x8(%rbp), %rdi
callq 0xbd50
movq -0x100(%rbp), %rdi
callq 0x2d3e0
leaq -0x20(%rbp), %rdi
movl $0x2, %esi
callq 0x2d380
jmp 0x3a72c
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movq %rsi, -0x108(%rbp)
callq 0xbd50
movq -0x108(%rbp), %rdi
callq 0x2d3e0
leaq -0x38(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq 0xb900
jmp 0x3a75b
leaq -0x38(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x37ee0
jmp 0x3a76a
movq 0x1c857(%rip), %rdi     # 0x56fc8
leaq 0x3454(%rip), %rsi      # 0x3dbcc
callq 0x83e0
movq %rax, -0x110(%rbp)
jmp 0x3a786
movq -0x110(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq 0x1c140
movq %rax, -0x118(%rbp)
jmp 0x3a79f
movq -0x118(%rbp), %rdi
movq 0x1c7e3(%rip), %rsi     # 0x56f90
callq 0x8460
jmp 0x3a7b4
movq 0x1c80d(%rip), %rdi     # 0x56fc8
leaq 0x3410(%rip), %rsi      # 0x3dbd2
callq 0x83e0
movq %rax, -0x120(%rbp)
jmp 0x3a7d0
movq -0x120(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x1c140
movq %rax, -0x128(%rbp)
jmp 0x3a7e9
movq -0x128(%rbp), %rdi
movq 0x1c799(%rip), %rsi     # 0x56f90
callq 0x8460
jmp 0x3a7fe
movq 0x1c7c3(%rip), %rdi     # 0x56fc8
leaq 0x33cc(%rip), %rsi      # 0x3dbd8
callq 0x83e0
movq %rax, -0x130(%rbp)
jmp 0x3a81a
movq -0x130(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x1c140
movq %rax, -0x138(%rbp)
jmp 0x3a833
movq -0x138(%rbp), %rdi
movq 0x1c74f(%rip), %rsi     # 0x56f90
callq 0x8460
jmp 0x3a848
movq 0x1c779(%rip), %rdi     # 0x56fc8
leaq 0x338a(%rip), %rsi      # 0x3dbe0
callq 0x83e0
movq %rax, -0x140(%rbp)
jmp 0x3a864
movq -0x140(%rbp), %rdi
leaq 0x1d2e6(%rip), %rsi     # 0x57b58
callq 0x1c140
movq %rax, -0x148(%rbp)
jmp 0x3a880
movq -0x148(%rbp), %rdi
movq 0x1c702(%rip), %rsi     # 0x56f90
callq 0x8460
jmp 0x3a895
movq 0x1c72c(%rip), %rdi     # 0x56fc8
leaq 0x3343(%rip), %rsi      # 0x3dbe6
callq 0x83e0
movq %rax, -0x150(%rbp)
jmp 0x3a8b1
movq -0x150(%rbp), %rdi
leaq 0x1d2a1(%rip), %rsi     # 0x57b60
callq 0x1c140
movq %rax, -0x158(%rbp)
jmp 0x3a8cd
movq -0x158(%rbp), %rdi
movq 0x1c6b5(%rip), %rsi     # 0x56f90
callq 0x8460
jmp 0x3a8e2
movq 0x1c6df(%rip), %rdi     # 0x56fc8
leaq 0x32fd(%rip), %rsi      # 0x3dbed
callq 0x83e0
movq %rax, -0x160(%rbp)
jmp 0x3a8fe
movq -0x160(%rbp), %rdi
leaq 0x1d25c(%rip), %rsi     # 0x57b68
callq 0x1c140
movq %rax, -0x168(%rbp)
jmp 0x3a91a
movq -0x168(%rbp), %rdi
movq 0x1c668(%rip), %rsi     # 0x56f90
callq 0x8460
jmp 0x3a92f
leaq -0x50(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0xc080
movq -0x170(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq 0x14d00
jmp 0x3a951
leaq -0x50(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x14d00
jmp 0x3a960
leaq -0x50(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x14d00
jmp 0x3a96f
leaq -0x58(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x34840
jmp 0x3a97e
leaq -0x58(%rbp), %rdi
callq 0xb9d0
leaq -0x60(%rbp), %rdi
callq 0x137c0
jmp 0x3a992
leaq -0x60(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x13840
jmp 0x3a9a1
leaq -0x60(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x13840
jmp 0x3a9b0
leaq -0x60(%rbp), %rdi
leaq -0x8(%rbp), %rsi
callq 0x13840
jmp 0x3a9bf
movq 0x1c602(%rip), %rdi     # 0x56fc8
leaq 0x3228(%rip), %rsi      # 0x3dbf5
callq 0x83e0
movq %rax, -0x178(%rbp)
jmp 0x3a9db
xorl %eax, %eax
movl %eax, %edx
leaq -0x68(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x1bda0
jmp 0x3a9ee
movq -0x178(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x1c140
movq %rax, -0x180(%rbp)
jmp 0x3aa07
movq -0x180(%rbp), %rdi
movq 0x1c57b(%rip), %rsi     # 0x56f90
callq 0x8460
jmp 0x3aa1c
leaq -0x68(%rbp), %rdi
callq 0xb9d0
movq 0x1c59c(%rip), %rdi     # 0x56fc8
leaq 0x31ca(%rip), %rsi      # 0x3dbfd
callq 0x83e0
movq %rax, -0x188(%rbp)
jmp 0x3aa41
leaq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x1, %edx
callq 0x1bda0
jmp 0x3aa55
movq -0x188(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x1c140
movq %rax, -0x190(%rbp)
jmp 0x3aa6e
movq -0x190(%rbp), %rdi
movq 0x1c514(%rip), %rsi     # 0x56f90
callq 0x8460
jmp 0x3aa83
leaq -0x70(%rbp), %rdi
callq 0xb9d0
movq 0x1c535(%rip), %rdi     # 0x56fc8
leaq 0x316b(%rip), %rsi      # 0x3dc05
callq 0x83e0
movq %rax, -0x198(%rbp)
jmp 0x3aaa8
leaq -0x78(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x2, %edx
callq 0x1bda0
jmp 0x3aabc
movq -0x198(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x1c140
movq %rax, -0x1a0(%rbp)
jmp 0x3aad5
movq -0x1a0(%rbp), %rdi
movq 0x1c4ad(%rip), %rsi     # 0x56f90
callq 0x8460
jmp 0x3aaea
leaq -0x78(%rbp), %rdi
callq 0xb9d0
movq 0x1c4ce(%rip), %rdi     # 0x56fc8
leaq 0x310c(%rip), %rsi      # 0x3dc0d
callq 0x83e0
movq %rax, -0x1a8(%rbp)
jmp 0x3ab0f
leaq -0x80(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x3, %edx
callq 0x1bda0
jmp 0x3ab23
movq -0x1a8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x1c140
movq %rax, -0x1b0(%rbp)
jmp 0x3ab3c
movq -0x1b0(%rbp), %rdi
movq 0x1c446(%rip), %rsi     # 0x56f90
callq 0x8460
jmp 0x3ab51
leaq -0x80(%rbp), %rdi
callq 0xb9d0
movq 0x1c467(%rip), %rdi     # 0x56fc8
leaq 0x30ad(%rip), %rsi      # 0x3dc15
callq 0x83e0
movq %rax, -0x1b8(%rbp)
jmp 0x3ab76
movq -0x1b8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x1c140
movq %rax, -0x1c0(%rbp)
jmp 0x3ab8f
movq -0x1c0(%rbp), %rdi
movq 0x1c3f3(%rip), %rsi     # 0x56f90
callq 0x8460
jmp 0x3aba4
leaq -0x60(%rbp), %rdi
callq 0x139a0
movq %rax, -0x1c8(%rbp)
jmp 0x3abb6
movq -0x1c8(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x13ac0
movq %rax, -0x1d0(%rbp)
jmp 0x3abd6
movq -0x1d0(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x1d8(%rbp)
callq 0x13010
movq -0x1d8(%rbp), %rcx
movq -0xa8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0x13030
jmp 0x3ac1a
leaq -0x88(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x34840
jmp 0x3ac2f
leaq -0x88(%rbp), %rdi
callq 0xb9d0
leaq -0xa0(%rbp), %rdi
callq 0xc130
leaq -0xb1(%rbp), %rdi
callq 0x12ac0
leaq -0x641a(%rip), %rsi     # 0x34840
leaq -0xc0(%rbp), %rdi
callq 0x33500
jmp 0x3ac68
leaq -0xc0(%rbp), %rdi
callq 0x287b0
movq %rax, -0x1e0(%rbp)
jmp 0x3ac7d
leaq -0x60(%rbp), %rdi
callq 0x139a0
movq %rax, -0x1e8(%rbp)
jmp 0x3ac8f
movq -0x1e8(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x13ac0
movq %rax, -0x1f0(%rbp)
jmp 0x3acaf
movq -0x1f0(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x13010
movq -0x1f8(%rbp), %rcx
movq -0xe8(%rbp), %rsi
movq -0xf0(%rbp), %rdx
leaq -0xe0(%rbp), %rdi
callq 0x13030
jmp 0x3acf3
movq -0x1e0(%rbp), %rax
leaq -0xc8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq *%rax
jmp 0x3ad0c
leaq -0xc8(%rbp), %rdi
callq 0xb9d0
leaq -0xe0(%rbp), %rdi
callq 0xc130
leaq -0xf1(%rbp), %rdi
callq 0x12ac0
callq 0x3a0b0
jmp 0x3ad37
leaq -0xc0(%rbp), %rdi
callq 0x33560
leaq -0x60(%rbp), %rdi
callq 0xbd80
leaq -0x50(%rbp), %rdi
callq 0xc130
leaq -0x38(%rbp), %rdi
callq 0xb9d0
leaq -0x18(%rbp), %rdi
callq 0xb9d0
leaq -0x8(%rbp), %rdi
callq 0xb9d0
addq $0x200, %rsp            # imm = 0x200
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x3aeda
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x3aed1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x3aec8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x3aebf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x3aeb6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0xb9d0
jmp 0x3aeb6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0xb9d0
jmp 0x3aeb6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0xb9d0
jmp 0x3aeb6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xb9d0
jmp 0x3aeb6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x3ae5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0xc130
leaq -0xb1(%rbp), %rdi
callq 0x12ac0
jmp 0x3aeb6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x3aeaa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x3ae9e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0xc130
leaq -0xf1(%rbp), %rdi
callq 0x12ac0
leaq -0xc0(%rbp), %rdi
callq 0x33560
leaq -0x60(%rbp), %rdi
callq 0xbd80
leaq -0x50(%rbp), %rdi
callq 0xc130
leaq -0x38(%rbp), %rdi
callq 0xb9d0
leaq -0x18(%rbp), %rdi
callq 0xb9d0
leaq -0x8(%rbp), %rdi
callq 0xb9d0
movq -0x28(%rbp), %rdi
callq 0x87b0
nopl (%rax)