// File: mh0fm4[P]SCDC/src/components/dataset/dataset_inout.cc
// Function: scdc_dataset_input_fslist_dir_create(_scdc_dataset_inout_t*, char const*, _scdc_args_t*, char const*)
static scdc_dataset_inout_t *scdc_dataset_input_fslist_dir_create(scdc_dataset_input_t *input, const char *conf, scdc_args_t *args, const char *pathname)
{
  DIR *dir = opendir(pathname);

  if (!dir) return 0;

  scdcint_t size = DEFAULT_DATASET_INOUT_BUF_SIZE;

  stringlist confs(':', conf);
  scdc_args xargs(args);

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

  if (!scdc_dataset_inout_alloc(input, size, sizeof(input_fslist_dir_data_t)))
  {
    closedir(dir);
    return 0;
  }

  input->next = input_fslist_dir_next;

  snprintf(static_cast<input_fslist_dir_data_t *>(input->data)->pathname, MAX_PATHNAME, "%s%s", pathname, ((pathname[strlen(pathname) - 1] != '/')?"/":""));
  static_cast<input_fslist_dir_data_t *>(input->data)->follow_links = FOLLOW_LINKS;
  static_cast<input_fslist_dir_data_t *>(input->data)->dir = dir;
  static_cast<input_fslist_dir_data_t *>(input->data)->result = 0;

  input->intern->type = SCDC_DATASET_INOUT_TYPE_FSLIST_DIR;

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

  return input;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xca20
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x4993c
movq $0x0, -0x8(%rbp)
jmp 0x49ba3
movq $0x4000, -0x38(%rbp)    # imm = 0x4000
movq -0x18(%rbp), %rdx
leaq -0x60(%rbp), %rdi
movl $0x3a, %esi
movq $-0x1, %rcx
callq 0x25a70
movq -0x20(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x25660
jmp 0x4996f
leaq -0xc8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x267a0
jmp 0x49981
leaq 0x5dbec(%rip), %rsi     # 0xa7574
leaq -0xc8(%rbp), %rdi
callq 0x25b80
movb %al, -0xed(%rbp)
jmp 0x4999c
leaq -0xc8(%rbp), %rdi
callq 0xc3e0
movb -0xed(%rbp), %al
testb $0x1, %al
jne 0x499b7
jmp 0x49a41
leaq -0x98(%rbp), %rdi
movl $0x2, %esi
leaq -0x38(%rbp), %rdx
xorl %ecx, %ecx
callq 0x4d170
jmp 0x499d0
leaq -0xe8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x25b00
jmp 0x499e2
leaq -0xe8(%rbp), %rdi
callq 0xc3e0
jmp 0x49a41
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x49b98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x49b8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0xc3e0
jmp 0x49b8c
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x118, %edx            # imm = 0x118
callq 0x47500
testb $0x1, %al
jne 0x49a79
movq -0x30(%rbp), %rdi
callq 0xcb00
jmp 0x49a62
movq $0x0, -0x8(%rbp)
movl $0x1, -0xec(%rbp)
jmp 0x49b75
movq -0x10(%rbp), %rax
leaq 0x3dc(%rip), %rcx       # 0x49e60
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x108(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x28(%rbp), %rdi
callq 0xc280
movq -0x108(%rbp), %rdi
movq -0x100(%rbp), %rcx
movq %rax, %rdx
movq -0xf8(%rbp), %rax
subq $0x1, %rdx
movsbl (%rax,%rdx), %edx
leaq 0x5cac7(%rip), %r8      # 0xa65a4
leaq 0x5c889(%rip), %rax     # 0xa636d
cmpl $0x2f, %edx
cmovneq %rax, %r8
movl $0x100, %esi            # imm = 0x100
leaq 0x5d9f9(%rip), %rdx     # 0xa74f0
movb $0x0, %al
callq 0xcaf0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movb $0x1, 0x100(%rax)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rcx, 0x108(%rax)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq $0x0, 0x110(%rax)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq $0xa, 0x8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x10(%rbp), %rax
movb $0x6c, 0x30(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0xec(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x256b0
leaq -0x60(%rbp), %rdi
callq 0x25c90
jmp 0x49ba3
leaq -0x98(%rbp), %rdi
callq 0x256b0
leaq -0x60(%rbp), %rdi
callq 0x25c90
jmp 0x49bb0
movq -0x8(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0xa0(%rbp), %rdi
callq 0xcba0
nopl (%rax)