// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
subq %rdx, %rcx
subq %rcx, %rax
cmpq $0x8, %rax
jae 0x1f674
movq -0x10(%rbp), %rdi
leaq 0x6684(%rip), %rsi      # 0x25ce2
movl $0x28b4, %edx           # imm = 0x28B4
callq 0x6f20
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x1fdfe
jmp 0x1f676
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x6b10
movl -0x20(%rbp), %eax
sarl $0x8, %eax
cmpl $0x42000f, %eax         # imm = 0x42000F
je 0x1f6c6
movq -0x10(%rbp), %rdi
leaq 0x6632(%rip), %rsi      # 0x25ce2
movl $0x28bb, %edx           # imm = 0x28BB
callq 0x6f20
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
jmp 0x1fdfe
movl -0x20(%rbp), %eax
andl $0xff, %eax
cmpl $0x1, %eax
je 0x1f6f4
movq -0x10(%rbp), %rdi
leaq 0x6604(%rip), %rsi      # 0x25ce2
movl $0x28bb, %edx           # imm = 0x28BB
callq 0x6f20
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
jmp 0x1fdfe
jmp 0x1f6f6
jmp 0x1f6f8
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x6520
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
subq %rdx, %rcx
subq %rcx, %rax
movl -0x24(%rbp), %ecx
cmpq %rcx, %rax
jae 0x1f74b
movq -0x10(%rbp), %rdi
leaq 0x65ad(%rip), %rsi      # 0x25ce2
movl $0x28be, %edx           # imm = 0x28BE
callq 0x6f20
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x1fdfe
jmp 0x1f74d
movq -0x10(%rbp), %rdi
movl $0x42005c, %esi         # imm = 0x42005C
callq 0x6300
cmpl $0x0, %eax
je 0x1f7fe
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x42005c, %esi         # imm = 0x42005C
callq 0x6c00
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1f79f
movq -0x10(%rbp), %rdi
leaq 0x6558(%rip), %rsi      # 0x25ce2
movl $0x28c3, %edx           # imm = 0x28C3
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1fdfe
jmp 0x1f7a1
jmp 0x1f7a3
movq -0x10(%rbp), %rax
movl 0x18(%rax), %edi
movq -0x18(%rbp), %rax
movl (%rax), %edx
movl $0x42005c, %esi         # imm = 0x42005C
callq 0x63a0
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x1f7fa
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %edx
movl -0x28(%rbp), %ecx
movl $0x42005c, %esi         # imm = 0x42005C
callq 0x6140
movq -0x10(%rbp), %rdi
leaq 0x64fd(%rip), %rsi      # 0x25ce2
movl $0x28c4, %edx           # imm = 0x28C4
callq 0x6f20
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1fdfe
jmp 0x1f7fc
jmp 0x1f7fe
movq -0x10(%rbp), %rdi
movl $0x420093, %esi         # imm = 0x420093
callq 0x6300
cmpl $0x0, %eax
je 0x1f8c8
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *%rax
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x1f883
movq -0x10(%rbp), %rdi
movl $0x10, %esi
leaq 0x63ee(%rip), %rdx      # 0x25c4b
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x6475(%rip), %rsi      # 0x25ce2
movl $0x28ca, %edx           # imm = 0x28CA
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x1fdfe
jmp 0x1f885
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x420093, %esi         # imm = 0x420093
callq 0x6df0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1f8c4
movq -0x10(%rbp), %rdi
leaq 0x6433(%rip), %rsi      # 0x25ce2
movl $0x28cd, %edx           # imm = 0x28CD
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1fdfe
jmp 0x1f8c6
jmp 0x1f8c8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
addq $0x10, %rdx
movl $0x42007f, %esi         # imm = 0x42007F
callq 0x6c00
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1f907
movq -0x10(%rbp), %rdi
leaq 0x63f0(%rip), %rsi      # 0x25ce2
movl $0x28d1, %edx           # imm = 0x28D1
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1fdfe
jmp 0x1f909
jmp 0x1f90b
movq -0x10(%rbp), %rax
movl 0x18(%rax), %edi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
movl $0x42007f, %esi         # imm = 0x42007F
callq 0x63a0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x1f964
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
movl -0x2c(%rbp), %ecx
movl $0x42007f, %esi         # imm = 0x42007F
callq 0x6140
movq -0x10(%rbp), %rdi
leaq 0x6393(%rip), %rsi      # 0x25ce2
movl $0x28d2, %edx           # imm = 0x28D2
callq 0x6f20
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1fdfe
jmp 0x1f966
movq -0x10(%rbp), %rdi
movl $0x42007e, %esi         # imm = 0x42007E
callq 0x6300
cmpl $0x0, %eax
je 0x1f9bc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
addq $0x14, %rdx
movl $0x42007e, %esi         # imm = 0x42007E
callq 0x6c00
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1f9b8
movq -0x10(%rbp), %rdi
leaq 0x633f(%rip), %rsi      # 0x25ce2
movl $0x28d7, %edx           # imm = 0x28D7
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1fdfe
jmp 0x1f9ba
jmp 0x1f9bc
movq -0x10(%rbp), %rdi
movl $0x42007d, %esi         # imm = 0x42007D
callq 0x6300
cmpl $0x0, %eax
je 0x1fa86
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *%rax
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x1fa41
movq -0x10(%rbp), %rdi
movl $0x10, %esi
leaq 0x62e7(%rip), %rdx      # 0x25d02
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x62b7(%rip), %rsi      # 0x25ce2
movl $0x28dd, %edx           # imm = 0x28DD
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x1fdfe
jmp 0x1fa43
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
movl $0x42007d, %esi         # imm = 0x42007D
callq 0x65b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1fa82
movq -0x10(%rbp), %rdi
leaq 0x6275(%rip), %rsi      # 0x25ce2
movl $0x28e0, %edx           # imm = 0x28E0
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1fdfe
jmp 0x1fa84
jmp 0x1fa86
movq -0x10(%rbp), %rdi
movl $0x420006, %esi         # imm = 0x420006
callq 0x6300
cmpl $0x0, %eax
je 0x1fb50
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq *%rax
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x1fb0b
movq -0x10(%rbp), %rdi
movl $0x10, %esi
leaq 0x6237(%rip), %rdx      # 0x25d1c
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x61ed(%rip), %rsi      # 0x25ce2
movl $0x28e6, %edx           # imm = 0x28E6
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x1fdfe
jmp 0x1fb0d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movl $0x420006, %esi         # imm = 0x420006
callq 0x6df0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1fb4c
movq -0x10(%rbp), %rdi
leaq 0x61ab(%rip), %rsi      # 0x25ce2
movl $0x28e9, %edx           # imm = 0x28E9
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1fdfe
jmp 0x1fb4e
jmp 0x1fb50
movq -0x10(%rbp), %rdi
movl $0x42007c, %esi         # imm = 0x42007C
callq 0x6300
cmpl $0x0, %eax
je 0x1fdf7
movq -0x18(%rbp), %rax
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x17, %eax
ja 0x1fdb0
movq -0x38(%rbp), %rax
leaq 0x4ebb(%rip), %rcx      # 0x24a44
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *%rax
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x1fc00
movq -0x10(%rbp), %rdi
movl $0x18, %esi
leaq 0x616b(%rip), %rdx      # 0x25d45
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x60f8(%rip), %rsi      # 0x25ce2
movl $0x28f3, %edx           # imm = 0x28F3
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x1fdfe
jmp 0x1fc02
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x6da0
movl %eax, -0x1c(%rbp)
jmp 0x1fdce
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movl $0x1, %esi
movl $0x18, %edx
callq *%rax
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x1fc89
movq -0x10(%rbp), %rdi
movl $0x18, %esi
leaq 0x6102(%rip), %rdx      # 0x25d65
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x606f(%rip), %rsi      # 0x25ce2
movl $0x28f9, %edx           # imm = 0x28F9
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x1fdfe
jmp 0x1fc8b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x65c0
movl %eax, -0x1c(%rbp)
jmp 0x1fdce
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movl $0x1, %esi
movl $0x8, %edx
callq *%rax
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x1fd12
movq -0x10(%rbp), %rdi
movl $0x8, %esi
leaq 0x6096(%rip), %rdx      # 0x25d82
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x5fe6(%rip), %rsi      # 0x25ce2
movl $0x2900, %edx           # imm = 0x2900
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x1fdfe
jmp 0x1fd14
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x6ab0
movl %eax, -0x1c(%rbp)
jmp 0x1fdce
movq -0x10(%rbp), %rax
movq 0x868(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x890(%rcx), %rdi
movl $0x1, %esi
movl $0x20, %edx
callq *%rax
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x1fd98
movq -0x10(%rbp), %rdi
movl $0x20, %esi
leaq 0x602e(%rip), %rdx      # 0x25da3
callq 0x6cd0
movq -0x10(%rbp), %rdi
leaq 0x5f5d(%rip), %rsi      # 0x25ce2
movl $0x2906, %edx           # imm = 0x2906
callq 0x6f20
movl $0xfffffff4, -0x4(%rbp) # imm = 0xFFFFFFF4
jmp 0x1fdfe
jmp 0x1fd9a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x6890
movl %eax, -0x1c(%rbp)
jmp 0x1fdce
movq -0x10(%rbp), %rdi
leaq 0x5f27(%rip), %rsi      # 0x25ce2
movl $0x290b, %edx           # imm = 0x290B
callq 0x6f20
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1fdfe
jmp 0x1fdd0
cmpl $0x0, -0x1c(%rbp)
je 0x1fdf3
movq -0x10(%rbp), %rdi
leaq 0x5f01(%rip), %rsi      # 0x25ce2
movl $0x290f, %edx           # imm = 0x290F
callq 0x6f20
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1fdfe
jmp 0x1fdf5
jmp 0x1fdf7
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)