// File: /workspace/github_c_makefile_star2_O1/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 $0x78, %rsp
movq %rdi, %rbx
incw (%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x1800
movb $0x1, %al
testb %al, %al
je 0x1800
movq %rsp, %rdi
callq 0x12e2a
testq %rax, %rax
jne 0x1815
cmpq $0x0, (%rsp)
jne 0x1815
cmpq $0x0, 0x8(%rsp)
jne 0x1815
cmpq $0x0, 0x10(%rsp)
jne 0x1815
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %r13
movaps %xmm0, (%r13)
xorl %eax, %eax
movq %rax, 0x10(%r13)
leaq 0x40(%rsp), %r12
movq %rax, 0x10(%r12)
movaps %xmm0, (%r12)
leaq 0x20(%rsp), %r15
movaps %xmm0, (%r15)
movq %rax, 0x10(%r15)
movq %r12, (%r13)
movq %rax, 0x8(%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 0x12e2a
cmpq %r12, (%r14)
setne %dl
cmpq %r15, 0x8(%r14)
setne %cl
cmpq %r13, %rax
jne 0x183a
testb %dl, %dl
jne 0x183a
testb %cl, %cl
jne 0x183a
cmpq $0x2, 0x10(%rsp)
jne 0x183a
movq %rsp, %r14
movq %r14, %rdi
callq 0x12e2a
cmpq %r15, (%r14)
setne %dl
cmpq %r15, 0x8(%r14)
setne %cl
cmpq %r12, %rax
jne 0x184f
testb %dl, %dl
jne 0x184f
testb %cl, %cl
jne 0x184f
cmpq $0x1, 0x10(%rsp)
jne 0x184f
movq %rsp, %rdi
callq 0x12e2a
cmpq %r15, %rax
jne 0x1864
cmpq $0x0, (%rsp)
jne 0x1864
cmpq $0x0, 0x8(%rsp)
jne 0x1864
cmpq $0x0, 0x10(%rsp)
jne 0x1864
leaq 0x2da31(%rip), %rdi     # 0x2f217
leaq 0x2da5c(%rip), %rsi     # 0x2f249
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1090
movl $0x4, %eax
jmp 0x1888
leaq 0x2da1b(%rip), %rdi     # 0x2f222
leaq 0x2da3b(%rip), %rsi     # 0x2f249
movl $0xc8, %edx
jmp 0x1828
leaq 0x2da06(%rip), %rdi     # 0x2f222
leaq 0x2da26(%rip), %rsi     # 0x2f249
movl $0xcf, %edx
xorl %eax, %eax
callq 0x1090
incw 0x2(%rbx)
movl $0x1, %ebp
jmp 0x188c
leaq 0x2d9e1(%rip), %rdi     # 0x2f222
leaq 0x2da01(%rip), %rsi     # 0x2f249
movl $0xe5, %edx
jmp 0x1877
leaq 0x2d9cc(%rip), %rdi     # 0x2f222
leaq 0x2d9ec(%rip), %rsi     # 0x2f249
movl $0xec, %edx
jmp 0x1877
leaq 0x2d9b7(%rip), %rdi     # 0x2f222
leaq 0x2d9d7(%rip), %rsi     # 0x2f249
movl $0xf3, %edx
xorl %eax, %eax
callq 0x1090
movl $0x1, %ebp
movl $0x2, %eax
incw (%rbx,%rax)
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq