// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/editscript.c
// Function: editscript_space_get_length
static inline GtBitsequence
editscript_space_get_length(const GtEditscript *es,
                            GtEditscriptPos *pos,
                            uint32_t *elems_used)
{
  GtBitsequence ret = 0,
                elem = 0,
                part_elem = 0,
                num_elems = 0;

  elem = editscript_space_get_next(es, pos);
  (*elems_used)++;
  /* first bit not set, the value itself. */
  if ((elem & GT_EDITSCRIPT_FIRSTMASK(es)) == 0) {
    return elem;
  }
  /* first bit is set, cosecutive 1-bits represent number of elements to read */
  while (elem == GT_EDITSCRIPT_FULLMASK(es)) {
    num_elems += es->entry_size;
    elem = editscript_space_get_next(es, pos);
    (*elems_used)++;
  }
  /* elem is not full with 1 bits, but some most significant bits are set equal
     to number of elements to read, iterate over 1 bits, read elements of number
     while we do so. */
  while ((elem & GT_EDITSCRIPT_FIRSTMASK(es)) != 0) {
    elem <<= 1;
    part_elem = editscript_space_get_next(es, pos);
    (*elems_used)++;
    ret <<= es->entry_size;
    ret |= part_elem;
  }
  /* more elements to read as has been indicated by full 1-bit elems from above
     */
  while (num_elems != 0) {
    num_elems--;
    elem = editscript_space_get_next(es, pos);
    (*elems_used)++;
    ret <<= es->entry_size;
    ret |= elem;
  }
  return ret;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x15ad80
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0x18(%rsp), %rax
movq 0x38(%rsp), %rcx
movzbl 0x15(%rcx), %ecx
subq $0x1, %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
jne 0x15af1c
movq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x15b060
jmp 0x15af1e
movq 0x18(%rsp), %rax
movq 0x38(%rsp), %rcx
movzbl 0x15(%rcx), %ecx
movl %ecx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jne 0x15af77
movq 0x38(%rsp), %rax
movzbl 0x15(%rax), %eax
addq 0x8(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x15ad80
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x15af1e
jmp 0x15af79
movq 0x18(%rsp), %rax
movq 0x38(%rsp), %rcx
movzbl 0x15(%rcx), %ecx
subq $0x1, %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x15aff5
movq 0x18(%rsp), %rax
shlq %rax
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x15ad80
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0x38(%rsp), %rax
movzbl 0x15(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, %ecx
shlq %cl, %rax
movq %rax, 0x20(%rsp)
movq 0x10(%rsp), %rax
orq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x15af79
jmp 0x15aff7
cmpq $0x0, 0x8(%rsp)
je 0x15b056
movq 0x8(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x15ad80
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0x38(%rsp), %rax
movzbl 0x15(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, %ecx
shlq %cl, %rax
movq %rax, 0x20(%rsp)
movq 0x18(%rsp), %rax
orq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x15aff7
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopw (%rax,%rax)