// File: /workspace/github_c_makefile_star2_O0/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_decode_device_credential
int
kmip_decode_device_credential(KMIP *ctx, DeviceCredential *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_VALUE, KMIP_TYPE_STRUCTURE);
    
    kmip_decode_length(ctx, &length);
    CHECK_BUFFER_FULL(ctx, length);
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_DEVICE_SERIAL_NUMBER))
    {
        value->device_serial_number = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
        CHECK_NEW_MEMORY(ctx, value->device_serial_number, sizeof(TextString), "DeviceSerialNumber text string");
        
        result = kmip_decode_text_string(ctx, KMIP_TAG_DEVICE_SERIAL_NUMBER, value->device_serial_number);
        CHECK_RESULT(ctx, result);
    }
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_PASSWORD))
    {
        value->password = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
        CHECK_NEW_MEMORY(ctx, value->password, sizeof(TextString), "Password text string");
        
        result = kmip_decode_text_string(ctx, KMIP_TAG_PASSWORD, value->password);
        CHECK_RESULT(ctx, result);
    }
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_DEVICE_IDENTIFIER))
    {
        value->device_identifier = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
        CHECK_NEW_MEMORY(ctx, value->device_identifier, sizeof(TextString), "DeviceIdentifier text string");
        
        result = kmip_decode_text_string(ctx, KMIP_TAG_DEVICE_IDENTIFIER, value->device_identifier);
        CHECK_RESULT(ctx, result);
    }
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_NETWORK_IDENTIFIER))
    {
        value->network_identifier = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
        CHECK_NEW_MEMORY(ctx, value->network_identifier, sizeof(TextString), "NetworkIdentifier text string");
        
        result = kmip_decode_text_string(ctx, KMIP_TAG_NETWORK_IDENTIFIER, value->network_identifier);
        CHECK_RESULT(ctx, result);
    }
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_MACHINE_IDENTIFIER))
    {
        value->machine_identifier = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
        CHECK_NEW_MEMORY(ctx, value->machine_identifier, sizeof(TextString), "MachineIdentifier text string");
        
        result = kmip_decode_text_string(ctx, KMIP_TAG_MACHINE_IDENTIFIER, value->machine_identifier);
        CHECK_RESULT(ctx, result);
    }
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_MEDIA_IDENTIFIER))
    {
        value->media_identifier = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
        CHECK_NEW_MEMORY(ctx, value->media_identifier, sizeof(TextString), "MediaIdentifier text string");
        
        result = kmip_decode_text_string(ctx, KMIP_TAG_MEDIA_IDENTIFIER, value->media_identifier);
        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 0x207c4
movq -0x10(%rbp), %rdi
leaq 0x56a4(%rip), %rsi      # 0x25e52
movl $0x2957, %edx           # imm = 0x2957
callq 0x6f20
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x20d57
jmp 0x207c6
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 $0x420025, %eax         # imm = 0x420025
je 0x20816
movq -0x10(%rbp), %rdi
leaq 0x5652(%rip), %rsi      # 0x25e52
movl $0x295e, %edx           # imm = 0x295E
callq 0x6f20
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
jmp 0x20d57
movl -0x20(%rbp), %eax
andl $0xff, %eax
cmpl $0x1, %eax
je 0x20844
movq -0x10(%rbp), %rdi
leaq 0x5624(%rip), %rsi      # 0x25e52
movl $0x295e, %edx           # imm = 0x295E
callq 0x6f20
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
jmp 0x20d57
jmp 0x20846
jmp 0x20848
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 0x2089b
movq -0x10(%rbp), %rdi
leaq 0x55cd(%rip), %rsi      # 0x25e52
movl $0x2961, %edx           # imm = 0x2961
callq 0x6f20
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x20d57
jmp 0x2089d
movq -0x10(%rbp), %rdi
movl $0x4200b0, %esi         # imm = 0x4200B0
callq 0x6300
cmpl $0x0, %eax
je 0x20964
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 -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x20920
movq -0x10(%rbp), %rdi
movl $0x10, %esi
leaq 0x5576(%rip), %rdx      # 0x25e70
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x5548(%rip), %rsi      # 0x25e52
movl $0x2966, %edx           # imm = 0x2966
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x20d57
jmp 0x20922
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movl $0x4200b0, %esi         # imm = 0x4200B0
callq 0x65b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x20960
movq -0x10(%rbp), %rdi
leaq 0x5507(%rip), %rsi      # 0x25e52
movl $0x2969, %edx           # imm = 0x2969
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x20d57
jmp 0x20962
jmp 0x20964
movq -0x10(%rbp), %rdi
movl $0x4200a1, %esi         # imm = 0x4200A1
callq 0x6300
cmpl $0x0, %eax
je 0x20a2e
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, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x209e9
movq -0x10(%rbp), %rdi
movl $0x10, %esi
leaq 0x547a(%rip), %rdx      # 0x25e3d
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x547f(%rip), %rsi      # 0x25e52
movl $0x296f, %edx           # imm = 0x296F
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x20d57
jmp 0x209eb
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x4200a1, %esi         # imm = 0x4200A1
callq 0x65b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x20a2a
movq -0x10(%rbp), %rdi
leaq 0x543d(%rip), %rsi      # 0x25e52
movl $0x2972, %edx           # imm = 0x2972
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x20d57
jmp 0x20a2c
jmp 0x20a2e
movq -0x10(%rbp), %rdi
movl $0x4200a2, %esi         # imm = 0x4200A2
callq 0x6300
cmpl $0x0, %eax
je 0x20af8
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, 0x10(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x20ab3
movq -0x10(%rbp), %rdi
movl $0x10, %esi
leaq 0x5402(%rip), %rdx      # 0x25e8f
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x53b5(%rip), %rsi      # 0x25e52
movl $0x2978, %edx           # imm = 0x2978
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x20d57
jmp 0x20ab5
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdx
movl $0x4200a2, %esi         # imm = 0x4200A2
callq 0x65b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x20af4
movq -0x10(%rbp), %rdi
leaq 0x5373(%rip), %rsi      # 0x25e52
movl $0x297b, %edx           # imm = 0x297B
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x20d57
jmp 0x20af6
jmp 0x20af8
movq -0x10(%rbp), %rdi
movl $0x4200ab, %esi         # imm = 0x4200AB
callq 0x6300
cmpl $0x0, %eax
je 0x20bc2
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, 0x18(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x20b7d
movq -0x10(%rbp), %rdi
movl $0x10, %esi
leaq 0x5355(%rip), %rdx      # 0x25eac
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x52eb(%rip), %rsi      # 0x25e52
movl $0x2981, %edx           # imm = 0x2981
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x20d57
jmp 0x20b7f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
movl $0x4200ab, %esi         # imm = 0x4200AB
callq 0x65b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x20bbe
movq -0x10(%rbp), %rdi
leaq 0x52a9(%rip), %rsi      # 0x25e52
movl $0x2984, %edx           # imm = 0x2984
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x20d57
jmp 0x20bc0
jmp 0x20bc2
movq -0x10(%rbp), %rdi
movl $0x4200a9, %esi         # imm = 0x4200A9
callq 0x6300
cmpl $0x0, %eax
je 0x20c8c
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, 0x20(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x20c47
movq -0x10(%rbp), %rdi
movl $0x10, %esi
leaq 0x52a9(%rip), %rdx      # 0x25eca
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x5221(%rip), %rsi      # 0x25e52
movl $0x298a, %edx           # imm = 0x298A
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x20d57
jmp 0x20c49
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movl $0x4200a9, %esi         # imm = 0x4200A9
callq 0x65b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x20c88
movq -0x10(%rbp), %rdi
leaq 0x51df(%rip), %rsi      # 0x25e52
movl $0x298d, %edx           # imm = 0x298D
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x20d57
jmp 0x20c8a
jmp 0x20c8c
movq -0x10(%rbp), %rdi
movl $0x4200aa, %esi         # imm = 0x4200AA
callq 0x6300
cmpl $0x0, %eax
je 0x20d50
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, 0x28(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x20d0e
movq -0x10(%rbp), %rdi
movl $0x10, %esi
leaq 0x51fd(%rip), %rdx      # 0x25ee8
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x5157(%rip), %rsi      # 0x25e52
movl $0x2993, %edx           # imm = 0x2993
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x20d57
jmp 0x20d10
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdx
movl $0x4200aa, %esi         # imm = 0x4200AA
callq 0x65b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x20d4c
movq -0x10(%rbp), %rdi
leaq 0x5118(%rip), %rsi      # 0x25e52
movl $0x2996, %edx           # imm = 0x2996
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x20d57
jmp 0x20d4e
jmp 0x20d50
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq