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

    uint8 encoding[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, 
    };
    
    struct kmip ctx = {0};
    kmip_init(&ctx, encoding, ARRAY_LENGTH(encoding), 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 expected = {0};
    expected.object_type = KMIP_OBJTYPE_SYMMETRIC_KEY;
    expected.unique_identifier = &uuid;
    expected.template_attribute = &ta;
    
    struct create_response_payload observed = {0};
    
    int result = kmip_decode_create_response_payload(&ctx, &observed);
    result = report_decoding_test_result(
        tracker,
        &ctx,
        kmip_compare_create_response_payload(&expected, &observed),
        result,
        __func__);
    kmip_free_create_response_payload(&ctx, &observed);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x9a0, %rsp            # imm = 0x9A0
movq %rdi, %rbx
incw (%rdi)
leaq 0x2036f(%rip), %rsi     # 0x2a100
leaq 0x80(%rsp), %r15
movl $0x88, %edx
movq %r15, %rdi
callq 0x1100
leaq 0x108(%rsp), %r14
movl $0x898, %edx            # imm = 0x898
movq %r14, %rdi
xorl %esi, %esi
callq 0x10c0
movl $0x88, %edx
movq %r14, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x128ed
leaq 0x1d4ed(%rip), %rax     # 0x272c3
leaq 0x20(%rsp), %r12
movq %rax, (%r12)
movq $0x24, 0x8(%r12)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r15
movaps %xmm0, (%r15)
movq %r15, %rdi
callq 0x12e6d
pushq $0x3
popq %rax
leaq 0xc(%rsp), %rcx
movl %eax, (%rcx)
movl %eax, (%r15)
movq %rcx, 0x8(%r15)
leaq 0x60(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movq %r15, 0x10(%rax)
movq $0x1, 0x18(%rax)
leaq 0x48(%rsp), %r15
andq $0x0, (%r15)
movl $0x2, (%r15)
movq %r12, 0x8(%r15)
movq %rax, 0x10(%r15)
leaq 0x30(%rsp), %r12
movaps %xmm0, (%r12)
andq $0x0, 0x10(%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x1e279
movl %eax, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0x15714
leaq 0x1d501(%rip), %r8      # 0x2736c
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
movl %ebp, %ecx
callq 0x134d
movl %eax, %ebx
movq %r14, %rdi
movq %r12, %rsi
callq 0x1383c
movq %r14, %rdi
callq 0x12ade
movl %ebx, %eax
addq $0x9a0, %rsp            # imm = 0x9A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq