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

    /* This encoding matches the following value:
    *  Name
    *      Value - Template1
    *      Type - Uninterpreted Text String
    */
    uint8 encoding[48] = {
        0x42, 0x00, 0x53, 0x01, 0x00, 0x00, 0x00, 0x28,
        0x42, 0x00, 0x55, 0x07, 0x00, 0x00, 0x00, 0x09,
        0x54, 0x65, 0x6D, 0x70, 0x6C, 0x61, 0x74, 0x65,
        0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x00, 0x54, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00
    };

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

    Attribute expected = {0};
    kmip_init_attribute(&expected);
    TextString name_value = {0};
    name_value.value = "Template1";
    name_value.size = 9;
    Name name = {0};
    name.value = &name_value;
    name.type = KMIP_NAME_UNINTERPRETED_TEXT_STRING;

    expected.type = KMIP_ATTR_NAME;
    expected.value = &name;

    Attribute observed = {0};
    int result = kmip_decode_attribute_v2(&ctx, &observed);
    int comparison = kmip_compare_attribute(&expected, &observed);
    if(!comparison)
    {
        kmip_print_attribute(stderr, 1, &expected);
        kmip_print_attribute(stderr, 1, &observed);
    }
    result = report_decoding_test_result(tracker, &ctx, comparison, result, __func__);

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

    return(result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x910, %rsp            # imm = 0x910
movq %rdi, %rbx
incw (%rdi)
movaps 0x25b94(%rip), %xmm0    # 0x33a00
leaq 0x40(%rsp), %r15
movaps %xmm0, 0x20(%r15)
movaps 0x25b73(%rip), %xmm0    # 0x339f0
movaps %xmm0, 0x10(%r15)
movaps 0x25b57(%rip), %xmm0    # 0x339e0
movaps %xmm0, (%r15)
leaq 0x78(%rsp), %r14
movl $0x898, %edx            # imm = 0x898
movq %r14, %rdi
xorl %esi, %esi
callq 0x10c0
movl $0x30, %edx
movq %r14, %rdi
movq %r15, %rsi
movl $0x5, %ecx
callq 0x13747
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r15
movaps %xmm0, (%r15)
movq %r15, %rdi
callq 0x13e59
leaq 0x30(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
leaq 0x21904(%rip), %rcx     # 0x2f7e0
movq %rcx, (%rax)
movq $0x9, 0x8(%rax)
leaq 0x20(%rsp), %rcx
movaps %xmm0, (%rcx)
movq %rax, (%rcx)
movl $0x1, %eax
movl %eax, 0x8(%rcx)
movl %eax, (%r15)
movq %rcx, 0x8(%r15)
movq %rsp, %r12
movaps %xmm0, (%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x1fbde
movl %eax, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0x163c1
movl %eax, %r14d
testl %eax, %eax
jne 0xdf51
movq 0x370c9(%rip), %r15     # 0x44ff8
movq (%r15), %rdi
leaq 0x10(%rsp), %rdx
movl $0x1, %esi
callq 0x2c91e
movq (%r15), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0x2c91e
leaq 0x22d79(%rip), %r8      # 0x30cd1
leaq 0x78(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x1397
movl %eax, %ebx
movq %rsp, %rsi
movq %r15, %rdi
callq 0x140cc
movq %r15, %rdi
callq 0x13a23
movl %ebx, %eax
addq $0x910, %rsp            # imm = 0x910
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq