// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
cmpq $0x0, -0x28(%rbp)
jne 0x1882
cmpq $0x0, -0x20(%rbp)
jne 0x1882
cmpq $0x0, -0x18(%rbp)
je 0x18ba
jmp 0x1884
leaq 0x3d82a(%rip), %rdi     # 0x3f0b5
leaq 0x3d84a(%rip), %rsi     # 0x3f0dc
movl $0xc8, %edx
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
addw $0x1, %cx
movw %cx, 0x2(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x1af6
leaq -0x28(%rbp), %rdi
callq 0x1b500
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x18e3
cmpq $0x0, -0x28(%rbp)
jne 0x18e3
cmpq $0x0, -0x20(%rbp)
jne 0x18e3
cmpq $0x0, -0x18(%rbp)
je 0x191b
jmp 0x18e5
leaq 0x3d7c9(%rip), %rdi     # 0x3f0b5
leaq 0x3d7e9(%rip), %rsi     # 0x3f0dc
movl $0xcf, %edx
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
addw $0x1, %cx
movw %cx, 0x2(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x1af6
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
leaq -0x60(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
leaq -0x78(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x78(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x48(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0x78(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x3, -0x18(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x1b500
movq %rax, -0x30(%rbp)
leaq -0x48(%rbp), %rax
cmpq %rax, -0x30(%rbp)
jne 0x19c5
leaq -0x60(%rbp), %rax
cmpq %rax, -0x28(%rbp)
jne 0x19c5
leaq -0x78(%rbp), %rax
cmpq %rax, -0x20(%rbp)
jne 0x19c5
cmpq $0x2, -0x18(%rbp)
je 0x19fd
jmp 0x19c7
leaq 0x3d6e7(%rip), %rdi     # 0x3f0b5
leaq 0x3d707(%rip), %rsi     # 0x3f0dc
movl $0xe5, %edx
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
addw $0x1, %cx
movw %cx, 0x2(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x1af6
leaq -0x28(%rbp), %rdi
callq 0x1b500
movq %rax, -0x30(%rbp)
leaq -0x60(%rbp), %rax
cmpq %rax, -0x30(%rbp)
jne 0x1a2f
leaq -0x78(%rbp), %rax
cmpq %rax, -0x28(%rbp)
jne 0x1a2f
leaq -0x78(%rbp), %rax
cmpq %rax, -0x20(%rbp)
jne 0x1a2f
cmpq $0x1, -0x18(%rbp)
je 0x1a67
jmp 0x1a31
leaq 0x3d67d(%rip), %rdi     # 0x3f0b5
leaq 0x3d69d(%rip), %rsi     # 0x3f0dc
movl $0xec, %edx
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
addw $0x1, %cx
movw %cx, 0x2(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x1af6
leaq -0x28(%rbp), %rdi
callq 0x1b500
movq %rax, -0x30(%rbp)
leaq -0x78(%rbp), %rax
cmpq %rax, -0x30(%rbp)
jne 0x1a93
cmpq $0x0, -0x28(%rbp)
jne 0x1a93
cmpq $0x0, -0x20(%rbp)
jne 0x1a93
cmpq $0x0, -0x18(%rbp)
je 0x1ac8
jmp 0x1a95
leaq 0x3d619(%rip), %rdi     # 0x3f0b5
leaq 0x3d639(%rip), %rsi     # 0x3f0dc
movl $0xf3, %edx
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
addw $0x1, %cx
movw %cx, 0x2(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x1af6
jmp 0x1aca
leaq 0x3d57a(%rip), %rdi     # 0x3f04b
leaq 0x3d604(%rip), %rsi     # 0x3f0dc
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movw 0x4(%rax), %cx
addw $0x1, %cx
movw %cx, 0x4(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)