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

  if (rc->client) /* client */
  {
    /* FIXME: use buffer for output */

  } else /* server */
  {
    /* register dense output */
    register_param_dense<T>(rc, b, n);

#if REDIRECT_CALL_PARAMS_CACHE
    /* try to add an entry to the cache (dense output is cacheable) */
    if (rc->cache)
    {
      rdint_t buf_index = redirect_call_find_buf(rc, b);
      rdint_t entry_index = redirect_cache_find_entry(rc->cache, get_type<T>(), n * sizeof(T), b);

      /* caching entry if buffer is allocated or entry is already cached */
      if (buf_index >= 0 || entry_index >= 0)
      {
        if (entry_index >= 0)
        {
          TRACE_F("updating entry %" rdint_fmt " of cache", entry_index);
          redirect_cache_update_entry(rc->cache, entry_index);

        } else
        {
          TRACE_F("adding entry [%d,%" rdint_fmt ",%p] to cache", get_type<T>(), static_cast<rdint_t>(n * sizeof(T)), b);
          redirect_cache_put_entry(rc->cache, get_type<T>(), n * sizeof(T), b);
        }

        if (buf_index >= 0) redirect_call_remove_buf(rc, buf_index);
      }
    }
#endif
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x63616(%rip), %rbp     # 0x74fb8
movq (%rbp), %rdi
leaq 0x3ee5c(%rip), %rsi     # 0x50809
leaq 0x3f176(%rip), %rdx     # 0x50b2a
xorl %eax, %eax
callq 0xb7c0
movq (%rbp), %rdi
leaq 0x3f035(%rip), %rsi     # 0x509fb
movq %rbx, %rdx
movq %r12, %rcx
movq %r15, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0xb7c0
movq (%rbp), %rsi
pushq $0xa
popq %rdi
callq 0xb6b0
cmpl $0x0, (%rbx)
je 0x119f9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1162d
movq 0xba8(%rbx), %r13
testq %r13, %r13
je 0x119ea
movq %rbx, %rdi
movq %r15, %rsi
callq 0x11508
movq %rax, %r12
shlq $0x2, %r14
pushq $0x3
popq %rsi
movq %r13, %rdi
movq %r14, %rdx
movq %r15, %rcx
callq 0xec77
testq %rax, %r12
js 0x119ea
movq %rax, %r13
movq (%rbp), %rdi
leaq 0x3edc0(%rip), %rsi     # 0x50809
leaq 0x3f0da(%rip), %rdx     # 0x50b2a
xorl %eax, %eax
callq 0xb7c0
movq (%rbp), %rdi
testq %r13, %r13
js 0x11a8e
leaq 0x3f085(%rip), %rsi     # 0x50aec
movq %r13, %rdx
xorl %eax, %eax
callq 0xb7c0
movq (%rbp), %rsi
pushq $0xa
popq %rdi
callq 0xb6b0
movq 0xba8(%rbx), %rdi
movq %r13, %rsi
callq 0xecb4
jmp 0x11aca
leaq 0x3f073(%rip), %rsi     # 0x50b08
pushq $0x3
popq %r13
movl %r13d, %edx
movq %r14, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0xb7c0
movq (%rbp), %rsi
pushq $0xa
popq %rdi
callq 0xb6b0
movq 0xba8(%rbx), %rdi
movl %r13d, %esi
movq %r14, %rdx
movq %r15, %rcx
callq 0xeb5f
testq %r12, %r12
js 0x119ea
movq %rbx, %rdi
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11530