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

    uint8 encoding[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
    };
    
    struct kmip ctx = {0};
    kmip_init(&ctx, encoding, ARRAY_LENGTH(encoding), 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 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;
    
    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
movq %rsp, %rbp
subq $0xa30, %rsp            # imm = 0xA30
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0xa0(%rbp), %rdi
leaq 0x2f055(%rip), %rsi     # 0x46050
movl $0x98, %edx
callq 0x10c0
leaq -0x938(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0xa0(%rbp), %rsi
leaq -0x938(%rbp), %rdi
movl $0x98, %edx
movl $0x2, %ecx
callq 0x1c6e0
leaq -0x940(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
movl $0x1, -0x940(%rbp)
movl $0x0, -0x93c(%rbp)
movl 0x300b6(%rip), %eax     # 0x47118
movl %eax, -0x944(%rbp)
leaq -0x958(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x944(%rbp), %rax
movq %rax, -0x958(%rbp)
movq $0x4, -0x950(%rbp)
movl 0x2f04e(%rip), %eax     # 0x460e8
movl %eax, -0x95e(%rbp)
movw 0x2f045(%rip), %ax      # 0x460ec
movw %ax, -0x95a(%rbp)
leaq -0x970(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x95e(%rbp), %rax
movq %rax, -0x970(%rbp)
movq $0x6, -0x968(%rbp)
leaq -0x980(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x958(%rbp), %rax
movq %rax, -0x980(%rbp)
leaq -0x970(%rbp), %rax
movq %rax, -0x978(%rbp)
movq 0x30250(%rip), %rax     # 0x47360
movq %rax, -0x988(%rbp)
leaq -0x9d0(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x1090
leaq -0x9d0(%rbp), %rdi
callq 0x1d570
leaq -0x940(%rbp), %rax
movq %rax, -0x9d0(%rbp)
movq $0x4f9a54e5, -0x9c8(%rbp) # imm = 0x4F9A54E5
leaq -0x980(%rbp), %rax
movq %rax, -0x9b8(%rbp)
leaq -0x988(%rbp), %rax
movq %rax, -0x9b0(%rbp)
movq $0x2, -0x9a8(%rbp)
movl $0x1, -0x9c0(%rbp)
leaq -0xa18(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x1090
leaq -0xa18(%rbp), %rdi
callq 0x1d570
leaq -0x938(%rbp), %rdi
leaq -0xa18(%rbp), %rsi
callq 0x364a0
movl %eax, -0xa1c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa28(%rbp)
leaq -0x9d0(%rbp), %rdi
leaq -0xa18(%rbp), %rsi
callq 0x23e80
movq -0xa28(%rbp), %rdi
movl %eax, %edx
movl -0xa1c(%rbp), %ecx
leaq -0x938(%rbp), %rsi
leaq 0x29e7d(%rip), %r8      # 0x41070
callq 0x13a0
movl %eax, -0xa1c(%rbp)
leaq -0x938(%rbp), %rdi
leaq -0xa18(%rbp), %rsi
callq 0x1f6a0
leaq -0x938(%rbp), %rdi
callq 0x1cab0
movl -0xa1c(%rbp), %eax
addq $0xa30, %rsp            # imm = 0xA30
popq %rbp
retq
nopl (%rax)