// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/ft-trimstat.c
// Function: gt_ft_trimstat_add
void gt_ft_trimstat_add(GtFtTrimstat *trimstat,
                        bool diedout,
                        GtUword sumvalid,
                        GtUword maxvalid,
                        GtUword d,
                        size_t spaceforfront)
{
  if (trimstat == NULL)
  {
    return;
  }
  while (maxvalid >= trimstat->maxvalid_dist.allocatedGtUword)
  {
    GtUword idx;
    const GtUword allocated = trimstat->maxvalid_dist.allocatedGtUword;

    trimstat->maxvalid_dist.allocatedGtUword
      = trimstat->maxvalid_dist.allocatedGtUword * 1.2 + 128UL;
    trimstat->maxvalid_dist.spaceGtUword
      = gt_realloc(trimstat->maxvalid_dist.spaceGtUword,
                   sizeof *trimstat->maxvalid_dist.spaceGtUword *
                   trimstat->maxvalid_dist.allocatedGtUword);
    for (idx = allocated; idx < trimstat->maxvalid_dist.allocatedGtUword; idx++)
    {
      trimstat->maxvalid_dist.spaceGtUword[idx] = 0;
    }
  }
  gt_assert(maxvalid < trimstat->maxvalid_dist.allocatedGtUword);
  trimstat->maxvalid_dist.spaceGtUword[maxvalid]++;
  if (diedout)
  {
    trimstat->diedout++;
  } else
  {
    const GtUword fullfronts = (d+1) * (d+1);
    GtUword percentage;

    percentage
      = (GtUword) (100.0 * (double) (fullfronts - sumvalid)/fullfronts);
    gt_assert(percentage <= 100UL);
    trimstat->sum_meanvalid += (double) sumvalid/(d+1);
    trimstat->trim_dist[percentage]++;
    GT_CHECKARRAYSPACE(&trimstat->distance_dist,GtUword,32);
    trimstat->distance_dist.spaceGtUword[trimstat->
                                         distance_dist.nextfreeGtUword++] = d;
    trimstat->spaceforfront_total += spaceforfront;
  }
}

// Assembly:
subq $0x58, %rsp
movb %sil, %al
movq %rdi, 0x50(%rsp)
andb $0x1, %al
movb %al, 0x4f(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movq %r9, 0x28(%rsp)
cmpq $0x0, 0x50(%rsp)
jne 0x24fce3
jmp 0x2500f1
jmp 0x24fce5
movq 0x38(%rsp), %rax
movq 0x50(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jb 0x24fdf2
movq 0x50(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x50(%rsp), %rax
movq 0x38(%rax), %xmm0
movaps 0x2c8c18(%rip), %xmm1   # 0x518930
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x2c8c1c(%rip), %xmm1   # 0x518940
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x2c902d(%rip), %xmm1   # 0x518d68
mulsd %xmm1, %xmm0
movsd 0x3298c9(%rip), %xmm1   # 0x579610
addsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
movsd 0x2c900e(%rip), %xmm1   # 0x518d70
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
andq %rdx, %rax
orq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x50(%rsp), %rax
movq 0x30(%rax), %rdi
movq 0x50(%rsp), %rax
movq 0x38(%rax), %rsi
shlq $0x3, %rsi
leaq 0x329881(%rip), %rdx    # 0x579618
movl $0x37, %ecx
callq 0xe8540
movq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x50(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x24fded
movq 0x50(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x20(%rsp), %rcx
movq $0x0, (%rax,%rcx,8)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x24fdb7
jmp 0x24fce5
jmp 0x24fdf4
movq 0x38(%rsp), %rax
movq 0x50(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jb 0x24fe3c
movq 0x3ec195(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2c61fe(%rip), %rsi    # 0x516013
leaq 0x329851(%rip), %rdx    # 0x57966d
leaq 0x32987e(%rip), %rcx    # 0x5796a1
leaq 0x3297ee(%rip), %r8     # 0x579618
movl $0x3d, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x24fe3e
movq 0x50(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x38(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
testb $0x1, 0x4f(%rsp)
je 0x24fe73
movq 0x50(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x2500f1
movq 0x30(%rsp), %rax
incq %rax
imulq %rax, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x40(%rsp), %rdx
movq %rax, %rcx
subq %rdx, %rcx
movq %rcx, %xmm0
movaps 0x2c8a90(%rip), %xmm3   # 0x518930
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x2c8a94(%rip), %xmm2   # 0x518940
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x2ca975(%rip), %xmm1   # 0x51a838
mulsd %xmm1, %xmm0
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x2c8e76(%rip), %xmm1   # 0x518d70
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, 0x8(%rsp)
cmpq $0x64, 0x8(%rsp)
jbe 0x24ff4e
movq 0x3ec083(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2c60ec(%rip), %rsi    # 0x516013
leaq 0x329786(%rip), %rdx    # 0x5796b4
leaq 0x32976c(%rip), %rcx    # 0x5796a1
leaq 0x3296dc(%rip), %r8     # 0x579618
movl $0x49, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x24ff50
movq 0x40(%rsp), %xmm0
movaps 0x2c89d3(%rip), %xmm3   # 0x518930
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x2c89d7(%rip), %xmm2   # 0x518940
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq 0x30(%rsp), %rax
incq %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq 0x50(%rsp), %rax
addsd 0x50(%rax), %xmm0
movsd %xmm0, 0x50(%rax)
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x50(%rsp), %rax
movq 0x28(%rax), %rax
addq $0x0, %rax
movq 0x50(%rsp), %rcx
cmpq 0x20(%rcx), %rax
jb 0x25006f
movq $0x20, (%rsp)
xorl %eax, %eax
cmpq (%rsp), %rax
jbe 0x250029
movq 0x3ebfa8(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2c6011(%rip), %rsi    # 0x516013
leaq 0x2c919e(%rip), %rdx    # 0x5191a7
leaq 0x329691(%rip), %rcx    # 0x5796a1
leaq 0x329601(%rip), %r8     # 0x579618
movl $0x4c, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x25002b
movq (%rsp), %rcx
movq 0x50(%rsp), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x50(%rsp), %rax
movq 0x20(%rax), %rsi
shlq $0x3, %rsi
leaq 0x3295bf(%rip), %rdx    # 0x579618
movl $0x4c, %ecx
callq 0xe8540
movq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x250071
movq 0x50(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x2500b5
movq 0x3ebf1c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2c5f85(%rip), %rsi    # 0x516013
leaq 0x329633(%rip), %rdx    # 0x5796c8
leaq 0x329605(%rip), %rcx    # 0x5796a1
leaq 0x329575(%rip), %r8     # 0x579618
movl $0x4c, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2500b7
jmp 0x2500b9
movq 0x30(%rsp), %rdx
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x50(%rsp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x28(%rsi)
movq %rdx, (%rax,%rcx,8)
movq 0x28(%rsp), %rcx
movq 0x50(%rsp), %rax
addq 0x48(%rax), %rcx
movq %rcx, 0x48(%rax)
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)