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

    uint8 encoding[144] = {
        0x42, 0x00, 0x25, 0x01, 0x00, 0x00, 0x00, 0x88, 
        0x42, 0x00, 0xB0, 0x07, 0x00, 0x00, 0x00, 0x0C, 
        0x73, 0x65, 0x72, 0x4E, 0x75, 0x6D, 0x31, 0x32, 
        0x33, 0x34, 0x35, 0x36, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0xA1, 0x07, 0x00, 0x00, 0x00, 0x06, 
        0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x00, 0x00, 
        0x42, 0x00, 0xA2, 0x07, 0x00, 0x00, 0x00, 0x09, 
        0x64, 0x65, 0x76, 0x49, 0x44, 0x32, 0x32, 0x33, 
        0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0xAB, 0x07, 0x00, 0x00, 0x00, 0x09, 
        0x6E, 0x65, 0x74, 0x49, 0x44, 0x39, 0x30, 0x30, 
        0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0xA9, 0x07, 0x00, 0x00, 0x00, 0x0A, 
        0x6D, 0x61, 0x63, 0x68, 0x69, 0x6E, 0x65, 0x49, 
        0x44, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0xAA, 0x07, 0x00, 0x00, 0x00, 0x0A, 
        0x6D, 0x65, 0x64, 0x69, 0x61, 0x49, 0x44, 0x33, 
        0x31, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    };
    
    struct kmip ctx = {0};
    kmip_init(&ctx, encoding, ARRAY_LENGTH(encoding), KMIP_1_1);
    
    struct text_string dsn = {0};
    dsn.value = "serNum123456";
    dsn.size = 12;
    
    struct text_string p = {0};
    p.value = "secret";
    p.size = 6;
    
    struct text_string di = {0};
    di.value = "devID2233";
    di.size = 9;
    
    struct text_string ni = {0};
    ni.value = "netID9000";
    ni.size = 9;
    
    struct text_string mac = {0};
    mac.value = "machineID1";
    mac.size = 10;
    
    struct text_string med = {0};
    med.value = "mediaID313";
    med.size = 10;
    
    struct device_credential expected = {0};
    expected.device_serial_number = &dsn;
    expected.password = &p;
    expected.device_identifier = &di;
    expected.network_identifier = &ni;
    expected.machine_identifier = &mac;
    expected.media_identifier = &med;
    
    struct device_credential observed = {0};
    
    int result = kmip_decode_device_credential(&ctx, &observed);
    result = report_decoding_test_result(
        tracker,
        &ctx,
        kmip_compare_device_credential(&expected, &observed),
        result,
        __func__);
    kmip_free_device_credential(&ctx, &observed);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x9f0, %rsp            # imm = 0x9F0
movq %rdi, %rbx
incw (%rdi)
leaq 0x249f7(%rip), %rsi     # 0x33b70
leaq 0xc0(%rsp), %r15
movl $0x90, %edx
movq %r15, %rdi
callq 0x1100
leaq 0x158(%rsp), %r14
movl $0x898, %edx            # imm = 0x898
movq %r14, %rdi
xorl %esi, %esi
callq 0x10c0
movl $0x90, %edx
movq %r14, %rdi
movq %r15, %rsi
movl $0x1, %ecx
callq 0x13747
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rax
movaps %xmm0, (%rax)
leaq 0x21d6d(%rip), %rcx     # 0x30f39
movq %rcx, (%rax)
movq $0xc, 0x8(%rax)
leaq 0x40(%rsp), %rcx
movaps %xmm0, (%rcx)
leaq 0x21d60(%rip), %rdx     # 0x30f46
movq %rdx, (%rcx)
movq $0x6, 0x8(%rcx)
leaq 0x30(%rsp), %rdx
movaps %xmm0, (%rdx)
leaq 0x21d4d(%rip), %rsi     # 0x30f4d
movq %rsi, (%rdx)
movl $0x9, %esi
movq %rsi, 0x8(%rdx)
leaq 0x20(%rsp), %rdi
movaps %xmm0, (%rdi)
leaq 0x21d3c(%rip), %r8      # 0x30f57
movq %r8, (%rdi)
movq %rsi, 0x8(%rdi)
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x21d30(%rip), %r8      # 0x30f61
movq %r8, (%rsi)
movl $0xa, %r8d
movq %r8, 0x8(%rsi)
movq %rsp, %r9
movaps %xmm0, (%r9)
leaq 0x21d20(%rip), %r10     # 0x30f6c
movq %r10, (%r9)
movq %r8, 0x8(%r9)
leaq 0x90(%rsp), %r15
movaps %xmm0, (%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, 0x20(%r15)
movq %rax, (%r15)
movq %rcx, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rdi, 0x18(%r15)
movq %rsi, 0x20(%r15)
movq %r9, 0x28(%r15)
leaq 0x60(%rsp), %r12
movaps %xmm0, 0x20(%r12)
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x26887
movl %eax, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0x17507
leaq 0x21ce0(%rip), %r8      # 0x30f95
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
movl %ebp, %ecx
callq 0x1397
movl %eax, %ebx
movq %r14, %rdi
movq %r12, %rsi
callq 0x15081
movq %r14, %rdi
callq 0x13a23
movl %ebx, %eax
addq $0x9f0, %rsp            # imm = 0x9F0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq