// File: /workspace/github_c_makefile_star2_O1/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 0xd5a37
movq %r14, %rdi
callq 0x3566a
testb %al, %al
jne 0xd5bb5
testq %r15, %r15
je 0xd5bb0
callq 0x3bfe0
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x75fc0
movl %eax, %ebp
testl %eax, %eax
je 0xd5a76
testl %ebp, %ebp
je 0xd5a6a
movq %rbx, %rdi
callq 0x3d1eb
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x3c40b
movq %rax, %rdi
callq 0x75c01
testb %al, %al
je 0xd5af7
leaq 0x33a1c(%rip), %rsi     # 0x1094ad
movq %rbx, %rdi
callq 0x3c067
movq %rbx, %rdi
callq 0x3c40b
movq %rax, %rdi
callq 0x75c01
testb %al, %al
jne 0xd5a6a
movq %rbx, %rdi
callq 0x3c434
leaq -0x7(%rax), %rsi
movq %rbx, %rdi
callq 0x3c441
leaq 0x339aa(%rip), %rsi     # 0x109472
movq %rbx, %rdi
callq 0x3c067
leaq 0x339d6(%rip), %rsi     # 0x1094ad
movq %rbx, %rdi
callq 0x3c067
movq %rbx, %rdi
callq 0x3c40b
movq %rax, %rdi
callq 0x75c01
testb %al, %al
jne 0xd5a6a
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x75fc0
movl %eax, %ebp
testl %eax, %eax
jne 0xd5b32
leaq 0x33986(%rip), %rsi     # 0x109498
movq %rbx, %rdi
callq 0x3c067
movq %rbx, %rdi
callq 0x3c40b
movq %rax, %rdi
callq 0x75c01
testb %al, %al
jne 0xd5a6a
leaq 0x3397c(%rip), %r15     # 0x1094b5
leaq 0x7b168(%rip), %r12     # 0x150ca8
movq %rbx, %rdi
callq 0x3c49c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3c067
movq %rbx, %rdi
callq 0x3c40b
movq %rax, %rdi
callq 0x75c01
testb %al, %al
jne 0xd5a6a
movq (%r12), %r15
addq $0x8, %r12
testq %r15, %r15
jne 0xd5b40
movq %rbx, %rdi
callq 0x3c40b
movq %rax, %rdi
callq 0x75c01
testb %al, %al
jne 0xd5a5c
leaq 0x338df(%rip), %rsi     # 0x109476
movq %r14, %rdi
movl $0x2f, %edx
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xd5a5c
callq 0x31c61
callq 0x31c2a
nop