// File: /workspace/github_c_makefile_star2_O0/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_decode_credential
int
kmip_decode_credential(KMIP *ctx, Credential *value)
{
    CHECK_BUFFER_FULL(ctx, 8);
    
    int result = 0;
    int32 tag_type = 0;
    uint32 length = 0;
    
    kmip_decode_int32_be(ctx, &tag_type);
    CHECK_TAG_TYPE(ctx, tag_type, KMIP_TAG_CREDENTIAL, KMIP_TYPE_STRUCTURE);
    
    kmip_decode_length(ctx, &length);
    CHECK_BUFFER_FULL(ctx, length);
    
    result = kmip_decode_enum(ctx, KMIP_TAG_CREDENTIAL_TYPE, &value->credential_type);
    CHECK_RESULT(ctx, result);
    CHECK_ENUM(ctx, KMIP_TAG_CREDENTIAL_TYPE, value->credential_type);
    
    result = kmip_decode_credential_value(ctx, value->credential_type, &value->credential_value);
    CHECK_RESULT(ctx, result);
    
    return(KMIP_OK);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
subq %rdx, %rcx
subq %rcx, %rax
cmpq $0x8, %rax
jae 0x21404
movq -0x10(%rbp), %rdi
leaq 0x4c0a(%rip), %rsi      # 0x25ff8
movl $0x29f0, %edx           # imm = 0x29F0
callq 0x6f20
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x215b8
jmp 0x21406
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x6b10
movl -0x20(%rbp), %eax
sarl $0x8, %eax
cmpl $0x420023, %eax         # imm = 0x420023
je 0x21456
movq -0x10(%rbp), %rdi
leaq 0x4bb8(%rip), %rsi      # 0x25ff8
movl $0x29f7, %edx           # imm = 0x29F7
callq 0x6f20
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
jmp 0x215b8
movl -0x20(%rbp), %eax
andl $0xff, %eax
cmpl $0x1, %eax
je 0x21484
movq -0x10(%rbp), %rdi
leaq 0x4b8a(%rip), %rsi      # 0x25ff8
movl $0x29f7, %edx           # imm = 0x29F7
callq 0x6f20
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
jmp 0x215b8
jmp 0x21486
jmp 0x21488
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x6520
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
subq %rdx, %rcx
subq %rcx, %rax
movl -0x24(%rbp), %ecx
cmpq %rcx, %rax
jae 0x214db
movq -0x10(%rbp), %rdi
leaq 0x4b33(%rip), %rsi      # 0x25ff8
movl $0x29fa, %edx           # imm = 0x29FA
callq 0x6f20
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x215b8
jmp 0x214dd
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x420024, %esi         # imm = 0x420024
callq 0x6c00
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x21518
movq -0x10(%rbp), %rdi
leaq 0x4af5(%rip), %rsi      # 0x25ff8
movl $0x29fd, %edx           # imm = 0x29FD
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x215b8
jmp 0x2151a
jmp 0x2151c
movq -0x10(%rbp), %rax
movl 0x18(%rax), %edi
movq -0x18(%rbp), %rax
movl (%rax), %edx
movl $0x420024, %esi         # imm = 0x420024
callq 0x63a0
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x21570
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %edx
movl -0x28(%rbp), %ecx
movl $0x420024, %esi         # imm = 0x420024
callq 0x6140
movq -0x10(%rbp), %rdi
leaq 0x4a9a(%rip), %rsi      # 0x25ff8
movl $0x29fe, %edx           # imm = 0x29FE
callq 0x6f20
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x215b8
jmp 0x21572
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %esi
movq -0x18(%rbp), %rdx
addq $0x8, %rdx
callq 0x6c50
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x215af
movq -0x10(%rbp), %rdi
leaq 0x4a5b(%rip), %rsi      # 0x25ff8
movl $0x2a01, %edx           # imm = 0x2A01
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x215b8
jmp 0x215b1
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)