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

    uint8 expected[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
    };
    
    uint8 observed[144] = {0};
    struct kmip ctx = {0};
    kmip_init(&ctx, observed, ARRAY_LENGTH(observed), 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 dc = {0};
    dc.device_serial_number = &dsn;
    dc.password = &p;
    dc.device_identifier = &di;
    dc.network_identifier = &ni;
    dc.machine_identifier = &mac;
    dc.media_identifier = &med;
    
    int result = kmip_encode_device_credential(&ctx, &dc);
    result = report_encoding_test_result(
        tracker,
        &ctx,
        expected,
        observed,
        result,
        __func__);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa60, %rsp            # imm = 0xA60
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0xa0(%rbp), %rdi
leaq 0x30105(%rip), %rsi     # 0x45a70
movl $0x90, %edx
callq 0x10c0
leaq -0x130(%rbp), %rdi
xorl %esi, %esi
movl $0x90, %edx
callq 0x1090
leaq -0x9c8(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0x130(%rbp), %rsi
leaq -0x9c8(%rbp), %rdi
movl $0x90, %edx
movl $0x1, %ecx
callq 0x1c6e0
leaq -0x9d8(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2b4af(%rip), %rax     # 0x40e81
movq %rax, -0x9d8(%rbp)
movq $0xc, -0x9d0(%rbp)
leaq -0x9e8(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2b490(%rip), %rax     # 0x40e8e
movq %rax, -0x9e8(%rbp)
movq $0x6, -0x9e0(%rbp)
leaq -0x9f8(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2b46b(%rip), %rax     # 0x40e95
movq %rax, -0x9f8(%rbp)
movq $0x9, -0x9f0(%rbp)
leaq -0xa08(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2b449(%rip), %rax     # 0x40e9f
movq %rax, -0xa08(%rbp)
movq $0x9, -0xa00(%rbp)
leaq -0xa18(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2b427(%rip), %rax     # 0x40ea9
movq %rax, -0xa18(%rbp)
movq $0xa, -0xa10(%rbp)
leaq -0xa28(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x2b406(%rip), %rax     # 0x40eb4
movq %rax, -0xa28(%rbp)
movq $0xa, -0xa20(%rbp)
leaq -0xa58(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x1090
leaq -0x9d8(%rbp), %rax
movq %rax, -0xa58(%rbp)
leaq -0x9e8(%rbp), %rax
movq %rax, -0xa50(%rbp)
leaq -0x9f8(%rbp), %rax
movq %rax, -0xa48(%rbp)
leaq -0xa08(%rbp), %rax
movq %rax, -0xa40(%rbp)
leaq -0xa18(%rbp), %rax
movq %rax, -0xa38(%rbp)
leaq -0xa28(%rbp), %rax
movq %rax, -0xa30(%rbp)
leaq -0x9c8(%rbp), %rdi
leaq -0xa58(%rbp), %rsi
callq 0x290a0
movl %eax, -0xa5c(%rbp)
movq -0x8(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
leaq -0x130(%rbp), %rcx
movl -0xa5c(%rbp), %r8d
leaq -0x9c8(%rbp), %rsi
leaq 0x2b358(%rip), %r9      # 0x40ebf
callq 0x11f0
movl %eax, -0xa5c(%rbp)
leaq -0x9c8(%rbp), %rdi
callq 0x1cab0
movl -0xa5c(%rbp), %eax
addq $0xa60, %rsp            # imm = 0xA60
popq %rbp
retq
nopl (%rax)