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

    uint8 expected[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
    };
    
    uint8 observed[136] = {0};
    struct kmip ctx = {0};
    kmip_init(&ctx, observed, ARRAY_LENGTH(observed), KMIP_1_0);
    
    struct text_string uuid = {0};
    uuid.value = "f4b2b4c3-4c19-4ecf-827a-011ca6057d3e";
    uuid.size = 36;
    
    struct cryptographic_parameters cp = {0};
    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 kws = {0};
    kws.wrapping_method = KMIP_WRAP_ENCRYPT;
    kws.encryption_key_info = &eki;
    kws.attribute_names = &attribute_name;
    kws.attribute_name_count = 1;
    
    int result = kmip_encode_key_wrapping_specification(&ctx, &kws);
    result = report_encoding_test_result(
        tracker,
        &ctx,
        expected,
        observed,
        result,
        __func__);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x9d0, %rsp            # imm = 0x9D0
movq %rdi, %rbx
incw (%rdi)
leaq 0xb0(%rsp), %r14
movl $0x88, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x10c0
leaq 0x138(%rsp), %r15
movl $0x898, %edx            # imm = 0x898
movq %r15, %rdi
xorl %esi, %esi
callq 0x10c0
movl $0x88, %edx
movq %r15, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x13747
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rax
movaps %xmm0, (%rax)
leaq 0x269de(%rip), %rcx     # 0x301b2
movq %rcx, (%rax)
movq $0x24, 0x8(%rax)
leaq 0x60(%rsp), %rcx
movaps %xmm0, (%rcx)
movaps %xmm0, 0x40(%rcx)
movaps %xmm0, 0x30(%rcx)
movaps %xmm0, 0x20(%rcx)
movaps %xmm0, 0x10(%rcx)
movl $0xd, (%rcx)
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movq %rax, (%rdx)
movq %rcx, 0x8(%rdx)
movq %rsp, %rax
movaps %xmm0, (%rax)
leaq 0x2f802(%rip), %rcx     # 0x3901b
movq %rcx, (%rax)
movq $0x18, 0x8(%rax)
leaq 0x30(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movl $0x1, (%rsi)
movq %rdx, 0x8(%rsi)
movq %rax, 0x18(%rsi)
movq $0x1, 0x20(%rsi)
movq %r15, %rdi
callq 0x1a342
leaq 0x29687(%rip), %rdx     # 0x32ee0
leaq 0x26977(%rip), %r9      # 0x301d7
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
movl %eax, %r8d
callq 0x123c
movl %eax, %ebx
movq %r15, %rdi
callq 0x13a23
movl %ebx, %eax
addq $0x9d0, %rsp            # imm = 0x9D0
popq %rbx
popq %r14
popq %r15
retq