// File: /workspace/github_c_makefile_star2_O2/OpenKMIP[P]libkmip/tests/tests.c
// Function: test_linked_list_pop
int
test_linked_list_pop(TestTracker *tracker)
{
    TRACK_TEST(tracker);

    LinkedList list = {0};

    if(list.head != NULL || list.tail != NULL || list.size != 0)
    {
        TEST_FAILED(tracker, __func__, __LINE__);
    }

    LinkedListItem *item = kmip_linked_list_pop(&list);

    if(item != NULL || list.head != NULL || list.tail != NULL || list.size != 0)
    {
        TEST_FAILED(tracker, __func__, __LINE__);
    }

    LinkedListItem a = {0};
    LinkedListItem b = {0};
    LinkedListItem c = {0};

    a.next = &b;
    a.prev = NULL;
    b.next = &c;
    b.prev = &a;
    c.next = NULL;
    c.prev = &b;

    list.head = &a;
    list.tail = &c;
    list.size = 3;

    item = kmip_linked_list_pop(&list);

    if(item != &a || list.head != &b || list.tail != &c || list.size != 2)
    {
        TEST_FAILED(tracker, __func__, __LINE__);
    }

    item = kmip_linked_list_pop(&list);

    if(item != &b || list.head != &c || list.tail != &c || list.size != 1)
    {
        TEST_FAILED(tracker, __func__, __LINE__);
    }

    item = kmip_linked_list_pop(&list);

    if(item != &c || list.head != NULL || list.tail != NULL || list.size != 0)
    {
        TEST_FAILED(tracker, __func__, __LINE__);
    }

    TEST_PASSED(tracker, __func__);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
incw (%rdi)
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
callq 0x121ad
testq %rax, %rax
jne 0x1704
cmpq $0x0, (%rsp)
jne 0x1704
cmpq $0x0, 0x8(%rsp)
jne 0x1704
cmpq $0x0, 0x10(%rsp)
jne 0x1704
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %r13
leaq 0x38(%rsp), %r12
andq $0x0, 0x10(%r12)
leaq 0x20(%rsp), %r15
andq $0x0, 0x10(%r15)
movups %xmm0, 0x8(%r13)
movq %r12, (%r13)
movq %r15, (%r12)
movq %r13, 0x8(%r12)
andq $0x0, (%r15)
movq %r12, 0x8(%r15)
movq %rsp, %r14
movq %r13, (%r14)
movq %r15, 0x8(%r14)
movq $0x3, 0x10(%r14)
movq %r14, %rdi
callq 0x121ad
cmpq %r12, (%r14)
setne %dl
cmpq %r15, 0x8(%r14)
setne %cl
cmpq %r13, %rax
jne 0x1727
testb %dl, %dl
jne 0x1727
testb %cl, %cl
jne 0x1727
cmpq $0x2, 0x10(%rsp)
jne 0x1727
movq %rsp, %r14
movq %r14, %rdi
callq 0x121ad
cmpq %r15, (%r14)
setne %dl
cmpq %r15, 0x8(%r14)
setne %cl
cmpq %r12, %rax
jne 0x173c
testb %dl, %dl
jne 0x173c
testb %cl, %cl
jne 0x173c
cmpq $0x1, 0x10(%rsp)
jne 0x173c
movq %rsp, %rdi
callq 0x121ad
cmpq %r15, %rax
jne 0x1751
cmpq $0x0, (%rsp)
jne 0x1751
cmpq $0x0, 0x8(%rsp)
jne 0x1751
cmpq $0x0, 0x10(%rsp)
jne 0x1751
leaq 0x24b27(%rip), %rdi     # 0x26217
leaq 0x24b52(%rip), %rsi     # 0x26249
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1090
pushq $0x4
jmp 0x1770
leaq 0x24b17(%rip), %rdi     # 0x26222
leaq 0x24b37(%rip), %rsi     # 0x26249
movl $0xcf, %edx
xorl %eax, %eax
callq 0x1090
incw 0x2(%rbx)
pushq $0x1
popq %rbp
jmp 0x1775
leaq 0x24af4(%rip), %rdi     # 0x26222
leaq 0x24b14(%rip), %rsi     # 0x26249
movl $0xe5, %edx
jmp 0x1764
leaq 0x24adf(%rip), %rdi     # 0x26222
leaq 0x24aff(%rip), %rsi     # 0x26249
movl $0xec, %edx
jmp 0x1764
leaq 0x24aca(%rip), %rdi     # 0x26222
leaq 0x24aea(%rip), %rsi     # 0x26249
movl $0xf3, %edx
xorl %eax, %eax
callq 0x1090
pushq $0x1
popq %rbp
pushq $0x2
popq %rax
incw (%rbx,%rax)
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq