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

    uint8 expected[88] = {
        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, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
        0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 
        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
    };
    
    uint8 observed[88] = {0};
    struct kmip ctx = {0};
    kmip_init(&ctx, observed, ARRAY_LENGTH(observed), KMIP_1_0);
    
    uint8 value[16] = {
        0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
        0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
    };
    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.cryptographic_algorithm = KMIP_CRYPTOALG_AES;
    kb.cryptographic_length = 128;
    
    int result = kmip_encode_key_block(&ctx, &kb);
    result = report_encoding_test_result(
        tracker,
        &ctx,
        expected,
        observed,
        result,
        __func__);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x9d0, %rsp            # imm = 0x9D0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0x60(%rbp), %rdi
leaq 0x36138(%rip), %rsi     # 0x42970
movl $0x58, %edx
callq 0x10c0
leaq -0xc0(%rbp), %rdi
xorl %esi, %esi
movl $0x58, %edx
callq 0x1090
leaq -0x958(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0xc0(%rbp), %rsi
leaq -0x958(%rbp), %rdi
movl $0x58, %edx
xorl %ecx, %ecx
callq 0x1c6e0
movq 0x3a907(%rip), %rax     # 0x47190
movq %rax, -0x970(%rbp)
movq 0x3a901(%rip), %rax     # 0x47198
movq %rax, -0x968(%rbp)
leaq -0x980(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x970(%rbp), %rax
movq %rax, -0x980(%rbp)
movq $0x10, -0x978(%rbp)
leaq -0x998(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
leaq -0x980(%rbp), %rax
movq %rax, -0x998(%rbp)
leaq -0x9c0(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x1090
movl $0x1, -0x9c0(%rbp)
leaq -0x998(%rbp), %rax
movq %rax, -0x9b8(%rbp)
movl $0x3, -0x9ac(%rbp)
movl $0x80, -0x9a8(%rbp)
leaq -0x958(%rbp), %rdi
leaq -0x9c0(%rbp), %rsi
callq 0x278b0
movl %eax, -0x9c4(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x60(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
movl -0x9c4(%rbp), %r8d
leaq -0x958(%rbp), %rsi
leaq 0x336ad(%rip), %r9      # 0x40014
callq 0x11f0
movl %eax, -0x9c4(%rbp)
leaq -0x958(%rbp), %rdi
callq 0x1cab0
movl -0x9c4(%rbp), %eax
addq $0x9d0, %rsp            # imm = 0x9D0
popq %rbp
retq
nopl (%rax)