// File: /workspace/github_c_makefile_star2_O3/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)
movq $0x0, 0x10(%rdi)
callq 0x1285a
testq %rax, %rax
jne 0x1737
cmpq $0x0, (%rsp)
jne 0x1737
cmpq $0x0, 0x8(%rsp)
jne 0x1737
cmpq $0x0, 0x10(%rsp)
jne 0x1737
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %r13
movups %xmm0, 0x8(%r13)
xorl %eax, %eax
leaq 0x38(%rsp), %r12
movq %rax, 0x10(%r12)
leaq 0x20(%rsp), %r15
movq %rax, 0x10(%r15)
movq %r12, (%r13)
movq %r15, (%r12)
movq %r13, 0x8(%r12)
movq %rax, (%r15)
movq %r12, 0x8(%r15)
movq %rsp, %r14
movq %r13, (%r14)
movq %r15, 0x8(%r14)
movq $0x3, 0x10(%r14)
movq %r14, %rdi
callq 0x1285a
cmpq %r12, (%r14)
setne %dl
cmpq %r15, 0x8(%r14)
setne %cl
cmpq %r13, %rax
jne 0x175c
testb %dl, %dl
jne 0x175c
testb %cl, %cl
jne 0x175c
cmpq $0x2, 0x10(%rsp)
jne 0x175c
movq %rsp, %r14
movq %r14, %rdi
callq 0x1285a
cmpq %r15, (%r14)
setne %dl
cmpq %r15, 0x8(%r14)
setne %cl
cmpq %r12, %rax
jne 0x1771
testb %dl, %dl
jne 0x1771
testb %cl, %cl
jne 0x1771
cmpq $0x1, 0x10(%rsp)
jne 0x1771
movq %rsp, %rdi
callq 0x1285a
cmpq %r15, %rax
jne 0x1786
cmpq $0x0, (%rsp)
jne 0x1786
cmpq $0x0, 0x8(%rsp)
jne 0x1786
cmpq $0x0, 0x10(%rsp)
jne 0x1786
leaq 0x2baf7(%rip), %rdi     # 0x2d217
leaq 0x2bb22(%rip), %rsi     # 0x2d249
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1090
movl $0x4, %eax
jmp 0x17aa
leaq 0x2bae4(%rip), %rdi     # 0x2d222
leaq 0x2bb04(%rip), %rsi     # 0x2d249
movl $0xcf, %edx
xorl %eax, %eax
callq 0x1090
incw 0x2(%rbx)
movl $0x1, %ebp
jmp 0x17ae
leaq 0x2babf(%rip), %rdi     # 0x2d222
leaq 0x2badf(%rip), %rsi     # 0x2d249
movl $0xe5, %edx
jmp 0x1799
leaq 0x2baaa(%rip), %rdi     # 0x2d222
leaq 0x2baca(%rip), %rsi     # 0x2d249
movl $0xec, %edx
jmp 0x1799
leaq 0x2ba95(%rip), %rdi     # 0x2d222
leaq 0x2bab5(%rip), %rsi     # 0x2d249
movl $0xf3, %edx
xorl %eax, %eax
callq 0x1090
movl $0x1, %ebp
movl $0x2, %eax
incw (%rbx,%rax)
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq