// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/shu-dfs.c
// Function: process_shu_node
static int process_shu_node(ShuNode *node,
                            GtStackShuNode *stack,
                            uint64_t **shulen,
                            GtUword num_of_genomes,
                            GtUword numofchars,
                            GT_UNUSED GtLogger *logger,
                            GT_UNUSED GtError *err)
{
  int had_err = 0;
  uint64_t old;
  GtUword idx_i, idx_j, termChild_x_i, idx_char;
  unsigned child_c;
  ShuNode *parent = NULL;

  gt_assert(node->process);

  if (node->parentOffset > 0)
  {
    parent = stack->space + stack->nextfree - node->parentOffset;
  }

  for (idx_i = 0; idx_i < num_of_genomes; idx_i++)
  {
    if (!had_err && node->countTermSubtree[0][idx_i] > 0)
    {
      /* scan term */
      termChild_x_i = node->countTermSubtree[0][idx_i];
      for (idx_char = 1UL; idx_char <= numofchars; idx_char++)
      {
        gt_assert(node->countTermSubtree[idx_char][idx_i] <= termChild_x_i);
        termChild_x_i -= node->countTermSubtree[idx_char][idx_i];
      }
      if (termChild_x_i > 0)
      {
        for (idx_j = 0; idx_j < num_of_genomes; idx_j++)
        {
          if (node->countTermSubtree[0][idx_j] > 0 &&
                 idx_j != idx_i)
          {
            old = shulen[idx_i][idx_j];
            shulen[idx_i][idx_j] += ((node->depth + 1) * termChild_x_i);
            if (shulen[idx_i][idx_j] < old)
            {
              had_err = -1;
              gt_error_set(err, "overflow in addition of shuSums! "
                                Formatuint64_t "+ "GT_WU" ="
                                Formatuint64_t "\n",
                  PRINTuint64_tcast(old),
                  (node->depth + 1) * termChild_x_i,
                  PRINTuint64_tcast(shulen[idx_i][idx_j]));
            }
          }
        }
      }
      /* scan branch */
      for (child_c = 1U; (GtUword) child_c <= numofchars; child_c++)
      {
        if (!had_err && node->countTermSubtree[child_c][idx_i] > 0)
        {
          for (idx_j = 0; idx_j < num_of_genomes; idx_j++)
          {
            /* idx_j elem seqIds[x] \ seqIds[child_c] */
            if (node->countTermSubtree[0][idx_j] > 0 &&
                node->countTermSubtree[child_c][idx_j] == 0)
            {
              old = shulen[idx_i][idx_j];
              shulen[idx_i][idx_j] += ((node->depth + 1) *
                                       node->countTermSubtree[child_c][idx_i]);
              if (shulen[idx_i][idx_j] < old)
              {
                had_err = -1;
                gt_error_set(err, "overflow in addition of shuSums! "
                                  Formatuint64_t "+ "GT_WU" ="
                                  Formatuint64_t "\n",
                    PRINTuint64_tcast(old),
                    (node->depth + 1) * termChild_x_i,
                    PRINTuint64_tcast(shulen[idx_i][idx_j]));
              }
            }
          }
        }
      }
      if (node->parentOffset > 0)
      {
        gt_assert(parent && parent->countTermSubtree);
        parent->countTermSubtree[0][idx_i] += node->countTermSubtree[0][idx_i];
        parent->countTermSubtree[node->parentOffset][idx_i] =
                                              node->countTermSubtree[0][idx_i];
      }
    }
  }
  return had_err;
}

// Assembly:
subq $0x78, %rsp
movq 0x80(%rsp), %rax
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movq %r8, 0x50(%rsp)
movq %r9, 0x48(%rsp)
movl $0x0, 0x44(%rsp)
movq $0x0, 0x8(%rsp)
movq 0x70(%rsp), %rax
testb $0x1, (%rax)
jne 0x4e5bed
movq 0x1563e4(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3044d(%rip), %rsi     # 0x516013
leaq 0xd569d(%rip), %rdx     # 0x5bb26a
leaq 0xd56a4(%rip), %rcx     # 0x5bb278
leaq 0xd55e5(%rip), %r8      # 0x5bb1c0
movl $0x133, %r9d            # imm = 0x133
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4e5bef
movq 0x70(%rsp), %rax
cmpl $0x0, 0x4(%rax)
jbe 0x4e5c2e
movq 0x68(%rsp), %rax
movq 0x2828(%rax), %rax
movq 0x68(%rsp), %rcx
imulq $0x28, 0x10(%rcx), %rcx
addq %rcx, %rax
movq 0x70(%rsp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, %edx
xorl %ecx, %ecx
subq %rdx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x58(%rsp), %rax
jae 0x4e60be
cmpl $0x0, 0x44(%rsp)
jne 0x4e60a9
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x30(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jbe 0x4e60a9
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
movq $0x1, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x50(%rsp), %rax
ja 0x4e5d3a
jmp 0x4e5ca3
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpq 0x20(%rsp), %rax
jbe 0x4e5cfd
movq 0x1562d4(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3033d(%rip), %rsi     # 0x516013
leaq 0xd55ac(%rip), %rdx     # 0x5bb289
leaq 0xd5594(%rip), %rcx     # 0x5bb278
leaq 0xd54d5(%rip), %r8      # 0x5bb1c0
movl $0x142, %r9d            # imm = 0x142
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4e5cff
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x20(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x4e5c91
cmpq $0x0, 0x20(%rsp)
jbe 0x4e5e59
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x58(%rsp), %rax
jae 0x4e5e57
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jbe 0x4e5e42
movq 0x28(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x4e5e42
movq 0x60(%rsp), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x38(%rsp)
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rdx
addq $0x1, %rdx
imulq 0x20(%rsp), %rdx
movq 0x60(%rsp), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x28(%rsp), %rcx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x60(%rsp), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpq 0x38(%rsp), %rax
jae 0x4e5e40
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
movq 0x80(%rsp), %rdi
movq 0x38(%rsp), %rdx
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
imulq 0x20(%rsp), %rcx
movq 0x60(%rsp), %rax
movq 0x30(%rsp), %rsi
movq (%rax,%rsi,8), %rax
movq 0x28(%rsp), %rsi
movq (%rax,%rsi,8), %r8
leaq 0xd5489(%rip), %rsi     # 0x5bb2c2
movb $0x0, %al
callq 0xd88c0
jmp 0x4e5e42
jmp 0x4e5e44
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x4e5d4f
jmp 0x4e5e59
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpq 0x50(%rsp), %rax
ja 0x4e5fe7
cmpl $0x0, 0x44(%rsp)
jne 0x4e5fd5
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq 0x30(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jbe 0x4e5fd5
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x58(%rsp), %rax
jae 0x4e5fd3
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jbe 0x4e5fbe
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq 0x28(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x4e5fbe
movq 0x60(%rsp), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x38(%rsp)
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rdx
addq $0x1, %rdx
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq 0x30(%rsp), %rcx
imulq (%rax,%rcx,8), %rdx
movq 0x60(%rsp), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x28(%rsp), %rcx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x60(%rsp), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpq 0x38(%rsp), %rax
jae 0x4e5fbc
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
movq 0x80(%rsp), %rdi
movq 0x38(%rsp), %rdx
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
imulq 0x20(%rsp), %rcx
movq 0x60(%rsp), %rax
movq 0x30(%rsp), %rsi
movq (%rax,%rsi,8), %rax
movq 0x28(%rsp), %rsi
movq (%rax,%rsi,8), %r8
leaq 0xd530d(%rip), %rsi     # 0x5bb2c2
movb $0x0, %al
callq 0xd88c0
jmp 0x4e5fbe
jmp 0x4e5fc0
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x4e5ea5
jmp 0x4e5fd5
jmp 0x4e5fd7
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x4e5e61
movq 0x70(%rsp), %rax
cmpl $0x0, 0x4(%rax)
jbe 0x4e60a7
jmp 0x4e5ff8
cmpq $0x0, 0x8(%rsp)
je 0x4e600c
movq 0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x4e6044
movq 0x155f8d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2fff6(%rip), %rsi     # 0x516013
leaq 0xd52ce(%rip), %rdx     # 0x5bb2f2
leaq 0xd524d(%rip), %rcx     # 0x5bb278
leaq 0xd518e(%rip), %r8      # 0x5bb1c0
movl $0x179, %r9d            # imm = 0x179
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4e6046
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x30(%rsp), %rcx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x70(%rsp), %rcx
movl 0x4(%rcx), %ecx
movq (%rax,%rcx,8), %rax
movq 0x30(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x4e60a9
jmp 0x4e60ab
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x4e5c37
movl 0x44(%rsp), %eax
addq $0x78, %rsp
retq
nopw (%rax,%rax)