// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x9c0, %rsp            # imm = 0x9C0
movq %rdi, %rbx
incw (%rdi)
leaq 0x90(%rsp), %r14
movl $0x90, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x10c0
leaq 0x128(%rsp), %r15
movl $0x898, %edx            # imm = 0x898
movq %r15, %rdi
xorl %esi, %esi
callq 0x10c0
movl $0x90, %edx
movq %r15, %rdi
movq %r14, %rsi
movl $0x1, %ecx
callq 0x13177
leaq 0x20264(%rip), %rax     # 0x2ef39
leaq 0x50(%rsp), %rcx
movq %rax, (%rcx)
movq $0xc, 0x8(%rcx)
leaq 0x2025a(%rip), %rax     # 0x2ef46
leaq 0x40(%rsp), %rdx
movq %rax, (%rdx)
movq $0x6, 0x8(%rdx)
leaq 0x2024a(%rip), %rax     # 0x2ef4d
leaq 0x30(%rsp), %rdi
movq %rax, (%rdi)
movl $0x9, %eax
movq %rax, 0x8(%rdi)
leaq 0x2023c(%rip), %rsi     # 0x2ef57
leaq 0x20(%rsp), %r8
movq %rsi, (%r8)
movq %rax, 0x8(%r8)
leaq 0x20233(%rip), %rax     # 0x2ef61
leaq 0x10(%rsp), %r9
movq %rax, (%r9)
movl $0xa, %eax
movq %rax, 0x8(%r9)
leaq 0x20226(%rip), %rsi     # 0x2ef6c
movq %rsp, %r10
movq %rsi, (%r10)
movq %rax, 0x8(%r10)
leaq 0x60(%rsp), %rsi
movq %rcx, (%rsi)
movq %rdx, 0x8(%rsi)
movq %rdi, 0x10(%rsi)
movq %r8, 0x18(%rsi)
movq %r9, 0x20(%rsi)
movq %r10, 0x28(%rsi)
movq %r15, %rdi
callq 0x1a5d8
leaq 0x22de5(%rip), %rdx     # 0x31b60
leaq 0x201f5(%rip), %r9      # 0x2ef77
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
movl %eax, %r8d
callq 0x123c
movl %eax, %ebx
movq %r15, %rdi
callq 0x13455
movl %ebx, %eax
addq $0x9c0, %rsp            # imm = 0x9C0
popq %rbx
popq %r14
popq %r15
retq