// File: /workspace/github_c_makefile_star2_O0/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_decode_name
int
kmip_decode_name(KMIP *ctx, Name *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_NAME, KMIP_TYPE_STRUCTURE);
    
    kmip_decode_length(ctx, &length);
    CHECK_BUFFER_FULL(ctx, length);
    
    value->value = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
    
    result = kmip_decode_text_string(ctx, KMIP_TAG_NAME_VALUE, value->value);
    CHECK_RESULT(ctx, result);
    
    result = kmip_decode_enum(ctx, KMIP_TAG_NAME_TYPE, (int32*)&value->type);
    CHECK_RESULT(ctx, result);
    CHECK_ENUM(ctx, KMIP_TAG_NAME_TYPE, value->type);
    
    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 0x17804
movq -0x10(%rbp), %rdi
leaq 0xdbca(%rip), %rsi      # 0x253b8
movl $0x2212, %edx           # imm = 0x2212
callq 0x6f20
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x179e8
jmp 0x17806
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 $0x420053, %eax         # imm = 0x420053
je 0x17856
movq -0x10(%rbp), %rdi
leaq 0xdb78(%rip), %rsi      # 0x253b8
movl $0x2219, %edx           # imm = 0x2219
callq 0x6f20
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
jmp 0x179e8
movl -0x20(%rbp), %eax
andl $0xff, %eax
cmpl $0x1, %eax
je 0x17884
movq -0x10(%rbp), %rdi
leaq 0xdb4a(%rip), %rsi      # 0x253b8
movl $0x2219, %edx           # imm = 0x2219
callq 0x6f20
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
jmp 0x179e8
jmp 0x17886
jmp 0x17888
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 0x178db
movq -0x10(%rbp), %rdi
leaq 0xdaf3(%rip), %rsi      # 0x253b8
movl $0x221c, %edx           # imm = 0x221C
callq 0x6f20
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x179e8
jmp 0x178dd
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 -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movl $0x420055, %esi         # imm = 0x420055
callq 0x65b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x17947
movq -0x10(%rbp), %rdi
leaq 0xda86(%rip), %rsi      # 0x253b8
movl $0x2221, %edx           # imm = 0x2221
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x179e8
jmp 0x17949
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
addq $0x8, %rdx
movl $0x420054, %esi         # imm = 0x420054
callq 0x6c00
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x17985
movq -0x10(%rbp), %rdi
leaq 0xda45(%rip), %rsi      # 0x253b8
movl $0x2224, %edx           # imm = 0x2224
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x179e8
jmp 0x17987
jmp 0x17989
movq -0x10(%rbp), %rax
movl 0x18(%rax), %edi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
movl $0x420054, %esi         # imm = 0x420054
callq 0x63a0
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x179df
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
movl -0x28(%rbp), %ecx
movl $0x420054, %esi         # imm = 0x420054
callq 0x6140
movq -0x10(%rbp), %rdi
leaq 0xd9eb(%rip), %rsi      # 0x253b8
movl $0x2225, %edx           # imm = 0x2225
callq 0x6f20
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x179e8
jmp 0x179e1
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)