// File: /workspace/github_c_makefile_star2_O0/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
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 0x2e18c(%rip), %rax     # 0x47340
movq %rax, -0x30(%rbp)
movq 0x2e189(%rip), %rax     # 0x47348
movq %rax, -0x28(%rbp)
movq 0x2e186(%rip), %rax     # 0x47350
movq %rax, -0x20(%rbp)
movq 0x2e183(%rip), %rax     # 0x47358
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 $0x3, -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 0x375c0
movl %eax, -0x934(%rbp)
leaq -0x928(%rbp), %rdi
leaq -0x930(%rbp), %rsi
callq 0x24760
movl %eax, -0x938(%rbp)
cmpl $0x0, -0x938(%rbp)
jne 0x19337
movq 0x3acf0(%rip), %rax     # 0x53ff8
movq (%rax), %rdi
movl $0x1, %esi
leaq -0x928(%rbp), %rdx
callq 0x3e0c0
movq 0x3acd5(%rip), %rax     # 0x53ff8
movq (%rax), %rdi
movl $0x1, %esi
leaq -0x930(%rbp), %rdx
callq 0x3e0c0
movq -0x8(%rbp), %rdi
movl -0x938(%rbp), %edx
movl -0x934(%rbp), %ecx
leaq -0x8c8(%rbp), %rsi
leaq 0x27fd4(%rip), %r8      # 0x41329
callq 0x13a0
movl %eax, -0x934(%rbp)
leaq -0x8c8(%rbp), %rdi
leaq -0x930(%rbp), %rsi
callq 0x1fc10
leaq -0x8c8(%rbp), %rdi
callq 0x1cab0
movl -0x934(%rbp), %eax
addq $0x940, %rsp            # imm = 0x940
popq %rbp
retq
nop