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

      bool ret = false;

      const string sub = (params.empty())?"/":params;
      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_cd: pwd_path: '" << pwd_path << "', abs_path: '" << abs_path << "'");

      z_fs_stat_t stat;

      if (!z_fs_stat(abs_path.c_str(), &stat))
      {
        result = "path does not exist";
        SCDC_FAIL(__func__ << ": checking path '" << abs_path << "' failed: " << result);
        goto do_return;
      }

      pwd_file = stat.is_file;
      SCDC_TRACE("do_cmd_cd: pwd_file: " << pwd_file);

      ret = scdc_dataset_fs2::do_cmd_cd(pwd_path, input, output, result);

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

      return ret;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r13
movq %rdi, %rbp
cmpq $0x0, 0x8(%rsi)
je 0x3a746
leaq 0x48(%rsp), %rdi
callq 0xb750
jmp 0x3a75c
leaq 0x16c00(%rip), %rsi     # 0x5134d
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x1a132
leaq 0x18(%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(%rbp), %r12
leaq 0x48(%rsp), %r14
leaq 0x8(%rsp), %rcx
movq %r12, %rsi
movq %r14, %rdx
callq 0x37714
testb %al, %al
je 0x3a7f0
movq 0x8(%rbp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %r14
movq %r14, %rdx
callq 0x377f2
movq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x2da32
testq %rax, %rax
je 0x3a879
cmpq $0x0, 0x70(%rsp)
setne 0x38(%rbp)
leaq 0x8(%rsp), %rsi
movq %rbp, %rdi
movq %r13, %rdx
movq %r15, %rcx
movq %rbx, %r8
callq 0x3a99a
movl %eax, %ebx
jmp 0x3a928
leaq 0x187bf(%rip), %rsi     # 0x52fb6
movq %rbx, %rdi
callq 0xba40
leaq 0x3ad7a(%rip), %r15     # 0x75580
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x3a926
addq $0x20, %rdi
callq 0xb800
movq (%r15), %rax
movq 0x8(%rax), %rdi
leaq 0x1695d(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x18b06(%rip), %rsi     # 0x5333d
movq %rax, %rdi
callq 0xb520
leaq 0x1736f(%rip), %rsi     # 0x51bb5
movq %rax, %rdi
callq 0xb520
leaq 0x18afc(%rip), %rsi     # 0x53351
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
movq %r12, %rsi
callq 0xb490
leaq 0x18af0(%rip), %rsi     # 0x5335f
movq %rax, %rdi
callq 0xb520
jmp 0x3a8e6
leaq 0x18eae(%rip), %rsi     # 0x5372e
movq %rbx, %rdi
callq 0xba40
leaq 0x3acf1(%rip), %r15     # 0x75580
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x3a926
addq $0x20, %rdi
callq 0xb800
movq (%r15), %rax
movq 0x8(%rax), %rdi
leaq 0x168d4(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x18a7d(%rip), %rsi     # 0x5333d
movq %rax, %rdi
callq 0xb520
leaq 0x172e6(%rip), %rsi     # 0x51bb5
movq %rax, %rdi
callq 0xb520
leaq 0x18e64(%rip), %rsi     # 0x53742
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
movq %r14, %rsi
callq 0xb490
leaq 0x170ad(%rip), %rsi     # 0x519a5
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb490
movq %rax, %rdi
callq 0xb270
leaq 0x3ac66(%rip), %rax     # 0x75580
movq (%rax), %rdi
addq $0x20, %rdi
callq 0xb3e0
xorl %ebx, %ebx
leaq 0x28(%rsp), %rdi
callq 0xb230
leaq 0x8(%rsp), %rdi
callq 0xb230
leaq 0x48(%rsp), %rdi
callq 0xb230
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xb230
leaq 0x8(%rsp), %rdi
callq 0xb230
leaq 0x48(%rsp), %rdi
callq 0xb230
movq %rbx, %rdi
callq 0xb9a0
nop