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

    uint8 encoding[184] = {
        0x42, 0x00, 0x7A, 0x01, 0x00, 0x00, 0x00, 0xB0, 
        0x42, 0x00, 0x69, 0x01, 0x00, 0x00, 0x00, 0x20, 
        0x42, 0x00, 0x6A, 0x02, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x6B, 0x02, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x92, 0x09, 0x00, 0x00, 0x00, 0x08, 
        0x00, 0x00, 0x00, 0x00, 0x4F, 0x9A, 0x54, 0xE5,
        0x42, 0x00, 0xC8, 0x01, 0x00, 0x00, 0x00, 0x20,
        0x42, 0x00, 0xC9, 0x08, 0x00, 0x00, 0x00, 0x04,
        0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x00, 0xCA, 0x08, 0x00, 0x00, 0x00, 0x06,
        0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
        0x42, 0x00, 0xC7, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x00, 0xC7, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x01, 0x05, 0x07, 0x00, 0x00, 0x00, 0x08,
        0x63, 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x20, 0x31,
        0x42, 0x01, 0x06, 0x07, 0x00, 0x00, 0x00, 0x08,
        0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x31, 
        0x42, 0x00, 0x0D, 0x02, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00
    };
    
    struct kmip ctx = {0};
    kmip_init(&ctx, encoding, ARRAY_LENGTH(encoding), KMIP_1_4);
    
    struct protocol_version pv = {0};
    pv.major = 1;
    pv.minor = 0;
    
    uint8 id[4] = {0x01, 0x02, 0x03, 0x04};
    struct byte_string ni = {0};
    ni.value = id;
    ni.size = ARRAY_LENGTH(id);
    
    uint8 value[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
    struct byte_string nv = {0};
    nv.value = value;
    nv.size = ARRAY_LENGTH(value);
    
    struct nonce n = {0};
    n.nonce_id = &ni;
    n.nonce_value = &nv;
    
    enum attestation_type types[2] = {
        KMIP_ATTEST_TPM_QUOTE,
        KMIP_ATTEST_SAML_ASSERTION
    };
    
    struct text_string ccv = {0};
    ccv.value = "client 1";
    ccv.size = 8;
    
    struct text_string scv = {0};
    scv.value = "server 1";
    scv.size = 8;
    
    struct response_header expected = {0};
    kmip_init_response_header(&expected);
    
    expected.protocol_version = &pv;
    expected.time_stamp = 1335514341;
    expected.nonce = &n;
    expected.attestation_types = types;
    expected.attestation_type_count = ARRAY_LENGTH(types);
    expected.batch_count = 1;
    
    expected.client_correlation_value = &ccv;
    expected.server_correlation_value = &scv;
    
    struct response_header observed = {0};
    kmip_init_response_header(&observed);
    
    int result = kmip_decode_response_header(&ctx, &observed);
    result = report_decoding_test_result(
        tracker,
        &ctx,
        kmip_compare_response_header(&expected, &observed),
        result,
        __func__);
    kmip_free_response_header(&ctx, &observed);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa78, %rsp            # imm = 0xA78
movq %rdi, 0x8(%rsp)
incw (%rdi)
leaq 0x1b447(%rip), %rsi     # 0x2b2f0
leaq 0x120(%rsp), %r15
movl $0xb8, %edx
movq %r15, %rdi
callq 0x1100
leaq 0x1e0(%rsp), %r14
movl $0x898, %edx            # imm = 0x898
movq %r14, %rdi
xorl %esi, %esi
callq 0x10c0
pushq $0x4
popq %rcx
movl $0xb8, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x128ed
leaq 0x10(%rsp), %rax
movq $0x1, (%rax)
leaq 0x1c(%rsp), %rax
movl $0x4030201, (%rax)      # imm = 0x4030201
leaq 0x70(%rsp), %rcx
leaq 0x20(%rsp), %rdx
orw $-0x1, 0x4(%rdx)
movq %rax, (%rcx)
orl $-0x1, (%rdx)
movq $0x4, 0x8(%rcx)
leaq 0x60(%rsp), %rax
movq %rdx, (%rax)
movq $0x6, 0x8(%rax)
leaq 0x50(%rsp), %r13
movq %rcx, (%r13)
movq %rax, 0x8(%r13)
movabsq $0x300000001, %rax      # imm = 0x300000001
leaq 0x28(%rsp), %rbp
movq %rax, (%rbp)
leaq 0x1832b(%rip), %rax     # 0x2827e
leaq 0x40(%rsp), %r12
movq %rax, (%r12)
pushq $0x8
popq %rax
movq %rax, 0x8(%r12)
leaq 0x1831c(%rip), %rcx     # 0x28287
leaq 0x30(%rsp), %rbx
movq %rcx, (%rbx)
movq %rax, 0x8(%rbx)
xorps %xmm0, %xmm0
leaq 0xd0(%rsp), %r15
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
andq $0x0, 0x40(%r15)
movq %r15, %rdi
callq 0x12efd
leaq 0x10(%rsp), %rax
movq %rax, (%r15)
movq $0x4f9a54e5, 0x8(%r15)  # imm = 0x4F9A54E5
movq %r13, 0x18(%r15)
movq %rbp, 0x20(%r15)
movq $0x2, 0x28(%r15)
movl $0x1, 0x10(%r15)
movq %r12, 0x30(%r15)
movq %rbx, 0x38(%r15)
leaq 0x80(%rsp), %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%r12)
movaps %xmm0, 0x20(%r12)
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
andq $0x0, 0x40(%r12)
movq %r12, %rdi
callq 0x12efd
movq %r14, %rdi
movq %r12, %rsi
callq 0x20886
movl %eax, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0x16195
leaq 0x182d6(%rip), %r8      # 0x282f7
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movl %eax, %edx
movl %ebp, %ecx
callq 0x134d
movl %eax, %ebx
movq %r14, %rdi
movq %r12, %rsi
callq 0x140c5
movq %r14, %rdi
callq 0x12ade
movl %ebx, %eax
addq $0xa78, %rsp            # imm = 0xA78
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq