// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/src/lib/redirect/redirect/redirect_call.cc
// Function: redirect_call_execute
int redirect_call_execute(redirect_call_t *rc)
{
#if REDIRECT_CALL_PARAMS_CACHE
  char cache_state[256];
  rdint_t cache_state_size = 0;

  if (rc->cache) redirect_cache_check(rc->cache, rc->dataset, rc->uri, cache_state, &cache_state_size);

  TRACE_F("cache_state: %.*s", static_cast<int>(cache_state_size), cache_state);
#endif

  char cmd[REDIRECT_CALL_URI_MAX_SIZE + REDIRECT_CALL_OP_MAX_SIZE + REDIRECT_CALL_CACHE_STATE_MAX_SIZE + REDIRECT_CALL_INPUT_CONF_MAX_SIZE + REDIRECT_CALL_OUTPUT_CONF_MAX_SIZE];
  rdint_t cmd_size = 0;

  if (rc->dataset == SCDC_DATASET_NULL) cmd_size += sprintf(cmd, "%s ", rc->uri);

  cmd_size += sprintf(cmd + cmd_size, "%s ", rc->op);

#if REDIRECT_CALL_PARAMS_CACHE
  cmd_size += redirect_call_put_inout_conf_str(cmd + cmd_size, "cstate", cache_state, cache_state_size);
#endif
  cmd_size += redirect_call_put_inout_conf_str(cmd + cmd_size, "iconf", rc->input_conf, rc->input_conf_n);
  cmd_size += redirect_call_put_inout_conf_str(cmd + cmd_size, "oconf", rc->output_conf_put, rc->output_conf_put_n);

  rc->input->next = do_input_next;
  rc->input->data = rc;
#if REDIRECT_CALL_PARAMS_NEW
  rc->params_state[0] = rc->params_state[1] = 0;
#else
  rc->input_state = 0;
#endif

  rc->input->next(rc->input, 0);

  TRACE_F("cmd: '%s'", cmd);

  if (scdc_dataset_cmd(rc->dataset, cmd, rc->input, rc->output) != SCDC_SUCCESS)
  {
    TRACE_F("failed");
    return 0;
  }

  /* extract result and output_conf_get from output */
  const char *s = scdc_last_result();
  rdint_t n = 0;
  n += redirect_call_get_inout_conf_str(s + n, "result", rc->result_str, 0);
  rc->output_conf_get_n = 0;
  n += redirect_call_get_inout_conf_str(s + n, "oconf", rc->output_conf_get, 0);

  TRACE_F("result: '%s'", rc->result_str);
  TRACE_F("output_conf_get: '%s'", rc->output_conf_get);

  rc->output_offset = 0;

  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x758, %rsp            # imm = 0x758
movq %rdi, %rbx
movq $0x0, 0x8(%rsp)
movq 0xba8(%rdi), %rdi
testq %rdi, %rdi
je 0xfa83
movq 0x148(%rbx), %rsi
leaq 0x44(%rbx), %rdx
leaq 0x10(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0xee14
movq 0x7c516(%rip), %r13     # 0x8bfa0
movq (%r13), %rdi
leaq 0x59d74(%rip), %rsi     # 0x69809
leaq 0x59d81(%rip), %rdx     # 0x6981d
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rdi
movl 0x8(%rsp), %edx
leaq 0x59d7e(%rip), %rsi     # 0x69833
leaq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rsi
movl $0xa, %edi
callq 0xb690
cmpq $0x0, 0x148(%rbx)
jne 0xfaf6
leaq 0x44(%rbx), %rdx
leaq 0x59ece(%rip), %rsi     # 0x699b2
leaq 0x110(%rsp), %rdi
xorl %eax, %eax
callq 0xb0d0
movslq %eax, %r14
leaq (%rsp,%r14), %rdi
addq $0x110, %rdi            # imm = 0x110
leaq 0x4(%rbx), %rdx
leaq 0x59ea6(%rip), %rsi     # 0x699b2
xorl %ebp, %ebp
xorl %eax, %eax
callq 0xb0d0
cltq
addq %r14, %rax
leaq (%rsp,%rax), %r14
addq $0x110, %r14            # imm = 0x110
movq 0x8(%rsp), %rcx
leaq 0x59d14(%rip), %rsi     # 0x69845
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0xfd2a
addq %rax, %r14
leaq 0x168(%rbx), %rdx
movq 0x150(%rbx), %rcx
leaq 0x59cf6(%rip), %rsi     # 0x6984c
movq %r14, %rdi
callq 0xfd2a
addq %rax, %r14
leaq 0x368(%rbx), %rdx
movq 0x158(%rbx), %rcx
leaq 0x59cdc(%rip), %rsi     # 0x69852
movq %r14, %rdi
callq 0xfd2a
movq 0xb08(%rbx), %rdi
leaq 0x1de(%rip), %rax       # 0xfd6a
movq %rax, 0x38(%rdi)
movq %rbx, 0x40(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x870(%rbx)
callq 0xfd6a
movq (%r13), %rdi
leaq 0x59c5b(%rip), %rsi     # 0x69809
leaq 0x59c68(%rip), %rdx     # 0x6981d
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rdi
leaq 0x59a6a(%rip), %rsi     # 0x69631
leaq 0x110(%rsp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rsi
movl $0xa, %edi
callq 0xb690
movq 0x148(%rbx), %rdi
movq 0xb08(%rbx), %rdx
movq 0xb10(%rbx), %rcx
movq %r14, %rsi
xorl %eax, %eax
callq 0x1aba8
cmpq $0x1, %rax
jne 0xfcd5
callq 0x19290
movq %rax, %r12
leaq 0x768(%rbx), %r15
movq %rax, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x1001f
movq $0x0, 0x160(%rbx)
addq %rax, %r12
leaq 0x568(%rbx), %r14
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x1001f
movq (%r13), %rdi
leaq 0x59bb0(%rip), %r12     # 0x69809
leaq 0x59bbd(%rip), %rbp     # 0x6981d
movq %r12, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rdi
leaq 0x59ad9(%rip), %rsi     # 0x69751
movq %r15, %rdx
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rsi
movl $0xa, %edi
callq 0xb690
movq (%r13), %rdi
movq %r12, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rdi
leaq 0x59bac(%rip), %rsi     # 0x69858
movq %r14, %rdx
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rsi
movl $0xa, %edi
callq 0xb690
movl $0x0, 0xb04(%rbx)
movl $0x1, %ebp
jmp 0xfd16
movq (%r13), %rdi
leaq 0x59b29(%rip), %rsi     # 0x69809
leaq 0x59b36(%rip), %rdx     # 0x6981d
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rcx
leaq 0x5c191(%rip), %rdi     # 0x6be8a
movl $0x6, %esi
movl $0x1, %edx
callq 0xba90
movq (%r13), %rsi
movl $0xa, %edi
callq 0xb690
movl %ebp, %eax
addq $0x758, %rsp            # imm = 0x758
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq