// File: /workspace/github_cpp_makefile_star2_O3/mh0fm4[P]SCDC/src/components/dataset/dataset_inout.cc
// Function: scdc_dataset_inout_t* scdc_dataset_input_FX_create<int>(_scdc_dataset_inout_t*, char const*, _scdc_args_t*, int)
static scdc_dataset_inout_t *scdc_dataset_input_FX_create(scdc_dataset_input_t *input, const char *conf, scdc_args_t *args, T fx)
{
  bool offset_set = false;
  bool offset_front = true;
  scdcint_t offset = 0;
  scdcint_t size = -1;
  scdcint_t chunk_size = -1;
  scdc_args_buf_t buffer = { 0, DEFAULT_DATASET_INOUT_BUF_SIZE };

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

  scdc_dataset_inout_t *inout_redirect = 0;
  if (xargs.get<scdc_dataset_inout_t *>(SCDC_ARGS_TYPE_DATASET_INOUT_REDIRECT_PTR, &inout_redirect) != SCDC_ARG_REF_NULL && inout_redirect)
  {
    buffer.buf = SCDC_DATASET_INOUT_BUF_PTR(inout_redirect);
    buffer.buf_size = SCDC_DATASET_INOUT_BUF_SIZE(inout_redirect);
  }

  string c;
  scdcint_t i = 0;
  while (confs.front_pop(c))
  {
    if (c == "offset")
    {
      if (xargs.get<scdcint_t>(SCDC_ARGS_TYPE_SCDCINT, &offset) == SCDC_ARG_REF_NULL)
      {
        SCDC_ERROR("scdc_dataset_input_FXX_create: getting file offset");
        return 0;
      }

      offset_set = true;

    } else if (c == "size")
    {
      if (xargs.get<scdcint_t>(SCDC_ARGS_TYPE_SCDCINT, &size) == SCDC_ARG_REF_NULL)
      {
        SCDC_ERROR("scdc_dataset_input_FXX_create: getting file size");
        return 0;
      }

    } else if (c == "chunks")
    {
      if (xargs.get<scdcint_t>(SCDC_ARGS_TYPE_SCDCINT, &chunk_size) == SCDC_ARG_REF_NULL)
      {
        SCDC_ERROR("scdc_dataset_input_FXX_create: getting chunk size");
        return 0;
      }

    } else if (c == "buffer")
    {
      if (xargs.get<scdc_args_buf_t>(SCDC_ARGS_TYPE_BUF, &buffer) == SCDC_ARG_REF_NULL)
      {
        SCDC_ERROR("scdc_dataset_input_FXX_create: getting buffer");
        return 0;
      }

    } else
    {
      char r;

      if (!c.empty())
      switch (i)
      {
        case 0:
          r = toupper(c[c.size() - 1]);
          if (r == 'F' || r == 'B') { offset_front = (r == 'F'); c.resize(c.size() - 1); }
          scdc_args_string(c).get<scdcint_t>(c, SCDC_ARGS_TYPE_SCDCINT, &offset);
          offset_set = true;
          break;
        case 1: scdc_args_string(c).get<scdcint_t>(c, SCDC_ARGS_TYPE_SCDCINT, &size); break;
        case 2: scdc_args_string(c).get<scdcint_t>(c, SCDC_ARGS_TYPE_SCDCINT, &chunk_size); break;
        default: SCDC_FAIL("scdc_dataset_input_FXX_create: ignoring parameter '" << c << "'"); break;
      }

      ++i;
    }
  }

  SCDC_TRACE("scdc_dataset_input_FXX_create: offset: " << offset << ", size: " << size << ", chunks: " << chunk_size <<
             ", buffer: " << buffer.buf << " / " << buffer.buf_size);

  if (!input) return 0;

  if (!scdc_dataset_inout_alloc(input, (buffer.buf?0:buffer.buf_size), sizeof(inout_FX_data_t<T>))) return 0;

  if (buffer.buf)
  {
    SCDC_DATASET_INOUT_BUF_PTR(input) = buffer.buf;
    SCDC_DATASET_INOUT_BUF_SIZE(input) = buffer.buf_size;
  }

  input->intern->type = SCDC_DATASET_INOUT_TYPE_NONE;
  input->intern->destroy = NULL;

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

  inout_FX_data_t<T> *data = static_cast<inout_FX_data_t<T> *>(input->data);

  data->fx = fx;
  data->chunk_size = chunk_size;
  data->size_left = size;

  if (offset_set && data->seek(offset, (offset_front)?SEEK_SET:SEEK_END) < 0)
  {
    SCDC_ERROR("scdc_dataset_input_FXX_create: seek to offset " << offset << " from " << ((offset_front)?"front":"back"));
    return 0;
  }

  SCDC_TRACE("scdc_dataset_input_FXX_create: offset: " << data->tell());

#if DETERMINE_EXACT_TOTAL_SIZE
  scdcint_t size_left = (fd != -1)?get_FD_size_left(fd):((file != NULL)?get_FILE_size_left(file):-1);

  if (size_left >= 0)
  {
    input->total_size = size_left;
    if (size >= 0) input->total_size = z_min(input->total_size, size);
    input->total_size_given = SCDC_DATASET_INOUT_TOTAL_SIZE_GIVEN_EXACT;

  } else
#endif
  {
    if (size >= 0)
    {
      input->total_size = size;
      input->total_size_given = SCDC_DATASET_INOUT_TOTAL_SIZE_GIVEN_AT_MOST;

    } else
    {
      input->total_size = 0;
      input->total_size_given = SCDC_DATASET_INOUT_TOTAL_SIZE_GIVEN_AT_LEAST;
    }
  }

  SCDC_DATASET_INOUT_BUF_CURRENT(input) = 0;

  input->next = input_FX_next<T>;

  return input;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %ecx, 0x4c(%rsp)
movq %rdx, %rbx
movq %rsi, %rdx
movq %rdi, %r15
xorl %r14d, %r14d
movq %r14, 0x28(%rsp)
movq $-0x1, %rax
movq %rax, 0x20(%rsp)
movq %rax, 0x40(%rsp)
movups 0x3d3d9(%rip), %xmm0    # 0x6b838
movaps %xmm0, 0x30(%rsp)
leaq 0xc0(%rsp), %rdi
movl $0x3a, %esi
movq $-0x1, %rcx
callq 0x1b83e
leaq 0xa0(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
movq %r14, 0x10(%rax)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movaps %xmm0, -0x20(%rax)
movaps %xmm1, -0x10(%rax)
movq %r14, 0x70(%rsp)
movq -0x18(%rax), %rax
testq %rax, %rax
je 0x2e4eb
movq 0x80(%rsp), %rdi
leaq 0x70(%rsp), %rdx
movl $0xe, %esi
callq *%rax
testq %rax, %rax
setne %cl
movq 0x70(%rsp), %rax
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x2e4eb
movq 0x10(%rax), %rcx
movq %rcx, 0x30(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x38(%rsp)
movq %r15, 0x78(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movb $0x1, 0x7(%rsp)
movq $0x0, 0x18(%rsp)
leaq 0xc0(%rsp), %r14
leaq 0x50(%rsp), %r15
leaq 0x3d05e(%rip), %r12     # 0x6b584
leaq 0x3d08a(%rip), %r13     # 0x6b5b7
leaq 0x3cdba(%rip), %rbx     # 0x6b2ee
leaq 0x3f638(%rip), %rbp     # 0x6db73
movq $0x0, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1bb16
testb %al, %al
je 0x2e834
movq %r15, %rdi
movq %r12, %rsi
callq 0xb110
testl %eax, %eax
je 0x2e634
movq %r15, %rdi
movq %r13, %rsi
callq 0xb110
testl %eax, %eax
je 0x2e5ce
movq %r15, %rdi
movq %rbx, %rsi
callq 0xb110
testl %eax, %eax
je 0x2e601
movq %r15, %rdi
movq %rbp, %rsi
callq 0xb110
testl %eax, %eax
jne 0x2e66e
movq 0x88(%rsp), %rax
testq %rax, %rax
je 0x2e90f
movq 0x80(%rsp), %rdi
movl $0x8, %esi
leaq 0x30(%rsp), %rdx
callq *%rax
testq %rax, %rax
jne 0x2e544
jmp 0x2e90f
movq 0x88(%rsp), %rax
testq %rax, %rax
je 0x2e97d
movq 0x80(%rsp), %rdi
movl $0x2, %esi
leaq 0x20(%rsp), %rdx
callq *%rax
testq %rax, %rax
jne 0x2e544
jmp 0x2e97d
movq 0x88(%rsp), %rax
testq %rax, %rax
je 0x2ea0a
movq 0x80(%rsp), %rdi
movl $0x2, %esi
leaq 0x40(%rsp), %rdx
callq *%rax
testq %rax, %rax
jne 0x2e544
jmp 0x2ea0a
movq 0x88(%rsp), %rax
testq %rax, %rax
je 0x2ebca
movq 0x80(%rsp), %rdi
movl $0x2, %esi
leaq 0x28(%rsp), %rdx
callq *%rax
movb $0x1, %cl
movq %rcx, 0x18(%rsp)
testq %rax, %rax
jne 0x2e544
jmp 0x2ebca
movq 0x58(%rsp), %rcx
testq %rcx, %rcx
je 0x2e822
movq 0x10(%rsp), %rax
cmpq $0x2, %rax
je 0x2e729
cmpq $0x1, %rax
je 0x2e716
testq %rax, %rax
jne 0x2e746
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
movsbl -0x1(%rax,%rcx), %edi
movq %rcx, 0x8(%rsp)
callq 0xba30
movq 0x18(%rsp), %rdi
shll $0x18, %eax
movl %eax, %ecx
orl $0x4000000, %ecx        # imm = 0x4000000
cmpl $0x46000000, %ecx       # imm = 0x46000000
jne 0x2e6f7
movl %eax, 0x18(%rsp)
movq 0x8(%rsp), %rsi
decq %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0xb130
cmpl $0x46000000, 0x18(%rsp) # imm = 0x46000000
sete 0x7(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x3e632(%rip), %rsi     # 0x6cd30
leaq 0x28(%rsp), %rdx
xorl %eax, %eax
callq 0xb4e0
movb $0x1, %al
movq %rax, 0x18(%rsp)
jmp 0x2e822
movq 0x50(%rsp), %rdi
leaq 0x3e60e(%rip), %rsi     # 0x6cd30
leaq 0x20(%rsp), %rdx
jmp 0x2e73a
movq 0x50(%rsp), %rdi
leaq 0x3e5fb(%rip), %rsi     # 0x6cd30
leaq 0x40(%rsp), %rdx
xorl %eax, %eax
callq 0xb4e0
jmp 0x2e822
leaq 0x5de23(%rip), %rax     # 0x8c570
movq (%rax), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x2e822
addq $0x20, %rdi
callq 0xb7d0
leaq 0x5de05(%rip), %rax     # 0x8c570
movq (%rax), %rax
movq 0x8(%rax), %rdi
movl $0xb, %edx
movq %rdi, 0x8(%rsp)
leaq 0x3ba25(%rip), %rsi     # 0x6a1a8
callq 0xb5f0
movl $0xf, %edx
movq 0x8(%rsp), %rdi
leaq 0x3c92c(%rip), %rsi     # 0x6b0c5
callq 0xb5f0
movl $0x33, %edx
movq 0x8(%rsp), %rdi
leaq 0x3cba6(%rip), %rsi     # 0x6b355
callq 0xb5f0
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x8(%rsp), %rdi
callq 0xb5f0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3dbfc(%rip), %rsi     # 0x6c3d3
movq %rax, 0x8(%rsp)
callq 0xb5f0
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0xb4d0
movq 0x8(%rsp), %rdi
movsbl %al, %esi
callq 0xb050
movq %rax, %rdi
callq 0xb340
leaq 0x5dd5a(%rip), %rax     # 0x8c570
movq (%rax), %rdi
addq $0x20, %rdi
callq 0xb3b0
movq 0x10(%rsp), %rax
incq %rax
movq %rax, 0x10(%rsp)
jmp 0x2e544
xorl %ebx, %ebx
cmpq $0x0, 0x30(%rsp)
movl $0x0, %esi
jne 0x2e848
movq 0x38(%rsp), %rsi
movl $0x18, %edx
movq 0x78(%rsp), %r14
movq %r14, %rdi
callq 0x2e36a
testb %al, %al
je 0x2eaa7
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x2e879
movq %rax, 0x10(%r14)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%r14)
movq 0x48(%r14), %rax
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rcx, 0x20(%rax)
movb $0x0, 0x4(%r14)
movl $0x61746164, (%r14)     # imm = 0x61746164
movq 0x40(%r14), %rcx
movl 0x4c(%rsp), %edi
movl %edi, (%rcx)
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rcx)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rcx)
testb $0x1, 0x18(%rsp)
movb 0x7(%rsp), %cl
je 0x2e8de
movq 0x28(%rsp), %rsi
movl %ecx, %eax
notb %al
movzbl %al, %edx
andl $0x1, %edx
addl %edx, %edx
callq 0xba50
testq %rax, %rax
js 0x2eaf2
movq 0x20(%rsp), %rax
xorl %ecx, %ecx
testq %rax, %rax
cmovnsq %rax, %rcx
setns %al
orb $0x6c, %al
movq %rcx, 0x28(%r14)
movb %al, 0x30(%r14)
movq $0x0, 0x20(%r14)
leaq 0x3c5(%rip), %rax       # 0x2ecc8
movq %rax, 0x38(%r14)
movq %r14, %rbx
jmp 0x2eaa7
leaq 0x5dc5a(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x2eaa5
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x3bb6d(%rip), %rsi     # 0x6a4a8
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3c776(%rip), %rsi     # 0x6b0c5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3c9c4(%rip), %rsi     # 0x6b327
movl $0x2d, %edx
movq %rbx, %rdi
callq 0xb5f0
movq %rbx, %rdi
callq 0xb250
jmp 0x2ea92
leaq 0x5dbec(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x2eaa5
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x3baff(%rip), %rsi     # 0x6a4a8
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3c708(%rip), %rsi     # 0x6b0c5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3c8ec(%rip), %rsi     # 0x6b2bd
movl $0x30, %edx
movq %rbx, %rdi
callq 0xb5f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
jmp 0x2ea92
leaq 0x5db5f(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x2eaa5
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x3ba72(%rip), %rsi     # 0x6a4a8
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3c67b(%rip), %rsi     # 0x6b0c5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3c897(%rip), %rsi     # 0x6b2f5
movl $0x31, %edx
movq %rbx, %rdi
callq 0xb5f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
leaq 0x5dad7(%rip), %rax     # 0x8c570
movq (%rax), %rdi
addq $0x20, %rdi
callq 0xb3b0
xorl %ebx, %ebx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x2eac3
movq 0x60(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x80(%rsp), %rdi
callq 0x1b76c
leaq 0xc0(%rsp), %rdi
callq 0x1bad0
movq %rbx, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5da77(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x2eaa5
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x3b98e(%rip), %rsi     # 0x6a4a8
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3c597(%rip), %rsi     # 0x6b0c5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3c847(%rip), %rsi     # 0x6b389
movl $0x2e, %edx
movq %rbx, %rdi
callq 0xb5f0
movq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0xb1d0
movq %rax, %rbx
leaq 0x3c852(%rip), %rsi     # 0x6b3b8
movl $0x6, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x3c845(%rip), %rax     # 0x6b3bf
leaq 0x3c844(%rip), %rsi     # 0x6b3c5
movb 0x7(%rsp), %cl
testb $0x1, %cl
cmovneq %rax, %rsi
movzbl %cl, %edx
andl $0x1, %edx
orq $0x4, %rdx
movq %rbx, %rdi
callq 0xb5f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
jmp 0x2ea92
leaq 0x5d99f(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x2eaa5
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x3b8b2(%rip), %rsi     # 0x6a4a8
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3c4bb(%rip), %rsi     # 0x6b0c5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3c66c(%rip), %rsi     # 0x6b28a
movl $0x32, %edx
movq %rbx, %rdi
callq 0xb5f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
jmp 0x2ea92
jmp 0x2ec64
jmp 0x2ec64
jmp 0x2ec64
movq %rax, %rbx
jmp 0x2ec83
jmp 0x2ec64
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x2ec83
movq 0x60(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x80(%rsp), %rdi
callq 0x1b76c
leaq 0xc0(%rsp), %rdi
callq 0x1bad0
movq %rbx, %rdi
callq 0xb9c0