// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movl $0x0, 0x14(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x144e76
movq 0x30(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x144e3e
jmp 0x144e76
movq 0x6f193(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x19217(%rip), %rsi     # 0x15e066
leaq 0x197f2(%rip), %rdx     # 0x15e648
leaq 0x4740d(%rip), %rcx     # 0x18c26a
leaq 0x47419(%rip), %r8      # 0x18c27d
movl $0x30, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x144e78
jmp 0x144e7a
cmpq $0x0, 0x38(%rsp)
jne 0x144eba
movq 0x6f14f(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x191d3(%rip), %rsi     # 0x15e066
leaq 0x473f9(%rip), %rdx     # 0x18c293
leaq 0x473c9(%rip), %rcx     # 0x18c26a
leaq 0x473d5(%rip), %r8      # 0x18c27d
movl $0x31, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x144ebc
callq 0x18f00
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x84ba0
movl %eax, 0x14(%rsp)
cmpl $0x0, 0x14(%rsp)
jne 0x1450d0
movq 0x28(%rsp), %rdi
callq 0x19940
movq %rax, %rdi
callq 0x84380
testb $0x1, %al
jne 0x144f04
jmp 0x144fac
movq 0x28(%rsp), %rdi
leaq 0x473c3(%rip), %rsi     # 0x18c2d3
callq 0x18fb0
movq 0x28(%rsp), %rdi
callq 0x19940
movq %rax, %rdi
callq 0x84380
testb $0x1, %al
jne 0x144f2d
jmp 0x144f3c
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x1450f6
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
callq 0x19a00
movq 0x8(%rsp), %rdi
movq %rax, %rsi
subq $0x7, %rsi
callq 0x19a30
movq 0x28(%rsp), %rdi
leaq 0x4732b(%rip), %rsi     # 0x18c298
callq 0x18fb0
movq 0x28(%rsp), %rdi
leaq 0x47355(%rip), %rsi     # 0x18c2d3
callq 0x18fb0
movq 0x28(%rsp), %rdi
callq 0x19940
movq %rax, %rdi
callq 0x84380
testb $0x1, %al
jne 0x144f9b
jmp 0x144faa
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x1450f6
jmp 0x144fac
leaq 0x70e9d(%rip), %rax     # 0x1b5e50
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
je 0x14502f
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x84ba0
movl %eax, 0x14(%rsp)
cmpl $0x0, 0x14(%rsp)
jne 0x14501d
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rax
movq (%rax), %rsi
callq 0x18fb0
movq 0x28(%rsp), %rdi
callq 0x19940
movq %rax, %rdi
callq 0x84380
testb $0x1, %al
jne 0x14500c
jmp 0x14501b
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x1450f6
jmp 0x14501d
jmp 0x14501f
movq 0x18(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x18(%rsp)
jmp 0x144fb8
leaq 0x70e2a(%rip), %rax     # 0x1b5e60
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
je 0x145098
movq 0x28(%rsp), %rdi
callq 0x19b70
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rax
movq (%rax), %rsi
callq 0x18fb0
movq 0x28(%rsp), %rdi
callq 0x19940
movq %rax, %rdi
callq 0x84380
testb $0x1, %al
jne 0x14507a
jmp 0x145086
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x1450f6
jmp 0x145088
movq 0x20(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x20(%rsp)
jmp 0x14503b
movq 0x28(%rsp), %rdi
callq 0x19940
movq %rax, %rdi
callq 0x84380
testb $0x1, %al
jne 0x1450ce
movq 0x30(%rsp), %rdi
leaq 0x471e2(%rip), %rsi     # 0x18c29c
movl $0x2f, %edx
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
jmp 0x1450d0
cmpl $0x0, 0x14(%rsp)
je 0x1450ec
movq 0x28(%rsp), %rdi
callq 0x1afc0
movq $0x0, 0x40(%rsp)
jmp 0x1450f6
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq