// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/editscript.c
// Function: editscript_space_add_next
static inline void editscript_space_add_next(GtEditscript *es,
                                             GtEditscriptPos *fillpos,
                                             GtBitsequence elem)
{
  uint32_t cur_word = fillpos->cur_word,
           remaining = fillpos->bitsleft,
           bits2store = (uint32_t) es->entry_size;
  if (es->size == 0) {
    es->size = (uint32_t) (GT_INTWORDSIZE / es->entry_size) + 1U;
    es->space = gt_malloc(es->size * sizeof (*es->space));
    es->space[0] = 0;
  }
  es->num_elems++;
  if (remaining > bits2store) {
    es->space[cur_word] |= elem << (remaining - bits2store);
    remaining -= bits2store;
  }
  else {
    if (cur_word + 1 >= es->size) {
      es->size += (GT_INTWORDSIZE / es->entry_size) + 1U;
      es->size *= 1.2;
      es->space = gt_realloc(es->space, es->size * sizeof (*(es->space)));
    }
    es->space[cur_word] |= elem >> (bits2store - remaining);
    cur_word++;
    es->space[cur_word] = 0;
    bits2store -= remaining;
    remaining = (uint32_t) GT_INTWORDSIZE;
    /* this has to be checked because (uint64_t << 64) is not defined */
    if (bits2store != 0) {
      es->space[cur_word] |= elem << (remaining - bits2store);
      remaining -= bits2store;
    }
  }
  fillpos->cur_word = cur_word;
  fillpos->bitsleft = remaining;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x28(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x1c(%rsp)
movq 0x28(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x18(%rsp)
movq 0x30(%rsp), %rax
movzbl 0x15(%rax), %eax
movl %eax, 0x14(%rsp)
movq 0x30(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x15caf9
movq 0x30(%rsp), %rax
movzbl 0x15(%rax), %ecx
movl $0x40, %eax
cltd
idivl %ecx
movl %eax, %ecx
addl $0x1, %ecx
movq 0x30(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x30(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, %edi
shlq $0x3, %rdi
leaq 0x3f0f43(%rip), %rsi    # 0x54da18
movl $0x6f, %edx
callq 0xe80f0
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq $0x0, (%rax)
movq 0x30(%rsp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movl 0x18(%rsp), %eax
cmpl 0x14(%rsp), %eax
jbe 0x15cb4c
movq 0x20(%rsp), %rdx
movl 0x18(%rsp), %eax
subl 0x14(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
shlq %cl, %rdx
movq 0x30(%rsp), %rax
movq (%rax), %rax
movl 0x1c(%rsp), %ecx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl 0x14(%rsp), %ecx
movl 0x18(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x18(%rsp)
jmp 0x15cc78
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movq 0x30(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jb 0x15cbdc
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movzbl 0x15(%rax), %ecx
xorl %edx, %edx
movl $0x40, %eax
divl %ecx
movl %eax, %edx
movq 0x8(%rsp), %rax
movl 0x8(%rax), %esi
movl %edx, %ecx
movl %esi, %edx
leal 0x1(%rcx,%rdx), %ecx
movl %ecx, 0x8(%rax)
movq 0x30(%rsp), %rax
movl 0x8(%rax), %ecx
cvtsi2sd %rcx, %xmm0
movsd 0x3bc1ca(%rip), %xmm1   # 0x518d68
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
movl %ecx, 0x8(%rax)
movq 0x30(%rsp), %rax
movq (%rax), %rdi
movq 0x30(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
shlq $0x3, %rsi
leaq 0x3f0e51(%rip), %rdx    # 0x54da18
movl $0x7b, %ecx
callq 0xe8540
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rdx
movl 0x14(%rsp), %eax
subl 0x18(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
shrq %cl, %rdx
movq 0x30(%rsp), %rax
movq (%rax), %rax
movl 0x1c(%rsp), %ecx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movl 0x1c(%rsp), %ecx
movq $0x0, (%rax,%rcx,8)
movl 0x18(%rsp), %ecx
movl 0x14(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x14(%rsp)
movl $0x40, 0x18(%rsp)
cmpl $0x0, 0x14(%rsp)
je 0x15cc76
movq 0x20(%rsp), %rdx
movl 0x18(%rsp), %eax
subl 0x14(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
shlq %cl, %rdx
movq 0x30(%rsp), %rax
movq (%rax), %rax
movl 0x1c(%rsp), %ecx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl 0x14(%rsp), %ecx
movl 0x18(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x18(%rsp)
jmp 0x15cc78
movl 0x1c(%rsp), %ecx
movq 0x28(%rsp), %rax
movl %ecx, (%rax)
movl 0x18(%rsp), %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x4(%rax)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)