// File: mh0fm4[P]SCDC/test/units/redirect/redirect_test.c
// Function: do_cache
static void do_cache(redirect_call_t *rc, int step)
{
  TRACE_F("rc: %p", rc);

  REDIRECT_TEST_TIMING_INIT_();

  rdint_t in_n0 = 0;
  double *in_v0 = NULL;
  redirect_call_get_input_conf_rdint(rc, "in_n0", &in_n0);
  redirect_call_get_input_param_array_double(rc, "in_v0", &in_v0, &in_n0);
  printf("in_v0: %p, in_n0: %" rdint_fmt "\n", in_v0, in_n0);
  redirect_call_print_param_array_double(in_v0, in_n0);

  if (step == '0')
  {
    rdint_t out_n = 0;
    double *out_v = NULL;
    redirect_call_get_input_conf_rdint(rc, "out_n", &out_n);
    redirect_call_get_output_param_array_double(rc, "out_v", &out_v, &out_n);
    printf("out_v: %p, out_n: %" rdint_fmt "\n", out_v, out_n);
    vector_init(out_v, out_n, 1, -1.0, NAN);
    redirect_call_print_param_array_double(out_v, out_n);
    redirect_call_put_output_param_array_double(rc, "out_v", out_v, out_n);
  }

  if (step == '1')
  {
    rdint_t in_n1 = 0;
    double *in_v1 = NULL;
    redirect_call_get_input_conf_rdint(rc, "in_n1", &in_n1);
    redirect_call_get_input_param_array_double(rc, "in_v1", &in_v1, &in_n1);
    printf("in_v1: %p, in_n1: %" rdint_fmt "\n", in_v1, in_n1);
    redirect_call_print_param_array_double(in_v1, in_n1);

    rdint_t in_n2 = 0;
    double *in_v2 = NULL;
    redirect_call_get_input_conf_rdint(rc, "in_n2", &in_n2);
    redirect_call_get_input_param_array_double(rc, "in_v2", &in_v2, &in_n2);
    printf("in_v2: %p, in_n2: %" rdint_fmt "\n", in_v2, in_n2);
    redirect_call_print_param_array_double(in_v2, in_n2);
  }

  redirect_call_set_result_str(rc, "OK");
  TRACE_F("result: '%s'", redirect_call_get_result_str(rc, NULL, 0));

  TRACE_F("return");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq 0xc46da(%rip), %rax     # 0xd3fb0
movq (%rax), %rdi
leaq 0x95af8(%rip), %rsi     # 0xa53d8
leaq 0x95c58(%rip), %rdx     # 0xa553f
movb $0x0, %al
callq 0xc9a0
movq 0xc46bb(%rip), %rax     # 0xd3fb0
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x95be1(%rip), %rsi     # 0xa54e4
movb $0x0, %al
callq 0xc9a0
movq 0xc469f(%rip), %rax     # 0xd3fb0
movq (%rax), %rdi
leaq 0x95f8d(%rip), %rsi     # 0xa58a8
movb $0x0, %al
callq 0xc9a0
jmp 0xf924
jmp 0xf926
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x95845(%rip), %rsi     # 0xa5186
leaq -0x18(%rbp), %rdx
callq 0x13080
movq -0x8(%rbp), %rdi
leaq 0x95837(%rip), %rsi     # 0xa518c
leaq -0x20(%rbp), %rdx
leaq -0x18(%rbp), %rcx
callq 0x14dd0
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x957fe(%rip), %rdi     # 0xa516f
movb $0x0, %al
callq 0xcd30
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x14d30
cmpl $0x30, -0xc(%rbp)
jne 0xfa28
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x957ff(%rip), %rsi     # 0xa51a9
leaq -0x28(%rbp), %rdx
callq 0x13080
movq -0x8(%rbp), %rdi
leaq 0x957f1(%rip), %rsi     # 0xa51af
leaq -0x30(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x14e50
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq 0x957b8(%rip), %rdi     # 0xa5192
movb $0x0, %al
callq 0xcd30
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl $0x1, %edx
movsd 0x959ba(%rip), %xmm0    # 0xa53b0
movsd 0x9561a(%rip), %xmm1    # 0xa5018
callq 0xedd0
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x14d30
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq 0x9578c(%rip), %rsi     # 0xa51af
callq 0x14e10
cmpl $0x31, -0xc(%rbp)
jne 0xfaf0
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x95791(%rip), %rsi     # 0xa51de
leaq -0x38(%rbp), %rdx
callq 0x13080
movq -0x8(%rbp), %rdi
leaq 0x95783(%rip), %rsi     # 0xa51e4
leaq -0x40(%rbp), %rdx
leaq -0x38(%rbp), %rcx
callq 0x14dd0
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq 0x9574a(%rip), %rdi     # 0xa51c7
movb $0x0, %al
callq 0xcd30
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x14d30
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x95755(%rip), %rsi     # 0xa5201
leaq -0x48(%rbp), %rdx
callq 0x13080
movq -0x8(%rbp), %rdi
leaq 0x95747(%rip), %rsi     # 0xa5207
leaq -0x50(%rbp), %rdx
leaq -0x48(%rbp), %rcx
callq 0x14dd0
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq 0x9570e(%rip), %rdi     # 0xa51ea
movb $0x0, %al
callq 0xcd30
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x14d30
movq -0x8(%rbp), %rdi
leaq 0x95a41(%rip), %rsi     # 0xa553c
callq 0x136d0
movq 0xc44a9(%rip), %rax     # 0xd3fb0
movq (%rax), %rdi
leaq 0x958c7(%rip), %rsi     # 0xa53d8
leaq 0x95a27(%rip), %rdx     # 0xa553f
movb $0x0, %al
callq 0xc9a0
movq 0xc448a(%rip), %rax     # 0xd3fb0
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x13700
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x95c0e(%rip), %rsi     # 0xa5759
movb $0x0, %al
callq 0xc9a0
movq 0xc4457(%rip), %rax     # 0xd3fb0
movq (%rax), %rdi
leaq 0x95d45(%rip), %rsi     # 0xa58a8
movb $0x0, %al
callq 0xc9a0
jmp 0xfb6c
movq 0xc443d(%rip), %rax     # 0xd3fb0
movq (%rax), %rdi
leaq 0x9585b(%rip), %rsi     # 0xa53d8
leaq 0x959bb(%rip), %rdx     # 0xa553f
movb $0x0, %al
callq 0xc9a0
movq 0xc441e(%rip), %rax     # 0xd3fb0
movq (%rax), %rdi
leaq 0x9589a(%rip), %rsi     # 0xa5436
movb $0x0, %al
callq 0xc9a0
movq 0xc4406(%rip), %rax     # 0xd3fb0
movq (%rax), %rdi
leaq 0x95cf4(%rip), %rsi     # 0xa58a8
movb $0x0, %al
callq 0xc9a0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)