// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x940, %rsp            # imm = 0x940
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
movq 0x2e54c(%rip), %rax     # 0x47300
movq %rax, -0x30(%rbp)
movq 0x2e549(%rip), %rax     # 0x47308
movq %rax, -0x28(%rbp)
movq 0x2e546(%rip), %rax     # 0x47310
movq %rax, -0x20(%rbp)
movq 0x2e543(%rip), %rax     # 0x47318
movq %rax, -0x18(%rbp)
leaq -0x8c8(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0x30(%rbp), %rsi
leaq -0x8c8(%rbp), %rdi
movl $0x20, %edx
xorl %ecx, %ecx
callq 0x1c6e0
leaq -0x8e0(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
leaq -0x8f8(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
movl $0x1, -0x8fc(%rbp)
leaq -0x8fc(%rbp), %rax
movq %rax, -0x8e8(%rbp)
leaq -0x918(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
movl $0x2, -0x91c(%rbp)
leaq -0x91c(%rbp), %rax
movq %rax, -0x908(%rbp)
leaq -0x8e0(%rbp), %rdi
leaq -0x8f8(%rbp), %rsi
callq 0x1b660
leaq -0x8e0(%rbp), %rdi
leaq -0x918(%rbp), %rsi
callq 0x1b660
leaq -0x928(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
leaq -0x8e0(%rbp), %rax
movq %rax, -0x928(%rbp)
leaq -0x930(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
leaq -0x8c8(%rbp), %rdi
leaq -0x930(%rbp), %rsi
callq 0x371f0
movl %eax, -0x934(%rbp)
leaq -0x928(%rbp), %rdi
leaq -0x930(%rbp), %rsi
callq 0x245a0
movl %eax, -0x938(%rbp)
cmpl $0x0, -0x938(%rbp)
jne 0x18f37
movq 0x3b0f0(%rip), %rax     # 0x53ff8
movq (%rax), %rdi
movl $0x1, %esi
leaq -0x928(%rbp), %rdx
callq 0x3dea0
movq 0x3b0d5(%rip), %rax     # 0x53ff8
movq (%rax), %rdi
movl $0x1, %esi
leaq -0x930(%rbp), %rdx
callq 0x3dea0
movq -0x8(%rbp), %rdi
movl -0x938(%rbp), %edx
movl -0x934(%rbp), %ecx
leaq -0x8c8(%rbp), %rsi
leaq 0x283a1(%rip), %r8      # 0x412f6
callq 0x13a0
movl %eax, -0x934(%rbp)
leaq -0x8c8(%rbp), %rdi
leaq -0x930(%rbp), %rsi
callq 0x1fa70
leaq -0x8c8(%rbp), %rdi
callq 0x1cab0
movl -0x934(%rbp), %eax
addq $0x940, %rsp            # imm = 0x940
popq %rbp
retq
nop