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

    /* This encoding matches the following values:
    *  Cryptographic Parameters
    *      Block Cipher Mode - CBC
    *      Padding Method - PKCS5
    *      Hashing Algorithm - SHA-1
    */
    uint8 encoding[56] = {
        0x42, 0x00, 0x2B, 0x01, 0x00, 0x00, 0x00, 0x30,
        0x42, 0x00, 0x11, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x00, 0x5F, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x00, 0x38, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00
    };

    KMIP ctx = {0};
    kmip_init(&ctx, encoding, ARRAY_LENGTH(encoding), KMIP_2_0);

    CryptographicParameters value = {0};
    kmip_init_cryptographic_parameters(&value);
    value.block_cipher_mode = KMIP_BLOCK_CBC;
    value.padding_method = KMIP_PAD_PKCS5;
    value.hashing_algorithm = KMIP_HASH_SHA1;

    Attribute expected = {0};
    kmip_init_attribute(&expected);

    expected.type = KMIP_ATTR_CRYPTOGRAPHIC_PARAMETERS;
    expected.value = &value;

    Attribute observed = {0};
    kmip_init_attribute(&observed);

    int result = kmip_decode_attribute_v2(&ctx, &observed);
    int comparison = kmip_compare_attribute(&expected, &observed);
    if(!comparison)
    {
        kmip_print_attribute(stderr, 1, &expected);
        kmip_print_attribute(stderr, 1, &observed);
    }
    result = report_decoding_test_result(tracker, &ctx, comparison, result, __func__);

    kmip_free_attribute(&ctx, &observed);
    kmip_destroy(&ctx);

    return(result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x950, %rsp            # imm = 0x950
movq %rdi, %rbx
incw (%rdi)
movaps 0x1c889(%rip), %xmm0    # 0x2aa20
leaq 0x20(%rsp), %r15
movaps %xmm0, 0x20(%r15)
movaps 0x1c868(%rip), %xmm0    # 0x2aa10
movaps %xmm0, 0x10(%r15)
movaps 0x1c84c(%rip), %xmm0    # 0x2aa00
movaps %xmm0, (%r15)
movq $0x4000000, 0x30(%r15)  # imm = 0x4000000
leaq 0xb8(%rsp), %r14
movl $0x898, %edx            # imm = 0x898
movq %r14, %rdi
xorl %esi, %esi
callq 0x10c0
pushq $0x38
popq %rdx
pushq $0x5
popq %rcx
movq %r14, %rdi
movq %r15, %rsi
callq 0x128ed
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %r15
movaps %xmm0, 0x40(%r15)
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movq %r15, %rdi
callq 0x12e85
movabsq $0x300000001, %rax      # imm = 0x300000001
movq %rax, (%r15)
movl $0x4, 0x8(%r15)
leaq 0x10(%rsp), %r12
xorps %xmm0, %xmm0
movaps %xmm0, (%r12)
movq %r12, %rdi
callq 0x12e6d
movl $0xe, (%r12)
movq %r15, 0x8(%r12)
movq %rsp, %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
movq %r15, %rdi
callq 0x12e6d
movq %r14, %rdi
movq %r15, %rsi
callq 0x1bfe7
movl %eax, %ebp
movq %r12, %rdi
movq %r15, %rsi
callq 0x14d69
movl %eax, %r14d
testl %eax, %eax
jne 0xe2a3
movq 0x2fd79(%rip), %r12     # 0x3dff8
movq (%r12), %rdi
pushq $0x1
popq %r15
leaq 0x10(%rsp), %rdx
movl %r15d, %esi
callq 0x23eff
movq (%r12), %rdi
movq %rsp, %rdx
movl %r15d, %esi
callq 0x23eff
leaq 0x19beb(%rip), %r8      # 0x27e95
leaq 0xb8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x134d
movl %eax, %ebx
movq %rsp, %rsi
movq %r15, %rdi
callq 0x1309a
movq %r15, %rdi
callq 0x12ade
movl %ebx, %eax
addq $0x950, %rsp            # imm = 0x950
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq