// File: /workspace/github_c_makefile_star2_O1/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 0x24fb9(%rip), %xmm0    # 0x33a30
leaq 0x20(%rsp), %r15
movaps %xmm0, 0x20(%r15)
movaps 0x24f98(%rip), %xmm0    # 0x33a20
movaps %xmm0, 0x10(%r15)
movaps 0x24f7c(%rip), %xmm0    # 0x33a10
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
movl $0x38, %edx
movq %r14, %rdi
movq %r15, %rsi
movl $0x5, %ecx
callq 0x13747
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 0x13e74
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 0x13e59
movl $0xe, (%r12)
movq %r15, 0x8(%r12)
movq %rsp, %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
movq %r15, %rdi
callq 0x13e59
movq %r14, %rdi
movq %r15, %rsi
callq 0x1fbde
movl %eax, %ebp
movq %r12, %rdi
movq %r15, %rsi
callq 0x163c1
movl %eax, %r14d
testl %eax, %eax
jne 0xeb85
movq 0x36495(%rip), %r15     # 0x44ff8
movq (%r15), %rdi
leaq 0x10(%rsp), %rdx
movl $0x1, %esi
callq 0x2c91e
movq (%r15), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0x2c91e
leaq 0x22309(%rip), %r8      # 0x30e95
leaq 0xb8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x1397
movl %eax, %ebx
movq %rsp, %rsi
movq %r15, %rdi
callq 0x140cc
movq %r15, %rdi
callq 0x13a23
movl %ebx, %eax
addq $0x950, %rsp            # imm = 0x950
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq