// File: /workspace/github_cpp_makefile_star2_O2/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 0xd14b
testq %rax, %rax
je 0xc4a4
movq %rax, %rbx
leaq 0x37e0d(%rip), %rdi     # 0x44004
movq %r14, %rsi
xorl %eax, %eax
callq 0xb070
leaq 0x37e13(%rip), %rsi     # 0x4401b
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xda0c
cmpq $0x1, %rax
jne 0xc4b5
leaq 0x37e1a(%rip), %rdi     # 0x44041
leaq 0x37ded(%rip), %rsi     # 0x4401b
xorl %eax, %eax
callq 0xb070
leaq 0x37e2b(%rip), %r15     # 0x44067
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xda0c
cmpq $0x1, %rax
leaq 0x37e3e(%rip), %r12     # 0x44096
leaq 0x37e18(%rip), %r14     # 0x44077
movq %r14, %rdi
cmoveq %r12, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xb070
leaq 0x37e45(%rip), %rsi     # 0x440bc
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xda0c
cmpq $0x1, %rax
jne 0xc4c8
leaq 0x37e37(%rip), %rdi     # 0x440cd
leaq 0x37e1f(%rip), %rsi     # 0x440bc
xorl %eax, %eax
callq 0xb070
leaq 0x37e46(%rip), %rsi     # 0x440f1
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xda0c
cmpq $0x1, %rax
jne 0xc4d8
leaq 0x37e37(%rip), %rdi     # 0x44101
leaq 0x37e20(%rip), %rsi     # 0x440f1
xorl %eax, %eax
callq 0xb070
leaq 0x394ff(%rip), %rsi     # 0x457de
leaq 0x37e42(%rip), %rdx     # 0x44128
leaq 0x60(%rsp), %rdi
xorl %eax, %eax
callq 0x1a9e6
testq %rax, %rax
je 0xc4e8
movq %rax, %r15
leaq 0x37e31(%rip), %rsi     # 0x44136
movq %rbx, %rdi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xda0c
cmpq $0x1, %rax
jne 0xc4f1
leaq 0x37e20(%rip), %rdi     # 0x44145
leaq 0x37e0a(%rip), %rsi     # 0x44136
xorl %eax, %eax
callq 0xb070
movq %r15, %rdi
callq 0x1aaea
leaq 0x3949c(%rip), %rsi     # 0x457de
leaq 0x37e20(%rip), %rdx     # 0x44169
leaq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0x1b55c
testq %rax, %rax
je 0xc501
movq %rax, %r15
leaq 0x37e10(%rip), %rsi     # 0x44178
movq %rbx, %rdi
xorl %edx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xda0c
cmpq $0x1, %rax
jne 0xc50a
leaq 0x37dff(%rip), %rdi     # 0x44187
leaq 0x37de9(%rip), %rsi     # 0x44178
xorl %eax, %eax
callq 0xb070
movq %r15, %rdi
callq 0x1b61a
leaq 0x37e09(%rip), %rsi     # 0x441ae
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xda0c
cmpq $0x1, %rax
jne 0xc51a
leaq 0x37dfa(%rip), %rdi     # 0x441be
leaq 0x37de3(%rip), %rsi     # 0x441ae
xorl %eax, %eax
callq 0xb070
leaq 0x38bf4(%rip), %rsi     # 0x44fcd
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xda0c
cmpq $0x1, %rax
jne 0xc52a
leaq 0x37dea(%rip), %rdi     # 0x441e2
leaq 0x38bce(%rip), %rsi     # 0x44fcd
xorl %eax, %eax
callq 0xb070
leaq 0x37df9(%rip), %rsi     # 0x44206
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xda0c
cmpq $0x1, %rax
jne 0xc53a
leaq 0x37de8(%rip), %rdi     # 0x44214
leaq 0x37dd3(%rip), %rsi     # 0x44206
xorl %eax, %eax
callq 0xb070
leaq 0x37bda(%rip), %rsi     # 0x4401b
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xda0c
cmpq $0x1, %rax
jne 0xc4b5
leaq 0x37be5(%rip), %rdi     # 0x44041
leaq 0x37bb8(%rip), %rsi     # 0x4401b
xorl %eax, %eax
callq 0xb070
leaq 0x37bf6(%rip), %r15     # 0x44067
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xda0c
cmpq $0x1, %rax
cmoveq %r12, %r14
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xb070
movq %rbx, %rdi
callq 0xd203
jmp 0xc54f
leaq 0x37de8(%rip), %rdi     # 0x44293
callq 0xb850
jmp 0xc54f
leaq 0x37b68(%rip), %rdi     # 0x44024
leaq 0x37b58(%rip), %rsi     # 0x4401b
jmp 0xc548
leaq 0x37b55(%rip), %rdi     # 0x44024
leaq 0x37be6(%rip), %rsi     # 0x440bc
jmp 0xc548
leaq 0x37b45(%rip), %rdi     # 0x44024
leaq 0x37c0b(%rip), %rsi     # 0x440f1
jmp 0xc548
leaq 0x37d85(%rip), %rdi     # 0x44274
jmp 0xc4ab
leaq 0x37b2c(%rip), %rdi     # 0x44024
leaq 0x37c37(%rip), %rsi     # 0x44136
jmp 0xc548
leaq 0x37d4c(%rip), %rdi     # 0x44254
jmp 0xc4ab
leaq 0x37b13(%rip), %rdi     # 0x44024
leaq 0x37c60(%rip), %rsi     # 0x44178
jmp 0xc548
leaq 0x37b03(%rip), %rdi     # 0x44024
leaq 0x37c86(%rip), %rsi     # 0x441ae
jmp 0xc548
leaq 0x37af3(%rip), %rdi     # 0x44024
leaq 0x38a95(%rip), %rsi     # 0x44fcd
jmp 0xc548
leaq 0x37ae3(%rip), %rdi     # 0x44024
leaq 0x37cbe(%rip), %rsi     # 0x44206
xorl %eax, %eax
callq 0xb070
pushq $0x1
popq %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq