// File: /workspace/github_c_makefile_star2_O0/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_decode_credential_value
int
kmip_decode_credential_value(KMIP *ctx, enum credential_type type, void **value)
{
    int result = 0;
    
    switch(type)
    {
        case KMIP_CRED_USERNAME_AND_PASSWORD:
        *value = ctx->calloc_func(ctx->state, 1, sizeof(UsernamePasswordCredential));
        CHECK_NEW_MEMORY(ctx, *value, sizeof(UsernamePasswordCredential), "UsernamePasswordCredential structure");
        result = kmip_decode_username_password_credential(ctx, (UsernamePasswordCredential *)*value);
        break;
        
        case KMIP_CRED_DEVICE:
        *value = ctx->calloc_func(ctx->state, 1, sizeof(DeviceCredential));
        CHECK_NEW_MEMORY(ctx, *value, sizeof(DeviceCredential), "DeviceCredential structure");
        result = kmip_decode_device_credential(ctx, (DeviceCredential *)*value);
        break;
        
        case KMIP_CRED_ATTESTATION:
        *value = ctx->calloc_func(ctx->state, 1, sizeof(AttestationCredential));
        CHECK_NEW_MEMORY(ctx, *value, sizeof(AttestationCredential), "AttestationCredential structure");
        result = kmip_decode_attestation_credential(ctx, (AttestationCredential*)*value);
        break;
        
        default:
        kmip_push_error_frame(ctx, __func__, __LINE__);
        return(KMIP_NOT_IMPLEMENTED);
        break;
    }
    CHECK_RESULT(ctx, result);
    
    return(KMIP_OK);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x28(%rbp)
subl $0x1, %eax
je 0x211c6
jmp 0x211a7
movl -0x28(%rbp), %eax
subl $0x2, %eax
je 0x2124c
jmp 0x211b5
movl -0x28(%rbp), %eax
subl $0x3, %eax
je 0x212d2
jmp 0x21352
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *%rax
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x21232
movq -0x10(%rbp), %rdi
movl $0x10, %esi
leaq 0x4d6f(%rip), %rdx      # 0x25f7b
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x4d84(%rip), %rsi      # 0x25fa0
movl $0x29d3, %edx           # imm = 0x29D3
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x2139e
jmp 0x21234
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
callq 0x6760
movl %eax, -0x24(%rbp)
jmp 0x21370
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movl $0x1, %esi
movl $0x30, %edx
callq *%rax
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x212b8
movq -0x10(%rbp), %rdi
movl $0x30, %esi
leaq 0x4d2b(%rip), %rdx      # 0x25fbd
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x4cfe(%rip), %rsi      # 0x25fa0
movl $0x29d9, %edx           # imm = 0x29D9
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x2139e
jmp 0x212ba
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
callq 0x67a0
movl %eax, -0x24(%rbp)
jmp 0x21370
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movl $0x1, %esi
movl $0x20, %edx
callq *%rax
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2133b
movq -0x10(%rbp), %rdi
movl $0x20, %esi
leaq 0x4cc0(%rip), %rdx      # 0x25fd8
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x4c78(%rip), %rsi      # 0x25fa0
movl $0x29df, %edx           # imm = 0x29DF
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x2139e
jmp 0x2133d
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
callq 0x6810
movl %eax, -0x24(%rbp)
jmp 0x21370
movq -0x10(%rbp), %rdi
leaq 0x4c43(%rip), %rsi      # 0x25fa0
movl $0x29e4, %edx           # imm = 0x29E4
callq 0x6f20
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2139e
jmp 0x21372
cmpl $0x0, -0x24(%rbp)
je 0x21395
movq -0x10(%rbp), %rdi
leaq 0x4c1d(%rip), %rsi      # 0x25fa0
movl $0x29e8, %edx           # imm = 0x29E8
callq 0x6f20
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2139e
jmp 0x21397
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)