// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xa10, %rsp            # imm = 0xA10
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0xa0(%rbp), %rdi
leaq 0x2ff45(%rip), %rsi     # 0x45b00
movl $0x90, %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 $0x90, %edx
movl $0x1, %ecx
callq 0x1c6e0
leaq -0x948(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2b272(%rip), %rax     # 0x40e81
movq %rax, -0x948(%rbp)
movq $0xc, -0x940(%rbp)
leaq -0x958(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2b253(%rip), %rax     # 0x40e8e
movq %rax, -0x958(%rbp)
movq $0x6, -0x950(%rbp)
leaq -0x968(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2b22e(%rip), %rax     # 0x40e95
movq %rax, -0x968(%rbp)
movq $0x9, -0x960(%rbp)
leaq -0x978(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2b20c(%rip), %rax     # 0x40e9f
movq %rax, -0x978(%rbp)
movq $0x9, -0x970(%rbp)
leaq -0x988(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2b1ea(%rip), %rax     # 0x40ea9
movq %rax, -0x988(%rbp)
movq $0xa, -0x980(%rbp)
leaq -0x998(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2b1c9(%rip), %rax     # 0x40eb4
movq %rax, -0x998(%rbp)
movq $0xa, -0x990(%rbp)
leaq -0x9c8(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x1090
leaq -0x948(%rbp), %rax
movq %rax, -0x9c8(%rbp)
leaq -0x958(%rbp), %rax
movq %rax, -0x9c0(%rbp)
leaq -0x968(%rbp), %rax
movq %rax, -0x9b8(%rbp)
leaq -0x978(%rbp), %rax
movq %rax, -0x9b0(%rbp)
leaq -0x988(%rbp), %rax
movq %rax, -0x9a8(%rbp)
leaq -0x998(%rbp), %rax
movq %rax, -0x9a0(%rbp)
leaq -0x9f8(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x1090
leaq -0x938(%rbp), %rdi
leaq -0x9f8(%rbp), %rsi
callq 0x34bd0
movl %eax, -0x9fc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa08(%rbp)
leaq -0x9c8(%rbp), %rdi
leaq -0x9f8(%rbp), %rsi
callq 0x23500
movq -0xa08(%rbp), %rdi
movl %eax, %edx
movl -0x9fc(%rbp), %ecx
leaq -0x938(%rbp), %rsi
leaq 0x2b112(%rip), %r8      # 0x40edd
callq 0x13a0
movl %eax, -0x9fc(%rbp)
leaq -0x938(%rbp), %rdi
leaq -0x9f8(%rbp), %rsi
callq 0x1f080
leaq -0x938(%rbp), %rdi
callq 0x1cab0
movl -0x9fc(%rbp), %eax
addq $0xa10, %rsp            # imm = 0xA10
popq %rbp
retq
nopw %cs:(%rax,%rax)