// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_mkfeatureindex.c
// Function: gt_mkfeatureindex_runner
static int gt_mkfeatureindex_runner(int argc,
                                    const char **argv,
                                    int parsed_args,
                                    void *tool_arguments,
                                    GtError *err)
{
  GtMkfeatureindexArguments *arguments = tool_arguments;
  GtNodeStream *in_stream = NULL,
              *feature_stream = NULL;
  GtRDB *rdb = NULL;
  GtAnnoDBSchema *adb = NULL;
  GtFeatureIndex *fis = NULL;
  int had_err = 0;

  gt_error_check(err);
  gt_assert(arguments);

#ifdef HAVE_SQLITE
  if (strcmp(gt_str_get(arguments->backend),
             GT_SQLITE_BACKEND_STRING) == 0) {
    if (gt_file_exists(gt_str_get(arguments->filename))) {
      if (arguments->force) {
        gt_xunlink(gt_str_get(arguments->filename));
      } else {
        gt_error_set(err, "file \"%s\" exists already. use option -force to "
                     "overwrite", gt_str_get(arguments->filename));
        had_err = -1;
      }
    }
    if (!had_err) {
      rdb = gt_rdb_sqlite_new(gt_str_get(arguments->filename), err);
      if (!rdb)
        had_err = -1;
    }
  }
#endif
#ifdef HAVE_MYSQL
  if (strcmp(gt_str_get(arguments->backend),
                    GT_MYSQL_BACKEND_STRING) == 0) {
    arguments->pass = gt_get_password("password: ", err);
    rdb = gt_rdb_mysql_new(gt_str_get(arguments->host),
                           arguments->port,
                           gt_str_get(arguments->database),
                           gt_str_get(arguments->user),
                           gt_str_get(arguments->pass),
                           err);
    if (!rdb)
      had_err = -1;
  }
#endif

  adb = gt_anno_db_gfflike_new();
  if (!had_err && !adb)
    had_err = -1;

  if (!had_err) {
    fis = gt_anno_db_schema_get_feature_index(adb, rdb, err);
    if (!fis)
      had_err = -1;
  }

  if (!had_err) {
    if (strcmp(gt_str_get(arguments->input), "gff") == 0)
    {
      in_stream = gt_gff3_in_stream_new_unsorted(argc - parsed_args,
                                                 argv + parsed_args);
      if (arguments->verbose)
        gt_gff3_in_stream_show_progress_bar((GtGFF3InStream*) in_stream);
    } else if (strcmp(gt_str_get(arguments->input), "bed") == 0)
    {
      if (argc - parsed_args == 0)
        in_stream = gt_bed_in_stream_new(NULL);
      else
        in_stream = gt_bed_in_stream_new(argv[parsed_args]);
    } else if (strcmp(gt_str_get(arguments->input), "gtf") == 0)
    {
      if (argc - parsed_args == 0)
        in_stream = gt_gtf_in_stream_new(NULL);
      else
        in_stream = gt_gtf_in_stream_new(argv[parsed_args]);
    }
    gt_assert(in_stream);

    feature_stream = gt_feature_stream_new(in_stream, fis);
    had_err = gt_node_stream_pull(feature_stream, err);
  }
  gt_node_stream_delete(feature_stream);
  gt_node_stream_delete(in_stream);
  gt_feature_index_delete(fis);
  gt_anno_db_schema_delete(adb);
  gt_rdb_delete(rdb);
  return had_err;
}

