// File: mh0fm4[P]SCDC/src/components/dataset/dataset_inout.cc
// Function: scdc_dataset_input_produce_create(_scdc_dataset_inout_t*, char const*, _scdc_args_t*)
static scdc_dataset_inout_t *scdc_dataset_input_produce_create(scdc_dataset_input_t *input, const char *conf, scdc_args_t *args)
{
  scdc_args xargs(args);

  scdcint_t total_size = 0;

  xargs.get<scdcint_t>(SCDC_ARGS_TYPE_SCDCINT, &total_size);

  scdcint_t size = DEFAULT_DATASET_INOUT_BUF_SIZE;

  stringlist confs(':', conf);

  if (confs.front() == "size")
  {
    xargs.get<scdcint_t>(SCDC_ARGS_TYPE_SCDCINT, &size);
    confs.front_pop();
  }

  if (!input) return 0;

  if (!scdc_dataset_inout_alloc(input, size, sizeof(input_produce_data_t))) return 0;

  input->intern->type = SCDC_DATASET_INOUT_TYPE_PRODUCE;
  input->intern->destroy = scdc_dataset_input_produce_destroy;

  strcpy(input->format, "data");

  SCDC_DATASET_INOUT_BUF_CURRENT(input) = 0;
  input->total_size = total_size;
  input->total_size_given = SCDC_DATASET_INOUT_TOTAL_SIZE_GIVEN_EXACT;

  static_cast<input_produce_data_t *>(input->data)->total_size_left = total_size;

  input->next = input_produce_next;

#if INPUT_CREATE_NEXT
  input->next(input, 0);
#endif

  return input;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rsi
leaq -0x58(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x25660
movq -0xf0(%rbp), %rdi
movq $0x0, -0x60(%rbp)
movl $0x2, %esi
leaq -0x60(%rbp), %rdx
xorl %ecx, %ecx
callq 0x4d170
jmp 0x4528c
movq $0x4000, -0x78(%rbp)    # imm = 0x4000
movq -0x18(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
movl $0x3a, %esi
movq $-0x1, %rcx
callq 0x25a70
jmp 0x452b2
leaq -0xc0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x267a0
jmp 0x452c7
leaq 0x622a6(%rip), %rsi     # 0xa7574
leaq -0xc0(%rbp), %rdi
callq 0x25b80
movb %al, -0xf1(%rbp)
jmp 0x452e2
leaq -0xc0(%rbp), %rdi
callq 0xc3e0
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0x452fa
jmp 0x45372
leaq -0x58(%rbp), %rdi
movl $0x2, %esi
leaq -0x78(%rbp), %rdx
xorl %ecx, %ecx
callq 0x4d170
jmp 0x45310
leaq -0xe0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x25b00
jmp 0x45325
leaq -0xe0(%rbp), %rdi
callq 0xc3e0
jmp 0x45372
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x4547e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x45472
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0xc3e0
jmp 0x45472
cmpq $0x0, -0x10(%rbp)
jne 0x45390
movq $0x0, -0x8(%rbp)
movl $0x1, -0xe4(%rbp)
jmp 0x45450
movq -0x10(%rbp), %rdi
movq -0x78(%rbp), %rsi
movl $0x8, %edx
callq 0x47500
testb $0x1, %al
jne 0x453bd
movq $0x0, -0x8(%rbp)
movl $0x1, -0xe4(%rbp)
jmp 0x45450
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq $0xd, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
leaq 0x4f24(%rip), %rcx      # 0x4a300
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rdi
leaq 0x61e51(%rip), %rsi     # 0xa723c
callq 0xc610
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x60(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movb $0x78, 0x30(%rax)
movq -0x60(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x4f06(%rip), %rcx      # 0x4a330
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rdi
movq 0x38(%rdi), %rax
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
jmp 0x4543e
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0xe4(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x25c90
leaq -0x58(%rbp), %rdi
callq 0x256b0
movq -0x8(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
leaq -0xa0(%rbp), %rdi
callq 0x25c90
leaq -0x58(%rbp), %rdi
callq 0x256b0
movq -0x68(%rbp), %rdi
callq 0xcba0