// File: /workspace/github_c_makefile_star2_O3/OpenKMIP[P]libkmip/src/kmip.c
// Function: kmip_decode_response_batch_item
int
kmip_decode_response_batch_item(KMIP *ctx, ResponseBatchItem *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_BATCH_ITEM, KMIP_TYPE_STRUCTURE);
    
    kmip_decode_length(ctx, &length);
    CHECK_BUFFER_FULL(ctx, length);
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_OPERATION))
    {
        result = kmip_decode_enum(ctx, KMIP_TAG_OPERATION, &value->operation);
        CHECK_RESULT(ctx, result);
        CHECK_ENUM(ctx, KMIP_TAG_OPERATION, value->operation);
    }
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_UNIQUE_BATCH_ITEM_ID))
    {
        value->unique_batch_item_id = ctx->calloc_func(ctx->state, 1, sizeof(ByteString));
        CHECK_NEW_MEMORY(ctx, value->unique_batch_item_id, sizeof(ByteString), "UniqueBatchItemID byte string");
        
        result = kmip_decode_byte_string(ctx, KMIP_TAG_UNIQUE_BATCH_ITEM_ID, value->unique_batch_item_id);
        CHECK_RESULT(ctx, result);
    }
    
    result = kmip_decode_enum(ctx, KMIP_TAG_RESULT_STATUS, &value->result_status);
    CHECK_RESULT(ctx, result);
    CHECK_ENUM(ctx, KMIP_TAG_RESULT_STATUS, value->result_status);
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_RESULT_REASON))
    {
        result = kmip_decode_enum(ctx, KMIP_TAG_RESULT_REASON, &value->result_reason);
        CHECK_RESULT(ctx, result);
    }
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_RESULT_MESSAGE))
    {
        value->result_message = ctx->calloc_func(ctx->state, 1, sizeof(TextString));
        CHECK_NEW_MEMORY(ctx, value->result_message, sizeof(TextString), "ResultMessage text string");
        
        result = kmip_decode_text_string(ctx, KMIP_TAG_RESULT_MESSAGE, value->result_message);
        CHECK_RESULT(ctx, result);
    }
    
    if(kmip_is_tag_next(ctx, KMIP_TAG_ASYNCHRONOUS_CORRELATION_VALUE))
    {
        value->asynchronous_correlation_value = ctx->calloc_func(ctx->state, 1, sizeof(ByteString));
        CHECK_NEW_MEMORY(ctx, value->asynchronous_correlation_value, sizeof(ByteString), "AsynchronousCorrelationValue byte string");
        
        result = kmip_decode_byte_string(ctx, KMIP_TAG_ASYNCHRONOUS_CORRELATION_VALUE, value->asynchronous_correlation_value);
        CHECK_RESULT(ctx, result);
    }
    
    /* NOTE (ph) Omitting the tag check is a good way to test error output. */
    if(kmip_is_tag_next(ctx, KMIP_TAG_RESPONSE_PAYLOAD))
    {
        switch(value->operation)
        {
            case KMIP_OP_CREATE:
            value->response_payload = ctx->calloc_func(ctx->state, 1, sizeof(CreateResponsePayload));
            CHECK_NEW_MEMORY(ctx, value->response_payload, sizeof(CreateResponsePayload), "CreateResponsePayload structure");
            result = kmip_decode_create_response_payload(ctx, value->response_payload);
            break;
            
            case KMIP_OP_GET:
            value->response_payload = ctx->calloc_func(ctx->state, 1, sizeof(GetResponsePayload));
            CHECK_NEW_MEMORY(ctx, value->response_payload, sizeof(GetResponsePayload), "GetResponsePayload structure");
            
            result = kmip_decode_get_response_payload(ctx, value->response_payload);
            break;
            
            case KMIP_OP_DESTROY:
            value->response_payload = ctx->calloc_func(ctx->state, 1, sizeof(DestroyResponsePayload));
            CHECK_NEW_MEMORY(ctx, value->response_payload, sizeof(DestroyResponsePayload), "DestroyResponsePayload structure");
            result = kmip_decode_destroy_response_payload(ctx, value->response_payload);
            break;
            
            case KMIP_OP_QUERY:
            value->response_payload = ctx->calloc_func(ctx->state, 1, sizeof(QueryResponsePayload));
            CHECK_NEW_MEMORY(ctx, value->response_payload, sizeof(QueryResponsePayload), "QueryResponsePayload structure");
            result = kmip_decode_query_response_payload(ctx, value->response_payload);
            break;

            default:
            kmip_push_error_frame(ctx, __func__, __LINE__);
            return(KMIP_NOT_IMPLEMENTED);
            break;
        };
        CHECK_RESULT(ctx, result);
    }
    
    return(KMIP_OK);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rax
