// File: /workspace/github_cpp_makefile_star2_O2/mh0fm4[P]SCDC/src/lib/redirect/redirect/redirect_call.cc
// Function: void redirect_call_put_input_param_blocks_val<float>(_redirect_call_t*, char const*, float const*, long, long, long)
static void redirect_call_put_input_param_blocks_val(redirect_call_t *rc, const char *id, const T *b, rdint_t count, rdint_t size, rdint_t stride)
{
  TRACE_F("rc: %p, id: '%s', b: %p, count: %" rdint_fmt ", size: %" rdint_fmt ", stride: %" rdint_fmt, rc, id, b, count, size, stride);

  /* client only */
  ASSERT(rc->client);

  bool transfer_dense = false;
  rdint_t send_stride = stride;
  rdint_t transfer_stride = stride;

  if (size < stride)
  {
#if REDIRECT_CALL_INPUT_PARAM_BLOCKS == REDIRECT_CALL_BLOCKS_PLAIN
    TRACE_F("transfer plain");
    transfer_dense = true;
    send_stride = stride;
    transfer_stride = stride;
#elif REDIRECT_CALL_INPUT_PARAM_BLOCKS == REDIRECT_CALL_BLOCKS_PACK_IP
    TRACE_F("transform in-place to stride %" rdint_fmt, size);
    redirect_data_blocks_transform_val<T>(count, size, stride, const_cast<T *>(b), size, NULL);
    transfer_dense = true;
    send_stride = size;
    transfer_stride = size;
#elif REDIRECT_CALL_INPUT_PARAM_BLOCKS == REDIRECT_CALL_BLOCKS_PACK_OP
    TRACE_F("transform out-of-place to stride %" rdint_fmt, size);
    T *b_tmp = static_cast<T *>(redirect_call_alloc_buf(rc, count * size * sizeof(T)));
    redirect_data_blocks_transform_val<T>(count, size, stride, const_cast<T *>(b), size, b_tmp);
    b = b_tmp;
    transfer_dense = true;
    send_stride = size;
    transfer_stride = size;
#elif REDIRECT_CALL_INPUT_PARAM_BLOCKS == REDIRECT_CALL_BLOCKS_PIECES
    TRACE_F("process in pieces");
    transfer_dense = false;
    send_stride = stride;
    transfer_stride = size;
#endif
  }

  TRACE_F("send stride: %" rdint_fmt ", transfer stride: %" rdint_fmt, send_stride, transfer_stride);
  redirect_call_put_input_conf_rdint(rc, "stride", transfer_stride);

  if (size >= send_stride || transfer_dense)
  {
    TRACE_F("dense: %" rdint_fmt, get_blocks_cont_size(count, size, send_stride));
    register_param_dense<T>(rc, b, get_blocks_cont_size(count, size, send_stride));

  } else
  {
    TRACE_F("blocks: %" rdint_fmt " x %" rdint_fmt " / %" rdint_fmt, count, size, send_stride);
    register_param_blocks<T>(rc, b, count, size, send_stride);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movq %r8, %r13
movq %rcx, 0x8(%rsp)
movq %rdx, %rbx
movq %rsi, %rbp
movq %rdi, %r12
movq 0x632ef(%rip), %r14     # 0x74fb8
movq (%r14), %rdi
leaq 0x3eb36(%rip), %rsi     # 0x50809
leaq 0x3f05c(%rip), %rdx     # 0x50d36
xorl %eax, %eax
callq 0xb7c0
movq (%r14), %rdi
leaq 0x3f074(%rip), %rsi     # 0x50d5f
movq %r12, %rdx
movq %rbp, %rcx
movq %rbx, 0x10(%rsp)
movq %rbx, %r8
movq 0x8(%rsp), %rbx
movq %rbx, %r9
xorl %eax, %eax
pushq %r15
pushq %r13
callq 0xb7c0
popq %rcx
popq %rdx
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0xb6b0
movq %r12, %rbp
cmpl $0x0, (%r12)
je 0x11e2c
cmpq %r15, %r13
jge 0x11d64
movq (%r14), %rdi
leaq 0x3ead3(%rip), %rsi     # 0x50809
leaq 0x3eff9(%rip), %rdx     # 0x50d36
xorl %eax, %eax
callq 0xb7c0
movq (%r14), %rcx
leaq 0x3f04d(%rip), %rdi     # 0x50d9b
pushq $0xe
popq %rsi
pushq $0x1
popq %rdx
callq 0xba80
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0xb6b0
leaq -0x1(%rbx), %rax
imulq %r15, %rax
addq %r13, %rax
testq %r13, %r13
cmoveq %r13, %rax
cmpq $0x1, %rbx
movq (%r14), %rdi
leaq 0x3efb2(%rip), %rdx     # 0x50d36
leaq 0x3ea7e(%rip), %rsi     # 0x50809
movl $0x0, %r12d
cmovaeq %rax, %r12
xorl %eax, %eax
callq 0xb7c0
movq (%r14), %rdi
leaq 0x3f004(%rip), %rsi     # 0x50daa
movq %r15, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xb7c0
movq (%r14), %rsi
leaq 0x3f014(%rip), %rbx     # 0x50dd1
pushq $0xa
popq %r13
movl %r13d, %edi
callq 0xb6b0
movq %rbp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xf48b
movq (%r14), %rdi
leaq 0x3ea28(%rip), %rsi     # 0x50809
leaq 0x3ef4e(%rip), %rdx     # 0x50d36
xorl %eax, %eax
callq 0xb7c0
movq (%r14), %rdi
leaq 0x3f05d(%rip), %rsi     # 0x50e56
movq %r12, %rdx
xorl %eax, %eax
callq 0xb7c0
movq (%r14), %rsi
movl %r13d, %edi
callq 0xb6b0
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1162d
movq 0x631a5(%rip), %rax     # 0x74fd8
movq (%rax), %rcx
leaq 0x3ebde(%rip), %rdi     # 0x50a1b
pushq $0x1d
popq %rsi
pushq $0x1
popq %rdx
callq 0xba80
jmp 0x11d27