// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/linspace_management.c
// Function: gt_linspace_management_check_generic
static void gt_linspace_management_check_generic(GtLinspaceManagement
                                                 *spacemanager,
                                                 GtUword ulen, GtUword vlen,
                                                 size_t valuesize,
                                                 size_t rtabsize,
                                                 size_t crosspointsize,
                                                 bool local)
{
  size_t space = 0, localspace = 0; /* space in bytes */
  /*if (spacemanager == NULL)
    spacemanager = gt_new_linspace_management();*/

  gt_assert(spacemanager != NULL);

  if (spacemanager->valueTabsize < (ulen+1)*valuesize)
  {
    spacemanager->valueTabspace = gt_realloc(spacemanager->valueTabspace,
                                            (ulen+1)*valuesize);
    spacemanager->valueTabsize = (ulen+1)*valuesize;
  }

  if (spacemanager->rTabsize < (ulen+1)*rtabsize)
  {
    spacemanager->rTabspace = gt_realloc(spacemanager->rTabspace,
                                        (ulen+1)*rtabsize);
    spacemanager->rTabsize = (ulen+1)*rtabsize;
  }
  if (spacemanager->crosspointTabsize < (vlen+1)*crosspointsize)
  {
    spacemanager->crosspointTabspace =
           gt_realloc(spacemanager->crosspointTabspace,(vlen+1)*crosspointsize);
    spacemanager->crosspointTabsize = (vlen+1)*crosspointsize;
  }
  if (local)
  {
    if (spacemanager->maxscoordvaluespace == NULL)
      spacemanager->maxscoordvaluespace = gt_maxcoordvalue_new();
    else
      gt_maxcoordvalue_reset(spacemanager->maxscoordvaluespace);
  }
  if (spacemanager->maxscoordvaluespace != NULL)
    localspace = 2 * sizeof (GtUwordPair) + sizeof (GtWord);
            /* = sizeof (GtMaxcoordvalue)*/

  /* determine space peak */
  space = spacemanager->valueTabsize + spacemanager->rTabsize +
          spacemanager->crosspointTabsize + localspace;

  if (space > spacemanager->spacepeak)
    spacemanager->spacepeak = space;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x163acf
movq %r9, %r15
movq %r8, %r13
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
incq %r12
imulq %r12, %rbp
cmpq %rbp, 0x28(%rdi)
jae 0x163a1d
movq (%rbx), %rdi
leaq 0x22bb1b(%rip), %rdx    # 0x38f524
movq %rbp, %rsi
movl $0x5d, %ecx
callq 0x1094e6
movq %rax, (%rbx)
movq %rbp, 0x28(%rbx)
imulq %r13, %r12
cmpq %r12, 0x30(%rbx)
jae 0x163a47
movq 0x8(%rbx), %rdi
leaq 0x22baf2(%rip), %rdx    # 0x38f524
movq %r12, %rsi
movl $0x64, %ecx
callq 0x1094e6
movq %rax, 0x8(%rbx)
movq %r12, 0x30(%rbx)
movb 0x40(%rsp), %bpl
incq %r14
imulq %r15, %r14
cmpq %r14, 0x38(%rbx)
jae 0x163a79
movq 0x10(%rbx), %rdi
leaq 0x22bac0(%rip), %rdx    # 0x38f524
movq %r14, %rsi
movl $0x6a, %ecx
callq 0x1094e6
movq %rax, 0x10(%rbx)
movq %r14, 0x38(%rbx)
testb %bpl, %bpl
je 0x163a97
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x163a8e
callq 0x1684a6
jmp 0x163a97
callq 0x168350
movq %rax, 0x48(%rbx)
movq 0x48(%rbx), %rax
testq %rax, %rax
movl $0x28, %ecx
cmoveq %rax, %rcx
movq 0x30(%rbx), %rax
addq 0x28(%rbx), %rax
addq %rcx, %rax
addq 0x38(%rbx), %rax
cmpq 0x40(%rbx), %rax
jbe 0x163ac0
movq %rax, 0x40(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4bc68