// File: mh0fm4[P]SCDC/src/lib/redirect/redirect/redirect_call.cc
// Function: redirect_call_cmd
int redirect_call_cmd(redirect_call_t *rc, const char *cmd, const char *params, scdc_dataset_input_t *input, scdc_dataset_output_t *output, scdc_result_t *result)
{
  TRACE_F("cmd: '%s', params: '%s', input: %p, output: %p, result: %p", cmd, params, input, output, result);

#if REDIRECT_CALL_PARAMS_CACHE
  if (redirect_cache_check_cmd(rc->cache, cmd, params, result)) return 0;
#endif

  rdint_t n = 0;
#if REDIRECT_CALL_PARAMS_CACHE
  char cache_state[REDIRECT_CALL_CACHE_STATE_MAX_SIZE] = { '\0' };
  rdint_t cache_state_size = 0;
  n += redirect_call_get_inout_conf_str(params + n, "cstate", cache_state, &cache_state_size);
  if (rc->cache) redirect_cache_check_state(rc->cache, cache_state, cache_state_size);
#endif
  rc->input_conf_n = 0;
  n += redirect_call_get_inout_conf_str(params + n, "iconf", rc->input_conf, 0);
  rc->output_conf_get_n = 0;
  n += redirect_call_get_inout_conf_str(params + n, "oconf", rc->output_conf_get, 0);

  rc->input = input;
  rc->output = output;
  rc->result = result;

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq 0xc10f6(%rip), %rax     # 0xd3fb0
movq (%rax), %rdi
leaq 0x9294d(%rip), %rsi     # 0xa5811
leaq 0x929df(%rip), %rdx     # 0xa58aa
movb $0x0, %al
callq 0xc9a0
movq 0xc10d7(%rip), %rax     # 0xd3fb0
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
movq -0x38(%rbp), %rax
leaq 0x9257b(%rip), %rsi     # 0xa5472
movq %rax, (%rsp)
movb $0x0, %al
callq 0xc9a0
movq 0xc10a7(%rip), %rax     # 0xd3fb0
movq (%rax), %rdi
leaq 0x92995(%rip), %rsi     # 0xa58a8
movb $0x0, %al
callq 0xc9a0
movq -0x10(%rbp), %rax
movq 0xba8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x10f50
cmpl $0x0, %eax
je 0x12f47
movl $0x0, -0x4(%rbp)
jmp 0x1306b
movq $0x0, -0x40(%rbp)
leaq -0x140(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0xc350
movq $0x0, -0x148(%rbp)
movq -0x20(%rbp), %rdi
addq -0x40(%rbp), %rdi
leaq -0x140(%rbp), %rdx
leaq 0x928ca(%rip), %rsi     # 0xa584d
leaq -0x148(%rbp), %rcx
callq 0x12490
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xba8(%rax)
je 0x12fc3
movq -0x10(%rbp), %rax
movq 0xba8(%rax), %rdi
leaq -0x140(%rbp), %rsi
movq -0x148(%rbp), %rdx
callq 0x11440
movq -0x10(%rbp), %rax
movq $0x0, 0x150(%rax)
movq -0x20(%rbp), %rdi
addq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x168, %rdx            # imm = 0x168
leaq 0x92868(%rip), %rsi     # 0xa5854
xorl %eax, %eax
movl %eax, %ecx
callq 0x12490
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0x160(%rax)
movq -0x20(%rbp), %rdi
addq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x568, %rdx            # imm = 0x568
leaq 0x92834(%rip), %rsi     # 0xa585a
xorl %eax, %eax
movl %eax, %ecx
callq 0x12490
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xb08(%rax)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xb10(%rax)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xb18(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw (%rax,%rax)