// Assembly:
subq $0x68, %rsp
movl %edi, 0x64(%rsp)
movq %rsi, 0x58(%rsp)
movl %edx, 0x54(%rsp)
movq %rcx, 0x48(%rsp)
movq %r8, 0x40(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x46f3a
movq 0x40(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x46f02
jmp 0x46f3a
movq 0x5f5097(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4cf100(%rip), %rsi    # 0x516013
leaq 0x4cf2a5(%rip), %rdx    # 0x5161bf
leaq 0x4db22f(%rip), %rcx    # 0x522150
leaq 0x4db127(%rip), %r8     # 0x52204f
movl $0xc3, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x46f3c
jmp 0x46f3e
cmpq $0x0, 0x38(%rsp)
jne 0x46f7e
movq 0x5f5053(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4cf0bc(%rip), %rsi    # 0x516013
leaq 0x533c01(%rip), %rdx    # 0x57ab5f
leaq 0x4db1eb(%rip), %rcx    # 0x522150
leaq 0x4db0e3(%rip), %r8     # 0x52204f
movl $0xc4, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x46f80
movq 0x38(%rsp), %rax
movq (%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
leaq 0x500d4c(%rip), %rsi    # 0x547ce3
callq 0x19980
cmpl $0x0, %eax
jne 0x47055
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
callq 0xde820
testb $0x1, %al
jne 0x46fc1
jmp 0x4701a
movq 0x38(%rsp), %rax
testb $0x1, 0x3d(%rax)
je 0x46fe4
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
callq 0x127980
jmp 0x47018
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq (%rsp), %rdi
movq %rax, %rdx
leaq 0x4db160(%rip), %rsi    # 0x522169
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
jmp 0x4701a
cmpl $0x0, 0xc(%rsp)
jne 0x47053
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x40(%rsp), %rsi
callq 0x1c4a80
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x47051
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
jmp 0x47053
jmp 0x47055
callq 0x1308b0
movq %rax, 0x18(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0x47076
cmpq $0x0, 0x18(%rsp)
jne 0x47076
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
cmpl $0x0, 0xc(%rsp)
jne 0x470a8
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0x132b50
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x470a6
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
jmp 0x470a8
cmpl $0x0, 0xc(%rsp)
jne 0x47233
movq 0x38(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
leaq 0x4d1f14(%rip), %rsi    # 0x518fdf
callq 0x19980
cmpl $0x0, %eax
jne 0x47112
movl 0x64(%rsp), %edi
subl 0x54(%rsp), %edi
movq 0x58(%rsp), %rsi
movslq 0x54(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x1746b0
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rax
testb $0x1, 0x3c(%rax)
je 0x4710d
movq 0x30(%rsp), %rdi
callq 0x1741e0
jmp 0x471c8
movq 0x38(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
leaq 0x4daf43(%rip), %rsi    # 0x52206d
callq 0x19980
cmpl $0x0, %eax
jne 0x4716b
movl 0x64(%rsp), %eax
subl 0x54(%rsp), %eax
cmpl $0x0, %eax
jne 0x47151
xorl %eax, %eax
movl %eax, %edi
callq 0x134680
movq %rax, 0x30(%rsp)
jmp 0x47169
movq 0x58(%rsp), %rax
movslq 0x54(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x134680
movq %rax, 0x30(%rsp)
jmp 0x471c6
movq 0x38(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
leaq 0x4cf5c9(%rip), %rsi    # 0x51674c
callq 0x19980
cmpl $0x0, %eax
jne 0x471c4
movl 0x64(%rsp), %eax
subl 0x54(%rsp), %eax
cmpl $0x0, %eax
jne 0x471aa
xorl %eax, %eax
movl %eax, %edi
callq 0x182240
movq %rax, 0x30(%rsp)
jmp 0x471c2
movq 0x58(%rsp), %rax
movslq 0x54(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x182240
movq %rax, 0x30(%rsp)
jmp 0x471c4
jmp 0x471c6
jmp 0x471c8
jmp 0x471ca
cmpq $0x0, 0x30(%rsp)
jne 0x4720a
movq 0x5f4dc7(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4cee30(%rip), %rsi    # 0x516013
leaq 0x4d9239(%rip), %rdx    # 0x520423
leaq 0x4daf5f(%rip), %rcx    # 0x522150
leaq 0x4dae57(%rip), %r8     # 0x52204f
movl $0x106, %r9d            # imm = 0x106
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4720c
movq 0x30(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x1710c0
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x1b1f90
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rdi
callq 0x1b1cb0
movq 0x30(%rsp), %rdi
callq 0x1b1cb0
movq 0x10(%rsp), %rdi
callq 0x169460
movq 0x18(%rsp), %rdi
callq 0x132a00
movq 0x20(%rsp), %rdi
callq 0x1c3d40
movl 0xc(%rsp), %eax
addq $0x68, %rsp
retq
nop