// File: /workspace/github_cpp_makefile_star2_O2/mh0fm4[P]SCDC/test/demos/multi/multi_cli.c
// Function: main
int main(int argc, char *argv[])
{
  MULTI_TRACE("start multi demo client");

  scdc_init(SCDC_INIT_DEFAULT);

  scdc_dataprov_t dp_hook = dp_hook = scdc_dataprov_open(MULTI_BASE, "hook", &multidemo_hook);

  scdc_dataset_input_t input;
  scdc_dataset_output_t output;

  scdc_dataset_input_unset(&input);
  scdc_dataset_output_unset(&output);

#if SCDC_DATASET_INOUT_BUF_MULTIPLE
  char input_buf_m[2 * sizeof(scdc_buf_t)];
  char input_buf_0[] = "aaa";
  char input_buf_1[] = "zzzzz";

  SCDC_DATASET_INOUT_MBUF_INIT(&input, input_buf_m, sizeof(input_buf_m));
  SCDC_DATASET_INOUT_MBUF_SET_C(&input, 2);
  SCDC_DATASET_INOUT_MBUF_M_SET(&input, 0, input_buf_0, sizeof(input_buf_0), strlen(input_buf_0));
  SCDC_DATASET_INOUT_MBUF_M_SET(&input, 1, input_buf_1, sizeof(input_buf_1), strlen(input_buf_1));
#endif
/*
  char format[SCDC_FORMAT_MAX_SIZE];
  scdcint_t buf_size;
  void *buf;
  scdcint_t total_size, current_size;
  char total_size_given;
  scdc_dataset_inout_next_f *next;
  void *data;
*/

  MULTI_TRACE("before:");
  MULTI_TRACE_N("  "); scdc_dataset_input_print(&input); MULTI_TRACE_NL("");
  MULTI_TRACE_N("  "); scdc_dataset_output_print(&output); MULTI_TRACE_NL("");

  scdc_dataset_cmd(SCDC_DATASET_NULL,
#if 0
    "scdc:/"
#else
    "scdc+uds://multi/"
#endif
    MULTI_BASE " CMD PARAM1 PARAM2 PARAM3", &input, &output);

  MULTI_TRACE("after:");
  MULTI_TRACE_N("  "); scdc_dataset_output_print(&output); MULTI_TRACE_NL("");
  MULTI_TRACE("  output buf: '%.*s'", (int) SCDC_DATASET_INOUT_BUF_SIZE(&output), (char *) SCDC_DATASET_INOUT_BUF_PTR(&output));

  while (output.next) output.next(&output, 0);

  scdc_dataprov_close(dp_hook);

  scdc_release();

  MULTI_TRACE("quit multi demo client");

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
leaq 0x37e30(%rip), %rdi     # 0x44004
xorl %eax, %eax
callq 0xb070
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0xb760
leaq 0x39451(%rip), %rdi     # 0x4563d
xorl %eax, %eax
callq 0xc591
leaq 0x37e3a(%rip), %rdi     # 0x44034
leaq 0x3a72f(%rip), %rsi     # 0x46930
leaq 0x54928(%rip), %rdx     # 0x60b30
xorl %eax, %eax
callq 0xc8ec
movq %rax, %r14
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
callq 0x195e8
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x19608
leaq 0xc(%rsp), %rdi
movl $0x616161, (%rdi)       # imm = 0x616161
leaq 0x10(%rsp), %r13
movw $0x7a, 0x4(%r13)
movl $0x7a7a7a7a, (%r13)     # imm = 0x7A7A7A7A
leaq 0x70(%rsp), %rbp
movq %rbp, 0x10(%r12)
pushq $-0x2
popq %rax
movq %rax, 0x18(%r12)
movq %rax, 0x20(%r12)
movq %rdi, (%rbp)
movq $0x4, 0x8(%rbp)
callq 0xb210
movq %rax, 0x10(%rbp)
movq %r13, 0x18(%rbp)
movq $0x6, 0x20(%rbp)
movq %r13, %rdi
callq 0xb210
movq %rax, 0x28(%rbp)
leaq 0x37da8(%rip), %rdi     # 0x44041
xorl %eax, %eax
callq 0xb070
movl %ebx, %edi
callq 0xb760
leaq 0x37db3(%rip), %r13     # 0x44061
movq %r13, %rdi
xorl %eax, %eax
callq 0xb070
movq %r12, %rdi
callq 0x1934c
movl %ebx, %edi
callq 0xb760
movq %r13, %rdi
xorl %eax, %eax
callq 0xb070
movq %r15, %rdi
callq 0x19472
movl %ebx, %edi
callq 0xb760
leaq 0x37d95(%rip), %rsi     # 0x4407c
xorl %edi, %edi
movq %r12, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xd9cc
leaq 0x37db0(%rip), %rdi     # 0x440ad
xorl %eax, %eax
callq 0xb070
movl %ebx, %edi
callq 0xb760
movq %r13, %rdi
xorl %eax, %eax
callq 0xb070
movq %r15, %rdi
callq 0x19472
movl %ebx, %edi
callq 0xb760
movl 0x18(%r15), %esi
movq 0x10(%r15), %rdx
leaq 0x37d99(%rip), %rdi     # 0x440cc
xorl %eax, %eax
callq 0xb070
movl %ebx, %edi
callq 0xb760
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0xc354
movq %r15, %rdi
xorl %esi, %esi
callq *%rax
jmp 0xc341
movq %r14, %rdi
callq 0xc9aa
callq 0xc6a6
leaq 0x37d91(%rip), %rdi     # 0x440f9
xorl %eax, %eax
callq 0xb070
pushq $0xa
popq %rdi
callq 0xb760
xorl %eax, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop