// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/tool_iterator.c
// Function: gt_tool_iterator_next
bool gt_tool_iterator_next(GtToolIterator *tool_iterator, const char **name,
                           GtTool **tool)
{
  ToolIterationInfo tii;
  gt_assert(tool_iterator && name && tool);
  if (gt_array_size(tool_iterator->tool_stack)) {
    ToolEntry *entry = gt_array_pop(tool_iterator->tool_stack);
    *name = entry->name;
    *tool = entry->tool;
    if (tool_iterator->prefixptr) {
      gt_str_reset(tool_iterator->prefixptr);
      if (entry->prefix) {
        gt_str_append_str(tool_iterator->prefixptr, entry->prefix);
        gt_str_append_char(tool_iterator->prefixptr, tool_iterator->prefixsep);
      }
    }
    if (gt_tool_is_toolbox(entry->tool)) {
      GtToolbox *toolbox;
      GtArray *toollist;
      GtStr *myprefix;
      myprefix =
                gt_str_new_cstr(entry->prefix ? gt_str_get(entry->prefix) : "");
      gt_str_append_cstr(myprefix, entry->name);
      toolbox = gt_tool_get_toolbox(entry->tool);
      toollist = gt_array_new(sizeof (ToolEntry));
      tii.arr = toollist;
      tii.str = myprefix;
      gt_toolbox_iterate(toolbox, add_tool_to_stack, &tii);
      if (gt_array_size(toollist)) {
        gt_array_reverse(toollist); /* alphabetical order */
        gt_array_add_array(tool_iterator->tool_stack, toollist);
      }
      gt_array_delete(toollist);
      gt_str_delete(myprefix);
    } else
      gt_str_delete(entry->prefix);
    return true;
  }
  else
    return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0xb0b87
movq %rsi, %r13
testq %rsi, %rsi
je 0xb0b87
movq %rdx, %r12
testq %rdx, %rdx
je 0xb0b87
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x586a4
movq %rax, %rbx
testq %rax, %rax
je 0xb0b73
movq (%r14), %rdi
callq 0x58247
movq %rax, %r15
movq (%rax), %rax
movq %rax, (%r13)
movq 0x8(%r15), %rax
movq %rax, (%r12)
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0xb0ad5
callq 0xad357
movq 0x10(%r15), %rsi
testq %rsi, %rsi
je 0xb0ad5
movq 0x8(%r14), %rdi
callq 0xacd13
movq 0x8(%r14), %rdi
movsbl 0x10(%r14), %esi
callq 0xaced9
movq 0x8(%r15), %rdi
callq 0xb0743
movq 0x10(%r15), %rdi
testb %al, %al
je 0xb0b6e
testq %rdi, %rdi
je 0xb0af9
callq 0xad1fa
movq %rax, %rdi
jmp 0xb0b00
leaq 0x2b9a70(%rip), %rdi    # 0x36a570
callq 0xacbd1
movq %rax, %r12
movq (%r15), %rsi
movq %rax, %rdi
callq 0xacbfb
movq 0x8(%r15), %rdi
callq 0xb0788
movq %rax, %r13
pushq $0x18
popq %rdi
callq 0x5809c
movq %rax, %r15
movq %rsp, %rdx
movq %rax, (%rdx)
movq %r12, 0x8(%rdx)
leaq -0x1db(%rip), %rsi      # 0xb0960
movq %r13, %rdi
callq 0xb102e
movq %r15, %rdi
callq 0x586a4
testq %rax, %rax
je 0xb0b63
movq %r15, %rdi
callq 0x583f9
movq (%r14), %rdi
movq %r15, %rsi
callq 0x5861f
movq %r15, %rdi
callq 0x58eb9
movq %r12, %rdi
callq 0xae103
testq %rbx, %rbx
setne %al
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x3873da(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x23447b(%rip), %rsi    # 0x2e5013
leaq 0x261de5(%rip), %rdx    # 0x312984
leaq 0x261dfc(%rip), %rcx    # 0x3129a2
leaq 0x261d9b(%rip), %r8     # 0x312948
pushq $0x51
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390