// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_free_response_batch_item
void
kmip_free_response_batch_item(KMIP *ctx, ResponseBatchItem *value)
{
    if(value != NULL)
    {
        if(value->unique_batch_item_id != NULL)
        {
            kmip_free_byte_string(ctx, value->unique_batch_item_id);
            ctx->free_func(ctx->state, value->unique_batch_item_id);
            value->unique_batch_item_id = NULL;
        }
        
        if(value->result_message != NULL)
        {
            kmip_free_text_string(ctx, value->result_message);
            ctx->free_func(ctx->state, value->result_message);
            value->result_message = NULL;
        }
        
        if(value->asynchronous_correlation_value != NULL)
        {
            kmip_free_byte_string(ctx, value->asynchronous_correlation_value);
            ctx->free_func(ctx->state, value->asynchronous_correlation_value);
            value->asynchronous_correlation_value = NULL;
        }
        
        if(value->response_payload != NULL)
        {
            switch(value->operation)
            {
                case KMIP_OP_CREATE:
                kmip_free_create_response_payload(ctx, (CreateResponsePayload *)value->response_payload);
                break;
                
                case KMIP_OP_GET:
                kmip_free_get_response_payload(ctx, (GetResponsePayload *)value->response_payload);
                break;
                
                case KMIP_OP_DESTROY:
                kmip_free_destroy_response_payload(ctx, (DestroyResponsePayload *)value->response_payload);
                break;
                
                case KMIP_OP_QUERY:
                kmip_free_query_response_payload(ctx, (QueryResponsePayload *)value->response_payload);
                break;

                default:
                /* NOTE (ph) Hitting this case means that we don't know    */
                /*      what the actual type, size, or value of            */
                /*      value->response_payload is. We can still free it   */
                /*      but we cannot securely zero the memory. We also    */
                /*      do not know how to free any possible substructures */
                /*      pointed to within value->response_payload.         */
                /*                                                         */
                /*      Avoid hitting this case at all costs.              */
                break;
            };
            
            ctx->free_func(ctx->state, value->response_payload);
            value->response_payload = NULL;
        }
        
        value->operation = 0;
        value->result_status = 0;
        value->result_reason = 0;
    }
    
    return;
}

// Assembly:
testq %rsi, %rsi
je 0x8f92
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %r15
testq %r15, %r15
je 0x8e94
movq (%r15), %rdi
movq %r15, %rsi
testq %rdi, %rdi
je 0x8e7b
movq 0x8(%r15), %rdx
xorl %esi, %esi
callq *0x888(%r14)
movq 0x890(%r14), %rdi
movq (%r15), %rsi
callq *0x878(%r14)
movq $0x0, (%r15)
movq 0x8(%rbx), %rsi
xorl %r12d, %r12d
movq %r12, 0x8(%r15)
movq 0x890(%r14), %rdi
callq *0x878(%r14)
movq %r12, 0x8(%rbx)
movq 0x18(%rbx), %rsi
testq %rsi, %rsi
je 0x8ebf
movq %r14, %rdi
callq 0x6330
movq 0x890(%r14), %rdi
movq 0x18(%rbx), %rsi
callq *0x878(%r14)
movq $0x0, 0x18(%rbx)
movq 0x20(%rbx), %r15
testq %r15, %r15
je 0x8f15
movq (%r15), %rdi
movq %r15, %rsi
testq %rdi, %rdi
je 0x8efc
movq 0x8(%r15), %rdx
xorl %esi, %esi
callq *0x888(%r14)
movq 0x890(%r14), %rdi
movq (%r15), %rsi
callq *0x878(%r14)
movq $0x0, (%r15)
movq 0x20(%rbx), %rsi
xorl %r12d, %r12d
movq %r12, 0x8(%r15)
movq 0x890(%r14), %rdi
callq *0x878(%r14)
movq %r12, 0x20(%rbx)
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x8f79
movl (%rbx), %eax
cmpl $0x13, %eax
jg 0x8f39
cmpl $0x1, %eax
je 0x8f4d
cmpl $0xa, %eax
jne 0x8f5f
movq %r14, %rdi
callq 0x6c00
jmp 0x8f5f
cmpl $0x14, %eax
je 0x8f57
cmpl $0x18, %eax
jne 0x8f5f
movq %r14, %rdi
callq 0x69f0
jmp 0x8f5f
movq %r14, %rdi
callq 0x6820
jmp 0x8f5f
movq %r14, %rdi
callq 0x6990
movq 0x890(%r14), %rdi
movq 0x28(%rbx), %rsi
callq *0x878(%r14)
movq $0x0, 0x28(%rbx)
movl $0x0, (%rbx)
movq $0x0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq