// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/src/components/dataset/dataset_inout.cc
// Function: scdc_dataset_inout_t* scdc_dataset_output_FX_create<int>(_scdc_dataset_inout_t*, char const*, _scdc_args_t*, int)
static scdc_dataset_output_t *scdc_dataset_output_FX_create(scdc_dataset_output_t *output, 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 };
  bool trunc = false;

  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_output_FX_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_output_FX_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_output_FX_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_output_FX_create: getting buffer");
        return 0;
      }

    } else if (c == "trunc")
    {
      trunc = true;

    } 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_output_FX_create: ignoring parameter '" << c << "'"); break;
      }

      ++i;
    }
  }

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

  if (!output) return 0;

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

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

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

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

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

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

  if (trunc && data->truncate(0) != 0)
  {
    SCDC_ERROR("scdc_dataset_output_FX_create: truncate file");
    return 0;
  }

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

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

  output->next = output_FX_next<T>;

  return output;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movl %ecx, 0x54(%rsp)
movq %rdx, %r14
movq %rsi, %rdx
movq %rdi, %r15
xorl %ebx, %ebx
movq %rbx, 0x28(%rsp)
movq $-0x1, %rax
movq %rax, 0x48(%rsp)
movq %rax, 0x40(%rsp)
movups 0x3b6d2(%rip), %xmm0    # 0x6b818
movaps %xmm0, 0x30(%rsp)
leaq 0xd0(%rsp), %rdi
movl $0x3a, %esi
movq $-0x1, %rcx
callq 0x1b8f2
leaq 0xb0(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
movq %rbx, 0x10(%rax)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movaps %xmm0, -0x20(%rax)
movaps %xmm1, -0x10(%rax)
movq %rbx, 0x80(%rsp)
movq -0x18(%rax), %rax
testq %rax, %rax
je 0x301b3
movq 0x90(%rsp), %rdi
leaq 0x80(%rsp), %rdx
movl $0xe, %esi
callq *%rax
movq %rax, %rbx
movq %r15, 0x88(%rsp)
testq %rbx, %rbx
setne %cl
movq 0x80(%rsp), %rax
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x301e8
movq 0x10(%rax), %rcx
movq %rcx, 0x30(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x38(%rsp)
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movb $0x1, 0xf(%rsp)
leaq 0xd0(%rsp), %r14
leaq 0x58(%rsp), %r15
leaq 0x3b34f(%rip), %r12     # 0x6b564
leaq 0x3b37b(%rip), %r13     # 0x6b597
leaq 0x3b0ab(%rip), %rbx     # 0x6b2ce
leaq 0x3d8d9(%rip), %rbp     # 0x6db03
xorl %eax, %eax
movq $0x0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl %eax, %ecx
movl %ecx, %eax
movq %rax, 0x78(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1bbc4
testb %al, %al
je 0x30540
movq %r15, %rdi
movq %r12, %rsi
callq 0xb110
testl %eax, %eax
je 0x30337
movq %r15, %rdi
movq %r13, %rsi
callq 0xb110
testl %eax, %eax
je 0x302c1
movq %r15, %rdi
movq %rbx, %rsi
callq 0xb110
testl %eax, %eax
je 0x302e4
movq %r15, %rdi
movq %rbp, %rsi
callq 0xb110
testl %eax, %eax
jne 0x30371
movq 0x98(%rsp), %rax
testq %rax, %rax
je 0x30307
movq 0x90(%rsp), %rdi
movl $0x8, %esi
leaq 0x30(%rsp), %rdx
callq *%rax
jmp 0x30309
movq 0x98(%rsp), %rax
testq %rax, %rax
je 0x30317
movq 0x90(%rsp), %rdi
movl $0x2, %esi
leaq 0x48(%rsp), %rdx
callq *%rax
jmp 0x30319
movq 0x98(%rsp), %rax
testq %rax, %rax
je 0x30327
movq 0x90(%rsp), %rdi
movl $0x2, %esi
leaq 0x40(%rsp), %rdx
callq *%rax
jmp 0x30329
xorl %eax, %eax
testq %rax, %rax
jne 0x30247
jmp 0x30668
xorl %eax, %eax
testq %rax, %rax
jne 0x30247
jmp 0x306d6
xorl %eax, %eax
testq %rax, %rax
jne 0x30247
jmp 0x307a0
movq 0x98(%rsp), %rax
testq %rax, %rax
je 0x3035a
movq 0x90(%rsp), %rdi
movl $0x2, %esi
leaq 0x28(%rsp), %rdx
callq *%rax
jmp 0x3035c
xorl %eax, %eax
movb $0x1, %cl
movq %rcx, 0x20(%rsp)
testq %rax, %rax
jne 0x30247
jmp 0x30909
movq %r15, %rdi
leaq 0x3b281(%rip), %rsi     # 0x6b5fc
callq 0xb110
movb $0x1, %cl
testl %eax, %eax
je 0x30240
movq 0x60(%rsp), %rdx
testq %rdx, %rdx
je 0x30529
movq 0x10(%rsp), %rcx
cmpq $0x2, %rcx
je 0x30430
cmpq $0x1, %rcx
je 0x3041d
testq %rcx, %rcx
jne 0x3044d
movq 0x58(%rsp), %rax
movsbl -0x1(%rax,%rdx), %edi
movq %rdx, 0x20(%rsp)
callq 0xba30
shll $0x18, %eax
movl %eax, %ecx
orl $0x4000000, %ecx        # imm = 0x4000000
cmpl $0x46000000, %ecx       # imm = 0x46000000
jne 0x303f9
movq 0x20(%rsp), %rsi
decq %rsi
cmpl $0x46000000, %eax       # imm = 0x46000000
sete 0xf(%rsp)
movq %r15, %rdi
xorl %edx, %edx
callq 0xb130
movq 0x58(%rsp), %rdi
leaq 0x3c8bb(%rip), %rsi     # 0x6ccc0
leaq 0x28(%rsp), %rdx
xorl %eax, %eax
callq 0xb4e0
movb $0x1, %al
movq %rax, 0x20(%rsp)
jmp 0x30529
movq 0x58(%rsp), %rdi
leaq 0x3c897(%rip), %rsi     # 0x6ccc0
leaq 0x48(%rsp), %rdx
jmp 0x30441
movq 0x58(%rsp), %rdi
leaq 0x3c884(%rip), %rsi     # 0x6ccc0
leaq 0x40(%rsp), %rdx
xorl %eax, %eax
callq 0xb4e0
jmp 0x30529
leaq 0x5c11c(%rip), %rax     # 0x8c570
movq (%rax), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x3052e
addq $0x20, %rdi
callq 0xb7d0
leaq 0x5c0fe(%rip), %rax     # 0x8c570
movq (%rax), %rax
movq 0x8(%rax), %rdi
movl $0xb, %edx
movq %rdi, 0x18(%rsp)
leaq 0x39cfe(%rip), %rsi     # 0x6a188
callq 0xb5f0
movl $0xf, %edx
movq 0x18(%rsp), %rdi
leaq 0x3ac05(%rip), %rsi     # 0x6b0a5
callq 0xb5f0
movl $0x33, %edx
movq 0x18(%rsp), %rdi
leaq 0x3b14c(%rip), %rsi     # 0x6b602
callq 0xb5f0
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x18(%rsp), %rdi
callq 0xb5f0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3be7d(%rip), %rsi     # 0x6c35b
movq %rax, 0x18(%rsp)
callq 0xb5f0
movq 0x18(%rsp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0xb4d0
movq 0x18(%rsp), %rdi
movsbl %al, %esi
callq 0xb050
movq %rax, %rdi
callq 0xb340
leaq 0x5c053(%rip), %rax     # 0x8c570
movq (%rax), %rdi
addq $0x20, %rdi
callq 0xb3b0
movq 0x10(%rsp), %rcx
incq %rcx
movq %rcx, 0x10(%rsp)
movq 0x78(%rsp), %rax
jmp 0x3023e
xorl %ebx, %ebx
cmpq $0x0, 0x30(%rsp)
movl $0x0, %esi
jne 0x30554
movq 0x38(%rsp), %rsi
movl $0x18, %edx
movq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0x2e611
testb %al, %al
movq 0x78(%rsp), %rdx
je 0x309a6
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x3058d
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), %rbx
movl 0x54(%rsp), %edi
movl %edi, (%rbx)
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rbx)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rbx)
testb $0x1, %dl
je 0x30763
xorl %esi, %esi
callq 0xb740
testl %eax, %eax
je 0x30763
leaq 0x5bf8e(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x309a4
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x39e81(%rip), %rsi     # 0x6a488
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3aa8a(%rip), %rsi     # 0x6b0a5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3b007(%rip), %rsi     # 0x6b636
movl $0x2c, %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 0x30991
leaq 0x5bf01(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x309a4
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x39df4(%rip), %rsi     # 0x6a488
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3a9fd(%rip), %rsi     # 0x6b0a5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3af12(%rip), %rsi     # 0x6b5ce
movl $0x2d, %edx
movq %rbx, %rdi
callq 0xb5f0
movq %rbx, %rdi
callq 0xb250
jmp 0x30991
leaq 0x5be93(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x309a4
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x39d86(%rip), %rsi     # 0x6a488
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3a98f(%rip), %rsi     # 0x6b0a5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3ae41(%rip), %rsi     # 0x6b56b
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 0x30991
testb $0x1, 0x20(%rsp)
je 0x3078d
movq 0x28(%rsp), %rsi
movb 0xf(%rsp), %al
notb %al
movzbl %al, %edx
andl $0x1, %edx
addl %edx, %edx
movl (%rbx), %edi
callq 0xba50
testq %rax, %rax
js 0x3082d
leaq 0x2ce(%rip), %rax       # 0x30a62
movq %rax, 0x38(%r14)
movq %r14, %rbx
jmp 0x309a6
leaq 0x5bdc9(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x309a4
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x39cbc(%rip), %rsi     # 0x6a488
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3a8c5(%rip), %rsi     # 0x6b0a5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3ada8(%rip), %rsi     # 0x6b59c
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
jmp 0x30991
leaq 0x5bd3c(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x309a4
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x39c2f(%rip), %rsi     # 0x6a488
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3a838(%rip), %rsi     # 0x6b0a5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3ade2(%rip), %rsi     # 0x6b663
movl $0x2e, %edx
movq %rbx, %rdi
callq 0xb5f0
movq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0xb1d0
movq %rax, %rbx
leaq 0x3aaf3(%rip), %rsi     # 0x6b398
movl $0x6, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x3aae6(%rip), %rax     # 0x6b39f
leaq 0x3aae5(%rip), %rsi     # 0x6b3a5
movb 0xf(%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 0x30991
leaq 0x5bc60(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x309a4
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x39b53(%rip), %rsi     # 0x6a488
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3a75c(%rip), %rsi     # 0x6b0a5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3abdb(%rip), %rsi     # 0x6b538
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
leaq 0x5bbd8(%rip), %rax     # 0x8c570
movq (%rax), %rdi
addq $0x20, %rdi
callq 0xb3b0
xorl %ebx, %ebx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x309c2
movq 0x68(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x90(%rsp), %rdi
callq 0x1b820
leaq 0xd0(%rsp), %rdi
callq 0x1bb7e
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x309fe
jmp 0x309fe
jmp 0x309fe
movq %rax, %rbx
jmp 0x30a1d
jmp 0x309fe
movq %rax, %rbx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x30a1d
movq 0x68(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x90(%rsp), %rdi
callq 0x1b820
leaq 0xd0(%rsp), %rdi
callq 0x1bb7e
movq %rbx, %rdi
callq 0xb9c0