// File: mh0fm4[P]SCDC/src/components/dataset/dataset_inout.cc
// Function: scdc_dataset_inout_prn(_scdc_dataset_inout_t*, char const*, int (*)(char const*, ...))
static void scdc_dataset_inout_prn(scdc_dataset_inout_t *inout, const char *prefix, printf_t *prn)
{
  prn("%s<", prefix);

  if (inout)
  {
    // prn("format: '%s', buf: %" scdcint_fmt " at %p, total_size: %" scdcint_fmt ", total_size_given: %c, current_size: %" scdcint_fmt ", next: %p, data: %p, intern: %p",
    //   inout->format, SCDC_DATASET_INOUT_BUF_SIZE(inout), SCDC_DATASET_INOUT_BUF_PTR(inout), inout->total_size, inout->total_size_given, SCDC_DATASET_INOUT_BUF_CURRENT(inout), inout->next, inout->data, inout->intern);
#if SCDC_DATASET_INOUT_BUF_MULTIPLE
    if (SCDC_DATASET_INOUT_MBUF_ISSET(inout))
    {
      const scdcint_t mb_s = SCDC_DATASET_INOUT_MBUF_GET_S(inout);
      const scdcint_t mb_c = SCDC_DATASET_INOUT_MBUF_GET_C(inout);
      prn("buf: %" scdcint_fmt " of %" scdcint_fmt ": ", mb_s, mb_c);
      scdcint_t i;
      for (i = 0; i < mb_s; ++i)
        prn("%s[%" scdcint_fmt "] %" scdcint_fmt " of %" scdcint_fmt " at %p",
          ((i == 0)?"":", "), i, SCDC_DATASET_INOUT_MBUF_M_CURRENT(inout, i), SCDC_DATASET_INOUT_MBUF_M_SIZE(inout, i), SCDC_DATASET_INOUT_MBUF_M_PTR(inout, i));
    } else
#endif
    {
      prn("buf: %" scdcint_fmt " of %" scdcint_fmt " at %p", SCDC_DATASET_INOUT_BUF_CURRENT(inout), SCDC_DATASET_INOUT_BUF_SIZE(inout), SCDC_DATASET_INOUT_BUF_PTR(inout));
    }

    prn(", format: '%s', total_size: %" scdcint_fmt ", total_size_given: %c, next: %p, data: %p, intern: %p",
      inout->format, inout->total_size, inout->total_size_given, inout->next, inout->data, inout->intern);

    if (strcmp(inout->format, "text") == 0) prn(", content: '%.*s'", (int) SCDC_DATASET_INOUT_BUF_CURRENT(inout), (char *) SCDC_DATASET_INOUT_BUF_PTR(inout));
  }

  prn(">");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rsi
leaq 0x64101(%rip), %rdi     # 0xa7184
movb $0x0, %al
callq *%rcx
cmpq $0x0, -0x8(%rbp)
je 0x4323c
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jge 0x4319c
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jge 0x430bc
movq -0x8(%rbp), %rcx
xorl %eax, %eax
subq 0x18(%rcx), %rax
movq %rax, -0x38(%rbp)
jmp 0x430c4
xorl %eax, %eax
movq %rax, -0x38(%rbp)
jmp 0x430c4
movq -0x38(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jge 0x430e7
movq -0x8(%rbp), %rcx
xorl %eax, %eax
subq 0x20(%rcx), %rax
movq %rax, -0x40(%rbp)
jmp 0x430ef
xorl %eax, %eax
movq %rax, -0x40(%rbp)
jmp 0x430ef
movq -0x40(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq 0x6407e(%rip), %rdi     # 0xa7188
movb $0x0, %al
callq *%rcx
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x4319a
movq -0x18(%rbp), %r10
movq -0x30(%rbp), %rcx
leaq 0x64089(%rip), %rsi     # 0xa71b8
leaq 0x6346e(%rip), %rax     # 0xa65a4
cmpq $0x0, %rcx
cmoveq %rax, %rsi
movq -0x30(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x18, -0x30(%rbp), %rdi
addq %rdi, %rax
movq 0x8(%rax), %r8
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x18, -0x30(%rbp), %rdi
addq %rdi, %rax
movq (%rax), %r9
leaq 0x64018(%rip), %rdi     # 0xa719c
movb $0x0, %al
callq *%r10
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x43116
jmp 0x431c4
movq -0x18(%rbp), %r8
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
leaq 0x63ffc(%rip), %rdi     # 0xa71bb
movb $0x0, %al
callq *%r8
movq -0x18(%rbp), %r10
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdx
movq -0x8(%rbp), %rax
movsbl 0x30(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x38(%rax), %r8
movq -0x8(%rbp), %rax
movq 0x40(%rax), %r9
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
leaq 0x63fd8(%rip), %rdi     # 0xa71d3
movq %rax, (%rsp)
movb $0x0, %al
callq *%r10
movq -0x8(%rbp), %rdi
leaq 0x63e21(%rip), %rsi     # 0xa7030
callq 0xc970
cmpl $0x0, %eax
jne 0x4323a
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x63ff4(%rip), %rdi     # 0xa722a
movb $0x0, %al
callq *%rcx
jmp 0x4323c
leaq 0x66197(%rip), %rdi     # 0xa93da
movb $0x0, %al
callq *-0x18(%rbp)
addq $0x50, %rsp
popq %rbp
retq
nop