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

    uint8 expected[304] = {
        0x42, 0x00, 0x7B, 0x01, 0x00, 0x00, 0x01, 0x28, 
        0x42, 0x00, 0x7A, 0x01, 0x00, 0x00, 0x00, 0x48, 
        0x42, 0x00, 0x69, 0x01, 0x00, 0x00, 0x00, 0x20, 
        0x42, 0x00, 0x6A, 0x02, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x6B, 0x02, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x92, 0x09, 0x00, 0x00, 0x00, 0x08, 
        0x00, 0x00, 0x00, 0x00, 0x4F, 0x9A, 0x54, 0xE7, 
        0x42, 0x00, 0x0D, 0x02, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x00, 0x0F, 0x01, 0x00, 0x00, 0x00, 0xD0, 
        0x42, 0x00, 0x5C, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x7F, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x7C, 0x01, 0x00, 0x00, 0x00, 0xA8, 
        0x42, 0x00, 0x57, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x94, 0x07, 0x00, 0x00, 0x00, 0x24, 
        0x34, 0x39, 0x61, 0x31, 0x63, 0x61, 0x38, 0x38, 
        0x2D, 0x36, 0x62, 0x65, 0x61, 0x2D, 0x34, 0x66, 
        0x62, 0x32, 0x2D, 0x62, 0x34, 0x35, 0x30, 0x2D, 
        0x37, 0x65, 0x35, 0x38, 0x38, 0x30, 0x32, 0x63, 
        0x33, 0x30, 0x33, 0x38, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x8F, 0x01, 0x00, 0x00, 0x00, 0x60, 
        0x42, 0x00, 0x40, 0x01, 0x00, 0x00, 0x00, 0x58, 
        0x42, 0x00, 0x42, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x45, 0x01, 0x00, 0x00, 0x00, 0x20, 
        0x42, 0x00, 0x43, 0x08, 0x00, 0x00, 0x00, 0x18, 
        0x73, 0x67, 0x57, 0x80, 0x51, 0x01, 0x2A, 0x6D, 
        0x13, 0x4A, 0x85, 0x5E, 0x25, 0xC8, 0xCD, 0x5E, 
        0x4C, 0xA1, 0x31, 0x45, 0x57, 0x29, 0xD3, 0xC8, 
        0x42, 0x00, 0x28, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x2A, 0x02, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0xA8, 0x00, 0x00, 0x00, 0x00
    };
    
    uint8 observed[304] = {0};
    struct kmip ctx = {0};
    kmip_init(&ctx, observed, ARRAY_LENGTH(observed), KMIP_1_0);
    
    struct protocol_version pv = {0};
    pv.major = 1;
    pv.minor = 0;
    
    struct response_header rh = {0};
    kmip_init_response_header(&rh);
    
    rh.protocol_version = &pv;
    rh.time_stamp = 1335514343;
    rh.batch_count = 1;
    
    struct text_string uuid = {0};
    uuid.value = "49a1ca88-6bea-4fb2-b450-7e58802c3038";
    uuid.size = 36;
    
    uint8 value[24] = {
        0x73, 0x67, 0x57, 0x80, 0x51, 0x01, 0x2A, 0x6D, 
        0x13, 0x4A, 0x85, 0x5E, 0x25, 0xC8, 0xCD, 0x5E, 
        0x4C, 0xA1, 0x31, 0x45, 0x57, 0x29, 0xD3, 0xC8
    };
    
    struct byte_string v = {0};
    v.value = value;
    v.size = ARRAY_LENGTH(value);
    
    struct key_value kv = {0};
    kv.key_material = &v;
    
    struct key_block kb = {0};
    kb.key_format_type = KMIP_KEYFORMAT_RAW;
    kb.key_value = &kv;
    kb.cryptographic_algorithm = KMIP_CRYPTOALG_TRIPLE_DES;
    kb.cryptographic_length = 168;
    
    struct symmetric_key key = {0};
    key.key_block = &kb;
    
    struct get_response_payload grp = {0};
    grp.object_type = KMIP_OBJTYPE_SYMMETRIC_KEY;
    grp.unique_identifier = &uuid;
    grp.object = &key;
    
    struct response_batch_item rbi = {0};
    rbi.operation = KMIP_OP_GET;
    rbi.result_status = KMIP_STATUS_SUCCESS;
    rbi.response_payload = &grp;
    
    struct response_message rm = {0};
    rm.response_header = &rh;
    rm.batch_items = &rbi;
    rm.batch_count = 1;
    
    int result = kmip_encode_response_message(&ctx, &rm);
    result = report_encoding_test_result(
        tracker,
        &ctx,
        expected,
        observed,
        result,
        __func__);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc40, %rsp            # imm = 0xC40
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0x140(%rbp), %rdi
leaq 0x339d5(%rip), %rsi     # 0x45370
movl $0x130, %edx            # imm = 0x130
callq 0x10c0
leaq -0x270(%rbp), %rdi
xorl %esi, %esi
movl $0x130, %edx            # imm = 0x130
callq 0x1090
leaq -0xb08(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0x270(%rbp), %rsi
leaq -0xb08(%rbp), %rdi
movl $0x130, %edx            # imm = 0x130
xorl %ecx, %ecx
callq 0x1c6e0
leaq -0xb10(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
movl $0x1, -0xb10(%rbp)
movl $0x0, -0xb0c(%rbp)
leaq -0xb58(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x1090
leaq -0xb58(%rbp), %rdi
callq 0x1d570
leaq -0xb10(%rbp), %rax
movq %rax, -0xb58(%rbp)
movq $0x4f9a54e7, -0xb50(%rbp) # imm = 0x4F9A54E7
movl $0x1, -0xb48(%rbp)
leaq -0xb68(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2dae7(%rip), %rax     # 0x3f54f
movq %rax, -0xb68(%rbp)
movq $0x24, -0xb60(%rbp)
movq 0x33a1f(%rip), %rax     # 0x454a0
movq %rax, -0xb80(%rbp)
movq 0x33a19(%rip), %rax     # 0x454a8
movq %rax, -0xb78(%rbp)
movq 0x33a13(%rip), %rax     # 0x454b0
movq %rax, -0xb70(%rbp)
leaq -0xb90(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0xb80(%rbp), %rax
movq %rax, -0xb90(%rbp)
movq $0x18, -0xb88(%rbp)
leaq -0xba8(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
leaq -0xb90(%rbp), %rax
movq %rax, -0xba8(%rbp)
leaq -0xbd0(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x1090
movl $0x1, -0xbd0(%rbp)
leaq -0xba8(%rbp), %rax
movq %rax, -0xbc8(%rbp)
movl $0x2, -0xbbc(%rbp)
movl $0xa8, -0xbb8(%rbp)
leaq -0xbd8(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
leaq -0xbd0(%rbp), %rax
movq %rax, -0xbd8(%rbp)
leaq -0xbf0(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
movl $0x2, -0xbf0(%rbp)
leaq -0xb68(%rbp), %rax
movq %rax, -0xbe8(%rbp)
leaq -0xbd8(%rbp), %rax
movq %rax, -0xbe0(%rbp)
leaq -0xc20(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x1090
movl $0xa, -0xc20(%rbp)
movl $0x0, -0xc10(%rbp)
leaq -0xbf0(%rbp), %rax
movq %rax, -0xbf8(%rbp)
leaq -0xc38(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1090
leaq -0xb58(%rbp), %rax
movq %rax, -0xc38(%rbp)
leaq -0xc20(%rbp), %rax
movq %rax, -0xc30(%rbp)
movq $0x1, -0xc28(%rbp)
leaq -0xb08(%rbp), %rdi
leaq -0xc38(%rbp), %rsi
callq 0x2a980
movl %eax, -0xc3c(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x140(%rbp), %rdx
leaq -0x270(%rbp), %rcx
movl -0xc3c(%rbp), %r8d
leaq -0xb08(%rbp), %rsi
leaq 0x2eb8c(%rip), %r9      # 0x407c5
callq 0x11f0
movl %eax, -0xc3c(%rbp)
leaq -0xb08(%rbp), %rdi
callq 0x1cab0
movl -0xc3c(%rbp), %eax
addq $0xc40, %rsp            # imm = 0xC40
popq %rbp
retq
nop