subq 0x8(%rdi), %rax
addq (%rdi), %rax
cmpq $0x7, %rax
ja 0x18cc6
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x18d4a
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x18ca8
jmp 0x18d71
movq %rsi, %r14
xorl %eax, %eax
leaq 0x4(%rsp), %r15
movl %eax, (%r15)
movl %eax, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6a10
movl (%r15), %eax
movl %eax, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
cmpl $0x42000f00, %ecx       # imm = 0x42000F00
jne 0x18d7b
cmpb $0x1, %al
jne 0x18dca
movq %rsp, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64b0
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
movl (%r15), %edx
cmpq %rdx, %rcx
jae 0x18e19
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x18e7e
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x18d2f
jmp 0x18d71
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x6d5d(%rip), %rsi      # 0x1fab8
movl $0x63, %edx
callq 0x66f0
movl $0x28b4, 0x9c(%rbx,%r14) # imm = 0x28B4
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x1900a
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x18d99
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x18d82
jmp 0x18dc0
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x6d0e(%rip), %rsi      # 0x1fab8
movl $0x63, %edx
callq 0x66f0
movl $0x28bb, 0x9c(%rbx,%r14) # imm = 0x28BB
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
jmp 0x1900a
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x18de8
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x18dd1
jmp 0x18e0f
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x6cbf(%rip), %rsi      # 0x1fab8
movl $0x63, %edx
callq 0x66f0
movl $0x28bb, 0x9c(%rbx,%r14) # imm = 0x28BB
movl $0xfffffffb, %ebp       # imm = 0xFFFFFFFB
jmp 0x1900a
cmpq $0x3, %rcx
jb 0x18ec4
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %eax
orl %edx, %eax
cmpl $0x42005c, %eax         # imm = 0x42005C
jne 0x18ec4
movq %rbx, %rdi
movl $0x42005c, %esi         # imm = 0x42005C
movq %r14, %rdx
callq 0x6ae0
testl %eax, %eax
je 0x18eaa
movl %eax, %ebp
leaq 0x38(%rbx), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0x64(%rdi,%r14)
je 0x19017
addq $0x68, %r14
cmpq $0x820, %r14            # imm = 0x820
jne 0x18e60
jmp 0x1900a
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x6c29(%rip), %rsi      # 0x1fab8
movl $0x63, %edx
callq 0x66f0
movl $0x28be, 0x9c(%rbx,%r14) # imm = 0x28BE
jmp 0x18d71
movl (%r14), %edx
cmpl $0x18, %edx
ja 0x1906f
movl $0x1100402, %eax        # imm = 0x1100402
btl %edx, %eax
jae 0x1906f
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
cmpq $0x3, %rcx
jb 0x18f42
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %eax
orl %edx, %eax
cmpl $0x420093, %eax         # imm = 0x420093
jne 0x18f42
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *0x868(%rbx)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x19040
movq %rbx, %rdi
movl $0x420093, %esi         # imm = 0x420093
movq %rax, %rdx
callq 0x6cc0
testl %eax, %eax
je 0x18f42
movl %eax, %ebp
leaq 0x7f55(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x28cd, %edx           # imm = 0x28CD
jmp 0x19005
leaq 0x10(%r14), %r15
movq %rbx, %rdi
movl $0x42007f, %esi         # imm = 0x42007F
movq %r15, %rdx
callq 0x6ae0
testl %eax, %eax
je 0x18f70
movl %eax, %ebp
leaq 0x7f27(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x28d1, %edx           # imm = 0x28D1
jmp 0x19005
movl (%r15), %edx
cmpl $0x4, %edx
jae 0x18fdf
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
xorl %ebp, %ebp
cmpq $0x3, %rcx
jb 0x1900a
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %ecx
orl %edx, %ecx
cmpl $0x42007e, %ecx         # imm = 0x42007E
jne 0x190b2
leaq 0x14(%r14), %rdx
movq %rbx, %rdi
movl $0x42007e, %esi         # imm = 0x42007E
callq 0x6ae0
testl %eax, %eax
je 0x1909a
movl %eax, %r15d
leaq 0x7eb8(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x28d7, %edx           # imm = 0x28D7
jmp 0x191c5
movl $0xfffffff7, %ebp       # imm = 0xFFFFFFF7
movq %rbx, %rdi
movl $0x42007f, %esi         # imm = 0x42007F
movl $0xfffffff7, %ecx       # imm = 0xFFFFFFF7
callq 0x6120
leaq 0x7e8d(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x28d2, %edx           # imm = 0x28D2
callq 0x6de0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
addq %r14, %rdi
movq %rdi, 0x860(%rbx)
leaq 0x6a90(%rip), %rsi      # 0x1fab8
movl $0x63, %edx
callq 0x66f0
movl $0x28c3, 0x9c(%rbx,%r14) # imm = 0x28C3
jmp 0x1900a
leaq 0x7dac(%rip), %rdx      # 0x20df3
movl $0x10, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x7e2f(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x28ca, %edx           # imm = 0x28CA
callq 0x6de0
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
jmp 0x1900a
movl $0xfffffff7, %ebp       # imm = 0xFFFFFFF7
movq %rbx, %rdi
movl $0x42005c, %esi         # imm = 0x42005C
movl $0xfffffff7, %ecx       # imm = 0xFFFFFFF7
callq 0x6120
leaq 0x7dfd(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x28c4, %edx           # imm = 0x28C4
jmp 0x19005
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
cmpq $0x3, %rcx
jb 0x1900a
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %ecx
orl %edx, %ecx
cmpl $0x42007d, %ecx         # imm = 0x42007D
jne 0x1915e
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *0x868(%rbx)
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x1911e
movq %rbx, %rdi
movl $0x42007d, %esi         # imm = 0x42007D
movq %rax, %rdx
callq 0x6540
testl %eax, %eax
je 0x19146
movl %eax, %r15d
leaq 0x7d79(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x28e0, %edx           # imm = 0x28E0
jmp 0x191c5
leaq 0x7d85(%rip), %rdx      # 0x20eaa
movl $0x10, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x7d51(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x28dd, %edx           # imm = 0x28DD
jmp 0x19063
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
cmpq $0x3, %rcx
jb 0x1900a
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %ecx
orl %edx, %ecx
cmpl $0x420006, %ecx         # imm = 0x420006
jne 0x19212
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *0x868(%rbx)
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0x191d2
movq %rbx, %rdi
movl $0x420006, %esi         # imm = 0x420006
movq %rax, %rdx
callq 0x6cc0
testl %eax, %eax
je 0x191fa
movl %eax, %r15d
leaq 0x7ccd(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x28e9, %edx           # imm = 0x28E9
callq 0x6de0
movl %r15d, %ebp
jmp 0x1900a
leaq 0x7ceb(%rip), %rdx      # 0x20ec4
movl $0x10, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x7c9d(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x28e6, %edx           # imm = 0x28E6
jmp 0x19063
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
addq (%rbx), %rcx
cmpq $0x3, %rcx
jb 0x1900a
movzbl (%rax), %ecx
shll $0x10, %ecx
movzbl 0x1(%rax), %edx
shll $0x8, %edx
orl %ecx, %edx
movzbl 0x2(%rax), %eax
orl %edx, %eax
cmpl $0x42007c, %eax         # imm = 0x42007C
jne 0x1900a
movl (%r14), %eax
cmpl $0x13, %eax
jg 0x1927c
cmpl $0x1, %eax
je 0x192d9
cmpl $0xa, %eax
jne 0x192bb
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *0x868(%rbx)
movq %rax, 0x28(%r14)
testq %rax, %rax
je 0x19360
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6550
jmp 0x19339
cmpl $0x14, %eax
je 0x1930a
cmpl $0x18, %eax
jne 0x192bb
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x20, %edx
callq *0x868(%rbx)
movq %rax, 0x28(%r14)
testq %rax, %rax
je 0x19388
movq %rbx, %rdi
movq %rax, %rsi
callq 0x67e0
jmp 0x19339
leaq 0x7bc8(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x290b, %edx           # imm = 0x290B
callq 0x6de0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x1900a
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *0x868(%rbx)
movq %rax, 0x28(%r14)
testq %rax, %rax
je 0x193b0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6c70
jmp 0x19339
movq 0x890(%rbx), %rdi
movl $0x1, %esi
movl $0x8, %edx
callq *0x868(%rbx)
movq %rax, 0x28(%r14)
testq %rax, %rax
je 0x193d8
movq %rbx, %rdi
movq %rax, %rsi
callq 0x69b0
movl %eax, %r14d
testl %eax, %eax
je 0x1900a
leaq 0x7b3f(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x290f, %edx           # imm = 0x290F
callq 0x6de0
movl %r14d, %ebp
jmp 0x1900a
leaq 0x7ba6(%rip), %rdx      # 0x20f0d
movl $0x18, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x7b0f(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x28f9, %edx           # imm = 0x28F9
jmp 0x19063
leaq 0x7bbc(%rip), %rdx      # 0x20f4b
movl $0x20, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x7ae7(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x2906, %edx           # imm = 0x2906
jmp 0x19063
leaq 0x7b36(%rip), %rdx      # 0x20eed
movl $0x18, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x7abf(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x28f3, %edx           # imm = 0x28F3
jmp 0x19063
leaq 0x7b4b(%rip), %rdx      # 0x20f2a
movl $0x8, %esi
movq %rbx, %rdi
callq 0x6ba0
leaq 0x7a97(%rip), %rsi      # 0x20e8a
movq %rbx, %rdi
movl $0x2900, %edx           # imm = 0x2900
jmp 0x19063