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

    uint8 expected[136] = {
        0x42, 0x00, 0x7C, 0x01, 0x00, 0x00, 0x00, 0x80, 
        0x42, 0x00, 0x57, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x94, 0x07, 0x00, 0x00, 0x00, 0x24, 
        0x66, 0x62, 0x34, 0x62, 0x35, 0x62, 0x39, 0x63, 
        0x2D, 0x36, 0x31, 0x38, 0x38, 0x2D, 0x34, 0x63, 
        0x36, 0x33, 0x2D, 0x38, 0x31, 0x34, 0x32, 0x2D, 
        0x66, 0x65, 0x39, 0x63, 0x33, 0x32, 0x38, 0x31, 
        0x32, 0x39, 0x66, 0x63, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x00, 0x91, 0x01, 0x00, 0x00, 0x00, 0x38, 
        0x42, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x30, 
        0x42, 0x00, 0x0A, 0x07, 0x00, 0x00, 0x00, 0x17, 
        0x43, 0x72, 0x79, 0x70, 0x74, 0x6F, 0x67, 0x72, 
        0x61, 0x70, 0x68, 0x69, 0x63, 0x20, 0x41, 0x6C, 
        0x67, 0x6F, 0x72, 0x69, 0x74, 0x68, 0x6D, 0x00, 
        0x42, 0x00, 0x0B, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 
    };
    
    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 = "fb4b5b9c-6188-4c63-8142-fe9c328129fc";
    uuid.size = 36;
    
    struct attribute a = {0};
    kmip_init_attribute(&a);
    
    enum cryptographic_algorithm algorithm = KMIP_CRYPTOALG_AES;
    a.type = KMIP_ATTR_CRYPTOGRAPHIC_ALGORITHM;
    a.value = &algorithm;
    
    struct template_attribute ta = {0};
    ta.attributes = &a;
    ta.attribute_count = 1;
    
    struct create_response_payload crp = {0};
    crp.object_type = KMIP_OBJTYPE_SYMMETRIC_KEY;
    crp.unique_identifier = &uuid;
    crp.template_attribute = &ta;
    
    int result = kmip_encode_create_response_payload(&ctx, &crp);
    result = report_encoding_test_result(
        tracker,
        &ctx,
        expected,
        observed,
        result,
        __func__);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x990, %rsp            # imm = 0x990
movq %rdi, %rbx
incw (%rdi)
leaq 0x70(%rsp), %r14
movl $0x88, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x10c0
leaq 0xf8(%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 0x128ed
leaq 0x1d5f9(%rip), %rax     # 0x272c3
leaq 0x28(%rsp), %r13
movq %rax, (%r13)
movq $0x24, 0x8(%r13)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r12
movaps %xmm0, (%r12)
movq %r12, %rdi
callq 0x12e6d
pushq $0x3
popq %rax
leaq 0xc(%rsp), %rcx
movl %eax, (%rcx)
movl %eax, (%r12)
movq %rcx, 0x8(%r12)
leaq 0x50(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movq %r12, 0x10(%rax)
leaq 0x38(%rsp), %rsi
andq $0x0, (%rsi)
movq $0x1, 0x18(%rax)
movl $0x2, (%rsi)
movq %r13, 0x8(%rsi)
movq %rax, 0x10(%rsi)
movq %r15, %rdi
callq 0x1880d
leaq 0x203c0(%rip), %rdx     # 0x2a100
leaq 0x1d5e9(%rip), %r9      # 0x27330
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
movl %eax, %r8d
callq 0x123c
movl %eax, %ebx
movq %r15, %rdi
callq 0x12ade
movl %ebx, %eax
addq $0x990, %rsp            # imm = 0x990
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq