// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/core/gtdatapath.c
// Function: gt_get_gtdata_path
GtStr* gt_get_gtdata_path(const char *prog, GtError *err)
{
  GtStr *path;
  const char **defaultpath, **spath;
  int had_err = 0;
  gt_error_check(err);
  gt_assert(prog);
  path = gt_str_new();
  had_err = gt_file_find_exec_in_path(path, prog, err);
  if (!had_err) {
    if (gt_file_exists_and_is_dir(gt_str_get(path))) {
      gt_str_append_cstr(path, GTDATADIR);
      if (gt_file_exists_and_is_dir(gt_str_get(path)))
        return path;
      gt_str_set_length(path, gt_str_length(path) - strlen(GTDATADIR));
      gt_str_append_cstr(path, UPDIR);
      gt_str_append_cstr(path, GTDATADIR);
      if (gt_file_exists_and_is_dir(gt_str_get(path)))
        return path;
    }
    for (spath = GTDATA_RELATIVE_SEARCH_PATHS; *spath; spath++) {
      had_err = gt_file_find_exec_in_path(path, prog, err);
      if (!had_err) {
        gt_str_append_cstr(path, *spath);
        if (gt_file_exists_and_is_dir(gt_str_get(path)))
          return path;
      }
    }
    for (defaultpath = GTDATA_DEFAULT_PATHS; *defaultpath; defaultpath++) {
      gt_str_reset(path);
      gt_str_append_cstr(path, *defaultpath);
      if (gt_file_exists_and_is_dir(gt_str_get(path)))
        return path;
    }
    if (!gt_file_exists_and_is_dir(gt_str_get(path))) {
      gt_error_set(err, "could not find gtdata%c directory", GT_PATH_SEPARATOR);
      had_err = -1;
    }
  }
  if (had_err) {
    gt_str_delete(path);
    return NULL;
  }
  return path;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rsi, %rsi
je 0xd619f
movq %r14, %rdi
callq 0x34fea
testb %al, %al
jne 0xd631b
testq %r15, %r15
je 0xd6316
callq 0x3b728
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x764d2
testl %eax, %eax
je 0xd61d8
movq %rbx, %rdi
callq 0x3c87b
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x3bb5d
movq %rax, %rdi
callq 0x76145
testb %al, %al
je 0xd6259
leaq 0x330e2(%rip), %rsi     # 0x1092d5
movq %rbx, %rdi
callq 0x3b7af
movq %rbx, %rdi
callq 0x3bb5d
movq %rax, %rdi
callq 0x76145
testb %al, %al
jne 0xd61cc
movq %rbx, %rdi
callq 0x3bb86
leaq -0x7(%rax), %rsi
movq %rbx, %rdi
callq 0x3bb93
leaq 0x33070(%rip), %rsi     # 0x10929a
movq %rbx, %rdi
callq 0x3b7af
leaq 0x3309c(%rip), %rsi     # 0x1092d5
movq %rbx, %rdi
callq 0x3b7af
movq %rbx, %rdi
callq 0x3bb5d
movq %rax, %rdi
callq 0x76145
testb %al, %al
jne 0xd61cc
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x764d2
movl %eax, %ebp
testl %eax, %eax
jne 0xd6294
leaq 0x3304c(%rip), %rsi     # 0x1092c0
movq %rbx, %rdi
callq 0x3b7af
movq %rbx, %rdi
callq 0x3bb5d
movq %rax, %rdi
callq 0x76145
testb %al, %al
jne 0xd61cc
leaq 0x33042(%rip), %r15     # 0x1092dd
leaq 0x7aa06(%rip), %r12     # 0x150ca8
movq %rbx, %rdi
callq 0x3bbee
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3b7af
movq %rbx, %rdi
callq 0x3bb5d
movq %rax, %rdi
callq 0x76145
testb %al, %al
jne 0xd61cc
movq (%r12), %r15
addq $0x8, %r12
testq %r15, %r15
jne 0xd62a2
movq %rbx, %rdi
callq 0x3bb5d
movq %rax, %rdi
callq 0x76145
testb %al, %al
je 0xd62fb
testl %ebp, %ebp
jne 0xd61c2
jmp 0xd61cc
leaq 0x32f9c(%rip), %rsi     # 0x10929e
movq %r14, %rdi
movl $0x2f, %edx
xorl %eax, %eax
callq 0x34f1f
jmp 0xd61c2
callq 0x31664
callq 0x3162d