// File: /workspace/github_c_makefile_star2_O1/Ihsoh[P]ilang/list.c
// Function: llst_test
void llst_test(void) {
	LinkedList llst;

	llst_init(&llst, _test_comparer, NULL);
	MYASSERT(
		llst.head == NULL && llst.tail == NULL && llst.count == 0,
		"TEST llst_init(...)"
	);

	llst_append(&llst, "A");
	llst_append(&llst, "B");
	llst_append(&llst, "C");
	llst_append(&llst, "D");
	MYASSERT(
		llst.count == 4
			&& llst.head != NULL
			&& strcmp(llst.head->data, "A") == 0
			&& llst.head->next != NULL
			&& strcmp(llst.head->next->data, "B") == 0
			&& llst.head->next->next != NULL
			&& strcmp(llst.head->next->next->data, "C") == 0
			&& llst.head->next->next->next != NULL
			&& strcmp(llst.head->next->next->next->data, "D") == 0,
		"TEST llst_append(...)"
	);

	LinkedListNode *node = llst_find(&llst, "C");
	MYASSERT(
		node != NULL
			&& strcmp(node->data, "C") == 0,
		"TEST llst_find(...)"
	);

	llst_delete(&llst, llst.head->next, false);
	MYASSERT(
		llst.count == 3
			&& llst.head != NULL
			&& strcmp(llst.head->data, "A") == 0
			&& llst.head->next != NULL
			&& strcmp(llst.head->next->data, "C") == 0
			&& llst.head->next->next != NULL
			&& strcmp(llst.head->next->next->data, "D") == 0,
		"TEST llst_delete(...)"
	);

	llst_delete(&llst, llst.head, false);
	MYASSERT(
		llst.count == 2
			&& llst.head != NULL
			&& strcmp(llst.head->data, "C") == 0
			&& llst.head->next != NULL
			&& strcmp(llst.head->next->data, "D") == 0,
		"TEST llst_delete(...)"
	);


	llst_delete(&llst, llst.tail, false);
	MYASSERT(
		llst.count == 1
			&& llst.head != NULL
			&& strcmp(llst.head->data, "C") == 0,
		"TEST llst_delete(...)"
	);

	llst_delete(&llst, llst.head, false);
	MYASSERT(
		llst.head == NULL && llst.tail == NULL && llst.count == 0,
		"TEST llst_delete(...)"
	);

	llst_free(&llst, false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
leaq 0x35c(%rip), %rax       # 0xc4da
movq %rax, -0x28(%rbp)
leaq -0x43f(%rip), %rax      # 0xbd4a
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0xc19a
movb $0x1, %al
testb %al, %al
jne 0xc1b4
leaq 0x2298b(%rip), %rdi     # 0x2eb2c
leaq 0x22b28(%rip), %rdx     # 0x2ecd0
movl $0xaf, %esi
xorl %eax, %eax
callq 0xd08c
leaq 0x2a3b7(%rip), %rsi     # 0x36572
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0xbddf
leaq 0x25d53(%rip), %rsi     # 0x31f21
movq %rbx, %rdi
callq 0xbddf
leaq 0x26088(%rip), %rsi     # 0x32265
movq %rbx, %rdi
callq 0xbddf
leaq 0x25c88(%rip), %rsi     # 0x31e74
movq %rbx, %rdi
callq 0xbddf
movq (%rbx), %r14
cmpq $0x4, 0x10(%rbx)
sete %al
testq %r14, %r14
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xc224
movq 0x8(%r14), %rdi
leaq 0x2a35b(%rip), %rsi     # 0x36572
callq 0xa0e0
testl %eax, %eax
je 0xc3ed
leaq 0x22901(%rip), %rdi     # 0x2eb2c
leaq 0x22ab2(%rip), %rdx     # 0x2ece4
movl $0xc0, %esi
xorl %eax, %eax
callq 0xd08c
leaq 0x26020(%rip), %rsi     # 0x32265
leaq -0x40(%rbp), %rdi
callq 0xc0b3
testq %rax, %rax
je 0xc267
movq 0x8(%rax), %rdi
leaq 0x26007(%rip), %rsi     # 0x32265
callq 0xa0e0
testl %eax, %eax
je 0xc281
leaq 0x228be(%rip), %rdi     # 0x2eb2c
leaq 0x22a85(%rip), %rdx     # 0x2ecfa
movl $0xc7, %esi
xorl %eax, %eax
callq 0xd08c
leaq -0x40(%rbp), %rbx
movq (%rbx), %rax
movq 0x18(%rax), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xbf83
movq (%rbx), %r14
cmpq $0x3, 0x10(%rbx)
sete %al
testq %r14, %r14
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xc2c6
movq 0x8(%r14), %rdi
leaq 0x2a2b9(%rip), %rsi     # 0x36572
callq 0xa0e0
testl %eax, %eax
je 0xc461
leaq 0x2285f(%rip), %rdi     # 0x2eb2c
leaq 0x22a3a(%rip), %rdx     # 0x2ed0e
movl $0xd3, %esi
xorl %eax, %eax
callq 0xd08c
leaq -0x40(%rbp), %rbx
movq (%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xbf83
movq (%rbx), %r14
cmpq $0x2, 0x10(%rbx)
sete %al
testq %r14, %r14
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xc321
movq 0x8(%r14), %rdi
leaq 0x25f51(%rip), %rsi     # 0x32265
callq 0xa0e0
testl %eax, %eax
je 0xc4b0
leaq 0x22804(%rip), %rdi     # 0x2eb2c
leaq 0x229df(%rip), %rdx     # 0x2ed0e
movl $0xdd, %esi
xorl %eax, %eax
callq 0xd08c
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xbf83
movq (%rbx), %rax
cmpq $0x1, 0x10(%rbx)
sete %cl
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xc375
movq 0x8(%rax), %rdi
leaq 0x25ef9(%rip), %rsi     # 0x32265
callq 0xa0e0
testl %eax, %eax
je 0xc38f
leaq 0x227b0(%rip), %rdi     # 0x2eb2c
leaq 0x2298b(%rip), %rdx     # 0x2ed0e
movl $0xe6, %esi
xorl %eax, %eax
callq 0xd08c
movq (%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xbf83
cmpq $0x0, (%rbx)
jne 0xc3b0
cmpq $0x0, -0x38(%rbp)
jne 0xc3b0
cmpq $0x0, -0x30(%rbp)
je 0xc3ca
leaq 0x22775(%rip), %rdi     # 0x2eb2c
leaq 0x22950(%rip), %rdx     # 0x2ed0e
movl $0xec, %esi
xorl %eax, %eax
callq 0xd08c
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0xc3e4
movq 0x18(%rdi), %rbx
callq 0xa190
movq %rbx, %rdi
testq %rbx, %rbx
jne 0xc3d3
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x18(%r14), %rbx
testq %rbx, %rbx
je 0xc224
movq 0x8(%rbx), %rdi
leaq 0x25b1c(%rip), %rsi     # 0x31f21
callq 0xa0e0
testl %eax, %eax
jne 0xc224
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0xc224
movq 0x8(%rbx), %rdi
leaq 0x25e3b(%rip), %rsi     # 0x32265
callq 0xa0e0
testl %eax, %eax
jne 0xc224
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0xc224
movq 0x8(%rax), %rdi
leaq 0x25a25(%rip), %rsi     # 0x31e74
callq 0xa0e0
testl %eax, %eax
jne 0xc224
jmp 0xc23e
movq 0x18(%r14), %rbx
testq %rbx, %rbx
je 0xc2c6
movq 0x8(%rbx), %rdi
leaq 0x25dec(%rip), %rsi     # 0x32265
callq 0xa0e0
testl %eax, %eax
jne 0xc2c6
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0xc2c6
movq 0x8(%rax), %rdi
leaq 0x259d6(%rip), %rsi     # 0x31e74
callq 0xa0e0
testl %eax, %eax
jne 0xc2c6
jmp 0xc2e0
movq 0x18(%r14), %rax
testq %rax, %rax
je 0xc321
movq 0x8(%rax), %rdi
leaq 0x259ac(%rip), %rsi     # 0x31e74
callq 0xa0e0
testl %eax, %eax
jne 0xc321
jmp 0xc33b