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

    uint8 expected[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
    };
    
    uint8 observed[184] = {0};
    struct kmip ctx = {0};
    kmip_init(&ctx, observed, ARRAY_LENGTH(observed), 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 rh = {0};
    kmip_init_response_header(&rh);
    
    rh.protocol_version = &pv;
    rh.time_stamp = 1335514341;
    rh.nonce = &n;
    rh.attestation_types = types;
    rh.attestation_type_count = ARRAY_LENGTH(types);
    rh.batch_count = 1;
    
    rh.client_correlation_value = &ccv;
    rh.server_correlation_value = &scv;
    
    int result = kmip_encode_response_header(&ctx, &rh);
    result = report_encoding_test_result(
        tracker,
        &ctx,
        expected,
        observed,
        result,
        __func__);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xae0, %rsp            # imm = 0xAE0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0xc0(%rbp), %rdi
leaq 0x2e8e5(%rip), %rsi     # 0x46700
movl $0xb8, %edx
callq 0x10c0
leaq -0x180(%rbp), %rdi
xorl %esi, %esi
movl $0xb8, %edx
callq 0x1090
leaq -0xa18(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0x180(%rbp), %rsi
leaq -0xa18(%rbp), %rdi
movl $0xb8, %edx
movl $0x4, %ecx
callq 0x1c6e0
leaq -0xa20(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
movl $0x1, -0xa20(%rbp)
movl $0x0, -0xa1c(%rbp)
movl 0x2f283(%rip), %eax     # 0x47118
movl %eax, -0xa24(%rbp)
leaq -0xa38(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0xa24(%rbp), %rax
movq %rax, -0xa38(%rbp)
movq $0x4, -0xa30(%rbp)
movl 0x2e8eb(%rip), %eax     # 0x467b8
movl %eax, -0xa3e(%rbp)
movw 0x2e8e2(%rip), %ax      # 0x467bc
movw %ax, -0xa3a(%rbp)
leaq -0xa50(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0xa3e(%rbp), %rax
movq %rax, -0xa50(%rbp)
movq $0x6, -0xa48(%rbp)
leaq -0xa60(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0xa38(%rbp), %rax
movq %rax, -0xa60(%rbp)
leaq -0xa50(%rbp), %rax
movq %rax, -0xa58(%rbp)
movq 0x2f41d(%rip), %rax     # 0x47360
movq %rax, -0xa68(%rbp)
leaq -0xa78(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x29262(%rip), %rax     # 0x411c6
movq %rax, -0xa78(%rbp)
movq $0x8, -0xa70(%rbp)
leaq -0xa88(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2923f(%rip), %rax     # 0x411cf
movq %rax, -0xa88(%rbp)
movq $0x8, -0xa80(%rbp)
leaq -0xad0(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x1090
leaq -0xad0(%rbp), %rdi
callq 0x1d570
leaq -0xa20(%rbp), %rax
movq %rax, -0xad0(%rbp)
movq $0x4f9a54e5, -0xac8(%rbp) # imm = 0x4F9A54E5
leaq -0xa60(%rbp), %rax
movq %rax, -0xab8(%rbp)
leaq -0xa68(%rbp), %rax
movq %rax, -0xab0(%rbp)
movq $0x2, -0xaa8(%rbp)
movl $0x1, -0xac0(%rbp)
leaq -0xa78(%rbp), %rax
movq %rax, -0xaa0(%rbp)
leaq -0xa88(%rbp), %rax
movq %rax, -0xa98(%rbp)
leaq -0xa18(%rbp), %rdi
leaq -0xad0(%rbp), %rsi
callq 0x29d40
movl %eax, -0xad4(%rbp)
movq -0x8(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
leaq -0x180(%rbp), %rcx
movl -0xad4(%rbp), %r8d
leaq -0xa18(%rbp), %rsi
leaq 0x291a4(%rip), %r9      # 0x4120b
callq 0x11f0
movl %eax, -0xad4(%rbp)
leaq -0xa18(%rbp), %rdi
callq 0x1cab0
movl -0xad4(%rbp), %eax
addq $0xae0, %rsp            # imm = 0xAE0
popq %rbp
retq
nopl (%rax)