// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x960, %rsp            # imm = 0x960
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0x60(%rbp), %rdi
leaq 0x34b78(%rip), %rsi     # 0x44c80
movl $0x50, %edx
callq 0x10c0
leaq -0x8f8(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0x60(%rbp), %rsi
leaq -0x8f8(%rbp), %rdi
movl $0x50, %edx
xorl %ecx, %ecx
callq 0x1c6e0
leaq -0x908(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x30363(%rip), %rax     # 0x404b9
movq %rax, -0x908(%rbp)
movq $0x4, -0x900(%rbp)
leaq -0x918(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x3033c(%rip), %rax     # 0x404be
movq %rax, -0x918(%rbp)
movq $0x9, -0x910(%rbp)
leaq -0x928(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x908(%rbp), %rax
movq %rax, -0x928(%rbp)
leaq -0x918(%rbp), %rax
movq %rax, -0x920(%rbp)
leaq -0x938(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
movl $0x1, -0x938(%rbp)
leaq -0x928(%rbp), %rax
movq %rax, -0x930(%rbp)
leaq -0x940(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
leaq -0x938(%rbp), %rax
movq %rax, -0x940(%rbp)
leaq -0x948(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x1090
leaq -0x8f8(%rbp), %rdi
leaq -0x948(%rbp), %rsi
callq 0x35a30
movl %eax, -0x94c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x958(%rbp)
leaq -0x940(%rbp), %rdi
leaq -0x948(%rbp), %rsi
callq 0x23ac0
movq -0x958(%rbp), %rdi
movl %eax, %edx
movl -0x94c(%rbp), %ecx
leaq -0x8f8(%rbp), %rsi
leaq 0x30353(%rip), %r8      # 0x405c9
callq 0x13a0
movl %eax, -0x94c(%rbp)
leaq -0x8f8(%rbp), %rdi
leaq -0x948(%rbp), %rsi
callq 0x1f470
leaq -0x8f8(%rbp), %rdi
callq 0x1cab0
movl -0x94c(%rbp), %eax
addq $0x960, %rsp            # imm = 0x960
popq %rbp
retq
nop