// File: /workspace/github_cpp_makefile_star2_O3/mh0fm4[P]SCDC/test/units/dataprov_access/test_access.c
// Function: test_access
int test_access(const char *uri)
{
  char cmd[512];
  scdc_dataset_t ds;
  scdc_dataset_input_t _ip, *ip = &_ip;
  scdc_dataset_output_t _op, *op = &_op;

#if 1
  printf("TEST command 'cd'\n");
  sprintf(cmd, "%s/foo", uri);
  ds = scdc_dataset_open(uri);
  printf("open: '%s', result: '%s'\n", uri, scdc_last_result());

  sprintf(cmd, "cd bar");
  scdc_dataset_cmd(ds, cmd, NULL, NULL);
  printf("cmd: '%s', result: '%s'\n", cmd, scdc_last_result());

  sprintf(cmd, "pwd");
  scdc_dataset_cmd(ds, cmd, NULL, NULL);
  printf("cmd: '%s', result: '%s'\n", cmd, scdc_last_result());

  sprintf(cmd, "cd /bar");
  scdc_dataset_cmd(ds, cmd, NULL, NULL);
  printf("cmd: '%s', result: '%s'\n", cmd, scdc_last_result());

  sprintf(cmd, "pwd");
  scdc_dataset_cmd(ds, cmd, NULL, NULL);
  printf("cmd: '%s', result: '%s'\n", cmd, scdc_last_result());

  sprintf(cmd, "cd");
  scdc_dataset_cmd(ds, cmd, NULL, NULL);
  printf("cmd: '%s', result: '%s'\n", cmd, scdc_last_result());

  sprintf(cmd, "pwd");
  scdc_dataset_cmd(ds, cmd, NULL, NULL);
  printf("cmd: '%s', result: '%s'\n", cmd, scdc_last_result());

  scdc_dataset_close(ds);
  printf("close: '%s', result: '%s'\n", uri, scdc_last_result());
#endif

#if 1
  printf("TEST command 'ls'\n");
  sprintf(cmd, "%s ls", uri);
  scdc_dataset_cmd(SCDC_DATASET_NULL, cmd, NULL, NULL);
  printf("cmd: '%s', result: '%s'\n", cmd, scdc_last_result());
#endif

#if 1
  printf("TEST command 'info'\n");
  sprintf(cmd, "%s/foo info", uri);
  scdc_dataset_cmd(SCDC_DATASET_NULL, cmd, NULL, NULL);
  printf("cmd: '%s', result: '%s'\n", cmd, scdc_last_result());

  sprintf(cmd, "%s/foo info bar", uri);
  scdc_dataset_cmd(SCDC_DATASET_NULL, cmd, NULL, NULL);
  printf("cmd: '%s', result: '%s'\n", cmd, scdc_last_result());
#endif

#if 1
  printf("TEST command 'mkd'\n");
  sprintf(cmd, "%s mkd foo", uri);
  scdc_dataset_cmd(SCDC_DATASET_NULL, cmd, NULL, NULL);
  printf("cmd: '%s', result: '%s'\n", cmd, scdc_last_result());

  sprintf(cmd, "%s rm foo", uri);
  scdc_dataset_cmd(SCDC_DATASET_NULL, cmd, NULL, NULL);
  printf("cmd: '%s', result: '%s'\n", cmd, scdc_last_result());
#endif

#if 1
  printf("TEST command 'put'\n");
  /* create input object to read from file */
  ip = scdc_dataset_input_create(ip, "file", INPUT_FILE);
  if (ip != NULL)
  {
    /* store data from input object */
    sprintf(cmd, "%s put " TARGET, uri);
    scdc_dataset_cmd(SCDC_DATASET_NULL, cmd, ip, NULL);
    printf("cmd: '%s', result: '%s'\n", cmd, scdc_last_result());

    /* destroy input object */
    scdc_dataset_input_destroy(ip);

  } else printf("ERROR: open input file failed!\n");
#endif

#if 1
  printf("TEST command 'get'\n");
  /* create output object to write to file */
  op = scdc_dataset_output_create(op, "file", OUTPUT_FILE);
  if (op != NULL)
  {
    /* retrieve data from dataset to output object */
    sprintf(cmd, "%s get " TARGET, uri);
    scdc_dataset_cmd(SCDC_DATASET_NULL, cmd, NULL, op);
    printf("cmd: '%s', result: '%s'\n", cmd, scdc_last_result());
    
    /* destroy output object */
    scdc_dataset_output_destroy(op);

  } else printf("ERROR: open output file failed!\n");
#endif

#if 1
  /* remove the data stored */
  sprintf(cmd, "%s rm " TARGET, uri);
  scdc_dataset_cmd(SCDC_DATASET_NULL, cmd, NULL, op);
  printf("cmd: '%s', result: '%s'\n", cmd, scdc_last_result());
#endif

  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2b0, %rsp            # imm = 0x2B0
movq %rdi, %rbx
leaq 0x4ecb6(%rip), %rdi     # 0x5b10b
callq 0xb830
leaq 0x4eba3(%rip), %rsi     # 0x5b004
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0d0
movq %rbx, %rdi
xorl %eax, %eax
callq 0xd745
movq %rax, %r12
xorl %eax, %eax
callq 0xca44
leaq 0x4eb7a(%rip), %rdi     # 0x5b00b
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
movl $0x62206463, (%r14)     # imm = 0x62206463
movl $0x726162, 0x3(%r14)    # imm = 0x726162
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe343
xorl %eax, %eax
callq 0xca44
leaq 0x4eb60(%rip), %r15     # 0x5b02c
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
movl $0x647770, %ebp         # imm = 0x647770
movl %ebp, (%r14)
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe343
xorl %eax, %eax
callq 0xca44
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
movabsq $0x7261622f206463, %rax # imm = 0x7261622F206463
movq %rax, (%r14)
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe343
xorl %eax, %eax
callq 0xca44
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
movl %ebp, (%r14)
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe343
xorl %eax, %eax
callq 0xca44
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
movw $0x6463, (%r14)         # imm = 0x6463
movb $0x0, 0x2(%r14)
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe343
xorl %eax, %eax
callq 0xca44
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
movl %ebp, (%r14)
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe343
xorl %eax, %eax
callq 0xca44
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
movq %r12, %rdi
callq 0xd837
xorl %eax, %eax
callq 0xca44
leaq 0x4ea65(%rip), %rdi     # 0x5b045
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
leaq 0x4eb29(%rip), %rdi     # 0x5b11d
callq 0xb830
leaq 0x4ea60(%rip), %rsi     # 0x5b060
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0d0
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe343
xorl %eax, %eax
callq 0xca44
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
leaq 0x4eaf4(%rip), %rdi     # 0x5b12f
callq 0xb830
leaq 0x4ea1f(%rip), %rsi     # 0x5b066
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0d0
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe343
xorl %eax, %eax
callq 0xca44
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
leaq 0x4e9f0(%rip), %rsi     # 0x5b072
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0d0
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe343
xorl %eax, %eax
callq 0xca44
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
leaq 0x4ea86(%rip), %rdi     # 0x5b143
callq 0xb830
leaq 0x4e9b9(%rip), %rsi     # 0x5b082
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0d0
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe343
xorl %eax, %eax
callq 0xca44
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
leaq 0x4e989(%rip), %rsi     # 0x5b08d
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0d0
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe343
xorl %eax, %eax
callq 0xca44
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
leaq 0x4ea17(%rip), %rdi     # 0x5b156
callq 0xb830
leaq 0x4fff3(%rip), %rsi     # 0x5c73e
leaq 0x4e945(%rip), %rdx     # 0x5b097
leaq 0x58(%rsp), %rdi
xorl %eax, %eax
callq 0x1fe63
testq %rax, %rax
je 0xc7b8
movq %rax, %r14
leaq 0x4e939(%rip), %rsi     # 0x5b0a6
leaq 0xb0(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0d0
xorl %edi, %edi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe343
xorl %eax, %eax
callq 0xca44
leaq 0x4e88b(%rip), %rdi     # 0x5b02c
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
movq %r14, %rdi
callq 0x1ff53
jmp 0xc7c4
leaq 0x4e9aa(%rip), %rdi     # 0x5b169
callq 0xb830
leaq 0x4e9bd(%rip), %rdi     # 0x5b188
callq 0xb830
leaq 0x4ff67(%rip), %rsi     # 0x5c73e
leaq 0x4e8db(%rip), %rdx     # 0x5b0b9
movq %rsp, %rdi
xorl %eax, %eax
callq 0x20cab
movq %rax, %r14
testq %rax, %rax
je 0xc842
leaq 0x4e8d2(%rip), %rsi     # 0x5b0c9
leaq 0xb0(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0d0
xorl %edi, %edi
movq %r15, %rsi
xorl %edx, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0xe343
xorl %eax, %eax
callq 0xca44
leaq 0x4e801(%rip), %rdi     # 0x5b02c
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
movq %r14, %rdi
callq 0x20d9b
jmp 0xc84e
leaq 0x4e952(%rip), %rdi     # 0x5b19b
callq 0xb830
leaq 0x4e887(%rip), %rsi     # 0x5b0dc
leaq 0xb0(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0d0
xorl %edi, %edi
movq %r15, %rsi
xorl %edx, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0xe343
xorl %eax, %eax
callq 0xca44
leaq 0x4e7a3(%rip), %rdi     # 0x5b02c
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb080
movl $0x1, %eax
addq $0x2b0, %rsp            # imm = 0x2B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq