// File: mh0fm4[P]SCDC/test/units/redirect/redirect_cli.c
// Function: test_param_array
void test_param_array(const char *uri)
{
  redirect_call_t rc;

  redirect_call_create_scdc(&rc, "param_array", uri);

  rdint_t in_n = 10;
  double *in_v = malloc(in_n * sizeof(*in_v));
  vector_init(in_v, in_n, 1, 1.0, NAN);
  printf("in_v: %p, in_n: %" rdint_fmt "\n", in_v, in_n);
  redirect_call_print_param_array_double(in_v, in_n);
  redirect_call_put_input_conf_rdint(&rc, "in_n", in_n);
  redirect_call_put_input_param_array_double(&rc, "in_v", in_v, in_n);

  rdint_t out_n = 10;
  double *out_v = malloc(out_n * sizeof(*out_v));
  printf("out_v: %p, out_n: %" rdint_fmt "\n", out_v, out_n);
  redirect_call_put_input_conf_rdint(&rc, "out_n", out_n);
  redirect_call_put_output_param_array_double(&rc, "out_v", out_v, out_n);

  redirect_call_execute(&rc);

  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);
  redirect_call_print_param_array_double(out_v, out_n);

  free(in_v);
  free(out_v);

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

  redirect_call_destroy_scdc(&rc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xbe0, %rsp            # imm = 0xBE0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdx
leaq -0xbb8(%rbp), %rdi
leaq 0x9730a(%rip), %rsi     # 0xa554b
callq 0x118e0
movq $0xa, -0xbc0(%rbp)
movq -0xbc0(%rbp), %rdi
shlq $0x3, %rdi
callq 0xc900
movq %rax, -0xbc8(%rbp)
movq -0xbc8(%rbp), %rdi
movq -0xbc0(%rbp), %rsi
movl $0x1, %edx
movsd 0x96d8d(%rip), %xmm0    # 0xa5010
movsd 0x96d8d(%rip), %xmm1    # 0xa5018
callq 0xedd0
movq -0xbc8(%rbp), %rsi
movq -0xbc0(%rbp), %rdx
leaq 0x96f68(%rip), %rdi     # 0xa520d
movb $0x0, %al
callq 0xcd30
movq -0xbc8(%rbp), %rdi
movq -0xbc0(%rbp), %rsi
callq 0x14d30
movq -0xbc0(%rbp), %rdx
leaq -0xbb8(%rbp), %rdi
leaq 0x96f4e(%rip), %rsi     # 0xa5222
callq 0x12550
movq -0xbc8(%rbp), %rdx
movq -0xbc0(%rbp), %rcx
leaq -0xbb8(%rbp), %rdi
leaq 0x96f32(%rip), %rsi     # 0xa5227
callq 0x14d90
movq $0xa, -0xbd0(%rbp)
movq -0xbd0(%rbp), %rdi
shlq $0x3, %rdi
callq 0xc900
movq %rax, -0xbd8(%rbp)
movq -0xbd8(%rbp), %rsi
movq -0xbd0(%rbp), %rdx
leaq 0x96e61(%rip), %rdi     # 0xa5192
movb $0x0, %al
callq 0xcd30
movq -0xbd0(%rbp), %rdx
leaq -0xbb8(%rbp), %rdi
leaq 0x96e5c(%rip), %rsi     # 0xa51a9
callq 0x12550
movq -0xbd8(%rbp), %rdx
movq -0xbd0(%rbp), %rcx
leaq -0xbb8(%rbp), %rdi
leaq 0x96e41(%rip), %rsi     # 0xa51af
callq 0x14e10
leaq -0xbb8(%rbp), %rdi
callq 0x11af0
leaq -0xbb8(%rbp), %rdi
leaq 0x96e22(%rip), %rsi     # 0xa51af
leaq -0xbd8(%rbp), %rdx
leaq -0xbd0(%rbp), %rcx
callq 0x14e50
movq -0xbd8(%rbp), %rsi
movq -0xbd0(%rbp), %rdx
leaq 0x96ddd(%rip), %rdi     # 0xa5192
movb $0x0, %al
callq 0xcd30
movq -0xbd8(%rbp), %rdi
movq -0xbd0(%rbp), %rsi
callq 0x14d30
movq -0xbc8(%rbp), %rdi
callq 0xc830
movq -0xbd8(%rbp), %rdi
callq 0xc830
movq 0xc5bc2(%rip), %rax     # 0xd3fb0
movq (%rax), %rdi
leaq 0x96c7a(%rip), %rsi     # 0xa5072
leaq 0x96e2d(%rip), %rdx     # 0xa522c
movb $0x0, %al
callq 0xc9a0
movq 0xc5ba3(%rip), %rax     # 0xd3fb0
movq (%rax), %rax
movq %rax, -0xbe0(%rbp)
leaq -0xbb8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x13700
movq -0xbe0(%rbp), %rdi
movq %rax, %rdx
leaq 0x9731e(%rip), %rsi     # 0xa5759
movb $0x0, %al
callq 0xc9a0
movq 0xc5b67(%rip), %rax     # 0xd3fb0
movq (%rax), %rdi
leaq 0x97455(%rip), %rsi     # 0xa58a8
movb $0x0, %al
callq 0xc9a0
leaq -0xbb8(%rbp), %rdi
callq 0x11a50
addq $0xbe0, %rsp            # imm = 0xBE0
popq %rbp
retq
nop