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

    uint8 encoding[136] = {
        0x42, 0x00, 0x47, 0x01, 0x00, 0x00, 0x00, 0x80, 
        0x42, 0x00, 0x9E, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x36, 0x01, 0x00, 0x00, 0x00, 0x48, 
        0x42, 0x00, 0x94, 0x07, 0x00, 0x00, 0x00, 0x24, 
        0x66, 0x34, 0x62, 0x32, 0x62, 0x34, 0x63, 0x33, 
        0x2D, 0x34, 0x63, 0x31, 0x39, 0x2D, 0x34, 0x65, 
        0x63, 0x66, 0x2D, 0x38, 0x32, 0x37, 0x61, 0x2D, 
        0x30, 0x31, 0x31, 0x63, 0x61, 0x36, 0x30, 0x35, 
        0x37, 0x64, 0x33, 0x65, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x2B, 0x01, 0x00, 0x00, 0x00, 0x10, 
        0x42, 0x00, 0x11, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x0A, 0x07, 0x00, 0x00, 0x00, 0x18, 
        0x43, 0x72, 0x79, 0x70, 0x74, 0x6F, 0x67, 0x72, 
        0x61, 0x70, 0x68, 0x69, 0x63, 0x20, 0x55, 0x73, 
        0x61, 0x67, 0x65, 0x20, 0x4D, 0x61, 0x73, 0x6B
    };
    
    struct kmip ctx = {0};
    kmip_init(&ctx, encoding, ARRAY_LENGTH(encoding), KMIP_1_0);
    
    struct text_string uuid = {0};
    uuid.value = "f4b2b4c3-4c19-4ecf-827a-011ca6057d3e";
    uuid.size = 36;
    
    struct cryptographic_parameters cp = {0};
    kmip_init_cryptographic_parameters(&cp);
    
    cp.block_cipher_mode = KMIP_BLOCK_NIST_KEY_WRAP;
    
    struct encryption_key_information eki = {0};
    eki.unique_identifier = &uuid;
    eki.cryptographic_parameters = &cp;
    
    struct text_string attribute_name = {0};
    attribute_name.value = "Cryptographic Usage Mask";
    attribute_name.size = 24;
    
    struct key_wrapping_specification expected = {0};
    expected.wrapping_method = KMIP_WRAP_ENCRYPT;
    expected.encryption_key_info = &eki;
    expected.attribute_names = &attribute_name;
    expected.attribute_name_count = 1;
    
    struct key_wrapping_specification observed = {0};
    
    int result = kmip_decode_key_wrapping_specification(&ctx, &observed);
    result = report_decoding_test_result(
        tracker,
        &ctx,
        kmip_compare_key_wrapping_specification(&expected, &observed),
        result,
        __func__);
    kmip_free_key_wrapping_specification(&ctx, &observed);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa20, %rsp            # imm = 0xA20
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0x90(%rbp), %rdi
leaq 0x36a75(%rip), %rsi     # 0x44240
movl $0x88, %edx
callq 0x10c0
leaq -0x928(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0x90(%rbp), %rsi
leaq -0x928(%rbp), %rdi
movl $0x88, %edx
xorl %ecx, %ecx
callq 0x1c6e0
leaq -0x938(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x328de(%rip), %rax     # 0x400fa
movq %rax, -0x938(%rbp)
movq $0x24, -0x930(%rbp)
leaq -0x988(%rbp), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x1090
leaq -0x988(%rbp), %rdi
callq 0x1d370
movl $0xd, -0x988(%rbp)
leaq -0x998(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x938(%rbp), %rax
movq %rax, -0x998(%rbp)
leaq -0x988(%rbp), %rax
movq %rax, -0x990(%rbp)
leaq -0x9a8(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x3d0b7(%rip), %rax     # 0x4a957
movq %rax, -0x9a8(%rbp)
movq $0x18, -0x9a0(%rbp)
leaq -0x9d8(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x1090
movl $0x1, -0x9d8(%rbp)
leaq -0x998(%rbp), %rax
movq %rax, -0x9d0(%rbp)
leaq -0x9a8(%rbp), %rax
movq %rax, -0x9c0(%rbp)
movq $0x1, -0x9b8(%rbp)
leaq -0xa08(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x1090
leaq -0x928(%rbp), %rdi
leaq -0xa08(%rbp), %rsi
callq 0x316b0
movl %eax, -0xa0c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa18(%rbp)
leaq -0x9d8(%rbp), %rdi
leaq -0xa08(%rbp), %rsi
callq 0x22370
movq -0xa18(%rbp), %rdi
movl %eax, %edx
movl -0xa0c(%rbp), %ecx
leaq -0x928(%rbp), %rsi
leaq 0x327e9(%rip), %r8      # 0x40146
callq 0x13a0
movl %eax, -0xa0c(%rbp)
leaq -0x928(%rbp), %rdi
leaq -0xa08(%rbp), %rsi
callq 0x1e490
leaq -0x928(%rbp), %rdi
callq 0x1cab0
movl -0xa0c(%rbp), %eax
addq $0xa20, %rsp            # imm = 0xA20
popq %rbp
retq
nopw %cs:(%rax,%rax)