// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_free_request_batch_item
void
kmip_free_request_batch_item(KMIP *ctx, RequestBatchItem *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->request_payload != NULL)
        {
            switch(value->operation)
            {
                case KMIP_OP_CREATE:
                kmip_free_create_request_payload(ctx, (CreateRequestPayload *)value->request_payload);
                break;
                
                case KMIP_OP_GET:
                kmip_free_get_request_payload(ctx, (GetRequestPayload *)value->request_payload);
                break;
                
                case KMIP_OP_DESTROY:
                kmip_free_destroy_request_payload(ctx, (DestroyRequestPayload *)value->request_payload);
                break;
                
                case KMIP_OP_QUERY:
                kmip_free_query_request_payload(ctx, (QueryRequestPayload *)value->request_payload);
                break;

                default:
                /* NOTE (ph) Hitting this case means that we don't know    */
                /*      what the actual type, size, or value of            */
                /*      value->request_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->request_payload.          */
                /*                                                         */
                /*      Avoid hitting this case at all costs.              */
                break;
            };
            
            ctx->free_func(ctx->state, value->request_payload);
            value->request_payload = NULL;
        }
        
        value->operation = 0;
        value->ephemeral = 0;
    }
    
    return;
}

// Assembly:
testq %rsi, %rsi
je 0x8ddf
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %r15
testq %r15, %r15
je 0x8d69
movq (%r15), %rdi
movq %r15, %rsi
testq %rdi, %rdi
je 0x8d50
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 0x10(%rbx), %rsi
testq %rsi, %rsi
je 0x8dcd
movl (%rbx), %eax
cmpl $0x13, %eax
jg 0x8d8d
cmpl $0x1, %eax
je 0x8da1
cmpl $0xa, %eax
jne 0x8db3
movq %r14, %rdi
callq 0x6620
jmp 0x8db3
cmpl $0x14, %eax
je 0x8dab
cmpl $0x18, %eax
jne 0x8db3
movq %r14, %rdi
callq 0x6940
jmp 0x8db3
movq %r14, %rdi
callq 0x6b80
jmp 0x8db3
movq %r14, %rdi
callq 0x6660
movq 0x890(%r14), %rdi
movq 0x10(%rbx), %rsi
callq *0x878(%r14)
movq $0x0, 0x10(%rbx)
xorl %eax, %eax
movl %eax, (%rbx)
movl %eax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq