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


  /* open dataset */
  ds = scdc_dataset_open(uri);
  if (ds == SCDC_DATASET_NULL)
  {
    printf("ERROR: open dataset failed!\n");
    goto do_return;

  } else printf("open dataset '%s': OK\n", uri);

  /* become admin */
  cmd = "cd ADMIN";
  if (scdc_dataset_cmd(ds, cmd, NULL, NULL) != SCDC_SUCCESS)
  {
    printf("ERROR: command '%s' failed!\n", cmd);
    goto do_return;

  } else printf("becoming admin with command '%s': OK\n", cmd);

#if 1
  /* remove store (do not care whether it fails or not) */
  cmd = "rm storage_demo";
  if (scdc_dataset_cmd(ds, cmd, NULL, NULL) != SCDC_SUCCESS)
  {
    printf("WARNING: command '%s' failed!\n", cmd);

  } else printf("removing store with command '%s': OK\n", cmd);
#endif

#if 1
  /* add store */
  cmd = "put storage_demo";
  if (scdc_dataset_cmd(ds, cmd, NULL, NULL) != SCDC_SUCCESS)
  {
    printf("ERROR: command '%s' failed!\n", cmd);
    goto do_return;

  } else printf("adding store with command '%s': OK\n", cmd);
#endif

  /* select store */
  cmd = "cd storage_demo";
  if (scdc_dataset_cmd(ds, cmd, NULL, NULL) != SCDC_SUCCESS)
  {
    printf("ERROR: command '%s' failed!\n", cmd);
    goto do_return;

  } else printf("selecting store with command '%s': OK\n", cmd);

  /* create input object to read from file */
  ip = scdc_dataset_input_create(ip, "file", INPUT_FILE);
  if (ip == NULL)
  {
    printf("ERROR: open input file failed!\n");
    goto do_return;
  }

  /* store data from input object to dataset */
  cmd = "put " TARGET;
  if (scdc_dataset_cmd(ds, cmd, ip, NULL) != SCDC_SUCCESS)
  {
    printf("ERROR: command '%s' failed!\n", cmd);
    goto do_return;

  } else printf("storing data with command '%s': OK\n", cmd);

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

#if 1
  /* create output object to write to file */
  op = scdc_dataset_output_create(op, "file", OUTPUT_FILE);
  if (op == NULL)
  {
    printf("ERROR: open output file failed!\n");
    goto do_return;
  }

  /* retrieve data from dataset to output object */
  cmd = "get " TARGET;
  if (scdc_dataset_cmd(ds, cmd, NULL, op) != SCDC_SUCCESS)
  {
    printf("ERROR: command '%s' failed!\n", cmd);
    goto do_return;

  } else printf("retrieving data with command '%s': OK\n", cmd);

  /* destroy output object */
  scdc_dataset_output_destroy(op);
#endif

  /* info entry */
  cmd = "info " TARGET;
  if (scdc_dataset_cmd(ds, cmd, NULL, NULL) != SCDC_SUCCESS)
  {
    printf("ERROR: command '%s' failed!\n", cmd);
    goto do_return;

  } else printf("getting info with command '%s': OK\n", cmd);

  /* list store */
  cmd = "ls";
  if (scdc_dataset_cmd(ds, cmd, NULL, NULL) != SCDC_SUCCESS)
  {
    printf("ERROR: command '%s' failed!\n", cmd);
    goto do_return;

  } else printf("listing data with command '%s': OK\n", cmd);

  /* remove the data stored */
  cmd = "rm " TARGET;
  if (scdc_dataset_cmd(ds, cmd, NULL, NULL) != SCDC_SUCCESS)
  {
    printf("ERROR: command '%s' failed!\n", cmd);
    goto do_return;

  } else printf("removing data with command '%s': OK\n", cmd);

#if 1
  /* become admin */
  cmd = "cd ADMIN";
  if (scdc_dataset_cmd(ds, cmd, NULL, NULL) != SCDC_SUCCESS)
  {
    printf("ERROR: command '%s' failed!\n", cmd);
    goto do_return;

  } else printf("becoming admin with command '%s': OK\n", cmd);

  /* remove store (do not care whether it fails or not) */
  cmd = "rm storage_demo";
  if (scdc_dataset_cmd(ds, cmd, NULL, NULL) != SCDC_SUCCESS)
  {
    printf("WARNING: command '%s' failed!\n", cmd);

  } else printf("removing store with command '%s': OK\n", cmd);
#endif

  scdc_dataset_close(ds);

do_return:
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %r14
xorl %eax, %eax
callq 0xd68a
testq %rax, %rax
je 0xc714
movq %rax, %rbx
leaq 0x4eb9d(%rip), %rdi     # 0x5b004
movq %r14, %rsi
xorl %eax, %eax
callq 0xb080
leaq 0x4eba3(%rip), %rsi     # 0x5b01b
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe288
cmpq $0x1, %rax
jne 0xc725
leaq 0x4ebaa(%rip), %rdi     # 0x5b041
leaq 0x4eb7d(%rip), %rsi     # 0x5b01b
xorl %eax, %eax
callq 0xb080
leaq 0x4ebbb(%rip), %r15     # 0x5b067
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe288
cmpq $0x1, %rax
leaq 0x4ebce(%rip), %r12     # 0x5b096
leaq 0x4eba8(%rip), %r14     # 0x5b077
movq %r14, %rdi
cmoveq %r12, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xb080
leaq 0x4ebd5(%rip), %rsi     # 0x5b0bc
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe288
cmpq $0x1, %rax
jne 0xc738
leaq 0x4ebc7(%rip), %rdi     # 0x5b0cd
leaq 0x4ebaf(%rip), %rsi     # 0x5b0bc
xorl %eax, %eax
callq 0xb080
leaq 0x4ebd6(%rip), %rsi     # 0x5b0f1
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe288
cmpq $0x1, %rax
jne 0xc748
leaq 0x4ebc7(%rip), %rdi     # 0x5b101
leaq 0x4ebb0(%rip), %rsi     # 0x5b0f1
xorl %eax, %eax
callq 0xb080
leaq 0x502df(%rip), %rsi     # 0x5c82e
leaq 0x4ebd2(%rip), %rdx     # 0x5b128
leaq 0x60(%rsp), %rdi
xorl %eax, %eax
callq 0x1ff55
testq %rax, %rax
je 0xc758
movq %rax, %r15
leaq 0x4ebc1(%rip), %rsi     # 0x5b136
movq %rbx, %rdi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe288
cmpq $0x1, %rax
jne 0xc761
leaq 0x4ebb0(%rip), %rdi     # 0x5b145
leaq 0x4eb9a(%rip), %rsi     # 0x5b136
xorl %eax, %eax
callq 0xb080
movq %r15, %rdi
callq 0x20045
leaq 0x5027c(%rip), %rsi     # 0x5c82e
leaq 0x4ebb0(%rip), %rdx     # 0x5b169
leaq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0x20db3
testq %rax, %rax
je 0xc771
movq %rax, %r15
leaq 0x4eba0(%rip), %rsi     # 0x5b178
movq %rbx, %rdi
xorl %edx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe288
cmpq $0x1, %rax
jne 0xc77a
leaq 0x4eb8f(%rip), %rdi     # 0x5b187
leaq 0x4eb79(%rip), %rsi     # 0x5b178
xorl %eax, %eax
callq 0xb080
movq %r15, %rdi
callq 0x20ea3
leaq 0x4eb99(%rip), %rsi     # 0x5b1ae
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe288
cmpq $0x1, %rax
jne 0xc78a
leaq 0x4eb8a(%rip), %rdi     # 0x5b1be
leaq 0x4eb73(%rip), %rsi     # 0x5b1ae
xorl %eax, %eax
callq 0xb080
leaq 0x4f9d4(%rip), %rsi     # 0x5c01d
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe288
cmpq $0x1, %rax
jne 0xc79a
leaq 0x4eb7a(%rip), %rdi     # 0x5b1e2
leaq 0x4f9ae(%rip), %rsi     # 0x5c01d
xorl %eax, %eax
callq 0xb080
leaq 0x4eb89(%rip), %rsi     # 0x5b206
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe288
cmpq $0x1, %rax
jne 0xc7aa
leaq 0x4eb78(%rip), %rdi     # 0x5b214
leaq 0x4eb63(%rip), %rsi     # 0x5b206
xorl %eax, %eax
callq 0xb080
leaq 0x4e96a(%rip), %rsi     # 0x5b01b
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe288
cmpq $0x1, %rax
jne 0xc725
leaq 0x4e975(%rip), %rdi     # 0x5b041
leaq 0x4e948(%rip), %rsi     # 0x5b01b
xorl %eax, %eax
callq 0xb080
leaq 0x4e986(%rip), %r15     # 0x5b067
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe288
cmpq $0x1, %rax
cmoveq %r12, %r14
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xb080
movq %rbx, %rdi
callq 0xd77c
jmp 0xc7bf
leaq 0x4eb78(%rip), %rdi     # 0x5b293
callq 0xb830
jmp 0xc7bf
leaq 0x4e8f8(%rip), %rdi     # 0x5b024
leaq 0x4e8e8(%rip), %rsi     # 0x5b01b
jmp 0xc7b8
leaq 0x4e8e5(%rip), %rdi     # 0x5b024
leaq 0x4e976(%rip), %rsi     # 0x5b0bc
jmp 0xc7b8
leaq 0x4e8d5(%rip), %rdi     # 0x5b024
leaq 0x4e99b(%rip), %rsi     # 0x5b0f1
jmp 0xc7b8
leaq 0x4eb15(%rip), %rdi     # 0x5b274
jmp 0xc71b
leaq 0x4e8bc(%rip), %rdi     # 0x5b024
leaq 0x4e9c7(%rip), %rsi     # 0x5b136
jmp 0xc7b8
leaq 0x4eadc(%rip), %rdi     # 0x5b254
jmp 0xc71b
leaq 0x4e8a3(%rip), %rdi     # 0x5b024
leaq 0x4e9f0(%rip), %rsi     # 0x5b178
jmp 0xc7b8
leaq 0x4e893(%rip), %rdi     # 0x5b024
leaq 0x4ea16(%rip), %rsi     # 0x5b1ae
jmp 0xc7b8
leaq 0x4e883(%rip), %rdi     # 0x5b024
leaq 0x4f875(%rip), %rsi     # 0x5c01d
jmp 0xc7b8
leaq 0x4e873(%rip), %rdi     # 0x5b024
leaq 0x4ea4e(%rip), %rsi     # 0x5b206
xorl %eax, %eax
callq 0xb080
movl $0x1, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq