// File: /workspace/github_c_makefile_star2_O0/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_decode_response_header
int
kmip_decode_response_header(KMIP *ctx, ResponseHeader *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_RESPONSE_HEADER, KMIP_TYPE_STRUCTURE);
    
    kmip_decode_length(ctx, &length);
    CHECK_BUFFER_FULL(ctx, length);
    
    value->protocol_version = ctx->calloc_func(ctx->state, 1, sizeof(ProtocolVersion));
    CHECK_NEW_MEMORY(ctx, value->protocol_version, sizeof(ProtocolVersion), "ProtocolVersion structure");
    
    result = kmip_decode_protocol_version(ctx, value->protocol_version);
    CHECK_RESULT(ctx, result);
    
    result = kmip_decode_date_time(ctx, KMIP_TAG_TIME_STAMP, &value->time_stamp);
    CHECK_RESULT(ctx, result);
    
    if(ctx->version >= KMIP_1_2)
    {
        if(kmip_is_tag_next(ctx, KMIP_TAG_NONCE))
        {
            value->nonce = ctx->calloc_func(ctx->state, 1, sizeof(Nonce));
            CHECK_NEW_MEMORY(ctx, value->nonce, sizeof(Nonce), "Nonce structure");
            
            result = kmip_decode_nonce(ctx, value->nonce);
            CHECK_RESULT(ctx, result);
        }

        if(ctx->version >= KMIP_2_0)
        {
            if(kmip_is_tag_next(ctx, KMIP_TAG_SERVER_HASHED_PASSWORD))
            {
                value->server_hashed_password = ctx->calloc_func(ctx->state, 1, sizeof(ByteString));
                CHECK_NEW_MEMORY(ctx, value->server_hashed_password, sizeof(ByteString), "ByteString");

                result = kmip_decode_byte_string(ctx, KMIP_TAG_SERVER_HASHED_PASSWORD, value->server_hashed_password);
                CHECK_RESULT(ctx, result);
            }
        }

        value->attestation_type_count = kmip_get_num_items_next(ctx, KMIP_TAG_ATTESTATION_TYPE);
        if(value->attestation_type_count > 0)
        {
            value->attestation_types = ctx->calloc_func(ctx->state, value->attestation_type_count, sizeof(enum attestation_type));
            CHECK_NEW_MEMORY(ctx, value->attestation_types, value->attestation_type_count * sizeof(enum attestation_type), "sequence of AttestationType enumerations");
            
            for(size_t i = 0; i < value->attestation_type_count; i++)
            {
                result = kmip_decode_enum(ctx, KMIP_TAG_ATTESTATION_TYPE, &value->attestation_types[i]);
                CHECK_RESULT(ctx, result);
                CHECK_ENUM(ctx, KMIP_TAG_ATTESTATION_TYPE, value->attestation_types[i]);
            }
        }
    }
    
    if(ctx->version >= KMIP_1_4)
    {
        if(kmip_is_tag_next(ctx, KMIP_TAG_CLIENT_CORRELATION_VALUE))
        {
            value->client_correlation_value = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
            CHECK_NEW_MEMORY(ctx, value->client_correlation_value, sizeof(TextString), "ClientCorrelationValue text string");
            
            result = kmip_decode_text_string(ctx, KMIP_TAG_CLIENT_CORRELATION_VALUE, value->client_correlation_value);
            CHECK_RESULT(ctx, result);
        }
        
        if(kmip_is_tag_next(ctx, KMIP_TAG_SERVER_CORRELATION_VALUE))
        {
            value->server_correlation_value = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
            CHECK_NEW_MEMORY(ctx, value->server_correlation_value, sizeof(TextString), "ServerCorrelationValue text string");
            
            result = kmip_decode_text_string(ctx, KMIP_TAG_SERVER_CORRELATION_VALUE, value->server_correlation_value);
            CHECK_RESULT(ctx, result);
        }
    }
    
    result = kmip_decode_integer(ctx, KMIP_TAG_BATCH_COUNT, &value->batch_count);
    CHECK_RESULT(ctx, result);
    
    return(KMIP_OK);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %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 0x22094
