// File: /workspace/github_cpp_makefile_star2_O2/mh0fm4[P]SCDC/src/components/dataprov/dataprov_fs2.cc
// Function: scdc_dataset_fs2_access::do_cmd_sync(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_sync(const string &params, scdc_dataset_input_t *input, scdc_dataset_output_t *output, scdc_result &result)
    {
      SCDC_TRACE("do_cmd_sync: 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("do_cmd_sync: pwd_path: '" << pwd_path << "', abs_path: '" << abs_path << "'");

      if (z_fs_is_directory(abs_path.c_str()))
      {
        result = "syncing not supported";
        SCDC_FAIL(__func__ << ": syncing directory '" << abs_path << "' failed: " << result);

      } else
      {
        FILE *file = open_file(abs_path, false, false);

        if (!file || fsync(fileno(file)) != 0)
        {
          result = "syncing failed";
          SCDC_FAIL(__func__ << ": syncing file '" << abs_path << "' failed: " << result);

        } else ret = true;

        close_file(file);
      }

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

      return ret;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r8, %rbx
movq %rdi, %r15
leaq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0xb750
leaq 0x60(%rsp), %rdi
pushq $0x20
popq %rsi
movq %r14, %rdx
callq 0x2f05c
leaq 0x88(%rsp), %rdi
callq 0xb230
cmpb $0x0, 0x38(%r15)
je 0x38e96
leaq 0x19638(%rip), %rsi     # 0x524bd
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x1a132
jmp 0x38ea5
leaq 0x40(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x19ba0
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq 0x10(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %edx, %edx
movb %dl, (%rax)
movb %dl, (%rcx)
leaq 0x18(%r15), %r12
leaq 0x40(%rsp), %r14
leaq 0x20(%rsp), %rcx
movq %r12, %rsi
movq %r14, %rdx
callq 0x37714
testb %al, %al
je 0x38f80
movq 0x8(%r15), %rdi
leaq 0x20(%rsp), %rsi
movq %rsp, %r14
movq %r14, %rdx
callq 0x377f2
movq (%rsp), %rdi
callq 0x2d93f
testq %rax, %rax
je 0x39080
leaq 0x1a5e8(%rip), %rsi     # 0x534fd
movq %rbx, %rdi
callq 0xba40
leaq 0x3c65c(%rip), %r15     # 0x75580
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x39047
addq $0x20, %rdi
callq 0xb800
movq (%r15), %rax
movq 0x8(%rax), %rdi
leaq 0x1823f(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x1a3e8(%rip), %rsi     # 0x5333d
movq %rax, %rdi
callq 0xb520
leaq 0x1a58d(%rip), %rsi     # 0x534f1
movq %rax, %rdi
callq 0xb520
leaq 0x1a5a0(%rip), %rsi     # 0x53513
movq %rax, %rdi
callq 0xb520
jmp 0x39007
leaq 0x1a02f(%rip), %rsi     # 0x52fb6
movq %rbx, %rdi
callq 0xba40
leaq 0x3c5ea(%rip), %r15     # 0x75580
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x39047
addq $0x20, %rdi
callq 0xb800
movq (%r15), %rax
movq 0x8(%rax), %rdi
leaq 0x181cd(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x1a376(%rip), %rsi     # 0x5333d
movq %rax, %rdi
callq 0xb520
leaq 0x1a51b(%rip), %rsi     # 0x534f1
movq %rax, %rdi
callq 0xb520
leaq 0x1a36c(%rip), %rsi     # 0x53351
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
movq %r12, %rsi
callq 0xb490
leaq 0x1a360(%rip), %rsi     # 0x5335f
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
movq %r14, %rsi
callq 0xb490
leaq 0x1898c(%rip), %rsi     # 0x519a5
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb490
movq %rax, %rdi
callq 0xb270
leaq 0x3c545(%rip), %rax     # 0x75580
movq (%rax), %rdi
addq $0x20, %rdi
callq 0xb3e0
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0xb230
leaq 0x20(%rsp), %rdi
callq 0xb230
leaq 0x40(%rsp), %rdi
callq 0xb230
leaq 0x60(%rsp), %rdi
callq 0x19ef4
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3a57c
testq %rax, %rax
je 0x390ab
movq %rax, %rdi
callq 0xb590
movl %eax, %edi
callq 0xb470
testl %eax, %eax
je 0x3914a
leaq 0x1a477(%rip), %rsi     # 0x53529
movq %rbx, %rdi
callq 0xba40
leaq 0x3c4bf(%rip), %r14     # 0x75580
movq (%r14), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x39047
addq $0x20, %rdi
callq 0xb800
movq (%r14), %rax
movq 0x8(%rax), %rdi
leaq 0x180a2(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x1a24b(%rip), %rsi     # 0x5333d
movq %rax, %rdi
callq 0xb520
leaq 0x1a3f0(%rip), %rsi     # 0x534f1
movq %rax, %rdi
callq 0xb520
leaq 0x1a428(%rip), %rsi     # 0x53538
movq %rax, %rdi
callq 0xb520
movq %rsp, %rsi
movq %rax, %rdi
callq 0xb490
leaq 0x1887b(%rip), %rsi     # 0x519a5
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb490
movq %rax, %rdi
callq 0xb270
jmp 0x39034
movb $0x1, %bl
jmp 0x39049
jmp 0x39153
movq %rax, %rbx
jmp 0x3918b
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xb230
jmp 0x39195
jmp 0x3916c
movq %rax, %rbx
movq %rsp, %rdi
callq 0xb230
leaq 0x20(%rsp), %rdi
callq 0xb230
leaq 0x40(%rsp), %rdi
callq 0xb230
leaq 0x60(%rsp), %rdi
callq 0x19ef4
movq %rbx, %rdi
callq 0xb9a0
nop