// File: /workspace/github_c_makefile_star2_O3/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 0x2332b(%rip), %xmm0    # 0x31a20
leaq 0x20(%rsp), %r15
movaps %xmm0, 0x20(%r15)
movaps 0x2330a(%rip), %xmm0    # 0x31a10
movaps %xmm0, 0x10(%r15)
movaps 0x232ee(%rip), %xmm0    # 0x31a00
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 0x13177
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 0x138a6
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 0x1388b
movl $0xe, (%r12)
movq %r15, 0x8(%r12)
movq %rsp, %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
movq %r15, %rdi
callq 0x1388b
movq %r14, %rdi
movq %r15, %rsi
callq 0x1ee71
movl %eax, %ebp
movq %r12, %rdi
movq %r15, %rsi
callq 0x15d75
testl %eax, %eax
jne 0xe802
movq 0x3481a(%rip), %r14     # 0x42ff8
movq (%r14), %rdi
leaq 0x10(%rsp), %rdx
movl $0x1, %esi
callq 0x2b53a
movq (%r14), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0x2b53a
xorl %eax, %eax
leaq 0x2068c(%rip), %r8      # 0x2ee95
leaq 0xb8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
movl %ebp, %ecx
callq 0x1363
movl %eax, %ebx
movq %rsp, %rsi
movq %r14, %rdi
callq 0x13afe
movq %r14, %rdi
callq 0x13455
movl %ebx, %eax
addq $0x950, %rsp            # imm = 0x950
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq