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

    uint8 expected[120] = {
        0x42, 0x00, 0x46, 0x01, 0x00, 0x00, 0x00, 0x70, 
        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, 
        0x31, 0x30, 0x30, 0x31, 0x38, 0x32, 0x64, 0x35,
        0x2D, 0x37, 0x32, 0x62, 0x38, 0x2D, 0x34, 0x37, 
        0x61, 0x61, 0x2D, 0x38, 0x33, 0x38, 0x33, 0x2D, 
        0x34, 0x64, 0x39, 0x37, 0x64, 0x35, 0x31, 0x32, 
        0x65, 0x39, 0x38, 0x61, 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, 0xA3, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00
    };
    
    uint8 observed[120] = {0};
    struct kmip ctx = {0};
    kmip_init(&ctx, observed, ARRAY_LENGTH(observed), KMIP_1_1);
    
    struct text_string uuid = {0};
    uuid.value = "100182d5-72b8-47aa-8383-4d97d512e98a";
    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 key_wrapping_data kwd = {0};
    kwd.wrapping_method = KMIP_WRAP_ENCRYPT;
    kwd.encryption_key_info = &eki;
    kwd.encoding_option = KMIP_ENCODE_NO_ENCODING;
    
    int result = kmip_encode_key_wrapping_data(&ctx, &kwd);
    result = report_encoding_test_result(
        tracker,
        &ctx,
        expected,
        observed,
        result,
        __func__);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa40, %rsp            # imm = 0xA40
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0x80(%rbp), %rdi
leaq 0x2fd58(%rip), %rsi     # 0x45b90
movl $0x78, %edx
callq 0x10c0
leaq -0x100(%rbp), %rdi
xorl %esi, %esi
movl $0x78, %edx
callq 0x1090
leaq -0x998(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0x100(%rbp), %rsi
leaq -0x998(%rbp), %rdi
movl $0x78, %edx
movl $0x1, %ecx
callq 0x1c6e0
leaq -0x9a8(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x29ef2(%rip), %rax     # 0x3fd91
movq %rax, -0x9a8(%rbp)
movq $0x24, -0x9a0(%rbp)
leaq -0x9f8(%rbp), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x1090
movl $0xd, -0x9f8(%rbp)
leaq -0xa08(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x9a8(%rbp), %rax
movq %rax, -0xa08(%rbp)
leaq -0x9f8(%rbp), %rax
movq %rax, -0xa00(%rbp)
leaq -0xa38(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x1090
movl $0x1, -0xa38(%rbp)
leaq -0xa08(%rbp), %rax
movq %rax, -0xa30(%rbp)
movl $0x1, -0xa10(%rbp)
leaq -0x998(%rbp), %rdi
leaq -0xa38(%rbp), %rsi
callq 0x270d0
movl %eax, -0xa3c(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x80(%rbp), %rdx
leaq -0x100(%rbp), %rcx
movl -0xa3c(%rbp), %r8d
leaq -0x998(%rbp), %rsi
leaq 0x2af8c(%rip), %r9      # 0x40efb
callq 0x11f0
movl %eax, -0xa3c(%rbp)
leaq -0x998(%rbp), %rdi
callq 0x1cab0
movl -0xa3c(%rbp), %eax
addq $0xa40, %rsp            # imm = 0xA40
popq %rbp
retq
nopw %cs:(%rax,%rax)