// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movl $0x42007a01, %esi       # imm = 0x42007A01
callq 0x60b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1592e
movq -0x10(%rbp), %rdi
leaq 0xf8da(%rip), %rsi      # 0x251f3
movl $0x1fbe, %edx           # imm = 0x1FBE
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x15c3d
jmp 0x15930
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rax
addq $0x4, %rax
movq %rax, 0x8(%rcx)
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x6be0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x15989
movq -0x10(%rbp), %rdi
leaq 0xf87f(%rip), %rsi      # 0x251f3
movl $0x1fc4, %edx           # imm = 0x1FC4
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x15c3d
jmp 0x1598b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x420092, %esi         # imm = 0x420092
callq 0x6250
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x159ca
movq -0x10(%rbp), %rdi
leaq 0xf83e(%rip), %rsi      # 0x251f3
movl $0x1fc7, %edx           # imm = 0x1FC7
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x15c3d
jmp 0x159cc
movq -0x10(%rbp), %rax
cmpl $0x2, 0x18(%rax)
jb 0x15aed
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x15a23
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x6190
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x15a1f
movq -0x10(%rbp), %rdi
leaq 0xf7e9(%rip), %rsi      # 0x251f3
movl $0x1fce, %edx           # imm = 0x1FCE
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x15c3d
jmp 0x15a21
jmp 0x15a23
movq -0x10(%rbp), %rax
cmpl $0x5, 0x18(%rax)
jb 0x15a7d
movq -0x18(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x15a7b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdx
movl $0x420155, %esi         # imm = 0x420155
callq 0x6d40
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x15a77
movq -0x10(%rbp), %rdi
leaq 0xf791(%rip), %rsi      # 0x251f3
movl $0x1fd6, %edx           # imm = 0x1FD6
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x15c3d
jmp 0x15a79
jmp 0x15a7b
jmp 0x15a7d
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jae 0x15aeb
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movl $0x4200c7, %esi         # imm = 0x4200C7
callq 0x6770
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x15ad9
movq -0x10(%rbp), %rdi
leaq 0xf72f(%rip), %rsi      # 0x251f3
movl $0x1fdd, %edx           # imm = 0x1FDD
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x15c3d
jmp 0x15adb
jmp 0x15add
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x15a85
jmp 0x15aed
movq -0x10(%rbp), %rax
cmpl $0x4, 0x18(%rax)
jb 0x15b99
movq -0x18(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x15b49
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdx
movl $0x420105, %esi         # imm = 0x420105
callq 0x66f0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x15b45
movq -0x10(%rbp), %rdi
leaq 0xf6c3(%rip), %rsi      # 0x251f3
movl $0x1fe6, %edx           # imm = 0x1FE6
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x15c3d
jmp 0x15b47
jmp 0x15b49
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x15b97
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdx
movl $0x420106, %esi         # imm = 0x420106
callq 0x66f0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x15b93
movq -0x10(%rbp), %rdi
leaq 0xf675(%rip), %rsi      # 0x251f3
movl $0x1fec, %edx           # imm = 0x1FEC
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x15c3d
jmp 0x15b95
jmp 0x15b97
jmp 0x15b99
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
movl $0x42000d, %esi         # imm = 0x42000D
callq 0x6420
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x15bd4
movq -0x10(%rbp), %rdi
leaq 0xf631(%rip), %rsi      # 0x251f3
movl $0x1ff1, %edx           # imm = 0x1FF1
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x15c3d
jmp 0x15bd6
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rax
subq %rax, %rsi
callq 0x6ba0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x15c28
movq -0x10(%rbp), %rdi
leaq 0xf5dd(%rip), %rsi      # 0x251f3
movl $0x1ff7, %edx           # imm = 0x1FF7
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x15c3d
jmp 0x15c2a
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)