// File: /workspace/github_cpp_makefile_star2_O3/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, 0x5c(%rsp)
movq %rdx, %rbx
movq %rsi, %rdx
movq %rdi, %r15
xorl %r14d, %r14d
movq %r14, 0x28(%rsp)
movq $-0x1, %rax
movq %rax, 0x50(%rsp)
movq %rax, 0x48(%rsp)
movups 0x3b9c6(%rip), %xmm0    # 0x6b838
movaps %xmm0, 0x30(%rsp)
leaq 0xd0(%rsp), %rdi
movl $0x3a, %esi
movq $-0x1, %rcx
callq 0x1b83e
leaq 0xb0(%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, 0x80(%rsp)
movq -0x18(%rax), %rax
testq %rax, %rax
je 0x2ff07
movq 0x90(%rsp), %rdi
leaq 0x80(%rsp), %rdx
movl $0xe, %esi
callq *%rax
testq %rax, %rax
setne %cl
movq 0x80(%rsp), %rax
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x2ff07
movq 0x10(%rax), %rcx
movq %rcx, 0x30(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x38(%rsp)
movq %r15, 0x88(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movb $0x1, 0xf(%rsp)
leaq 0xd0(%rsp), %r14
leaq 0x60(%rsp), %r15
leaq 0x3b648(%rip), %r12     # 0x6b584
leaq 0x3b674(%rip), %r13     # 0x6b5b7
leaq 0x3b3a4(%rip), %rbx     # 0x6b2ee
xorl %ebp, %ebp
movq $0x0, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movl %ebp, %ecx
movl %ecx, %ebp
movq %r14, %rdi
movq %r15, %rsi
callq 0x1bb16
testb %al, %al
je 0x30271
movq %r15, %rdi
movq %r12, %rsi
callq 0xb110
testl %eax, %eax
je 0x30056
movq %r15, %rdi
movq %r13, %rsi
callq 0xb110
testl %eax, %eax
je 0x2fff0
movq %r15, %rdi
movq %rbx, %rsi
callq 0xb110
testl %eax, %eax
je 0x30023
movq %r15, %rdi
leaq 0x3dbc3(%rip), %rsi     # 0x6db73
callq 0xb110
testl %eax, %eax
jne 0x30090
movq 0x98(%rsp), %rax
testq %rax, %rax
je 0x30395
movq 0x90(%rsp), %rdi
movl $0x8, %esi
leaq 0x30(%rsp), %rdx
callq *%rax
testq %rax, %rax
jne 0x2ff62
jmp 0x30395
movq 0x98(%rsp), %rax
testq %rax, %rax
je 0x30403
movq 0x90(%rsp), %rdi
movl $0x2, %esi
leaq 0x50(%rsp), %rdx
callq *%rax
testq %rax, %rax
jne 0x2ff62
jmp 0x30403
movq 0x98(%rsp), %rax
testq %rax, %rax
je 0x30490
movq 0x90(%rsp), %rdi
movl $0x2, %esi
leaq 0x48(%rsp), %rdx
callq *%rax
testq %rax, %rax
jne 0x2ff62
jmp 0x30490
movq 0x98(%rsp), %rax
testq %rax, %rax
je 0x3068d
movq 0x90(%rsp), %rdi
movl $0x2, %esi
leaq 0x28(%rsp), %rdx
callq *%rax
movb $0x1, %cl
movq %rcx, 0x20(%rsp)
testq %rax, %rax
jne 0x2ff62
jmp 0x3068d
movq %r15, %rdi
leaq 0x3b582(%rip), %rsi     # 0x6b61c
callq 0xb110
movb $0x1, %cl
testl %eax, %eax
je 0x2ff60
movq 0x68(%rsp), %rax
testq %rax, %rax
je 0x3025f
movq 0x18(%rsp), %rcx
cmpq $0x2, %rcx
je 0x30164
cmpq $0x1, %rcx
je 0x30151
testq %rcx, %rcx
jne 0x30181
movq 0x60(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movsbl -0x1(%rcx,%rax), %edi
movq %rax, 0x10(%rsp)
callq 0xba30
movq 0x20(%rsp), %rdi
shll $0x18, %eax
movl %eax, %ecx
orl $0x4000000, %ecx        # imm = 0x4000000
cmpl $0x46000000, %ecx       # imm = 0x46000000
jne 0x30132
movl %eax, 0x20(%rsp)
movq 0x10(%rsp), %rsi
decq %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0xb130
cmpl $0x46000000, 0x20(%rsp) # imm = 0x46000000
sete 0xf(%rsp)
movq 0x60(%rsp), %rdi
leaq 0x3cbf7(%rip), %rsi     # 0x6cd30
leaq 0x28(%rsp), %rdx
xorl %eax, %eax
callq 0xb4e0
movb $0x1, %al
movq %rax, 0x20(%rsp)
jmp 0x3025f
movq 0x60(%rsp), %rdi
leaq 0x3cbd3(%rip), %rsi     # 0x6cd30
leaq 0x50(%rsp), %rdx
jmp 0x30175
movq 0x60(%rsp), %rdi
leaq 0x3cbc0(%rip), %rsi     # 0x6cd30
leaq 0x48(%rsp), %rdx
xorl %eax, %eax
callq 0xb4e0
jmp 0x3025f
leaq 0x5c3e8(%rip), %rax     # 0x8c570
movq (%rax), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x30264
addq $0x20, %rdi
callq 0xb7d0
leaq 0x5c3ca(%rip), %rax     # 0x8c570
movq (%rax), %rax
movq 0x8(%rax), %rdi
movl $0xb, %edx
movq %rdi, 0x10(%rsp)
leaq 0x39fea(%rip), %rsi     # 0x6a1a8
callq 0xb5f0
movl $0xf, %edx
movq 0x10(%rsp), %rdi
leaq 0x3aef1(%rip), %rsi     # 0x6b0c5
callq 0xb5f0
movl $0x33, %edx
movq 0x10(%rsp), %rdi
leaq 0x3b438(%rip), %rsi     # 0x6b622
callq 0xb5f0
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq 0x10(%rsp), %rdi
callq 0xb5f0
movq %rax, 0x10(%rsp)
movl $0x1, %edx
movq 0x10(%rsp), %rdi
leaq 0x3c1ba(%rip), %rsi     # 0x6c3d3
callq 0xb5f0
movq 0x10(%rsp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq 0x10(%rsp), %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
leaq 0x5c31d(%rip), %rax     # 0x8c570
movq (%rax), %rdi
addq $0x20, %rdi
callq 0xb3b0
movq 0x18(%rsp), %rcx
incq %rcx
movq %rcx, 0x18(%rsp)
jmp 0x2ff5e
xorl %ebx, %ebx
cmpq $0x0, 0x30(%rsp)
movl $0x0, %esi
jne 0x30285
movq 0x38(%rsp), %rsi
movl $0x18, %edx
movq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0x2e36a
testb %al, %al
je 0x3052d
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x302b9
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 0x5c(%rsp), %edi
movl %edi, (%rbx)
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rbx)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rbx)
testb $0x1, %bpl
je 0x30578
xorl %esi, %esi
callq 0xb740
testl %eax, %eax
je 0x30578
leaq 0x5c261(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x3052b
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x3a174(%rip), %rsi     # 0x6a4a8
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3ad7d(%rip), %rsi     # 0x6b0c5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3b2fa(%rip), %rsi     # 0x6b656
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 0x30518
leaq 0x5c1d4(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x3052b
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x3a0e7(%rip), %rsi     # 0x6a4a8
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3acf0(%rip), %rsi     # 0x6b0c5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3b205(%rip), %rsi     # 0x6b5ee
movl $0x2d, %edx
movq %rbx, %rdi
callq 0xb5f0
movq %rbx, %rdi
callq 0xb250
jmp 0x30518
leaq 0x5c166(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x3052b
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x3a079(%rip), %rsi     # 0x6a4a8
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3ac82(%rip), %rsi     # 0x6b0c5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3b134(%rip), %rsi     # 0x6b58b
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 0x30518
leaq 0x5c0d9(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x3052b
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x39fec(%rip), %rsi     # 0x6a4a8
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3abf5(%rip), %rsi     # 0x6b0c5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3b0d8(%rip), %rsi     # 0x6b5bc
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 0x5c051(%rip), %rax     # 0x8c570
movq (%rax), %rdi
addq $0x20, %rdi
callq 0xb3b0
xorl %ebx, %ebx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x30549
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x90(%rsp), %rdi
callq 0x1b76c
leaq 0xd0(%rsp), %rdi
callq 0x1bad0
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x1, 0x20(%rsp)
je 0x3059e
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 0x305b1
leaq 0x1e6(%rip), %rax       # 0x3078b
movq %rax, 0x38(%r14)
movq %r14, %rbx
jmp 0x3052d
leaq 0x5bfb8(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x3052b
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x39ecb(%rip), %rsi     # 0x6a4a8
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3aad4(%rip), %rsi     # 0x6b0c5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3b07e(%rip), %rsi     # 0x6b683
movl $0x2e, %edx
movq %rbx, %rdi
callq 0xb5f0
movq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0xb1d0
movq %rax, %rbx
leaq 0x3ad8f(%rip), %rsi     # 0x6b3b8
movl $0x6, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x3ad82(%rip), %rax     # 0x6b3bf
leaq 0x3ad81(%rip), %rsi     # 0x6b3c5
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 0x30518
leaq 0x5bedc(%rip), %rbx     # 0x8c570
movq (%rbx), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x3052b
addq $0x20, %rdi
callq 0xb7d0
movq (%rbx), %rax
movq 0x18(%rax), %rbx
leaq 0x39def(%rip), %rsi     # 0x6a4a8
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3a9f8(%rip), %rsi     # 0x6b0c5
movl $0xf, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x3ae77(%rip), %rsi     # 0x6b558
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 0x30518
jmp 0x30727
jmp 0x30727
jmp 0x30727
movq %rax, %rbx
jmp 0x30746
jmp 0x30727
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x30746
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x90(%rsp), %rdi
callq 0x1b76c
leaq 0xd0(%rsp), %rdi
callq 0x1bad0
movq %rbx, %rdi
callq 0xb9c0