// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/tool.c
// Function: gt_tool_run
int gt_tool_run(GtTool *tool, int argc, const char **argv, GtError *err)
{
  GtOPrval oprval;
  int parsed_args, had_err = 0;
  gt_error_check(err);
  gt_assert(tool);

  /* create tool arguments object */
  if (tool->tool_arguments_new && !tool->arguments)
    tool->arguments = tool->tool_arguments_new();

  /* create option parser object */
  if (tool->tool_option_parser_new && !tool->op)
    tool->op = tool->tool_option_parser_new(tool->arguments);
  else {
    /* make sure defaults are restored when reusing option parsers */
    gt_option_parser_reset(tool->op);
  }

  /* parse options */
  oprval = gt_option_parser_parse(tool->op, &parsed_args, argc, argv,
                                  gt_versionfunc, err);

  switch (oprval) {
    case GT_OPTION_PARSER_OK:
      break;
    case GT_OPTION_PARSER_ERROR:
      had_err = -1;
      break;
    case GT_OPTION_PARSER_REQUESTS_EXIT:
      if (tool->arguments) {
        tool->tool_arguments_delete(tool->arguments);
        tool->arguments = NULL;
      }
      return 0;
  }

  /* check tool arguments */
  if (!had_err && tool->tool_arguments_check) {
    had_err = tool->tool_arguments_check(argc - parsed_args, tool->arguments,
                                         err);
  }

  /* run tool */
  if (!had_err)
    had_err = tool->tool_runner(argc, argv, parsed_args, tool->arguments, err);

  /* return */
  if (had_err)
    return -1;
  return 0;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movl $0x0, 0x4(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x122c2f
movq 0x10(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x122bf7
jmp 0x122c2f
movq 0x5193a2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3f340b(%rip), %rsi    # 0x516013
leaq 0x3f35b0(%rip), %rdx    # 0x5161bf
leaq 0x421d06(%rip), %rcx    # 0x54491c
leaq 0x421c8d(%rip), %r8     # 0x5448aa
movl $0x42, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x122c31
jmp 0x122c33
cmpq $0x0, 0x28(%rsp)
jne 0x122c73
movq 0x51935e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3f33c7(%rip), %rsi    # 0x516013
leaq 0x421ddc(%rip), %rdx    # 0x544a2f
leaq 0x421cc2(%rip), %rcx    # 0x54491c
leaq 0x421c49(%rip), %r8     # 0x5448aa
movl $0x43, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x122c75
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
je 0x122c9f
movq 0x28(%rsp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x122c9f
movq 0x28(%rsp), %rax
callq *(%rax)
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x28(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x122cd9
movq 0x28(%rsp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x122cd9
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rsp), %rcx
movq 0x30(%rcx), %rdi
callq *%rax
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x38(%rax)
jmp 0x122ce7
movq 0x28(%rsp), %rax
movq 0x38(%rax), %rdi
callq 0xf1910
movq 0x28(%rsp), %rax
movq 0x38(%rax), %rdi
movl 0x24(%rsp), %edx
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %r9
leaq 0x3a2b(%rip), %r8       # 0x126730
leaq 0x8(%rsp), %rsi
callq 0xf2ab0
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl %eax, (%rsp)
testl %eax, %eax
je 0x122d34
jmp 0x122d20
movl (%rsp), %eax
subl $0x1, %eax
je 0x122d36
jmp 0x122d2a
movl (%rsp), %eax
subl $0x2, %eax
je 0x122d40
jmp 0x122d7a
jmp 0x122d7a
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
jmp 0x122d7a
movq 0x28(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x122d6d
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x28(%rsp), %rcx
movq 0x30(%rcx), %rdi
callq *%rax
movq 0x28(%rsp), %rax
movq $0x0, 0x30(%rax)
movl $0x0, 0x34(%rsp)
jmp 0x122dfc
cmpl $0x0, 0x4(%rsp)
jne 0x122db2
movq 0x28(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x122db2
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movl 0x24(%rsp), %edi
subl 0x8(%rsp), %edi
movq 0x28(%rsp), %rcx
movq 0x30(%rcx), %rsi
movq 0x10(%rsp), %rdx
callq *%rax
movl %eax, 0x4(%rsp)
cmpl $0x0, 0x4(%rsp)
jne 0x122de3
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rax
movl 0x24(%rsp), %edi
movq 0x18(%rsp), %rsi
movl 0x8(%rsp), %edx
movq 0x28(%rsp), %rcx
movq 0x30(%rcx), %rcx
movq 0x10(%rsp), %r8
callq *%rax
movl %eax, 0x4(%rsp)
cmpl $0x0, 0x4(%rsp)
je 0x122df4
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x122dfc
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)