// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %rax
subq 0x8(%rdi), %rax
addq (%rdi), %rax
cmpq $0x7, %rax
ja 0x1b8f0
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x1b974
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x1b8d2
jmp 0x1b99b
movq %rsi, %r14
xorl %eax, %eax
leaq 0xc(%rsp), %r15
movl %eax, (%r15)
movl %eax, 0x8(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6a10
movl (%r15), %eax
movl %eax, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
cmpl $0x42007a00, %ecx       # imm = 0x42007A00
jne 0x1b9a5
cmpb $0x1, %al
jne 0x1b9f1
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64b0
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
addq (%rbx), %rax
movl (%r15), %ecx
cmpq %rcx, %rax
jae 0x1ba4a
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x1baa0
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x1b959
jmp 0x1b99b
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x4453(%rip), %rsi      # 0x1fdd8
movl $0x63, %edx
callq 0x66f0
movl $0x2a90, 0x9c(%rbx,%r14) # imm = 0x2A90
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x1ba3b
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x1b9c3
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x1b9ac
jmp 0x1b9ea
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x4404(%rip), %rsi      # 0x1fdd8
movl $0x63, %edx
callq 0x66f0
movl $0x2a97, 0x9c(%rbx,%r14) # imm = 0x2A97
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
jmp 0x1ba3b
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x1ba0f
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x1b9f8
jmp 0x1ba36
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x43b8(%rip), %rsi      # 0x1fdd8
movl $0x63, %edx
callq 0x66f0
movl $0x2a97, 0x9c(%rbx,%r14) # imm = 0x2A97
movl $0xfffffffb, %ebp       # imm = 0xFFFFFFFB
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x8, %edx
callq *0x868(%rbx)
movq %rax, (%r14)
testq %rax, %rax
je 0x1bacc
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6750
testl %eax, %eax
je 0x1bb06
movl %eax, %ebp
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x1bb31
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x1ba85
jmp 0x1ba3b
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x4327(%rip), %rsi      # 0x1fdd8
movl $0x63, %edx
callq 0x66f0
movl $0x2a9a, 0x9c(%rbx,%r14) # imm = 0x2A9A
jmp 0x1b99b
leaq 0x56ff(%rip), %rdx      # 0x211d2
movl $0x8, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
cmpl $0x0, 0x64(%rdi,%r14)
je 0x1bb5d
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x1baec
jmp 0x1ba3b
leaq 0x8(%r14), %rdx
movq %rbx, %rdi
movl $0x420092, %esi         # imm = 0x420092
callq 0x6aa0
testl %eax, %eax
je 0x1bb8e
movl %eax, %ebp
leaq 0x5750(%rip), %rsi      # 0x21274
movq %rbx, %rdi
movl $0x2aa3, %edx           # imm = 0x2AA3
jmp 0x1bf44
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x4296(%rip), %rsi      # 0x1fdd8
movl $0x63, %edx
callq 0x66f0
movl $0x2aa0, 0x9c(%rbx,%r14) # imm = 0x2AA0
jmp 0x1ba3b
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x426a(%rip), %rsi      # 0x1fdd8
movl $0x63, %edx
callq 0x66f0
movl $0x2a9d, 0x9c(%rbx,%r14) # imm = 0x2A9D
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
jmp 0x1ba3b
movl 0x18(%rbx), %eax
cmpl $0x2, %eax
jb 0x1bf1b
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rdx
subq %rcx, %rdx
addq (%rbx), %rdx
cmpq $0x3, %rdx
jb 0x1bc3f
movzbl (%rcx), %edx
shll $0x10, %edx
movzbl 0x1(%rcx), %esi
shll $0x8, %esi
orl %edx, %esi
movzbl 0x2(%rcx), %ecx
orl %esi, %ecx
cmpl $0x4200c8, %ecx         # imm = 0x4200C8
jne 0x1bc3f
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *0x868(%rbx)
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x1bc14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6560
testl %eax, %eax
je 0x1bc3c
movl %eax, %ebp
leaq 0x566d(%rip), %rsi      # 0x21274
movq %rbx, %rdi
movl $0x2aad, %edx           # imm = 0x2AAD
jmp 0x1bf44
leaq 0x54b4(%rip), %rdx      # 0x210cf
movl $0x10, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x5645(%rip), %rsi      # 0x21274
movq %rbx, %rdi
movl $0x2aaa, %edx           # imm = 0x2AAA
jmp 0x1be06
movl 0x18(%rbx), %eax
cmpl $0x5, %eax
jb 0x1bcc2
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
cmpq $0x3, %rcx
jb 0x1bcc2
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %eax
orl %edx, %eax
cmpl $0x420155, %eax         # imm = 0x420155
jne 0x1bcc2
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *0x868(%rbx)
movq %rax, 0x40(%r14)
testq %rax, %rax
je 0x1be57
movq %rbx, %rdi
movl $0x420155, %esi         # imm = 0x420155
movq %rax, %rdx
callq 0x6cc0
testl %eax, %eax
je 0x1bcc2
movl %eax, %ebp
leaq 0x55bf(%rip), %rsi      # 0x21274
movq %rbx, %rdi
movl $0x2ab8, %edx           # imm = 0x2AB8
jmp 0x1bf44
movq %rbx, %rdi
movl $0x4200c7, %esi         # imm = 0x4200C7
callq 0x62f0
movq %rax, 0x28(%r14)
testq %rax, %rax
je 0x1bd4f
movq 0x890(%rbx), %rdi
movl $0x4, %edx
movq %rax, %rsi
callq *0x868(%rbx)
movq %rax, 0x20(%r14)
movq 0x28(%r14), %rsi
testq %rax, %rax
je 0x1bde4
testq %rsi, %rsi
je 0x1bd4f
movq %rax, %rdx
xorl %r15d, %r15d
xorl %r12d, %r12d
addq %r15, %rdx
movq %rbx, %rdi
movl $0x4200c7, %esi         # imm = 0x4200C7
callq 0x6ae0
testl %eax, %eax
jne 0x1be10
movq 0x20(%r14), %rdx
movl (%rdx,%r12,4), %eax
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
ja 0x1be26
cmpl $0x1, 0x18(%rbx)
jbe 0x1be2d
incq %r12
addq $0x4, %r15
cmpq 0x28(%r14), %r12
jb 0x1bd0c
cmpl $0x4, 0x18(%rbx)
jb 0x1bf1b
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
cmpq $0x3, %rcx
jb 0x1bf1b
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %ecx
orl %edx, %ecx
cmpl $0x420105, %ecx         # imm = 0x420105
jne 0x1beb8
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *0x868(%rbx)
movq %rax, 0x30(%r14)
testq %rax, %rax
je 0x1be7c
movq %rbx, %rdi
movl $0x420105, %esi         # imm = 0x420105
movq %rax, %rdx
callq 0x6540
testl %eax, %eax
je 0x1bea4
movl %eax, %ebp
leaq 0x549d(%rip), %rsi      # 0x21274
movq %rbx, %rdi
movl $0x2ad3, %edx           # imm = 0x2AD3
jmp 0x1bf44
shlq $0x2, %rsi
leaq 0x5443(%rip), %rdx      # 0x21232
movq %rbx, %rdi
callq 0x6ba0
leaq 0x5476(%rip), %rsi      # 0x21274
movq %rbx, %rdi
movl $0x2ac0, %edx           # imm = 0x2AC0
callq 0x6de0
jmp 0x1bb84
movl %eax, %ebp
leaq 0x545b(%rip), %rsi      # 0x21274
movq %rbx, %rdi
movl $0x2ac5, %edx           # imm = 0x2AC5
jmp 0x1bf44
movl $0xfffffff7, %ebp       # imm = 0xFFFFFFF7
jmp 0x1be32
movl $0xfffffff5, %ebp       # imm = 0xFFFFFFF5
movq %rbx, %rdi
movl $0x4200c7, %esi         # imm = 0x4200C7
movl %eax, %edx
movl %ebp, %ecx
callq 0x6120
leaq 0x542a(%rip), %rsi      # 0x21274
movq %rbx, %rdi
movl $0x2ac6, %edx           # imm = 0x2AC6
jmp 0x1bf44
leaq 0x5432(%rip), %rdx      # 0x21290
movl $0x10, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x5402(%rip), %rsi      # 0x21274
movq %rbx, %rdi
movl $0x2ab5, %edx           # imm = 0x2AB5
jmp 0x1be06
leaq 0x5369(%rip), %rdx      # 0x211ec
movl $0x10, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x53dd(%rip), %rsi      # 0x21274
movq %rbx, %rdi
movl $0x2ad0, %edx           # imm = 0x2AD0
jmp 0x1be06
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
cmpq $0x3, %rcx
jb 0x1bf1b
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %eax
orl %edx, %eax
cmpl $0x420106, %eax         # imm = 0x420106
jne 0x1bf1b
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *0x868(%rbx)
movq %rax, 0x38(%r14)
testq %rax, %rax
je 0x1bf55
movq %rbx, %rdi
movl $0x420106, %esi         # imm = 0x420106
movq %rax, %rdx
callq 0x6540
testl %eax, %eax
je 0x1bf1b
movl %eax, %ebp
leaq 0x5363(%rip), %rsi      # 0x21274
movq %rbx, %rdi
movl $0x2adc, %edx           # imm = 0x2ADC
jmp 0x1bf44
addq $0x10, %r14
movq %rbx, %rdi
movl $0x42000d, %esi         # imm = 0x42000D
movq %r14, %rdx
callq 0x60d0
testl %eax, %eax
je 0x1bf4e
movl %eax, %ebp
leaq 0x5338(%rip), %rsi      # 0x21274
movq %rbx, %rdi
movl $0x2ae1, %edx           # imm = 0x2AE1
callq 0x6de0
jmp 0x1ba3b
xorl %ebp, %ebp
jmp 0x1ba3b
leaq 0x52b3(%rip), %rdx      # 0x2120f
movl $0x10, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x5304(%rip), %rsi      # 0x21274
movq %rbx, %rdi
movl $0x2ad9, %edx           # imm = 0x2AD9
jmp 0x1be06