// File: /workspace/github_c_makefile_star2_O1/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_encode_response_header
int
kmip_encode_response_header(KMIP *ctx, const ResponseHeader *value)
{
    int result = 0;
    result = kmip_encode_int32_be(ctx, TAG_TYPE(KMIP_TAG_RESPONSE_HEADER, KMIP_TYPE_STRUCTURE));
    CHECK_RESULT(ctx, result);
    
    uint8 *length_index = ctx->index;
    uint8 *value_index = ctx->index += 4;
    
    result = kmip_encode_protocol_version(ctx, value->protocol_version);
    CHECK_RESULT(ctx, result);
    
    result = kmip_encode_date_time(ctx, KMIP_TAG_TIME_STAMP, value->time_stamp);
    CHECK_RESULT(ctx, result);
    
    if(ctx->version >= KMIP_1_2)
    {
        if(value->nonce != NULL)
        {
            result = kmip_encode_nonce(ctx, value->nonce);
            CHECK_RESULT(ctx, result);
        }

        if(ctx->version >= KMIP_2_0)
        {
            if(value->server_hashed_password != NULL)
            {
                result = kmip_encode_byte_string(ctx, KMIP_TAG_SERVER_HASHED_PASSWORD, value->server_hashed_password);
                CHECK_RESULT(ctx, result);
            }
        }

        for(size_t i = 0; i < value->attestation_type_count; i++)
        {
            result = kmip_encode_enum(ctx, KMIP_TAG_ATTESTATION_TYPE, value->attestation_types[i]);
            CHECK_RESULT(ctx, result);
        }
    }
    
    if(ctx->version >= KMIP_1_4)
    {
        if(value->client_correlation_value != NULL)
        {
            result = kmip_encode_text_string(ctx, KMIP_TAG_CLIENT_CORRELATION_VALUE, value->client_correlation_value);
            CHECK_RESULT(ctx, result);
        }
        
        if(value->server_correlation_value != NULL)
        {
            result = kmip_encode_text_string(ctx, KMIP_TAG_SERVER_CORRELATION_VALUE, value->server_correlation_value);
            CHECK_RESULT(ctx, result);
        }
    }
    
    result = kmip_encode_integer(ctx, KMIP_TAG_BATCH_COUNT, value->batch_count);
    CHECK_RESULT(ctx, result);
    
    uint8 *curr_index = ctx->index;
    ctx->index = length_index;
    
    result = kmip_encode_length(ctx, curr_index - value_index);
    CHECK_RESULT(ctx, result);

    ctx->index = curr_index;
    
    return(KMIP_OK);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x42007a01, %esi       # imm = 0x42007A01
callq 0x60a0
testl %eax, %eax
je 0xf7e4
movl %eax, %ebp
leaq 0x11ce3(%rip), %rsi     # 0x214bd
movq %rbx, %rdi
movl $0x1fbe, %edx           # imm = 0x1FBE
jmp 0xf839
movq 0x8(%rbx), %r12
leaq 0x4(%r12), %r15
movq %r15, 0x8(%rbx)
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x6ac0
testl %eax, %eax
je 0xf813
movl %eax, %ebp
leaq 0x11cb4(%rip), %rsi     # 0x214bd
movq %rbx, %rdi
movl $0x1fc4, %edx           # imm = 0x1FC4
jmp 0xf839
movq 0x8(%r14), %rdx
movq %rbx, %rdi
movl $0x420092, %esi         # imm = 0x420092
callq 0x6210
testl %eax, %eax
je 0xf84f
movl %eax, %ebp
leaq 0x11c8c(%rip), %rsi     # 0x214bd
movq %rbx, %rdi
movl $0x1fc7, %edx           # imm = 0x1FC7
callq 0x6de0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2, 0x18(%rbx)
jb 0xf931
movq 0x18(%r14), %rsi
testq %rsi, %rsi
je 0xf881
movq %rbx, %rdi
callq 0x6170
testl %eax, %eax
je 0xf881
movl %eax, %ebp
leaq 0x11c46(%rip), %rsi     # 0x214bd
movq %rbx, %rdi
movl $0x1fce, %edx           # imm = 0x1FCE
jmp 0xf839
cmpl $0x5, 0x18(%rbx)
jb 0xf8b4
movq 0x40(%r14), %rdx
testq %rdx, %rdx
je 0xf8b4
movq %rbx, %rdi
movl $0x420155, %esi         # imm = 0x420155
callq 0x6c10
testl %eax, %eax
je 0xf8b4
movl %eax, %ebp
leaq 0x11c13(%rip), %rsi     # 0x214bd
movq %rbx, %rdi
movl $0x1fd6, %edx           # imm = 0x1FD6
jmp 0xf839
cmpq $0x0, 0x28(%r14)
setne %r13b
je 0xf8da
movq 0x20(%r14), %rax
movl (%rax), %edx
movq %rbx, %rdi
movl $0x4200c7, %esi         # imm = 0x4200C7
callq 0x66d0
testl %eax, %eax
je 0xf8dc
movl %eax, %ebp
jmp 0xf914
jmp 0xf928
movl $0x1, %r13d
cmpq 0x28(%r14), %r13
setb 0x7(%rsp)
jae 0xf9fd
movq 0x20(%r14), %rax
movl (%rax,%r13,4), %edx
movq %rbx, %rdi
movl $0x4200c7, %esi         # imm = 0x4200C7
callq 0x66d0
incq %r13
testl %eax, %eax
je 0xf8e2
movl %eax, %ebp
movb 0x7(%rsp), %r13b
leaq 0x11ba2(%rip), %rsi     # 0x214bd
movq %rbx, %rdi
movl $0x1fdd, %edx           # imm = 0x1FDD
callq 0x6de0
testb %r13b, %r13b
jne 0xf83e
cmpl $0x4, 0x18(%rbx)
jb 0xf997
movq 0x30(%r14), %rdx
testq %rdx, %rdx
je 0xf967
movq %rbx, %rdi
movl $0x420105, %esi         # imm = 0x420105
callq 0x6670
testl %eax, %eax
je 0xf967
movl %eax, %ebp
leaq 0x11b63(%rip), %rsi     # 0x214bd
movq %rbx, %rdi
movl $0x1fe6, %edx           # imm = 0x1FE6
jmp 0xf839
movq 0x38(%r14), %rdx
testq %rdx, %rdx
je 0xf997
movq %rbx, %rdi
movl $0x420106, %esi         # imm = 0x420106
callq 0x6670
testl %eax, %eax
je 0xf997
movl %eax, %ebp
leaq 0x11b33(%rip), %rsi     # 0x214bd
movq %rbx, %rdi
movl $0x1fec, %edx           # imm = 0x1FEC
jmp 0xf839
movl 0x10(%r14), %edx
movq %rbx, %rdi
movl $0x42000d, %esi         # imm = 0x42000D
callq 0x63d0
testl %eax, %eax
je 0xf9c2
movl %eax, %ebp
leaq 0x11b08(%rip), %rsi     # 0x214bd
movq %rbx, %rdi
movl $0x1ff1, %edx           # imm = 0x1FF1
jmp 0xf839
movq 0x8(%rbx), %r14
movq %r12, 0x8(%rbx)
movq %r14, %rsi
subq %r15, %rsi
movq %rbx, %rdi
callq 0x6a80
testl %eax, %eax
je 0xf9f2
movl %eax, %ebp
leaq 0x11ad8(%rip), %rsi     # 0x214bd
movq %rbx, %rdi
movl $0x1ff7, %edx           # imm = 0x1FF7
jmp 0xf839
movq %r14, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0xf83e
movb 0x7(%rsp), %r13b
jmp 0xf928