// File: /workspace/github_cpp_makefile_star2_O3/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 0xfa8d
movq 0x148(%rbx), %rsi
leaq 0x44(%rbx), %rdx
leaq 0x10(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0xee28
movq 0x7c50c(%rip), %r13     # 0x8bfa0
movq (%r13), %rdi
leaq 0x59d8a(%rip), %rsi     # 0x69829
leaq 0x59d97(%rip), %rdx     # 0x6983d
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rdi
movl 0x8(%rsp), %edx
leaq 0x59d94(%rip), %rsi     # 0x69853
leaq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rsi
movl $0xa, %edi
callq 0xb690
cmpq $0x0, 0x148(%rbx)
jne 0xfb00
leaq 0x44(%rbx), %rdx
leaq 0x59ee4(%rip), %rsi     # 0x699d2
leaq 0x110(%rsp), %rdi
xorl %eax, %eax
callq 0xb0d0
movslq %eax, %r14
leaq (%rsp,%r14), %r15
addq $0x110, %r15            # imm = 0x110
leaq 0x4(%rbx), %rdx
leaq 0x59ebc(%rip), %rsi     # 0x699d2
xorl %ebp, %ebp
movq %r15, %rdi
xorl %eax, %eax
callq 0xb0d0
movslq %eax, %r14
addq %r15, %r14
movq 0x8(%rsp), %rcx
leaq 0x59d31(%rip), %rsi     # 0x69865
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0xfd2d
addq %rax, %r14
leaq 0x168(%rbx), %rdx
movq 0x150(%rbx), %rcx
leaq 0x59d13(%rip), %rsi     # 0x6986c
movq %r14, %rdi
callq 0xfd2d
addq %rax, %r14
leaq 0x368(%rbx), %rdx
movq 0x158(%rbx), %rcx
leaq 0x59cf9(%rip), %rsi     # 0x69872
movq %r14, %rdi
callq 0xfd2d
movq 0xb08(%rbx), %rdi
leaq 0x1de(%rip), %rax       # 0xfd6d
movq %rax, 0x38(%rdi)
movq %rbx, 0x40(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x870(%rbx)
callq 0xfd6d
movq (%r13), %rdi
leaq 0x59c78(%rip), %rsi     # 0x69829
leaq 0x59c85(%rip), %rdx     # 0x6983d
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rdi
leaq 0x59a87(%rip), %rsi     # 0x69651
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 0x1ab07
cmpq $0x1, %rax
jne 0xfcd8
callq 0x19208
movq %rax, %r12
leaq 0x768(%rbx), %r15
movq %rax, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xffcc
movq $0x0, 0x160(%rbx)
addq %rax, %r12
leaq 0x568(%rbx), %r14
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xffcc
movq (%r13), %rdi
leaq 0x59bcd(%rip), %r12     # 0x69829
leaq 0x59bda(%rip), %rbp     # 0x6983d
movq %r12, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rdi
leaq 0x59af6(%rip), %rsi     # 0x69771
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 0x59bc9(%rip), %rsi     # 0x69878
movq %r14, %rdx
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rsi
movl $0xa, %edi
callq 0xb690
movl $0x0, 0xb04(%rbx)
movl $0x1, %ebp
jmp 0xfd19
movq (%r13), %rdi
leaq 0x59b46(%rip), %rsi     # 0x69829
leaq 0x59b53(%rip), %rdx     # 0x6983d
xorl %eax, %eax
callq 0xb7a0
movq (%r13), %rcx
leaq 0x5c206(%rip), %rdi     # 0x6bf02
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