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

    uint8 expected[280] = {
        0x42, 0x00, 0x77, 0x01, 0x00, 0x00, 0x01, 0x10, 
        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, 0x50, 0x02, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x10, 0x00, 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, 0x07, 0x06, 0x00, 0x00, 0x00, 0x08,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
        0x42, 0x00, 0xD3, 0x06, 0x00, 0x00, 0x00, 0x08,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
        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, 0x00, 0x0C, 0x01, 0x00, 0x00, 0x00, 0x40, 
        0x42, 0x00, 0x23, 0x01, 0x00, 0x00, 0x00, 0x38, 
        0x42, 0x00, 0x24, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x25, 0x01, 0x00, 0x00, 0x00, 0x20, 
        0x42, 0x00, 0x99, 0x07, 0x00, 0x00, 0x00, 0x06, 
        0x42, 0x61, 0x72, 0x6E, 0x65, 0x79, 0x00, 0x00, 
        0x42, 0x00, 0xA1, 0x07, 0x00, 0x00, 0x00, 0x07, 
        0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x32, 0x00, 
        0x42, 0x00, 0x0E, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x10, 0x06, 0x00, 0x00, 0x00, 0x08, 
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 
        0x42, 0x00, 0x0D, 0x02, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00
    };
    
    uint8 observed[280] = {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;
    
    struct text_string username = {0};
    username.value = "Barney";
    username.size = 6;
    struct text_string password = {0};
    password.value = "secret2";
    password.size = 7;
    
    struct username_password_credential upc = {0};
    upc.username = &username;
    upc.password = &password;
    
    struct credential c = {0};
    c.credential_type = KMIP_CRED_USERNAME_AND_PASSWORD;
    c.credential_value = &upc;
    
    struct authentication a = {0};
    a.credential = &c;
    
    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 request_header rh = {0};
    kmip_init_request_header(&rh);
    
    rh.protocol_version = &pv;
    rh.maximum_response_size = 4096;
    rh.asynchronous_indicator = KMIP_TRUE;
    rh.attestation_capable_indicator = KMIP_TRUE;
    rh.attestation_types = types;
    rh.attestation_type_count = ARRAY_LENGTH(types);
    rh.authentication = &a;
    rh.batch_error_continuation_option = KMIP_BATCH_CONTINUE;
    rh.batch_order_option = KMIP_TRUE;
    rh.batch_count = 2;
    
    rh.client_correlation_value = &ccv;
    rh.server_correlation_value = &scv;
    
    int result = kmip_encode_request_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 $0xbb0, %rsp            # imm = 0xBB0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0x120(%rbp), %rdi
leaq 0x2eab5(%rip), %rsi     # 0x465e0
movl $0x118, %edx            # imm = 0x118
callq 0x10c0
leaq -0x240(%rbp), %rdi
xorl %esi, %esi
movl $0x118, %edx            # imm = 0x118
callq 0x1090
leaq -0xad8(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0x240(%rbp), %rsi
leaq -0xad8(%rbp), %rdi
movl $0x118, %edx            # imm = 0x118
movl $0x4, %ecx
callq 0x1c6e0
leaq -0xae0(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
movl $0x1, -0xae0(%rbp)
movl $0x0, -0xadc(%rbp)
leaq -0xaf0(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x28961(%rip), %rax     # 0x4051a
movq %rax, -0xaf0(%rbp)
movq $0x6, -0xae8(%rbp)
leaq -0xb00(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2893c(%rip), %rax     # 0x40521
movq %rax, -0xb00(%rbp)
movq $0x7, -0xaf8(%rbp)
leaq -0xb10(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0xaf0(%rbp), %rax
movq %rax, -0xb10(%rbp)
leaq -0xb00(%rbp), %rax
movq %rax, -0xb08(%rbp)
leaq -0xb20(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
movl $0x1, -0xb20(%rbp)
leaq -0xb10(%rbp), %rax
movq %rax, -0xb18(%rbp)
leaq -0xb28(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
leaq -0xb20(%rbp), %rax
movq %rax, -0xb28(%rbp)
movq 0x2f6e7(%rip), %rax     # 0x47360
movq %rax, -0xb30(%rbp)
leaq -0xb40(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2952c(%rip), %rax     # 0x411c6
movq %rax, -0xb40(%rbp)
movq $0x8, -0xb38(%rbp)
leaq -0xb50(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x29509(%rip), %rax     # 0x411cf
movq %rax, -0xb50(%rbp)
movq $0x8, -0xb48(%rbp)
leaq -0xba0(%rbp), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x1090
leaq -0xba0(%rbp), %rdi
callq 0x1d4c0
leaq -0xae0(%rbp), %rax
movq %rax, -0xba0(%rbp)
movl $0x1000, -0xb98(%rbp)   # imm = 0x1000
movl $0x1, -0xb94(%rbp)
movl $0x1, -0xb74(%rbp)
leaq -0xb30(%rbp), %rax
movq %rax, -0xb70(%rbp)
movq $0x2, -0xb68(%rbp)
leaq -0xb28(%rbp), %rax
movq %rax, -0xb90(%rbp)
movl $0x1, -0xb88(%rbp)
movl $0x1, -0xb84(%rbp)
movl $0x2, -0xb78(%rbp)
leaq -0xb40(%rbp), %rax
movq %rax, -0xb60(%rbp)
leaq -0xb50(%rbp), %rax
movq %rax, -0xb58(%rbp)
leaq -0xad8(%rbp), %rdi
leaq -0xba0(%rbp), %rsi
callq 0x298a0
movl %eax, -0xba4(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x120(%rbp), %rdx
leaq -0x240(%rbp), %rcx
movl -0xba4(%rbp), %r8d
leaq -0xad8(%rbp), %rsi
leaq 0x29414(%rip), %r9      # 0x411d8
callq 0x11f0
movl %eax, -0xba4(%rbp)
leaq -0xad8(%rbp), %rdi
callq 0x1cab0
movl -0xba4(%rbp), %eax
addq $0xbb0, %rsp            # imm = 0xBB0
popq %rbp
retq
nopw (%rax,%rax)