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

    uint8 encoding[64] = {
        0x42, 0x00, 0x23, 0x01, 0x00, 0x00, 0x00, 0x38, 
        0x42, 0x00, 0x24, 0x05, 0x00, 0x00, 0x00, 0x04, 
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 
        0x42, 0x00, 0x25, 0x01, 0x00, 0x00, 0x00, 0x20, 
        0x42, 0x00, 0x99, 0x07, 0x00, 0x00, 0x00, 0x06, 
        0x42, 0x61, 0x72, 0x6E, 0x65, 0x79, 0x00, 0x00, 
        0x42, 0x00, 0xA1, 0x07, 0x00, 0x00, 0x00, 0x07, 
        0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x32, 0x00
    };
    
    struct kmip ctx = {0};
    kmip_init(&ctx, encoding, ARRAY_LENGTH(encoding), KMIP_1_0);
    
    struct text_string username = {0};
    username.value = "Barney";
    username.size = 6;
    struct text_string password = {0};
    password.value = "secret2";
    password.size = 7;
    
    struct username_password_credential upc = {0};
    upc.username = &username;
    upc.password = &password;
    
    struct credential expected = {0};
    expected.credential_type = KMIP_CRED_USERNAME_AND_PASSWORD;
    expected.credential_value = &upc;

    struct credential observed = {0};
    
    int result = kmip_decode_credential(&ctx, &observed);
    result = report_decoding_test_result(
        tracker,
        &ctx,
        kmip_compare_credential(&expected, &observed),
        result,
        __func__);
    kmip_free_credential(&ctx, &observed);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x950, %rsp            # imm = 0x950
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0x50(%rbp), %rdi
leaq 0x34e48(%rip), %rsi     # 0x44bf0
movl $0x40, %edx
callq 0x10c0
leaq -0x8e8(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0x50(%rbp), %rsi
leaq -0x8e8(%rbp), %rdi
movl $0x40, %edx
xorl %ecx, %ecx
callq 0x1c6e0
leaq -0x8f8(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x30724(%rip), %rax     # 0x4051a
movq %rax, -0x8f8(%rbp)
movq $0x6, -0x8f0(%rbp)
leaq -0x908(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq 0x306ff(%rip), %rax     # 0x40521
movq %rax, -0x908(%rbp)
movq $0x7, -0x900(%rbp)
leaq -0x918(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x8f8(%rbp), %rax
movq %rax, -0x918(%rbp)
leaq -0x908(%rbp), %rax
movq %rax, -0x910(%rbp)
leaq -0x928(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
movl $0x1, -0x928(%rbp)
leaq -0x918(%rbp), %rax
movq %rax, -0x920(%rbp)
leaq -0x938(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x8e8(%rbp), %rdi
leaq -0x938(%rbp), %rsi
callq 0x35810
movl %eax, -0x93c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x948(%rbp)
leaq -0x928(%rbp), %rdi
leaq -0x938(%rbp), %rsi
callq 0x23a00
movq -0x948(%rbp), %rdi
movl %eax, %edx
movl -0x93c(%rbp), %ecx
leaq -0x8e8(%rbp), %rsi
leaq 0x30668(%rip), %r8      # 0x4055d
callq 0x13a0
movl %eax, -0x93c(%rbp)
leaq -0x8e8(%rbp), %rdi
leaq -0x938(%rbp), %rsi
callq 0x1f410
leaq -0x8e8(%rbp), %rdi
callq 0x1cab0
movl -0x93c(%rbp), %eax
addq $0x950, %rsp            # imm = 0x950
popq %rbp
retq
nop