movq -0x10(%rbp), %rdi
leaq 0x4069(%rip), %rsi      # 0x260e7
movl $0x2a90, %edx           # imm = 0x2A90
callq 0x6f20
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x22776
jmp 0x22096
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 $0x42007a, %eax         # imm = 0x42007A
je 0x220e6
movq -0x10(%rbp), %rdi
leaq 0x4017(%rip), %rsi      # 0x260e7
movl $0x2a97, %edx           # imm = 0x2A97
callq 0x6f20
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
jmp 0x22776
movl -0x20(%rbp), %eax
andl $0xff, %eax
cmpl $0x1, %eax
je 0x22114
movq -0x10(%rbp), %rdi
leaq 0x3fe9(%rip), %rsi      # 0x260e7
movl $0x2a97, %edx           # imm = 0x2A97
callq 0x6f20
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
jmp 0x22776
jmp 0x22116
jmp 0x22118
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 0x2216b
movq -0x10(%rbp), %rdi
leaq 0x3f92(%rip), %rsi      # 0x260e7
movl $0x2a9a, %edx           # imm = 0x2A9A
callq 0x6f20
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x22776
jmp 0x2216d
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movl $0x1, %esi
movl $0x8, %edx
callq *%rax
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x221d9
movq -0x10(%rbp), %rdi
movl $0x8, %esi
leaq 0x3e92(%rip), %rdx      # 0x26045
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x3f24(%rip), %rsi      # 0x260e7
movl $0x2a9d, %edx           # imm = 0x2A9D
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x22776
jmp 0x221db
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x67f0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x22214
movq -0x10(%rbp), %rdi
leaq 0x3ee8(%rip), %rsi      # 0x260e7
movl $0x2aa0, %edx           # imm = 0x2AA0
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x22776
jmp 0x22216
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
addq $0x8, %rdx
movl $0x420092, %esi         # imm = 0x420092
callq 0x6bc0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x22255
movq -0x10(%rbp), %rdi
leaq 0x3ea7(%rip), %rsi      # 0x260e7
movl $0x2aa3, %edx           # imm = 0x2AA3
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x22776
jmp 0x22257
movq -0x10(%rbp), %rax
cmpl $0x2, 0x18(%rax)
jb 0x22590
movq -0x10(%rbp), %rdi
movl $0x4200c8, %esi         # imm = 0x4200C8
callq 0x6300
cmpl $0x0, %eax
je 0x2232a
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 0x222ea
movq -0x10(%rbp), %rdi
movl $0x10, %esi
leaq 0x3c63(%rip), %rdx      # 0x25f27
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x3e13(%rip), %rsi      # 0x260e7
movl $0x2aaa, %edx           # imm = 0x2AAA
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x22776
jmp 0x222ec
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x65d0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x22326
movq -0x10(%rbp), %rdi
leaq 0x3dd6(%rip), %rsi      # 0x260e7
movl $0x2aad, %edx           # imm = 0x2AAD
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x22776
jmp 0x22328
jmp 0x2232a
movq -0x10(%rbp), %rax
cmpl $0x5, 0x18(%rax)
jb 0x22404
movq -0x10(%rbp), %rdi
movl $0x420155, %esi         # imm = 0x420155
callq 0x6300
cmpl $0x0, %eax
je 0x22402
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, 0x40(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x223bd
movq -0x10(%rbp), %rdi
movl $0x10, %esi
leaq 0x3d6c(%rip), %rdx      # 0x26103
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x3d40(%rip), %rsi      # 0x260e7
movl $0x2ab5, %edx           # imm = 0x2AB5
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x22776
jmp 0x223bf
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdx
movl $0x420155, %esi         # imm = 0x420155
callq 0x6df0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x223fe
movq -0x10(%rbp), %rdi
leaq 0x3cfe(%rip), %rsi      # 0x260e7
movl $0x2ab8, %edx           # imm = 0x2AB8
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x22776
jmp 0x22400
jmp 0x22402
jmp 0x22404
movq -0x10(%rbp), %rdi
movl $0x4200c7, %esi         # imm = 0x4200C7
callq 0x6340
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jbe 0x2258e
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movq -0x18(%rbp), %rcx
movq 0x28(%rcx), %rsi
movl $0x4, %edx
callq *%rax
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x224a4
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
shlq $0x2, %rsi
leaq 0x3c27(%rip), %rdx      # 0x260a5
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x3c59(%rip), %rsi      # 0x260e7
movl $0x2ac0, %edx           # imm = 0x2AC0
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x22776
jmp 0x224a6
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jae 0x2258c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x30(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdx
movl $0x4200c7, %esi         # imm = 0x4200C7
callq 0x6c00
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x2250a
movq -0x10(%rbp), %rdi
leaq 0x3bf2(%rip), %rsi      # 0x260e7
movl $0x2ac5, %edx           # imm = 0x2AC5
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x22776
jmp 0x2250c
jmp 0x2250e
movq -0x10(%rbp), %rax
movl 0x18(%rax), %edi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movl $0x4200c7, %esi         # imm = 0x4200C7
callq 0x63a0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x22577
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movl -0x34(%rbp), %ecx
movl $0x4200c7, %esi         # imm = 0x4200C7
callq 0x6140
movq -0x10(%rbp), %rdi
leaq 0x3b85(%rip), %rsi      # 0x260e7
movl $0x2ac6, %edx           # imm = 0x2AC6
callq 0x6f20
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x22776
jmp 0x22579
jmp 0x2257b
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x224ae
jmp 0x2258e
jmp 0x22590
movq -0x10(%rbp), %rax
cmpl $0x4, 0x18(%rax)
jb 0x22731
movq -0x10(%rbp), %rdi
movl $0x420105, %esi         # imm = 0x420105
callq 0x6300
cmpl $0x0, %eax
je 0x22668
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, 0x30(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x22623
movq -0x10(%rbp), %rdi
movl $0x10, %esi
leaq 0x3a62(%rip), %rdx      # 0x2605f
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x3ada(%rip), %rsi      # 0x260e7
movl $0x2ad0, %edx           # imm = 0x2AD0
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x22776
jmp 0x22625
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdx
movl $0x420105, %esi         # imm = 0x420105
callq 0x65b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x22664
movq -0x10(%rbp), %rdi
leaq 0x3a98(%rip), %rsi      # 0x260e7
movl $0x2ad3, %edx           # imm = 0x2AD3
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x22776
jmp 0x22666
jmp 0x22668
movq -0x10(%rbp), %rdi
movl $0x420106, %esi         # imm = 0x420106
callq 0x6300
cmpl $0x0, %eax
je 0x2272f
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, 0x38(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x226ed
movq -0x10(%rbp), %rdi
movl $0x10, %esi
leaq 0x39bb(%rip), %rdx      # 0x26082
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x3a10(%rip), %rsi      # 0x260e7
movl $0x2ad9, %edx           # imm = 0x2AD9
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x22776
jmp 0x226ef
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdx
movl $0x420106, %esi         # imm = 0x420106
callq 0x65b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x2272b
movq -0x10(%rbp), %rdi
leaq 0x39ce(%rip), %rsi      # 0x260e7
movl $0x2adc, %edx           # imm = 0x2ADC
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x22776
jmp 0x2272d
jmp 0x2272f
jmp 0x22731
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
addq $0x10, %rdx
movl $0x42000d, %esi         # imm = 0x42000D
callq 0x60e0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x2276d
movq -0x10(%rbp), %rdi
leaq 0x398c(%rip), %rsi      # 0x260e7
movl $0x2ae1, %edx           # imm = 0x2AE1
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x22776
jmp 0x2276f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop