// File: /workspace/github_c_makefile_star2_O3/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 0x3ee4(%rip), %rax      # 0x1e40a
movq %rsp, %rdi
movq %rax, (%rdi)
leaq 0x8dfd(%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 0x1dfb(%rip), %rbx      # 0x1c34a
movq %rbx, 0x10(%rdi)
leaq 0x8d66(%rip), %rcx      # 0x232c0
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0x1ba26
leaq 0x411a(%rip), %rdi      # 0x1e688
callq 0x20a0
leaq 0x8d26(%rip), %rax      # 0x232a0
cmpq %rax, 0x8d1f(%rip)      # 0x232a0
jne 0x1abd6
cmpq %rax, 0x8d1a(%rip)      # 0x232a8
jne 0x1abf5
leaq 0x8d05(%rip), %r15      # 0x232a0
movq %r15, %rdi
movq %r15, %rsi
callq 0x19c50
movq %rax, %r14
leaq 0x9380(%rip), %rbp      # 0x23930
cmpl $0x0, (%rbp)
je 0x1a5ee
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b188
testl %eax, %eax
je 0x1a5ee
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x16b, 0xc(%rax)       # imm = 0x16B
leaq 0x3e8d(%rip), %rdi      # 0x1e471
movq %r14, %rsi
xorl %eax, %eax
callq 0x1ba97
cmpq %r15, %r14
je 0x1ac14
testq %r14, %r14
je 0x1ac33
movl %r14d, %eax
andl $0x3, %eax
jne 0x1ac33
movq %r14, %rdi
callq 0x19c72
cmpq %r15, %rax
jne 0x1ac52
movq %r14, %rdi
callq 0x19c72
cmpq %r15, %rax
jne 0x1ac71
movq %r14, %rdi
callq 0x19d11
cmpq %r15, %rax
jne 0x1ac90
movq %r14, %rdi
callq 0x19d11
cmpq %r15, %rax
jne 0x1acaf
leaq 0x8c49(%rip), %r12      # 0x232a0
movq %r12, %rdi
movq %r14, %rsi
callq 0x19c50
movq %rax, %r15
cmpl $0x0, (%rbp)
je 0x1a6a3
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b188
testl %eax, %eax
je 0x1a6a3
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x178, 0xc(%rax)       # imm = 0x178
leaq 0x3e1d(%rip), %rdi      # 0x1e4b6
movq %r15, %rsi
xorl %eax, %eax
callq 0x1ba97
cmpq %r12, %r15
je 0x1acce
testq %r15, %r15
je 0x1aced
movl %r15d, %eax
andl $0x3, %eax
jne 0x1aced
movq %r15, %rdi
callq 0x19c72
cmpq %r12, %rax
jne 0x1ad0c
movq %r15, %rdi
callq 0x19c72
cmpq %r12, %rax
jne 0x1ad2b
movq %r15, %rdi
callq 0x19d11
cmpq %r12, %rax
je 0x1ad4a
movq %r15, %rdi
callq 0x19d11
testq %rax, %rax
je 0x1abb7
movq %r15, %rdi
callq 0x19d11
testb $0x3, %al
jne 0x1abb7
movq %r15, %rdi
callq 0x19d11
cmpq %r14, %rax
jne 0x1ad69
cmpl $0x0, (%rbp)
je 0x1a761
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b188
testl %eax, %eax
je 0x1a761
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x185, 0xc(%rax)       # imm = 0x185
leaq 0x3dc2(%rip), %rdi      # 0x1e51c
xorl %eax, %eax
callq 0x1ba97
leaq 0x8b38(%rip), %r14      # 0x232a0
movl $0xb, %edi
movq %r14, %rsi
callq 0x19c50
movl $0x7, %edi
movq %rax, %rsi
callq 0x19c50
movq %rax, %rdi
movq %r14, %rsi
callq 0x19c50
movl $0x3, %edi
movq %rax, %rsi
callq 0x19c50
movq %rax, %r14
cmpl $0x0, (%rbp)
je 0x1a7e3
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b188
testl %eax, %eax
je 0x1a7e3
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x187, 0xc(%rax)       # imm = 0x187
movq %r14, %rdi
callq 0x13c40
leaq 0x3015(%rip), %rdi      # 0x1d7ee
movq %rax, %rsi
xorl %eax, %eax
callq 0x1ba97
movq %r14, %rdi
callq 0x19f33
movq %rax, %r14
cmpl $0x0, (%rbp)
je 0x1a834
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b188
testl %eax, %eax
je 0x1a834
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x189, 0xc(%rax)       # imm = 0x189
movq %r14, %rdi
callq 0x13c40
leaq 0x30b8(%rip), %rdi      # 0x1d8e2
movq %rax, %rsi
xorl %eax, %eax
callq 0x1ba97
movq %r14, %rdi
callq 0x19d11
movq %rax, %rdi
callq 0x19c72
cmpq $0x3, %rax
jne 0x1ad88
movq %r14, %rdi
callq 0x19c72
movq %rax, %rdi
callq 0x19c72
cmpq $0x7, %rax
jne 0x1ada7
movq %r14, %rdi
callq 0x19c72
movq %rax, %rdi
callq 0x19d11
movq %rax, %rdi
callq 0x19c72
cmpq $0xb, %rax
jne 0x1adc6
cmpl $0x0, (%rbp)
je 0x1a8c5
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b188
testl %eax, %eax
je 0x1a8c5
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x18e, 0xc(%rax)       # imm = 0x18E
leaq 0x3cc0(%rip), %rdi      # 0x1e57e
xorl %eax, %eax
callq 0x1ba97
movl $0x3, %edi
movl $0x3, %esi
callq 0x19c50
leaq 0x89c5(%rip), %rsi      # 0x232a0
movq %rax, %rdi
callq 0x19c50
movl $0x7, %esi
movl $0x7, %edx
movq %rax, %rdi
callq 0x1a1b8
movl $0x7, %esi
movl $0xb, %edx
movq %rax, %rdi
callq 0x1a1b8
movl $0x3, %esi
movl $0xf, %edx
movq %rax, %rdi
callq 0x1a1b8
movq %rax, %r14
cmpl $0x0, (%rbp)
je 0x1a962
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b188
testl %eax, %eax
je 0x1a962
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x195, 0xc(%rax)       # imm = 0x195
movq %r14, %rdi
callq 0x13c40
leaq 0x2e96(%rip), %rdi      # 0x1d7ee
movq %rax, %rsi
xorl %eax, %eax
callq 0x1ba97
movq %r14, %rdi
callq 0x19fab
cmpl $0x4, %eax
jne 0x1ade5
movl $0x3, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1a146
cmpq $0xf, %rax
jne 0x1ae04
leaq 0x890d(%rip), %rsi      # 0x232a0
movq %r14, %rdi
callq 0x1a396
movq %rax, %r15
cmpl $0x0, (%rbp)
je 0x1a9e4
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b188
testl %eax, %eax
je 0x1a9e4
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x199, 0xc(%rax)       # imm = 0x199
movq %r15, %rdi
callq 0x13c40
leaq 0x2f08(%rip), %rdi      # 0x1d8e2
movq %rax, %rsi
xorl %eax, %eax
callq 0x1ba97
cmpq %r15, %r14
je 0x1ae23
movl $0x3, %esi
movq %r14, %rdi
callq 0x1a396
movq %rax, %r12
cmpl $0x0, (%rbp)
je 0x1aa43
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b188
testl %eax, %eax
je 0x1aa43
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x19c, 0xc(%rax)       # imm = 0x19C
movq %r12, %rdi
callq 0x13c40
leaq 0x2db5(%rip), %rdi      # 0x1d7ee
movq %rax, %rsi
xorl %eax, %eax
callq 0x1ba97
cmpq %r14, %r12
je 0x1ae42
movq %r12, %rdi
callq 0x19fab
cmpl $0x1, %eax
jne 0x1ae61
movl $0x3, %esi
movq %r14, %rdi
callq 0x1a467
movq %rax, %r15
cmpl $0x0, (%rbp)
je 0x1aab3
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b188
testl %eax, %eax
je 0x1aab3
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x1a0, 0xc(%rax)       # imm = 0x1A0
movq %r15, %rdi
callq 0x13c40
leaq 0x2e39(%rip), %rdi      # 0x1d8e2
movq %rax, %rsi
xorl %eax, %eax
callq 0x1ba97
cmpq %r15, %r14
je 0x1ae80
cmpq %r15, %r12
je 0x1ae9f
movq %r12, %rdi
callq 0x19fab
cmpl $0x1, %eax
jne 0x1aebe
movq %r15, %rdi
callq 0x19fab
cmpl $0x3, %eax
jne 0x1aedd
movq %r14, %rdi
callq 0x19fab
cmpl $0x4, %eax
jne 0x1aefc
movl $0x3, %esi
movq %r15, %rdi
xorl %edx, %edx
callq 0x1a146
cmpq $0x3, %rax
jne 0x1af1b
movl $0x3, %esi
movq %r15, %rdi
callq 0x1a467
movq %rax, %r14
cmpl $0x0, (%rbp)
je 0x1ab67
movq (%r13), %rax
movq 0x50(%rax), %rax
movq %rbx, 0x10(%rax)
movq %rbx, %rdi
callq 0x1b188
testl %eax, %eax
je 0x1ab67
movq (%r13), %rax
movq 0x50(%rax), %rax
movl $0x1a8, 0xc(%rax)       # imm = 0x1A8
movq %r14, %rdi
callq 0x13c40
leaq 0x2c91(%rip), %rdi      # 0x1d7ee
movq %rax, %rsi
xorl %eax, %eax
callq 0x1ba97
cmpq %r15, %r14
jne 0x1af3a
movq %r14, %rdi
callq 0x19fab
cmpl $0x2, %eax
jne 0x1af59
movl $0x3, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1a146
testq %rax, %rax
jne 0x1af78
movq %rsp, %rdi
movl $0x1ad, 0xc(%rdi)       # imm = 0x1AD
callq 0x1bbab
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3944(%rip), %rdi      # 0x1e502
leaq 0x365e(%rip), %rsi      # 0x1e223
leaq 0x3848(%rip), %rcx      # 0x1e414
movl $0x182, %edx            # imm = 0x182
callq 0x2100
leaq 0x3848(%rip), %rdi      # 0x1e425
leaq 0x363f(%rip), %rsi      # 0x1e223
leaq 0x3829(%rip), %rcx      # 0x1e414
movl $0x165, %edx            # imm = 0x165
callq 0x2100
leaq 0x3850(%rip), %rdi      # 0x1e44c
leaq 0x3620(%rip), %rsi      # 0x1e223
leaq 0x380a(%rip), %rcx      # 0x1e414
movl $0x167, %edx            # imm = 0x167
callq 0x2100
leaq 0x3869(%rip), %rdi      # 0x1e484
leaq 0x3601(%rip), %rsi      # 0x1e223
leaq 0x37eb(%rip), %rcx      # 0x1e414
movl $0x16c, %edx            # imm = 0x16C
callq 0x2100
leaq 0x22c9(%rip), %rdi      # 0x1cf03
leaq 0x35e2(%rip), %rsi      # 0x1e223
leaq 0x37cc(%rip), %rcx      # 0x1e414
movl $0x16e, %edx            # imm = 0x16E
callq 0x2100
leaq 0x3834(%rip), %rdi      # 0x1e48d
leaq 0x35c3(%rip), %rsi      # 0x1e223
leaq 0x37ad(%rip), %rcx      # 0x1e414
movl $0x172, %edx            # imm = 0x172
callq 0x2100
leaq 0x3822(%rip), %rdi      # 0x1e49a
leaq 0x35a4(%rip), %rsi      # 0x1e223
leaq 0x378e(%rip), %rcx      # 0x1e414
movl $0x173, %edx            # imm = 0x173
callq 0x2100
leaq 0x2b63(%rip), %rdi      # 0x1d7fa
leaq 0x3585(%rip), %rsi      # 0x1e223
leaq 0x376f(%rip), %rcx      # 0x1e414
movl $0x174, %edx            # imm = 0x174
callq 0x2100
leaq 0x37f2(%rip), %rdi      # 0x1e4a8
leaq 0x3566(%rip), %rsi      # 0x1e223
leaq 0x3750(%rip), %rcx      # 0x1e414
movl $0x175, %edx            # imm = 0x175
callq 0x2100
leaq 0x37f2(%rip), %rdi      # 0x1e4c7
leaq 0x3547(%rip), %rsi      # 0x1e223
leaq 0x3731(%rip), %rcx      # 0x1e414
movl $0x179, %edx            # imm = 0x179
callq 0x2100
leaq 0x37dc(%rip), %rdi      # 0x1e4d0
leaq 0x3528(%rip), %rsi      # 0x1e223
leaq 0x3712(%rip), %rcx      # 0x1e414
movl $0x17b, %edx            # imm = 0x17B
callq 0x2100
leaq 0x37c6(%rip), %rdi      # 0x1e4d9
leaq 0x3509(%rip), %rsi      # 0x1e223
leaq 0x36f3(%rip), %rcx      # 0x1e414
movl $0x17f, %edx            # imm = 0x17F
callq 0x2100
leaq 0x37b4(%rip), %rdi      # 0x1e4e6
leaq 0x34ea(%rip), %rsi      # 0x1e223
leaq 0x36d4(%rip), %rcx      # 0x1e414
movl $0x180, %edx            # imm = 0x180
callq 0x2100
leaq 0x37a3(%rip), %rdi      # 0x1e4f4
leaq 0x34cb(%rip), %rsi      # 0x1e223
leaq 0x36b5(%rip), %rcx      # 0x1e414
movl $0x181, %edx            # imm = 0x181
callq 0x2100
leaq 0x37a0(%rip), %rdi      # 0x1e510
leaq 0x34ac(%rip), %rsi      # 0x1e223
leaq 0x3696(%rip), %rcx      # 0x1e414
movl $0x183, %edx            # imm = 0x183
callq 0x2100
leaq 0x379f(%rip), %rdi      # 0x1e52e
leaq 0x348d(%rip), %rsi      # 0x1e223
leaq 0x3677(%rip), %rcx      # 0x1e414
movl $0x18a, %edx            # imm = 0x18A
callq 0x2100
leaq 0x3799(%rip), %rdi      # 0x1e547
leaq 0x346e(%rip), %rsi      # 0x1e223
leaq 0x3658(%rip), %rcx      # 0x1e414
movl $0x18b, %edx            # imm = 0x18B
callq 0x2100
leaq 0x3793(%rip), %rdi      # 0x1e560
leaq 0x344f(%rip), %rsi      # 0x1e223
leaq 0x3639(%rip), %rcx      # 0x1e414
movl $0x18c, %edx            # imm = 0x18C
callq 0x2100
leaq 0x37a7(%rip), %rdi      # 0x1e593
leaq 0x3430(%rip), %rsi      # 0x1e223
leaq 0x361a(%rip), %rcx      # 0x1e414
movl $0x196, %edx            # imm = 0x196
callq 0x2100
leaq 0x3797(%rip), %rdi      # 0x1e5a2
leaq 0x3411(%rip), %rsi      # 0x1e223
leaq 0x35fb(%rip), %rcx      # 0x1e414
movl $0x197, %edx            # imm = 0x197
callq 0x2100
leaq 0x2bcd(%rip), %rdi      # 0x1d9f7
leaq 0x33f2(%rip), %rsi      # 0x1e223
leaq 0x35dc(%rip), %rcx      # 0x1e414
movl $0x19a, %edx            # imm = 0x19A
callq 0x2100
leaq 0x377c(%rip), %rdi      # 0x1e5c5
leaq 0x33d3(%rip), %rsi      # 0x1e223
leaq 0x35bd(%rip), %rcx      # 0x1e414
movl $0x19d, %edx            # imm = 0x19D
callq 0x2100
leaq 0x3764(%rip), %rdi      # 0x1e5cc
leaq 0x33b4(%rip), %rsi      # 0x1e223
leaq 0x359e(%rip), %rcx      # 0x1e414
movl $0x19e, %edx            # imm = 0x19E
callq 0x2100
leaq 0x3754(%rip), %rdi      # 0x1e5db
leaq 0x3395(%rip), %rsi      # 0x1e223
leaq 0x357f(%rip), %rcx      # 0x1e414
movl $0x1a1, %edx            # imm = 0x1A1
callq 0x2100
leaq 0x2b51(%rip), %rdi      # 0x1d9f7
leaq 0x3376(%rip), %rsi      # 0x1e223
leaq 0x3560(%rip), %rcx      # 0x1e414
movl $0x1a2, %edx            # imm = 0x1A2
callq 0x2100
leaq 0x3707(%rip), %rdi      # 0x1e5cc
leaq 0x3357(%rip), %rsi      # 0x1e223
leaq 0x3541(%rip), %rcx      # 0x1e414
movl $0x1a3, %edx            # imm = 0x1A3
callq 0x2100
leaq 0x36fe(%rip), %rdi      # 0x1e5e2
leaq 0x3338(%rip), %rsi      # 0x1e223
leaq 0x3522(%rip), %rcx      # 0x1e414
movl $0x1a4, %edx            # imm = 0x1A4
callq 0x2100
leaq 0x36ee(%rip), %rdi      # 0x1e5f1
leaq 0x3319(%rip), %rsi      # 0x1e223
leaq 0x3503(%rip), %rcx      # 0x1e414
movl $0x1a5, %edx            # imm = 0x1A5
callq 0x2100
leaq 0x36de(%rip), %rdi      # 0x1e600
leaq 0x32fa(%rip), %rsi      # 0x1e223
leaq 0x34e4(%rip), %rcx      # 0x1e414
movl $0x1a6, %edx            # imm = 0x1A6
callq 0x2100
leaq 0x2a98(%rip), %rdi      # 0x1d9d9
leaq 0x32db(%rip), %rsi      # 0x1e223
leaq 0x34c5(%rip), %rcx      # 0x1e414
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x2100
leaq 0x36c3(%rip), %rdi      # 0x1e623
leaq 0x32bc(%rip), %rsi      # 0x1e223
leaq 0x34a6(%rip), %rcx      # 0x1e414
movl $0x1aa, %edx            # imm = 0x1AA
callq 0x2100
leaq 0x36b3(%rip), %rdi      # 0x1e632
leaq 0x329d(%rip), %rsi      # 0x1e223
leaq 0x3487(%rip), %rcx      # 0x1e414
movl $0x1ab, %edx            # imm = 0x1AB
callq 0x2100