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

    /* This encoding matches the following set of values:
    *  Object_types
          KMIP_OBJTYPE_CERTIFICATE = 0x01,
          KMIP_OBJTYPE_PUBLIC_KEY  = 0x03,
    */
    uint8 encoding[32] = {
        0x42, 0x00, 0x57, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x00, 0x57, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x03, 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 obj_1 = KMIP_OBJTYPE_CERTIFICATE;
    item_1.data = &obj_1;

    LinkedListItem item_2 = {0};
    int32 obj_2 = KMIP_OBJTYPE_PUBLIC_KEY;
    item_2.data = &obj_2;

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

    ObjectTypes expected = {0};
    expected.object_list = &list_1;

    ObjectTypes observed = {0};
    int result = kmip_decode_object_types(&ctx, &observed);
    int comparison = kmip_compare_objects(&expected, &observed);
    if(!comparison)
    {
        kmip_print_object_types(stderr, 1, &expected);
        kmip_print_object_types(stderr, 1, &observed);
    }
    result = report_decoding_test_result(tracker, &ctx, comparison, result, __func__);

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

    return(result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x938, %rsp            # imm = 0x938
movq %rdi, %rbx
incw (%rdi)
movaps 0x21c87(%rip), %xmm0    # 0x32c40
leaq 0x80(%rsp), %r15
movaps %xmm0, 0x10(%r15)
movaps 0x21c63(%rip), %xmm0    # 0x32c30
movaps %xmm0, (%r15)
leaq 0xa0(%rsp), %r14
xorl %r13d, %r13d
movl $0x898, %edx            # imm = 0x898
movq %r14, %rdi
xorl %esi, %esi
callq 0x10c0
movl $0x20, %edx
movq %r14, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x13177
leaq 0x60(%rsp), %r15
movq %r13, 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 $0x3, (%rax)
movq %rax, 0x10(%r12)
movq %r15, %rdi
callq 0x128ec
movq %r15, %rdi
movq %r12, %rsi
callq 0x128ec
leaq 0x10(%rsp), %r12
movq %r15, (%r12)
leaq 0x8(%rsp), %r15
movq %r13, (%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x28379
movl %eax, %ebp
movq %r12, %rdi
movq %r15, %rsi
callq 0x17642
testl %eax, %eax
jne 0x110ab
movq 0x31f73(%rip), %r14     # 0x42ff8
movq (%r14), %rdi
leaq 0x10(%rsp), %rdx
movl $0x1, %esi
callq 0x2caf1
movq (%r14), %rdi
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
callq 0x2caf1
xorl %eax, %eax
leaq 0x1e32f(%rip), %r8      # 0x2f3e1
leaq 0xa0(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
movl %ebp, %ecx
callq 0x1363
movl %eax, %ebx
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x152b2
movq %r14, %rdi
callq 0x13455
movl %ebx, %eax
addq $0x938, %rsp            # imm = 0x938
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq