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

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

#if REDIRECT_CALL_PARAMS_CACHE
  if (rc->cache)
  {
    rdint_t entry_index = redirect_cache_get_next_param_entry_index(rc->cache);

    if (entry_index >= 0)
    {
      TRACE_F("using cache entry %" rdint_fmt, entry_index);
      if (*b)
      {
        /* copy cache entry to buffer */
        memcpy(*b, redirect_cache_get_entry_buf(rc->cache, entry_index), n * sizeof(T));

      } else
      {
        /* reuse buffer of cache entry */
        *b = static_cast<T *>(redirect_cache_get_entry_buf(rc->cache, entry_index));
      }

      return;
    }
  }
#endif

  if (*b == NULL)
  {
    /* allocate buffer */
    *b = static_cast<T *>(redirect_call_alloc_buf(rc, n * sizeof(T)));
  }

  /* copy data from input to buffer */
  consume_input_dense<T>(rc, *b, n);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
movq 0x61c6c(%rip), %r14     # 0x74fb8
movq (%r14), %rdi
leaq 0x3d4b3(%rip), %rsi     # 0x50809
leaq 0x3d71e(%rip), %rdx     # 0x50a7b
xorl %eax, %eax
callq 0xb7c0
movq (%r14), %rdi
movq (%r12), %r8
leaq 0x3d689(%rip), %rsi     # 0x509fb
movq %rbx, %rdx
movq %r15, %rcx
movq %rbp, %r9
xorl %eax, %eax
callq 0xb7c0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0xb6b0
cmpl $0x0, (%rbx)
jne 0x135c4
movq 0xba8(%rbx), %rdi
testq %rdi, %rdi
je 0x13426
callq 0xed05
testq %rax, %rax
js 0x13426
movq %rax, %r15
movq (%r14), %rdi
leaq 0x3d44c(%rip), %rsi     # 0x50809
leaq 0x3d6b7(%rip), %rdx     # 0x50a7b
xorl %eax, %eax
callq 0xb7c0
movq (%r14), %rdi
leaq 0x3d6ed(%rip), %rsi     # 0x50ac2
movq %r15, %rdx
xorl %eax, %eax
callq 0xb7c0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0xb6b0
movq (%r12), %r13
movq 0xba8(%rbx), %rdi
movq %r15, %rsi
callq 0xecc1
testq %r13, %r13
je 0x13556
shlq $0x2, %rbp
movq %r13, %rdi
movq %rax, %rsi
movq %rbp, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb420
movq (%r12), %r15
shlq $0x2, %rbp
testq %r15, %r15
jne 0x13445
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x114ce
movq %rax, %r15
movq %rax, (%r12)
movq 0xb08(%rbx), %rcx
movq 0x10(%rcx), %rsi
movl 0xb00(%rbx), %eax
movq %r15, %r12
movq %rbp, %r14
movq 0x20(%rcx), %r13
movslq %eax, %rcx
subq %rcx, %r13
cmpq %r13, %r14
cmovlq %r14, %r13
addq %rcx, %rsi
cmpq %rsi, %r12
je 0x13486
movq %r12, %rdi
movq %r13, %rdx
callq 0xb420
movl 0xb00(%rbx), %eax
addl %r13d, %eax
movl %eax, 0xb00(%rbx)
subq %r13, %r14
jle 0x134c7
movq 0xb08(%rbx), %rdi
movq 0x38(%rdi), %rax
testq %rax, %rax
je 0x134c7
xorl %esi, %esi
callq *%rax
cmpq $0x1, %rax
jne 0x134c7
addq %r13, %r12
movq 0xb08(%rbx), %rcx
movq 0x10(%rcx), %rsi
andl $0x0, 0xb00(%rbx)
xorl %eax, %eax
jmp 0x1345c
movq 0xba8(%rbx), %r13
testq %r13, %r13
je 0x135b5
movq %rbx, %rdi
movq %r15, %rsi
callq 0x11508
movq %rax, %r12
pushq $0x1
popq %rsi
movq %r13, %rdi
movq %rbp, %rdx
movq %r15, %rcx
callq 0xec77
testq %rax, %r12
js 0x135b5
movq %rax, %r13
movq 0x61aaf(%rip), %r14     # 0x74fb8
movq (%r14), %rdi
leaq 0x3d2f6(%rip), %rsi     # 0x50809
leaq 0x3d5be(%rip), %rdx     # 0x50ad8
xorl %eax, %eax
callq 0xb7c0
movq (%r14), %rdi
testq %r13, %r13
js 0x1355c
leaq 0x3d5bc(%rip), %rsi     # 0x50aec
movq %r13, %rdx
xorl %eax, %eax
callq 0xb7c0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0xb6b0
movq 0xba8(%rbx), %rdi
movq %r13, %rsi
callq 0xecb4
jmp 0x13597
movq %rax, (%r12)
jmp 0x135b5
leaq 0x3d5a5(%rip), %rsi     # 0x50b08
pushq $0x1
popq %r13
movl %r13d, %edx
movq %rbp, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0xb7c0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0xb6b0
movq 0xba8(%rbx), %rdi
movl %r13d, %esi
movq %rbp, %rdx
movq %r15, %rcx
callq 0xeb5f
testq %r12, %r12
js 0x135b5
movq %rbx, %rdi
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11530
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x61a0d(%rip), %rax     # 0x74fd8
movq (%rax), %rcx
leaq 0x3d4ce(%rip), %rdi     # 0x50aa3
pushq $0x1e
popq %rsi
pushq $0x1
popq %rdx
callq 0xba80
jmp 0x13396