// File: /workspace/github_cpp_makefile_star2_O3/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 0x77c3b(%rip), %r14     # 0x8bfa0
movq (%r14), %rdi
leaq 0x554ba(%rip), %rsi     # 0x69829
leaq 0x55725(%rip), %rdx     # 0x69a9b
xorl %eax, %eax
callq 0xb7a0
movq (%r14), %rdi
movq (%r12), %r8
leaq 0x55690(%rip), %rsi     # 0x69a1b
movq %rbx, %rdx
movq %r15, %rcx
movq %rbp, %r9
xorl %eax, %eax
callq 0xb7a0
movq (%r14), %rsi
movl $0xa, %edi
callq 0xb690
cmpl $0x0, (%rbx)
jne 0x1463d
movq 0xba8(%rbx), %rdi
testq %rdi, %rdi
je 0x1443b
callq 0xf8d9
testq %rax, %rax
js 0x1443b
movq %rax, %r15
movq (%r14), %rdi
leaq 0x55455(%rip), %rsi     # 0x69829
leaq 0x556c0(%rip), %rdx     # 0x69a9b
xorl %eax, %eax
callq 0xb7a0
movq (%r14), %rdi
leaq 0x556f6(%rip), %rsi     # 0x69ae2
movq %r15, %rdx
xorl %eax, %eax
callq 0xb7a0
movq (%r14), %rsi
movl $0xa, %edi
callq 0xb690
movq (%r12), %r13
movq 0xba8(%rbx), %rdi
movq %r15, %rsi
callq 0xf891
testq %r13, %r13
je 0x14456
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 0xb3f0
movq (%r12), %r15
testq %r15, %r15
jne 0x14485
movslq 0xb20(%rbx), %r14
cmpq $0xf, %r14
jle 0x1445f
xorl %r15d, %r15d
jmp 0x14481
movq %rax, (%r12)
jmp 0x1462e
leaq (,%rbp,4), %rdi
callq 0xb6f0
movq %rax, %r15
movq %rax, 0xb28(%rbx,%r14,8)
leal 0x1(%r14), %eax
movl %eax, 0xb20(%rbx)
movq %r15, (%r12)
shlq $0x2, %rbp
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 0x144ca
movq %r12, %rdi
movq %r13, %rdx
callq 0xb3f0
movl 0xb00(%rbx), %eax
addl %r13d, %eax
movl %eax, 0xb00(%rbx)
subq %r13, %r14
jle 0x1450e
movq 0xb08(%rbx), %rdi
movq 0x38(%rdi), %rax
testq %rax, %rax
je 0x1450e
xorl %esi, %esi
callq *%rax
cmpq $0x1, %rax
jne 0x1450e
addq %r13, %r12
movq 0xb08(%rbx), %rcx
movq 0x10(%rcx), %rsi
movl $0x0, 0xb00(%rbx)
xorl %eax, %eax
jmp 0x144a0
movq 0xba8(%rbx), %rdi
testq %rdi, %rdi
je 0x1462e
movslq 0xb20(%rbx), %rax
movq $-0x1, %r13
testq %rax, %rax
jle 0x1454a
xorl %ecx, %ecx
cmpq %r15, 0xb28(%rbx,%rcx,8)
je 0x14547
incq %rcx
cmpq %rcx, %rax
jne 0x14533
jmp 0x1454a
movq %rcx, %r13
movl $0x1, %esi
movq %rbp, %rdx
movq %r15, %rcx
callq 0xf843
movq %rax, %r12
testq %r13, %r13
jns 0x1456b
testq %r12, %r12
js 0x1462e
movq 0x77a2e(%rip), %r14     # 0x8bfa0
movq (%r14), %rdi
leaq 0x552ad(%rip), %rsi     # 0x69829
leaq 0x55575(%rip), %rdx     # 0x69af8
xorl %eax, %eax
callq 0xb7a0
movq (%r14), %rdi
testq %r12, %r12
js 0x145c1
leaq 0x55573(%rip), %rsi     # 0x69b0c
movq %r12, %rdx
xorl %eax, %eax
callq 0xb7a0
movq (%r14), %rsi
movl $0xa, %edi
callq 0xb690
movq 0xba8(%rbx), %rdi
movq %r12, %rsi
callq 0xf881
jmp 0x145fe
leaq 0x55560(%rip), %rsi     # 0x69b28
movl $0x1, %edx
movq %rbp, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0xb7a0
movq (%r14), %rsi
movl $0xa, %edi
callq 0xb690
movq 0xba8(%rbx), %rdi
movl $0x1, %esi
movq %rbp, %rdx
movq %r15, %rcx
callq 0xf710
testq %r13, %r13
js 0x1462e
movslq 0xb20(%rbx), %rax
cmpq %rax, %r13
jge 0x1462e
leaq -0x1(%rax), %rcx
movl %ecx, 0xb20(%rbx)
cmpq %rcx, %r13
je 0x1462e
movq 0xb20(%rbx,%rax,8), %rax
movq %rax, 0xb28(%rbx,%r13,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xc048
jmp 0x143b1