// File: /workspace/github_c_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x9a8, %rsp            # imm = 0x9A8
movq %rdi, %rbx
incw (%rdi)
leaq 0x26fa6(%rip), %rsi     # 0x31100
leaq 0x80(%rsp), %r15
movl $0x88, %edx
movq %r15, %rdi
callq 0x1100
leaq 0x110(%rsp), %r14
xorl %r13d, %r13d
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 0x13177
leaq 0x24121(%rip), %rax     # 0x2e2c3
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 0x1388b
movl $0x3, %eax
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
movq %r13, (%r15)
movl $0x2, (%r15)
movq %r12, 0x8(%r15)
movq %rax, 0x10(%r15)
leaq 0x30(%rsp), %r12
movq %r13, 0x10(%r12)
movaps %xmm0, (%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x22b57
movl %eax, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0x16757
leaq 0x24135(%rip), %r8      # 0x2e36c
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
movl %ebp, %ecx
callq 0x1363
movl %eax, %ebx
movq %r14, %rdi
movq %r12, %rsi
callq 0x14448
movq %r14, %rdi
callq 0x13455
movl %ebx, %eax
addq $0x9a8, %rsp            # imm = 0x9A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq