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

    uint8 expected[152] = {
        0x42, 0x00, 0x7A, 0x01, 0x00, 0x00, 0x00, 0x90, 
        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, 0x00, 0x0D, 0x02, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00
    };
    
    uint8 observed[152] = {0};
    struct kmip ctx = {0};
    kmip_init(&ctx, observed, ARRAY_LENGTH(observed), KMIP_1_2);
    
    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 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;
    
    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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x9d8, %rsp            # imm = 0x9D8
movq %rdi, %rbx
incw (%rdi)
leaq 0xa0(%rsp), %r14
movl $0x98, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x10c0
leaq 0x140(%rsp), %r15
movl $0x898, %edx            # imm = 0x898
movq %r15, %rdi
xorl %esi, %esi
callq 0x10c0
movl $0x98, %edx
movq %r15, %rdi
movq %r14, %rsi
movl $0x2, %ecx
callq 0x13177
leaq 0x18(%rsp), %r13
movq $0x1, (%r13)
leaq 0x4(%rsp), %rax
movl $0x4030201, (%rax)      # imm = 0x4030201
leaq 0x40(%rsp), %rcx
movq %rax, (%rcx)
movq $0x4, 0x8(%rcx)
leaq 0x8(%rsp), %rax
movw $0xffff, 0x4(%rax)      # imm = 0xFFFF
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq 0x30(%rsp), %rdx
movq %rax, (%rdx)
movq $0x6, 0x8(%rdx)
leaq 0x20(%rsp), %rbp
movq %rcx, (%rbp)
movq %rdx, 0x8(%rbp)
movabsq $0x300000001, %rax      # imm = 0x300000001
leaq 0x10(%rsp), %r14
movq %rax, (%r14)
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %r12
movaps %xmm0, 0x30(%r12)
movaps %xmm0, 0x20(%r12)
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
movq $0x0, 0x40(%r12)
movq %r12, %rdi
callq 0x1392b
movq %r13, (%r12)
movq $0x4f9a54e5, 0x8(%r12)  # imm = 0x4F9A54E5
movq %rbp, 0x18(%r12)
movq %r14, 0x20(%r12)
movq $0x2, 0x28(%r12)
movl $0x1, 0x10(%r12)
movq %r15, %rdi
movq %r12, %rsi
callq 0x1ad4b
leaq 0x224aa(%rip), %rdx     # 0x31ea0
leaq 0x1f6f6(%rip), %r9      # 0x2f0f3
movq %rbx, %rdi
movq %r15, %rsi
leaq 0xa0(%rsp), %rcx
movl %eax, %r8d
callq 0x123c
movl %eax, %ebx
movq %r15, %rdi
callq 0x13455
movl %ebx, %eax
addq $0x9d8, %rsp            # imm = 0x9D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq