// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/sfx-sain.c
// Function: gt_sainbuffer_new
static GtSainbuffer *gt_sainbuffer_new(GtUsainindextype *suftab,
                                       GtUsainindextype *fillptr,
                                       GtUword numofchars,
                                       GtUword totallength,
                                       GtLogger *logger)
{
  if (numofchars <= UCHAR_MAX+1)
  {
    GtSainbuffer *buf = (GtSainbuffer *) gt_malloc(sizeof (*buf));

    buf->size = sizeof (*buf);
    buf->fillptr = fillptr;
    buf->suftab = suftab;
    buf->log_bufsize = 18 - (sizeof (GtUsainindextype) == (size_t) 4 ? 1 : 2) -
                             (int) gt_determinebitspervalue(numofchars);
    buf->buf_size = 1UL << buf->log_bufsize;
    buf->numofchars = numofchars;
    gt_assert(buf->buf_size <= UINT16_MAX);
    buf->cachesize = numofchars << buf->log_bufsize;
    buf->size += sizeof (*buf->values) * buf->cachesize;
    buf->size += sizeof (*buf->nextidx) * numofchars;
    if ((GtUword) buf->size * 10UL >= totallength)
    {
      gt_free(buf);
      buf = NULL;
    } else
    {
      buf->values = (GtUsainindextype *)
                    gt_malloc(sizeof (*buf->values) * buf->cachesize);
      buf->nextidx = gt_calloc((size_t) numofchars,sizeof (*buf->nextidx));
      gt_logger_log(logger,"used buffer of "GT_WU" bytes (bufsize="GT_WU")",
                         (GtUword) buf->size,buf->buf_size);
    }
    return buf;
  } else
  {
    return NULL;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x100, %rdx            # imm = 0x100
ja 0x1a5eee
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %rbp
movq %rdi, %r13
leaq 0x1b36d4(%rip), %rsi    # 0x3594f8
pushq $0x48
popq %rdi
movl $0x17d, %edx            # imm = 0x17D
callq 0x93160
movq %rax, %rbx
movq $0x48, 0x40(%rax)
movq %rbp, 0x20(%rax)
movq %r13, 0x28(%rax)
movq %r15, %rdi
callq 0x9580f
pushq $0x11
popq %rcx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
movl %ecx, 0x38(%rbx)
movq %rax, (%rbx)
movq %r15, 0x8(%rbx)
cmpl $0x10, %ecx
jae 0x1a5f02
movq %r15, %rdi
shlq %cl, %rdi
movq %rdi, 0x10(%rbx)
leaq (%r15,%r15), %rax
leaq (%rax,%rdi,4), %rax
addq 0x40(%rbx), %rax
movq %rax, 0x40(%rbx)
imulq $0xa, %rax, %rax
cmpq %r12, %rax
jae 0x1a5eda
shlq $0x2, %rdi
leaq 0x1b3660(%rip), %r12    # 0x3594f8
movq %r12, %rsi
movl $0x191, %edx            # imm = 0x191
callq 0x93160
movq %rax, 0x18(%rbx)
pushq $0x2
popq %rsi
movq %r15, %rdi
movq %r12, %rdx
movl $0x192, %ecx            # imm = 0x192
callq 0x9334a
movq %rax, 0x30(%rbx)
movq (%rbx), %rcx
movq 0x40(%rbx), %rdx
leaq 0x1b3a04(%rip), %rsi    # 0x3598d2
movq %r14, %rdi
xorl %eax, %eax
callq 0x92e71
jmp 0x1a5ef0
leaq 0x1b3617(%rip), %rsi    # 0x3594f8
movq %rbx, %rdi
movl $0x18c, %edx            # imm = 0x18C
callq 0x936f9
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x29205f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x13f100(%rip), %rsi    # 0x2e5013
leaq 0x1b398a(%rip), %rdx    # 0x3598a4
leaq 0x1b399f(%rip), %rcx    # 0x3598c0
leaq 0x1b35d0(%rip), %r8     # 0x3594f8
movl $0x186, %r9d            # imm = 0x186
xorl %eax, %eax
callq 0x17a50
callq 0x17390