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

    uint8 encoding[168] = {
        0x42, 0x00, 0x77, 0x01, 0x00, 0x00, 0x00, 0xA0, 
        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, 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
    };
    
    struct kmip ctx = {0};
    kmip_init(&ctx, encoding, ARRAY_LENGTH(encoding), KMIP_1_0);
    
    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;
    
    struct request_header expected = {0};
    kmip_init_request_header(&expected);
    
    expected.protocol_version = &pv;
    expected.authentication = &a;
    expected.batch_error_continuation_option = KMIP_BATCH_CONTINUE;
    expected.batch_order_option = KMIP_TRUE;
    expected.batch_count = 2;
    
    struct request_header observed = {0};
    kmip_init_request_header(&observed);
    
    int result = kmip_decode_request_header(&ctx, &observed);
    result = report_decoding_test_result(
        tracker,
        &ctx,
        kmip_compare_request_header(&expected, &observed),
        result,
        __func__);
    kmip_free_request_header(&ctx, &observed);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa50, %rsp            # imm = 0xA50
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0xb0(%rbp), %rdi
leaq 0x34875(%rip), %rsi     # 0x44d80
movl $0xa8, %edx
callq 0x10c0
leaq -0x948(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0xb0(%rbp), %rsi
leaq -0x948(%rbp), %rdi
movl $0xa8, %edx
xorl %ecx, %ecx
callq 0x1c6e0
leaq -0x950(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
movl $0x1, -0x950(%rbp)
movl $0x0, -0x94c(%rbp)
leaq -0x960(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2ff97(%rip), %rax     # 0x4051a
movq %rax, -0x960(%rbp)
movq $0x6, -0x958(%rbp)
leaq -0x970(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2ff72(%rip), %rax     # 0x40521
movq %rax, -0x970(%rbp)
movq $0x7, -0x968(%rbp)
leaq -0x980(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x960(%rbp), %rax
movq %rax, -0x980(%rbp)
leaq -0x970(%rbp), %rax
movq %rax, -0x978(%rbp)
leaq -0x990(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
movl $0x1, -0x990(%rbp)
leaq -0x980(%rbp), %rax
movq %rax, -0x988(%rbp)
leaq -0x998(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
leaq -0x990(%rbp), %rax
movq %rax, -0x998(%rbp)
leaq -0x9e8(%rbp), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x1090
leaq -0x9e8(%rbp), %rdi
callq 0x1d4c0
leaq -0x950(%rbp), %rax
movq %rax, -0x9e8(%rbp)
leaq -0x998(%rbp), %rax
movq %rax, -0x9d8(%rbp)
movl $0x1, -0x9d0(%rbp)
movl $0x1, -0x9cc(%rbp)
movl $0x2, -0x9c0(%rbp)
leaq -0xa38(%rbp), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x1090
leaq -0xa38(%rbp), %rdi
callq 0x1d4c0
leaq -0x948(%rbp), %rdi
leaq -0xa38(%rbp), %rsi
callq 0x35c10
movl %eax, -0xa3c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa48(%rbp)
leaq -0x9e8(%rbp), %rdi
leaq -0xa38(%rbp), %rsi
callq 0x23b60
movq -0xa48(%rbp), %rdi
movl %eax, %edx
movl -0xa3c(%rbp), %ecx
leaq -0x948(%rbp), %rsi
leaq 0x2ff14(%rip), %r8      # 0x4061c
callq 0x13a0
movl %eax, -0xa3c(%rbp)
leaq -0x948(%rbp), %rdi
leaq -0xa38(%rbp), %rsi
callq 0x1f4e0
leaq -0x948(%rbp), %rdi
callq 0x1cab0
movl -0xa3c(%rbp), %eax
addq $0xa50, %rsp            # imm = 0xA50
popq %rbp
retq
nopw %cs:(%rax,%rax)