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

    uint8 encoding[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
    };
    
    struct kmip ctx = {0};
    kmip_init(&ctx, encoding, ARRAY_LENGTH(encoding), 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 expected = {0};
    expected.credential = &c;
    
    struct authentication observed = {0};
    
    int result = kmip_decode_authentication(&ctx, &observed);
    result = report_decoding_test_result(
        tracker,
        &ctx,
        kmip_compare_authentication(&expected, &observed),
        result,
        __func__);
    kmip_free_authentication(&ctx, &observed);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x940, %rsp            # imm = 0x940
movq %rdi, %r14
incw (%rdi)
leaq 0x28095(%rip), %rsi     # 0x33480
leaq 0x50(%rsp), %r15
movl $0xa, %ecx
movq %r15, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xa8(%rsp), %rbx
movl $0x898, %edx            # imm = 0x898
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10c0
movl $0x50, %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x13747
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rax
movaps %xmm0, (%rax)
leaq 0x2513b(%rip), %rcx     # 0x30571
movq %rcx, (%rax)
movq $0x4, 0x8(%rax)
leaq 0x30(%rsp), %rcx
movaps %xmm0, (%rcx)
leaq 0x25126(%rip), %rdx     # 0x30576
movq %rdx, (%rcx)
movq $0x9, 0x8(%rcx)
leaq 0x20(%rsp), %rdx
movaps %xmm0, (%rdx)
movq %rax, (%rdx)
movq %rcx, 0x8(%rdx)
leaq 0x10(%rsp), %rax
movaps %xmm0, (%rax)
movl $0x1, (%rax)
movq %rdx, 0x8(%rax)
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movq %rsp, %r12
movq $0x0, (%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2773e
movl %eax, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0x177a7
leaq 0x251d3(%rip), %r8      # 0x30681
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
movl %ebp, %ecx
callq 0x1397
movl %eax, %ebp
movq %rbx, %rdi
movq %r12, %rsi
callq 0x15322
movq %rbx, %rdi
callq 0x13a23
movl %ebp, %eax
addq $0x940, %rsp            # imm = 0x940
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq