// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/firstcodes-spacelog.c
// Function: gt_firstcodes_spacelog_add
void gt_firstcodes_spacelog_add(GtFirstcodesspacelog *fcsl,
                                int line,
                                const char *filename,
                                bool add,
                                const char *title,
                                bool work,
                                size_t size)
{
  GtFirstcodespacelogentry *entry;
  size_t logspace;

  if (add)
  {
    entry = gt_spacelog_find(fcsl,title);
    if (entry != NULL)
    {
      if (entry->size != 0)
      {
        fprintf(stderr,"existing entry for title \"%s\""
                       "(from file %s, line %d) "
                       "in spacelog entries must have size 0\n",
                       title,filename,line);
        exit(GT_EXIT_PROGRAMMING_ERROR);
      }
      gt_spacelog_updateaddentry(entry,filename,line,title,size,work);
    } else
    {
      gt_spacelog_addentry(fcsl,filename,line,title,size,work);
    }
    if (work)
    {
      fcsl->workspace += size;
    } else
    {
      fcsl->splitspace += size;
    }
    gt_firstcodes_updatemax(fcsl);
  } else
  {
    entry = gt_spacelog_find(fcsl,title);
    if (entry == NULL)
    {
      fprintf(stderr,"cannot find title \"%s\" (from file %s, line %d) "
                     "in spacelog entries\n",title,filename,line);
      (void) gt_firstcodes_spacelog_showentries(stderr,fcsl);
      exit(GT_EXIT_PROGRAMMING_ERROR);
    }
    if ((entry->work && !work) || (!entry->work && work))
    {
      fprintf(stderr,"for title \"%s\" (from file %s, line %d) "
                     "in spacelog entries: inconsistent work/splitassignment\n",
               title,filename,line);
      exit(GT_EXIT_PROGRAMMING_ERROR);
    }
    if (work)
    {
      if (entry->size > fcsl->workspace)
      {
        gt_firstcodes_subtract_error(title, filename, line, entry->size, true,
                                     fcsl->workspace);
        (void) gt_firstcodes_spacelog_showentries(stderr,fcsl);
        exit(GT_EXIT_PROGRAMMING_ERROR);
      }
      fcsl->workspace -= entry->size;
    } else
    {
      if (entry->size > fcsl->splitspace)
      {
        gt_firstcodes_subtract_error(title, filename, line, entry->size, false,
                                     fcsl->splitspace);
        (void) gt_firstcodes_spacelog_showentries(stderr,fcsl);
        exit(GT_EXIT_PROGRAMMING_ERROR);
      }
      fcsl->splitspace -= entry->size;
    }
    if (size > 0)
    {
      size_t previous_size = entry->size;
      gt_spacelog_updateaddentry(entry,filename,line,title,size,work);
      if (work)
      {
        fcsl->workspace += size;
      } else
      {
        fcsl->splitspace += size;
      }
      if (size > previous_size)
      {
        add = true;
        size -= previous_size;
      } else
      {
        size = previous_size - size;
      }
      gt_firstcodes_updatemax(fcsl);
    } else
    {
      size = entry->size;
      entry->size = 0;
    }
  }
  logspace = fcsl->workspace+fcsl->splitspace;
  gt_log_log(
#ifdef SKDEBUG
             "file %s, line %d: "
#endif
             "%s %s= %.2f, %s, w=%.2f, s=%.2f, sum=%.2f MB",
#ifdef SKDEBUG
             filename,
             line,
#endif
             work ? "w" : "s",
             add ? "+" : "-",
             GT_MEGABYTES(size),
             title,
             GT_MEGABYTES(fcsl->workspace),
             GT_MEGABYTES(fcsl->splitspace),
             GT_MEGABYTES(logspace));
#ifdef SKDEBUG
  if (gt_ma_bookkeeping_enabled())
  {
    GtUword realspace = gt_ma_get_space_current() +
                              gt_fa_get_space_current();
    gt_log_log("current space usage %.2f MB (%.2f+%.2f)",
                                GT_MEGABYTES(realspace),
                                GT_MEGABYTES(gt_ma_get_space_current()),
                                GT_MEGABYTES(gt_fa_get_space_current()));
    if (fcsl->calc_difference)
    {
      double percent_difference;

      if ((GtUword) logspace > realspace)
      {
        fprintf(stderr,"overestimating logspace\n");
        exit(GT_EXIT_PROGRAMMING_ERROR);
      }
      if (realspace >= 1000000UL)
      {
        /*
        printf("realspace="GT_WU",logspace="GT_WU"\n",realspace,
                                              (GtUword) logspace);
        */
        percent_difference = 100.0 * (double) (realspace - logspace)/realspace;
        if (gt_double_larger_double(percent_difference,3.0))
        {
          fprintf(stderr,"space difference of %.2f%% is too large\n",
                       percent_difference);
          exit(GT_EXIT_PROGRAMMING_ERROR);
        }
        if (gt_double_smaller_double(fcsl->max_percent_difference,
                                     percent_difference))
        {
          fcsl->max_percent_difference = percent_difference;
        }
      }
    }
  }
#endif
}

// Assembly:
subq $0x48, %rsp
movb %r9b, %al
movq 0x50(%rsp), %r9
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movq %rdx, 0x30(%rsp)
andb $0x1, %cl
movb %cl, 0x2f(%rsp)
movq %r8, 0x20(%rsp)
andb $0x1, %al
movb %al, 0x1f(%rsp)
testb $0x1, 0x2f(%rsp)
je 0x4beb7a
movq 0x40(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x4beee0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x4beb19
movq 0x10(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x4beaf0
movq 0x17d4da(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0x20(%rsp), %rdx
movq 0x30(%rsp), %rcx
movl 0x3c(%rsp), %r8d
leaq 0xf908a(%rip), %rsi     # 0x5b7b69
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl 0x3c(%rsp), %edx
movq 0x20(%rsp), %rcx
movq 0x50(%rsp), %r8
movb 0x1f(%rsp), %al
andb $0x1, %al
movzbl %al, %r9d
callq 0x4bef70
jmp 0x4beb40
movq 0x40(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl 0x3c(%rsp), %edx
movq 0x20(%rsp), %rcx
movq 0x50(%rsp), %r8
movb 0x1f(%rsp), %al
andb $0x1, %al
movzbl %al, %r9d
callq 0x4befe0
testb $0x1, 0x1f(%rsp)
je 0x4beb59
movq 0x50(%rsp), %rcx
movq 0x40(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x4beb6b
movq 0x50(%rsp), %rcx
movq 0x40(%rsp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x40(%rsp), %rdi
callq 0x4bf100
jmp 0x4bede3
movq 0x40(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x4beee0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x4bebdb
movq 0x17d403(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0x20(%rsp), %rdx
movq 0x30(%rsp), %rcx
movl 0x3c(%rsp), %r8d
leaq 0xf900e(%rip), %rsi     # 0x5b7bc4
movb $0x0, %al
callq 0x199f0
movq 0x17d3dc(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0x40(%rsp), %rsi
callq 0x4be8f0
movl $0x2, %edi
callq 0x19890
movq 0x10(%rsp), %rax
testb $0x1, 0x20(%rax)
je 0x4bebed
testb $0x1, 0x1f(%rsp)
je 0x4bebff
movq 0x10(%rsp), %rax
testb $0x1, 0x20(%rax)
jne 0x4bec30
testb $0x1, 0x1f(%rsp)
je 0x4bec30
movq 0x17d39a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0x20(%rsp), %rdx
movq 0x30(%rsp), %rcx
movl 0x3c(%rsp), %r8d
leaq 0xf8fe9(%rip), %rsi     # 0x5b7c08
movb $0x0, %al
callq 0x199f0
movl $0x2, %edi
callq 0x19890
testb $0x1, 0x1f(%rsp)
je 0x4becab
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x40(%rsp), %rcx
cmpq (%rcx), %rax
jbe 0x4bec92
movq 0x20(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl 0x3c(%rsp), %edx
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x40(%rsp), %rax
movq (%rax), %r9
movl $0x1, %r8d
callq 0x4bf180
movq 0x17d325(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0x40(%rsp), %rsi
callq 0x4be8f0
movl $0x2, %edi
callq 0x19890
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdx
movq 0x40(%rsp), %rax
movq (%rax), %rcx
subq %rdx, %rcx
movq %rcx, (%rax)
jmp 0x4bed1e
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x40(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x4bed05
movq 0x20(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl 0x3c(%rsp), %edx
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x40(%rsp), %rax
movq 0x8(%rax), %r9
xorl %r8d, %r8d
callq 0x4bf180
movq 0x17d2b2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
movq 0x40(%rsp), %rsi
callq 0x4be8f0
movl $0x2, %edi
callq 0x19890
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdx
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x50(%rsp)
jbe 0x4bedc6
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl 0x3c(%rsp), %edx
movq 0x20(%rsp), %rcx
movq 0x50(%rsp), %r8
movb 0x1f(%rsp), %al
andb $0x1, %al
movzbl %al, %r9d
callq 0x4bef70
testb $0x1, 0x1f(%rsp)
je 0x4bed77
movq 0x50(%rsp), %rcx
movq 0x40(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x4bed89
movq 0x50(%rsp), %rcx
movq 0x40(%rsp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x50(%rsp), %rax
cmpq (%rsp), %rax
jbe 0x4bedac
movb $0x1, 0x2f(%rsp)
movq (%rsp), %rcx
movq 0x50(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x50(%rsp)
jmp 0x4bedba
movq (%rsp), %rax
subq 0x50(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x40(%rsp), %rdi
callq 0x4bf100
jmp 0x4bede1
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x10(%rsp), %rax
movq $0x0, 0x18(%rax)
jmp 0x4bede3
movq 0x40(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movb 0x1f(%rsp), %cl
leaq 0xa70c3(%rip), %rax     # 0x565ec5
leaq 0x6daa3(%rip), %rsi     # 0x52c8ac
testb $0x1, %cl
cmovneq %rax, %rsi
movb 0x2f(%rsp), %cl
leaq 0xd435d(%rip), %rax     # 0x593178
leaq 0xdc505(%rip), %rdx     # 0x59b327
testb $0x1, %cl
cmovneq %rax, %rdx
movq 0x50(%rsp), %xmm0
movaps 0x59afa(%rip), %xmm5    # 0x518930
punpckldq %xmm5, %xmm0    # xmm0 = xmm0[0],xmm5[0],xmm0[1],xmm5[1]
movapd 0x59afe(%rip), %xmm4    # 0x518940
subpd %xmm4, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x59acf(%rip), %xmm3    # 0x518928
mulsd %xmm3, %xmm0
movq 0x20(%rsp), %rcx
movq 0x40(%rsp), %rax
movq (%rax), %xmm1
punpckldq %xmm5, %xmm1    # xmm1 = xmm1[0],xmm5[0],xmm1[1],xmm5[1]
subpd %xmm4, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
mulsd %xmm3, %xmm1
movq 0x8(%rax), %xmm2
punpckldq %xmm5, %xmm2    # xmm2 = xmm2[0],xmm5[0],xmm2[1],xmm5[1]
subpd %xmm4, %xmm2
movaps %xmm2, %xmm6
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm6, %xmm2
mulsd %xmm3, %xmm2
movq 0x8(%rsp), %xmm3
punpckldq %xmm5, %xmm3    # xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1]
subpd %xmm4, %xmm3
movaps %xmm3, %xmm4
unpckhpd %xmm3, %xmm3            # xmm3 = xmm3[1,1]
addsd %xmm4, %xmm3
movsd 0x59a61(%rip), %xmm4    # 0x518920
divsd %xmm4, %xmm3
leaq 0xf8d9d(%rip), %rdi     # 0x5b7c67
movb $0x4, %al
callq 0xe7740
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)