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

    /* This encoding matches the following set of values:
    *  Query Functions
          Query Operations
          Query Objects
    */
    uint8 encoding[32] = {
        0x42, 0x00, 0x74, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x00, 0x74, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00
    };

    KMIP ctx = {0};
    kmip_init(&ctx, encoding, ARRAY_LENGTH(encoding), KMIP_1_0);

    LinkedList list_1 = {0};
    LinkedListItem item_1 = {0};
    int32 funct_1 = KMIP_QUERY_OPERATIONS;
    item_1.data = &funct_1;

    LinkedListItem item_2 = {0};
    int32 funct_2 = KMIP_QUERY_OBJECTS;
    item_2.data = &funct_2;

    kmip_linked_list_enqueue(&list_1, &item_1);
    kmip_linked_list_enqueue(&list_1, &item_2);

    Functions expected = {0};
    expected.function_list = &list_1;

    Functions observed = {0};

    int result = kmip_decode_query_functions(&ctx, &observed);
    int comparison = kmip_compare_query_functions(&expected, &observed);
    if(!comparison)
    {
        kmip_print_query_functions(stderr, 1, &expected);
        kmip_print_query_functions(stderr, 1, &observed);
    }
    result = report_decoding_test_result(tracker, &ctx, comparison, result, __func__);

    kmip_free_query_functions(&ctx, &observed);
    kmip_destroy(&ctx);

    return(result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x940, %rsp            # imm = 0x940
movq %rdi, %rbx
incw (%rdi)
movaps 0x1b53a(%rip), %xmm0    # 0x2bc00
leaq 0x80(%rsp), %r15
movaps %xmm0, 0x10(%r15)
movaps 0x1b516(%rip), %xmm0    # 0x2bbf0
movaps %xmm0, (%r15)
leaq 0xa8(%rsp), %r14
movl $0x898, %edx            # imm = 0x898
movq %r14, %rdi
xorl %esi, %esi
callq 0x10c0
pushq $0x20
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x128ed
leaq 0x60(%rsp), %r15
andq $0x0, 0x10(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
leaq 0x40(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x1c(%rsp), %rax
movl $0x1, (%rax)
movq %rax, 0x10(%rsi)
leaq 0x20(%rsp), %r12
movaps %xmm0, (%r12)
leaq 0x18(%rsp), %rax
movl $0x2, (%rax)
movq %rax, 0x10(%r12)
movq %r15, %rdi
callq 0x12233
movq %r15, %rdi
movq %r12, %rsi
callq 0x12233
leaq 0x10(%rsp), %r12
movq %r15, (%r12)
leaq 0x8(%rsp), %r15
andq $0x0, (%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x21009
movl %eax, %ebp
movq %r12, %rdi
movq %r15, %rsi
callq 0x164d0
movl %eax, %r14d
testl %eax, %eax
jne 0x107b8
movq 0x2d866(%rip), %r12     # 0x3dff8
movq (%r12), %rdi
pushq $0x1
popq %r15
leaq 0x10(%rsp), %rdx
movl %r15d, %esi
callq 0x25261
movq (%r12), %rdi
leaq 0x8(%rsp), %rdx
movl %r15d, %esi
callq 0x25261
leaq 0x17bef(%rip), %r8      # 0x283ae
leaq 0xa8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x134d
movl %eax, %ebx
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x14309
movq %r15, %rdi
callq 0x12ade
movl %ebx, %eax
addq $0x940, %rsp            # imm = 0x940
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq