// File: /workspace/github_cpp_makefile_star2_O2/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 0x37f26(%rip), %rdi     # 0x4410b
callq 0xb850
leaq 0x37e13(%rip), %rsi     # 0x44004
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0c0
movq %rbx, %rdi
xorl %eax, %eax
callq 0xd223
movq %rax, %r12
xorl %eax, %eax
callq 0xc7d6
leaq 0x37dea(%rip), %rdi     # 0x4400b
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
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 0xdae4
xorl %eax, %eax
callq 0xc7d6
leaq 0x37dd0(%rip), %r15     # 0x4402c
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
movl $0x647770, %ebp         # imm = 0x647770
movl %ebp, (%r14)
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xdae4
xorl %eax, %eax
callq 0xc7d6
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
movabsq $0x7261622f206463, %rax # imm = 0x7261622F206463
movq %rax, (%r14)
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xdae4
xorl %eax, %eax
callq 0xc7d6
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
movl %ebp, (%r14)
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xdae4
xorl %eax, %eax
callq 0xc7d6
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
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 0xdae4
xorl %eax, %eax
callq 0xc7d6
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
movl %ebp, (%r14)
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xdae4
xorl %eax, %eax
callq 0xc7d6
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
movq %r12, %rdi
callq 0xd2db
xorl %eax, %eax
callq 0xc7d6
leaq 0x37cd5(%rip), %rdi     # 0x44045
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
leaq 0x37d99(%rip), %rdi     # 0x4411d
callq 0xb850
leaq 0x37cd0(%rip), %rsi     # 0x44060
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0c0
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xdae4
xorl %eax, %eax
callq 0xc7d6
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
leaq 0x37d64(%rip), %rdi     # 0x4412f
callq 0xb850
leaq 0x37c8f(%rip), %rsi     # 0x44066
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0c0
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xdae4
xorl %eax, %eax
callq 0xc7d6
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
leaq 0x37c60(%rip), %rsi     # 0x44072
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0c0
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xdae4
xorl %eax, %eax
callq 0xc7d6
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
leaq 0x37cf6(%rip), %rdi     # 0x44143
callq 0xb850
leaq 0x37c29(%rip), %rsi     # 0x44082
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0c0
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xdae4
xorl %eax, %eax
callq 0xc7d6
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
leaq 0x37bf9(%rip), %rsi     # 0x4408d
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0c0
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xdae4
xorl %eax, %eax
callq 0xc7d6
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
leaq 0x37c87(%rip), %rdi     # 0x44156
callq 0xb850
leaq 0x39213(%rip), %rsi     # 0x456ee
leaq 0x37bb5(%rip), %rdx     # 0x44097
leaq 0x58(%rsp), %rdi
xorl %eax, %eax
callq 0x1aabe
testq %rax, %rax
je 0xc548
movq %rax, %r14
leaq 0x37ba9(%rip), %rsi     # 0x440a6
leaq 0xb0(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0c0
xorl %edi, %edi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xdae4
xorl %eax, %eax
callq 0xc7d6
leaq 0x37afb(%rip), %rdi     # 0x4402c
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
movq %r14, %rdi
callq 0x1abc2
jmp 0xc554
leaq 0x37c1a(%rip), %rdi     # 0x44169
callq 0xb850
leaq 0x37c2d(%rip), %rdi     # 0x44188
callq 0xb850
leaq 0x39187(%rip), %rsi     # 0x456ee
leaq 0x37b4b(%rip), %rdx     # 0x440b9
movq %rsp, %rdi
xorl %eax, %eax
callq 0x1b634
movq %rax, %r14
testq %rax, %rax
je 0xc5d2
leaq 0x37b42(%rip), %rsi     # 0x440c9
leaq 0xb0(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0c0
xorl %edi, %edi
movq %r15, %rsi
xorl %edx, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0xdae4
xorl %eax, %eax
callq 0xc7d6
leaq 0x37a71(%rip), %rdi     # 0x4402c
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
movq %r14, %rdi
callq 0x1b6f2
jmp 0xc5de
leaq 0x37bc2(%rip), %rdi     # 0x4419b
callq 0xb850
leaq 0x37af7(%rip), %rsi     # 0x440dc
leaq 0xb0(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb0c0
xorl %edi, %edi
movq %r15, %rsi
xorl %edx, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0xdae4
xorl %eax, %eax
callq 0xc7d6
leaq 0x37a13(%rip), %rdi     # 0x4402c
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb070
pushq $0x1
popq %rax
addq $0x2b0, %rsp            # imm = 0x2B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq