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

    uint8 encoding[96] = {
        0x42, 0x00, 0x8F, 0x01, 0x00, 0x00, 0x00, 0x58, 
        0x42, 0x00, 0x40, 0x01, 0x00, 0x00, 0x00, 0x50, 
        0x42, 0x00, 0x42, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x45, 0x01, 0x00, 0x00, 0x00, 0x18, 
        0x42, 0x00, 0x43, 0x08, 0x00, 0x00, 0x00, 0x10, 
        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 
        0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 
        0x42, 0x00, 0x28, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x00, 0x2A, 0x02, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00
    };
    
    struct kmip ctx = {0};
    kmip_init(&ctx, encoding, ARRAY_LENGTH(encoding), KMIP_1_0);
    
    uint8 value[16] = {
        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
        0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
    };
    struct byte_string key = {0};
    key.value = value;
    key.size = ARRAY_LENGTH(value);
    
    struct key_value kv = {0};
    kv.key_material = &key;
    
    struct key_block kb = {0};
    kb.key_format_type = KMIP_KEYFORMAT_RAW;
    kb.key_value = &kv;
    kb.key_value_type = KMIP_TYPE_STRUCTURE;
    kb.cryptographic_algorithm = KMIP_CRYPTOALG_AES;
    kb.cryptographic_length = 128;
    
    struct symmetric_key expected = {0};
    expected.key_block = &kb;
    
    struct symmetric_key observed = {0};
    
    int result = kmip_decode_symmetric_key(&ctx, &observed);
    result = report_decoding_test_result(
        tracker,
        &ctx,
        kmip_compare_symmetric_key(&expected, &observed),
        result,
        __func__);
    kmip_free_symmetric_key(&ctx, &observed);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x990, %rsp            # imm = 0x990
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0x70(%rbp), %rdi
leaq 0x35d68(%rip), %rsi     # 0x42a90
movl $0x60, %edx
callq 0x10c0
leaq -0x908(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0x70(%rbp), %rsi
leaq -0x908(%rbp), %rdi
movl $0x60, %edx
xorl %ecx, %ecx
callq 0x1c6e0
movq 0x3a44d(%rip), %rax     # 0x471b0
movq %rax, -0x920(%rbp)
movq 0x3a447(%rip), %rax     # 0x471b8
movq %rax, -0x918(%rbp)
leaq -0x930(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x920(%rbp), %rax
movq %rax, -0x930(%rbp)
movq $0x10, -0x928(%rbp)
leaq -0x948(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
leaq -0x930(%rbp), %rax
movq %rax, -0x948(%rbp)
leaq -0x970(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x1090
movl $0x1, -0x970(%rbp)
leaq -0x948(%rbp), %rax
movq %rax, -0x968(%rbp)
movl $0x1, -0x960(%rbp)
movl $0x3, -0x95c(%rbp)
movl $0x80, -0x958(%rbp)
leaq -0x978(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
leaq -0x970(%rbp), %rax
movq %rax, -0x978(%rbp)
leaq -0x980(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
leaq -0x908(%rbp), %rdi
leaq -0x980(%rbp), %rsi
callq 0x31110
movl %eax, -0x984(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x990(%rbp)
leaq -0x978(%rbp), %rdi
leaq -0x980(%rbp), %rsi
callq 0x22190
movq -0x990(%rbp), %rdi
movl %eax, %edx
movl -0x984(%rbp), %ecx
leaq -0x908(%rbp), %rsi
leaq 0x331ec(%rip), %r8      # 0x40082
callq 0x13a0
movl %eax, -0x984(%rbp)
leaq -0x908(%rbp), %rdi
leaq -0x980(%rbp), %rsi
callq 0x1e340
leaq -0x908(%rbp), %rdi
callq 0x1cab0
movl -0x984(%rbp), %eax
addq $0x990, %rsp            # imm = 0x990
popq %rbp
retq
nop