// File: /workspace/github_c_makefile_star2_O1/dalnefre[P]kernel_abe/cons.c
// Function: test_cons
void
test_cons()
{
	CONS* p;
	CONS* q;
	CONS* r;

	DBUG_ENTER("test_cons");
	TRACE(printf("--test_cons--\n"));
	assert(nilp(NIL));
	assert(consp(NIL));
	assert(!atomp(NIL));
	assert(!funcp(NIL));
	assert(!numberp(NIL));
	
	assert(nilp((NIL)->first));
	assert((NIL)->first == NIL);
	assert(nilp((NIL)->rest));
	assert((NIL)->rest == NIL);
	
	p = cons(NIL, NIL);
	DBUG_PRINT("", ("p:cons(NIL,NIL)=%p", p));
	assert(p != NIL);
	assert(!nilp(p));
	assert(consp(p));
	assert(!atomp(p));
	assert(!funcp(p));
	assert(!numberp(p));
	assert(nilp(car(p)));
	assert(car(p) == NIL);
	assert(nilp(cdr(p)));
	assert(cdr(p) == NIL);
	
	q = cons(NIL, p);
	DBUG_PRINT("", ("q:cons(NIL,p)=%p", q));
	assert(q != NIL);
	assert(!nilp(q));
	assert(consp(q));
	assert(!atomp(q));
	assert(!funcp(q));
	assert(!numberp(q));
	assert(nilp(car(q)));
	assert(car(q) == NIL);
	assert(!nilp(cdr(q)));
	assert(consp(cdr(q)));
	assert(cdr(q) == p);
	
	DBUG_PRINT("", ("testing reverse()"));
	p = cons(NUMBER(0), cons(cons(NUMBER(1), cons(NUMBER(2), NIL)), NIL));
	DBUG_PRINT("", ("p=%s", cons_to_str(p)));
	q = reverse(p);
	DBUG_PRINT("", ("q=%s", cons_to_str(q)));
	assert(car(cdr(q)) == NUMBER(0));
	assert(car(car(q)) == NUMBER(1));
	assert(car(cdr(car(q))) == NUMBER(2));
	
	DBUG_PRINT("", ("testing map_remove()"));
	p = NIL;
	p = map_put(p, NUMBER(0), NUMBER(0));
	p = map_put(p, NUMBER(1), NUMBER(1));
	p = map_put(p, NUMBER(1), NUMBER(2));
	p = map_put(p, NUMBER(0), NUMBER(3));
	r = p;
	DBUG_PRINT("", ("p=%s", cons_to_str(p)));
	assert(length(p) == 4);
	assert(map_get(p, NUMBER(0)) == NUMBER(3));
	q = map_remove(p, NIL);
	DBUG_PRINT("", ("q=%s", cons_to_str(q)));
	assert(p != q);
	p = map_remove(r, NUMBER(0));
	DBUG_PRINT("", ("p=%s", cons_to_str(p)));
	assert(p != r);
	assert(length(p) == 1);
	q = map_cut(r, NUMBER(0));
	DBUG_PRINT("", ("q=%s", cons_to_str(q)));
	assert(r != q);
	assert(p != q);
	assert(length(p) == 1);
	assert(length(q) == 3);
	assert(length(r) == 4);
	assert(map_get(q, NUMBER(0)) == NUMBER(0));
	p = map_cut(q, NUMBER(0));
	DBUG_PRINT("", ("p=%s", cons_to_str(p)));
	assert(p == q);
	assert(length(p) == 2);
	assert(map_get(p, NUMBER(0)) == NULL);
	
	DBUG_RETURN;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x3fb2(%rip), %rax      # 0x1e40a
movq %rsp, %rdi
movq %rax, (%rdi)
leaq 0x8ecb(%rip), %r13      # 0x23330
movq (%r13), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x15d, 0xc(%rdi)       # imm = 0x15D
leaq 0x1ec9(%rip), %rbx      # 0x1c34a
movq %rbx, 0x10(%rdi)
leaq 0x8e34(%rip), %rcx      # 0x232c0
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0x1b912
leaq 0x41e8(%rip), %rdi      # 0x1e688
callq 0x20a0
leaq 0x8df4(%rip), %rax      # 0x232a0
cmpq %rax, 0x8ded(%rip)      # 0x232a0
jne 0x1ab08
cmpq %rax, 0x8de8(%rip)      # 0x232a8
jne 0x1ab27
leaq 0x8dd3(%rip), %r15      # 0x232a0
movq %r15, %rdi
movq %r15, %rsi
callq 0x19b84
movq %rax, %r14
leaq 0x944e(%rip), %rbp      # 0x23930
cmpl $0x0, (%rbp)
je 0x1a520
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b084
testl %eax, %eax
je 0x1a520
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x16b, 0xc(%rax)       # imm = 0x16B
leaq 0x3f5b(%rip), %rdi      # 0x1e471
movq %r14, %rsi
xorl %eax, %eax
callq 0x1b983
cmpq %r15, %r14
je 0x1ab46
testq %r14, %r14
je 0x1ab65
movl %r14d, %eax
andl $0x3, %eax
jne 0x1ab65
movq %r14, %rdi
callq 0x19ba6
cmpq %r15, %rax
jne 0x1ab84
movq %r14, %rdi
callq 0x19ba6
cmpq %r15, %rax
jne 0x1aba3
movq %r14, %rdi
callq 0x19c45
cmpq %r15, %rax
jne 0x1abc2
movq %r14, %rdi
callq 0x19c45
cmpq %r15, %rax
jne 0x1abe1
leaq 0x8d17(%rip), %r12      # 0x232a0
movq %r12, %rdi
movq %r14, %rsi
callq 0x19b84
movq %rax, %r15
cmpl $0x0, (%rbp)
je 0x1a5d5
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b084
testl %eax, %eax
je 0x1a5d5
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x178, 0xc(%rax)       # imm = 0x178
leaq 0x3eeb(%rip), %rdi      # 0x1e4b6
movq %r15, %rsi
xorl %eax, %eax
callq 0x1b983
cmpq %r12, %r15
je 0x1ac00
testq %r15, %r15
je 0x1ac1f
movl %r15d, %eax
andl $0x3, %eax
jne 0x1ac1f
movq %r15, %rdi
callq 0x19ba6
cmpq %r12, %rax
jne 0x1ac3e
movq %r15, %rdi
callq 0x19ba6
cmpq %r12, %rax
jne 0x1ac5d
movq %r15, %rdi
callq 0x19c45
cmpq %r12, %rax
je 0x1ac7c
movq %r15, %rdi
callq 0x19c45
testq %rax, %rax
je 0x1aae9
movq %r15, %rdi
callq 0x19c45
testb $0x3, %al
jne 0x1aae9
movq %r15, %rdi
callq 0x19c45
cmpq %r14, %rax
jne 0x1ac9b
cmpl $0x0, (%rbp)
je 0x1a693
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b084
testl %eax, %eax
je 0x1a693
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x185, 0xc(%rax)       # imm = 0x185
leaq 0x3e90(%rip), %rdi      # 0x1e51c
xorl %eax, %eax
callq 0x1b983
leaq 0x8c06(%rip), %r14      # 0x232a0
movl $0xb, %edi
movq %r14, %rsi
callq 0x19b84
movl $0x7, %edi
movq %rax, %rsi
callq 0x19b84
movq %rax, %rdi
movq %r14, %rsi
callq 0x19b84
movl $0x3, %edi
movq %rax, %rsi
callq 0x19b84
movq %rax, %r14
cmpl $0x0, (%rbp)
je 0x1a715
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b084
testl %eax, %eax
je 0x1a715
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x187, 0xc(%rax)       # imm = 0x187
movq %r14, %rdi
callq 0x13b9c
leaq 0x30e3(%rip), %rdi      # 0x1d7ee
movq %rax, %rsi
xorl %eax, %eax
callq 0x1b983
movq %r14, %rdi
callq 0x19e67
movq %rax, %r14
cmpl $0x0, (%rbp)
je 0x1a766
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b084
testl %eax, %eax
je 0x1a766
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x189, 0xc(%rax)       # imm = 0x189
movq %r14, %rdi
callq 0x13b9c
leaq 0x3186(%rip), %rdi      # 0x1d8e2
movq %rax, %rsi
xorl %eax, %eax
callq 0x1b983
movq %r14, %rdi
callq 0x19c45
movq %rax, %rdi
callq 0x19ba6
cmpq $0x3, %rax
jne 0x1acba
movq %r14, %rdi
callq 0x19ba6
movq %rax, %rdi
callq 0x19ba6
cmpq $0x7, %rax
jne 0x1acd9
movq %r14, %rdi
callq 0x19ba6
movq %rax, %rdi
callq 0x19c45
movq %rax, %rdi
callq 0x19ba6
cmpq $0xb, %rax
jne 0x1acf8
cmpl $0x0, (%rbp)
je 0x1a7f7
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b084
testl %eax, %eax
je 0x1a7f7
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x18e, 0xc(%rax)       # imm = 0x18E
leaq 0x3d8e(%rip), %rdi      # 0x1e57e
xorl %eax, %eax
callq 0x1b983
movl $0x3, %edi
movl $0x3, %esi
callq 0x19b84
leaq 0x8a93(%rip), %rsi      # 0x232a0
movq %rax, %rdi
callq 0x19b84
movl $0x7, %esi
movl $0x7, %edx
movq %rax, %rdi
callq 0x1a0ec
movl $0x7, %esi
movl $0xb, %edx
movq %rax, %rdi
callq 0x1a0ec
movl $0x3, %esi
movl $0xf, %edx
movq %rax, %rdi
callq 0x1a0ec
movq %rax, %r14
cmpl $0x0, (%rbp)
je 0x1a894
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b084
testl %eax, %eax
je 0x1a894
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x195, 0xc(%rax)       # imm = 0x195
movq %r14, %rdi
callq 0x13b9c
leaq 0x2f64(%rip), %rdi      # 0x1d7ee
movq %rax, %rsi
xorl %eax, %eax
callq 0x1b983
movq %r14, %rdi
callq 0x19edf
cmpl $0x4, %eax
jne 0x1ad17
movl $0x3, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1a07a
cmpq $0xf, %rax
jne 0x1ad36
leaq 0x89db(%rip), %rsi      # 0x232a0
movq %r14, %rdi
callq 0x1a2ca
movq %rax, %r15
cmpl $0x0, (%rbp)
je 0x1a916
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b084
testl %eax, %eax
je 0x1a916
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x199, 0xc(%rax)       # imm = 0x199
movq %r15, %rdi
callq 0x13b9c
leaq 0x2fd6(%rip), %rdi      # 0x1d8e2
movq %rax, %rsi
xorl %eax, %eax
callq 0x1b983
cmpq %r15, %r14
je 0x1ad55
movl $0x3, %esi
movq %r14, %rdi
callq 0x1a2ca
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x1a975
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b084
testl %eax, %eax
je 0x1a975
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x19c, 0xc(%rax)       # imm = 0x19C
movq %r12, %rdi
callq 0x13b9c
leaq 0x2e83(%rip), %rdi      # 0x1d7ee
movq %rax, %rsi
xorl %eax, %eax
callq 0x1b983
cmpq %r14, %r12
je 0x1ad74
movq %r12, %rdi
callq 0x19edf
cmpl $0x1, %eax
jne 0x1ad93
movl $0x3, %esi
movq %r14, %rdi
callq 0x1a39b
movq %rax, %r15
cmpl $0x0, (%rbp)
je 0x1a9e5
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b084
testl %eax, %eax
je 0x1a9e5
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x1a0, 0xc(%rax)       # imm = 0x1A0
movq %r15, %rdi
callq 0x13b9c
leaq 0x2f07(%rip), %rdi      # 0x1d8e2
movq %rax, %rsi
xorl %eax, %eax
callq 0x1b983
cmpq %r15, %r14
je 0x1adb2
cmpq %r15, %r12
je 0x1add1
movq %r12, %rdi
callq 0x19edf
cmpl $0x1, %eax
jne 0x1adf0
movq %r15, %rdi
callq 0x19edf
cmpl $0x3, %eax
jne 0x1ae0f
movq %r14, %rdi
callq 0x19edf
cmpl $0x4, %eax
jne 0x1ae2e
movl $0x3, %esi
movq %r15, %rdi
xorl %edx, %edx
callq 0x1a07a
cmpq $0x3, %rax
jne 0x1ae4d
movl $0x3, %esi
movq %r15, %rdi
callq 0x1a39b
movq %rax, %r14
cmpl $0x0, (%rbp)
je 0x1aa99
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b084
testl %eax, %eax
je 0x1aa99
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x1a8, 0xc(%rax)       # imm = 0x1A8
movq %r14, %rdi
callq 0x13b9c
leaq 0x2d5f(%rip), %rdi      # 0x1d7ee
movq %rax, %rsi
xorl %eax, %eax
callq 0x1b983
cmpq %r15, %r14
jne 0x1ae6c
movq %r14, %rdi
callq 0x19edf
cmpl $0x2, %eax
jne 0x1ae8b
movl $0x3, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1a07a
testq %rax, %rax
jne 0x1aeaa
movq %rsp, %rdi
movl $0x1ad, 0xc(%rdi)       # imm = 0x1AD
callq 0x1ba97
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3a12(%rip), %rdi      # 0x1e502
leaq 0x372c(%rip), %rsi      # 0x1e223
leaq 0x3916(%rip), %rcx      # 0x1e414
movl $0x182, %edx            # imm = 0x182
callq 0x2100
leaq 0x3916(%rip), %rdi      # 0x1e425
leaq 0x370d(%rip), %rsi      # 0x1e223
leaq 0x38f7(%rip), %rcx      # 0x1e414
movl $0x165, %edx            # imm = 0x165
callq 0x2100
leaq 0x391e(%rip), %rdi      # 0x1e44c
leaq 0x36ee(%rip), %rsi      # 0x1e223
leaq 0x38d8(%rip), %rcx      # 0x1e414
movl $0x167, %edx            # imm = 0x167
callq 0x2100
leaq 0x3937(%rip), %rdi      # 0x1e484
leaq 0x36cf(%rip), %rsi      # 0x1e223
leaq 0x38b9(%rip), %rcx      # 0x1e414
movl $0x16c, %edx            # imm = 0x16C
callq 0x2100
leaq 0x2397(%rip), %rdi      # 0x1cf03
leaq 0x36b0(%rip), %rsi      # 0x1e223
leaq 0x389a(%rip), %rcx      # 0x1e414
movl $0x16e, %edx            # imm = 0x16E
callq 0x2100
leaq 0x3902(%rip), %rdi      # 0x1e48d
leaq 0x3691(%rip), %rsi      # 0x1e223
leaq 0x387b(%rip), %rcx      # 0x1e414
movl $0x172, %edx            # imm = 0x172
callq 0x2100
leaq 0x38f0(%rip), %rdi      # 0x1e49a
leaq 0x3672(%rip), %rsi      # 0x1e223
leaq 0x385c(%rip), %rcx      # 0x1e414
movl $0x173, %edx            # imm = 0x173
callq 0x2100
leaq 0x2c31(%rip), %rdi      # 0x1d7fa
leaq 0x3653(%rip), %rsi      # 0x1e223
leaq 0x383d(%rip), %rcx      # 0x1e414
movl $0x174, %edx            # imm = 0x174
callq 0x2100
leaq 0x38c0(%rip), %rdi      # 0x1e4a8
leaq 0x3634(%rip), %rsi      # 0x1e223
leaq 0x381e(%rip), %rcx      # 0x1e414
movl $0x175, %edx            # imm = 0x175
callq 0x2100
leaq 0x38c0(%rip), %rdi      # 0x1e4c7
leaq 0x3615(%rip), %rsi      # 0x1e223
leaq 0x37ff(%rip), %rcx      # 0x1e414
movl $0x179, %edx            # imm = 0x179
callq 0x2100
leaq 0x38aa(%rip), %rdi      # 0x1e4d0
leaq 0x35f6(%rip), %rsi      # 0x1e223
leaq 0x37e0(%rip), %rcx      # 0x1e414
movl $0x17b, %edx            # imm = 0x17B
callq 0x2100
leaq 0x3894(%rip), %rdi      # 0x1e4d9
leaq 0x35d7(%rip), %rsi      # 0x1e223
leaq 0x37c1(%rip), %rcx      # 0x1e414
movl $0x17f, %edx            # imm = 0x17F
callq 0x2100
leaq 0x3882(%rip), %rdi      # 0x1e4e6
leaq 0x35b8(%rip), %rsi      # 0x1e223
leaq 0x37a2(%rip), %rcx      # 0x1e414
movl $0x180, %edx            # imm = 0x180
callq 0x2100
leaq 0x3871(%rip), %rdi      # 0x1e4f4
leaq 0x3599(%rip), %rsi      # 0x1e223
leaq 0x3783(%rip), %rcx      # 0x1e414
movl $0x181, %edx            # imm = 0x181
callq 0x2100
leaq 0x386e(%rip), %rdi      # 0x1e510
leaq 0x357a(%rip), %rsi      # 0x1e223
leaq 0x3764(%rip), %rcx      # 0x1e414
movl $0x183, %edx            # imm = 0x183
callq 0x2100
leaq 0x386d(%rip), %rdi      # 0x1e52e
leaq 0x355b(%rip), %rsi      # 0x1e223
leaq 0x3745(%rip), %rcx      # 0x1e414
movl $0x18a, %edx            # imm = 0x18A
callq 0x2100
leaq 0x3867(%rip), %rdi      # 0x1e547
leaq 0x353c(%rip), %rsi      # 0x1e223
leaq 0x3726(%rip), %rcx      # 0x1e414
movl $0x18b, %edx            # imm = 0x18B
callq 0x2100
leaq 0x3861(%rip), %rdi      # 0x1e560
leaq 0x351d(%rip), %rsi      # 0x1e223
leaq 0x3707(%rip), %rcx      # 0x1e414
movl $0x18c, %edx            # imm = 0x18C
callq 0x2100
leaq 0x3875(%rip), %rdi      # 0x1e593
leaq 0x34fe(%rip), %rsi      # 0x1e223
leaq 0x36e8(%rip), %rcx      # 0x1e414
movl $0x196, %edx            # imm = 0x196
callq 0x2100
leaq 0x3865(%rip), %rdi      # 0x1e5a2
leaq 0x34df(%rip), %rsi      # 0x1e223
leaq 0x36c9(%rip), %rcx      # 0x1e414
movl $0x197, %edx            # imm = 0x197
callq 0x2100
leaq 0x2c9b(%rip), %rdi      # 0x1d9f7
leaq 0x34c0(%rip), %rsi      # 0x1e223
leaq 0x36aa(%rip), %rcx      # 0x1e414
movl $0x19a, %edx            # imm = 0x19A
callq 0x2100
leaq 0x384a(%rip), %rdi      # 0x1e5c5
leaq 0x34a1(%rip), %rsi      # 0x1e223
leaq 0x368b(%rip), %rcx      # 0x1e414
movl $0x19d, %edx            # imm = 0x19D
callq 0x2100
leaq 0x3832(%rip), %rdi      # 0x1e5cc
leaq 0x3482(%rip), %rsi      # 0x1e223
leaq 0x366c(%rip), %rcx      # 0x1e414
movl $0x19e, %edx            # imm = 0x19E
callq 0x2100
leaq 0x3822(%rip), %rdi      # 0x1e5db
leaq 0x3463(%rip), %rsi      # 0x1e223
leaq 0x364d(%rip), %rcx      # 0x1e414
movl $0x1a1, %edx            # imm = 0x1A1
callq 0x2100
leaq 0x2c1f(%rip), %rdi      # 0x1d9f7
leaq 0x3444(%rip), %rsi      # 0x1e223
leaq 0x362e(%rip), %rcx      # 0x1e414
movl $0x1a2, %edx            # imm = 0x1A2
callq 0x2100
leaq 0x37d5(%rip), %rdi      # 0x1e5cc
leaq 0x3425(%rip), %rsi      # 0x1e223
leaq 0x360f(%rip), %rcx      # 0x1e414
movl $0x1a3, %edx            # imm = 0x1A3
callq 0x2100
leaq 0x37cc(%rip), %rdi      # 0x1e5e2
leaq 0x3406(%rip), %rsi      # 0x1e223
leaq 0x35f0(%rip), %rcx      # 0x1e414
movl $0x1a4, %edx            # imm = 0x1A4
callq 0x2100
leaq 0x37bc(%rip), %rdi      # 0x1e5f1
leaq 0x33e7(%rip), %rsi      # 0x1e223
leaq 0x35d1(%rip), %rcx      # 0x1e414
movl $0x1a5, %edx            # imm = 0x1A5
callq 0x2100
leaq 0x37ac(%rip), %rdi      # 0x1e600
leaq 0x33c8(%rip), %rsi      # 0x1e223
leaq 0x35b2(%rip), %rcx      # 0x1e414
movl $0x1a6, %edx            # imm = 0x1A6
callq 0x2100
leaq 0x2b66(%rip), %rdi      # 0x1d9d9
leaq 0x33a9(%rip), %rsi      # 0x1e223
leaq 0x3593(%rip), %rcx      # 0x1e414
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x2100
leaq 0x3791(%rip), %rdi      # 0x1e623
leaq 0x338a(%rip), %rsi      # 0x1e223
leaq 0x3574(%rip), %rcx      # 0x1e414
movl $0x1aa, %edx            # imm = 0x1AA
callq 0x2100
leaq 0x3781(%rip), %rdi      # 0x1e632
leaq 0x336b(%rip), %rsi      # 0x1e223
leaq 0x3555(%rip), %rcx      # 0x1e414
movl $0x1ab, %edx            # imm = 0x1AB
callq 0x2100