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

    uint8 expected[80] = {
        0x42, 0x00, 0x0C, 0x01, 0x00, 0x00, 0x00, 0x48, 
        0x42, 0x00, 0x23, 0x01, 0x00, 0x00, 0x00, 0x40, 
        0x42, 0x00, 0x24, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x25, 0x01, 0x00, 0x00, 0x00, 0x28, 
        0x42, 0x00, 0x99, 0x07, 0x00, 0x00, 0x00, 0x04, 
        0x46, 0x72, 0x65, 0x64, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0xA1, 0x07, 0x00, 0x00, 0x00, 0x09, 
        0x70, 0x61, 0x73, 0x73, 0x77, 0x6F, 0x72, 0x64, 
        0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    };
    
    uint8 observed[80] = {0};
    struct kmip ctx = {0};
    kmip_init(&ctx, observed, ARRAY_LENGTH(observed), KMIP_1_0);
    
    struct text_string username = {0};
    username.value = "Fred";
    username.size = 4;
    struct text_string password = {0};
    password.value = "password1";
    password.size = 9;
    
    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;
    
    int result = kmip_encode_authentication(&ctx, &a);
    result = report_encoding_test_result(
        tracker,
        &ctx,
        expected,
        observed,
        result,
        __func__);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x9a0, %rsp            # imm = 0x9A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0x60(%rbp), %rdi
leaq 0x34cd8(%rip), %rsi     # 0x44c30
movl $0x50, %edx
callq 0x10c0
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x1090
leaq -0x948(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0xb0(%rbp), %rsi
leaq -0x948(%rbp), %rdi
movl $0x50, %edx
xorl %ecx, %ecx
callq 0x1c6e0
leaq -0x958(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x304fd(%rip), %rax     # 0x404b9
movq %rax, -0x958(%rbp)
movq $0x4, -0x950(%rbp)
leaq -0x968(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x304d6(%rip), %rax     # 0x404be
movq %rax, -0x968(%rbp)
movq $0x9, -0x960(%rbp)
leaq -0x978(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x958(%rbp), %rax
movq %rax, -0x978(%rbp)
leaq -0x968(%rbp), %rax
movq %rax, -0x970(%rbp)
leaq -0x988(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
movl $0x1, -0x988(%rbp)
leaq -0x978(%rbp), %rax
movq %rax, -0x980(%rbp)
leaq -0x990(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
leaq -0x988(%rbp), %rax
movq %rax, -0x990(%rbp)
leaq -0x948(%rbp), %rdi
leaq -0x990(%rbp), %rsi
callq 0x29780
movl %eax, -0x994(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x60(%rbp), %rdx
leaq -0xb0(%rbp), %rcx
movl -0x994(%rbp), %r8d
leaq -0x948(%rbp), %rsi
leaq 0x304df(%rip), %r9      # 0x40591
callq 0x11f0
movl %eax, -0x994(%rbp)
leaq -0x948(%rbp), %rdi
callq 0x1cab0
movl -0x994(%rbp), %eax
addq $0x9a0, %rsp            # imm = 0x9A0
popq %rbp
retq
nopl (%rax,%rax)