// File: /workspace/github_cpp_makefile_star2_O2/mh0fm4[P]SCDC/src/components/dataprov/dataprov_fs2.cc
// Function: scdc_dataset_fs2_access::do_cmd_put(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, _scdc_dataset_inout_t*, _scdc_dataset_inout_t*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool do_cmd_put(const string &params, scdc_dataset_input_t *input, scdc_dataset_output_t *output, scdc_result &result)
    {
      SCDC_TRACE("do_cmd_put: params: '" << params << "'");

      bool ret = false;

      stringlist psl(' ', params);

      const string sub = (!pwd_file)?psl.front_pop():"";
      string pwd_path, abs_path;

      if (!dataprov_fs2()->make_pwd_path(pwd, sub, pwd_path))
      {
        result = "invalid path";
        SCDC_FAIL(__func__ << ": make path '" << pwd << "' + '" << sub << "' failed: " << result);
        goto do_return;
      }

      dataprov_fs2()->make_abs_path(pwd_path, abs_path);
      SCDC_TRACE(__func__ << ": pwd_path: '" << pwd_path << "', abs_path: '" << abs_path << "'");

      if (input && strcmp(input->format, "fstar") == 0)
      {
        SCDC_TRACE(__func__ << ": fstar input to directory");

        string conf = "to:fs";

        if (scdc_dataset_input_redirect(input, conf.c_str(), abs_path.c_str()) != SCDC_SUCCESS)
        {
          result = "input redirection failed";
          SCDC_FAIL(__func__ << ": redirecting input to directory '" << abs_path << "' failed: " << result);

        } else ret = true;

      } else
      {
        string p = psl.front_pop();

        if (!p.empty() && p[0] == 'd')
        {
          SCDC_TRACE(__func__ << ": create directory");

          if (!z_fs_mkdir(abs_path.c_str()))
          {
            result = "directory creation failed";
            SCDC_FAIL(__func__ << ": creating directory '" << abs_path << "' failed: " << result);

          } else ret = true;

        } else
        {
          SCDC_TRACE(__func__ << ": plain input to file");

          size_t i = 0;

          if (!p.empty() && p[0] == 'f')
          {
            ++i;

            if (p.size() > 1 && p[1] == ':') ++i;
          }

          string conf = "to:streamdup:" + p.substr(i);

          FILE *file = open_file(abs_path, false, true);

          if (!file || scdc_dataset_input_redirect(input, conf.c_str(), file) != SCDC_SUCCESS)
          {
            result = "input redirection failed";
            SCDC_FAIL(__func__ << ": redirecting input to file '" << abs_path << "' failed: " << result);

          } else ret = true;

          close_file(file);
        }
      }

do_return:
      SCDC_TRACE(__func__ << ": return: " << ret);

      return ret;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %r8, %rbx
movq %rdx, %r14
movq %rdi, %r15
leaq 0xf0(%rsp), %r12
movq %r12, %rdi
callq 0xb750
leaq 0xc8(%rsp), %rdi
pushq $0x20
popq %rsi
movq %r12, %rdx
callq 0x2f05c
leaq 0xf0(%rsp), %rdi
callq 0xb230
cmpb $0x0, 0x38(%r15)
je 0x38213
leaq 0x1a2bb(%rip), %rsi     # 0x524bd
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x1a132
jmp 0x38225
leaq 0x68(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x19ba0
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %edx, %edx
movb %dl, (%rax)
movb %dl, (%rcx)
leaq 0x18(%r15), %r12
leaq 0x68(%rsp), %rdx
leaq 0x48(%rsp), %rcx
movq %r12, %rsi
callq 0x37714
testb %al, %al
je 0x38393
movq 0x8(%r15), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x377f2
testq %r14, %r14
je 0x38294
leaq 0x1a231(%rip), %rsi     # 0x524b5
movq %r14, %rdi
callq 0xb7a0
testl %eax, %eax
je 0x385d3
leaq 0x8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x19ba0
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x3845c
movq 0x8(%rsp), %rcx
movzbl (%rcx), %edx
cmpl $0x66, %edx
je 0x386b7
cmpl $0x64, %edx
jne 0x3845c
movq 0x28(%rsp), %rdi
callq 0x2da96
movb $0x1, %bpl
testq %rax, %rax
jne 0x3858c
leaq 0x1b0dc(%rip), %rsi     # 0x533c7
movq %rbx, %rdi
callq 0xba40
leaq 0x3d286(%rip), %r14     # 0x75580
movq (%r14), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x3838c
addq $0x20, %rdi
callq 0xb800
movq (%r14), %rax
movq 0x8(%rax), %rdi
leaq 0x18e69(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x1b012(%rip), %rsi     # 0x5333d
movq %rax, %rdi
callq 0xb520
leaq 0x1975f(%rip), %rsi     # 0x51a99
movq %rax, %rdi
callq 0xb520
leaq 0x1b098(%rip), %rsi     # 0x533e1
movq %rax, %rdi
callq 0xb520
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0xb490
leaq 0x19640(%rip), %rsi     # 0x519a5
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb490
movq %rax, %rdi
callq 0xb270
movq (%r14), %rdi
addq $0x20, %rdi
callq 0xb3e0
xorl %ebp, %ebp
jmp 0x3858c
leaq 0x1ac1c(%rip), %rsi     # 0x52fb6
movq %rbx, %rdi
callq 0xba40
leaq 0x3d1d7(%rip), %r14     # 0x75580
movq (%r14), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x38455
addq $0x20, %rdi
callq 0xb800
movq (%r14), %rax
movq 0x8(%rax), %rdi
leaq 0x18dba(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x1af63(%rip), %rsi     # 0x5333d
movq %rax, %rdi
callq 0xb520
leaq 0x196b0(%rip), %rsi     # 0x51a99
movq %rax, %rdi
callq 0xb520
leaq 0x1af59(%rip), %rsi     # 0x53351
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
movq %r12, %rsi
callq 0xb490
leaq 0x1af4d(%rip), %rsi     # 0x5335f
movq %rax, %rdi
callq 0xb520
leaq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0xb490
leaq 0x19577(%rip), %rsi     # 0x519a5
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb490
movq %rax, %rdi
callq 0xb270
movq (%r14), %rdi
addq $0x20, %rdi
callq 0xb3e0
xorl %ebp, %ebp
jmp 0x38596
xorl %edx, %edx
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $-0x1
popq %rcx
callq 0xb560
leaq 0x1af7e(%rip), %rsi     # 0x533f8
leaq 0x88(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
callq 0x218cd
leaq 0xa8(%rsp), %rdi
callq 0xb230
leaq 0x28(%rsp), %rsi
pushq $0x1
popq %rcx
movq %r15, %rdi
xorl %edx, %edx
callq 0x3a57c
testq %rax, %rax
je 0x384d5
movq 0x88(%rsp), %rsi
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x273af
movb $0x1, %bpl
cmpq $0x1, %rax
je 0x3857f
leaq 0x1b189(%rip), %rsi     # 0x53665
movq %rbx, %rdi
callq 0xba40
leaq 0x3d095(%rip), %r14     # 0x75580
movq (%r14), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x3857d
addq $0x20, %rdi
callq 0xb800
movq (%r14), %rax
movq 0x8(%rax), %rdi
leaq 0x18c78(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x1ae21(%rip), %rsi     # 0x5333d
movq %rax, %rdi
callq 0xb520
leaq 0x1956e(%rip), %rsi     # 0x51a99
movq %rax, %rdi
callq 0xb520
leaq 0x1aecc(%rip), %rsi     # 0x53406
movq %rax, %rdi
callq 0xb520
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0xb490
leaq 0x1944f(%rip), %rsi     # 0x519a5
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb490
movq %rax, %rdi
callq 0xb270
movq (%r14), %rdi
addq $0x20, %rdi
callq 0xb3e0
xorl %ebp, %ebp
leaq 0x88(%rsp), %rdi
callq 0xb230
leaq 0x8(%rsp), %rdi
callq 0xb230
leaq 0x28(%rsp), %rdi
callq 0xb230
leaq 0x48(%rsp), %rdi
callq 0xb230
leaq 0x68(%rsp), %rdi
callq 0xb230
leaq 0xc8(%rsp), %rdi
callq 0x19ef4
movl %ebp, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1adc4(%rip), %rsi     # 0x5339e
leaq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x1a132
movq 0x8(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x273af
cmpq $0x1, %rax
sete %bpl
je 0x3858c
leaq 0x1b054(%rip), %rsi     # 0x53665
movq %rbx, %rdi
callq 0xba40
leaq 0x3cf60(%rip), %r14     # 0x75580
movq (%r14), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x3858c
addq $0x20, %rdi
callq 0xb800
movq (%r14), %rax
movq 0x8(%rax), %rdi
leaq 0x18b43(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x1acec(%rip), %rsi     # 0x5333d
movq %rax, %rdi
callq 0xb520
leaq 0x19439(%rip), %rsi     # 0x51a99
movq %rax, %rdi
callq 0xb520
leaq 0x1ad35(%rip), %rsi     # 0x533a4
movq %rax, %rdi
callq 0xb520
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0xb490
leaq 0x1931a(%rip), %rsi     # 0x519a5
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb490
movq %rax, %rdi
callq 0xb270
movq (%r14), %rdi
addq $0x20, %rdi
callq 0xb3e0
jmp 0x3858c
cmpq $0x1, %rax
jne 0x386c5
pushq $0x1
popq %rdx
jmp 0x3845e
xorl %edx, %edx
cmpb $0x3a, 0x1(%rcx)
sete %dl
incq %rdx
jmp 0x3845e
jmp 0x38725
jmp 0x386eb
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
jmp 0x38714
jmp 0x386eb
jmp 0x38725
movq %rax, %rbx
jmp 0x38719
jmp 0x386f2
movq %rax, %rbx
jmp 0x38746
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0xb230
jmp 0x38753
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xb230
leaq 0x8(%rsp), %rdi
callq 0xb230
jmp 0x38728
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xb230
leaq 0x48(%rsp), %rdi
callq 0xb230
leaq 0x68(%rsp), %rdi
callq 0xb230
leaq 0xc8(%rsp), %rdi
callq 0x19ef4
movq %rbx, %rdi
callq 0xb9a0
nop