// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/compressed_bitsequence.c
// Function: gt_compressed_bitsequence_set_variable_field
static inline void
gt_compressed_bitsequence_set_variable_field(GtBitsequence *bitseq,
                                             GT_UNUSED GtUword size,
                                             GtUword start,
                                             unsigned int len,
                                             GtBitsequence value)
{
  const unsigned int bit_offset = (unsigned int) GT_MODWORDSIZE(start);
  const GtUword word_offset = GT_DIVWORDSIZE(start);
  const unsigned int bits_left = (unsigned int) (GT_INTWORDSIZE - bit_offset);
  GtBitsequence mask;
  mask = (bits_left == (unsigned int) GT_INTWORDSIZE) ?
    0 :
    ~((GtBitsequence) 0) << (GtBitsequence) bits_left;

  if (len > bits_left) {
    unsigned int overhang = len - bits_left;
    gt_assert(word_offset + 1 < size);

    bitseq[word_offset] &= mask;
    bitseq[word_offset] |= (value >> (GtBitsequence) overhang);

    mask = ~((GtBitsequence) 0) >> (GtBitsequence) overhang;
    bitseq[word_offset + 1] &= mask;
    bitseq[word_offset + 1] |=
      value << (GtBitsequence) (GT_INTWORDSIZE - overhang);
  }
  else {
    gt_assert(word_offset < size);
    if (bit_offset + len != (unsigned int) GT_INTWORDSIZE)
      mask |= ~((GtBitsequence) 0) >> (GtBitsequence) (bit_offset + len);

    bitseq[word_offset] &= mask;
    bitseq[word_offset] |= value << (GtBitsequence) (bits_left - len);
  }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movl %ecx, 0x3c(%rsp)
movq %r8, 0x30(%rsp)
movq 0x40(%rsp), %rax
andq $0x3f, %rax
movl %eax, 0x2c(%rsp)
movq 0x40(%rsp), %rax
shrq $0x6, %rax
movq %rax, 0x20(%rsp)
movl $0x40, %eax
subl 0x2c(%rsp), %eax
movl %eax, 0x1c(%rsp)
cmpl $0x40, 0x1c(%rsp)
jne 0x13e253
xorl %eax, %eax
movq %rax, (%rsp)
jmp 0x13e267
movl 0x1c(%rsp), %eax
movl %eax, %ecx
movq $-0x1, %rax
shlq %cl, %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x3c(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jbe 0x13e367
movl 0x3c(%rsp), %eax
subl 0x1c(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %rax
addq $0x1, %rax
cmpq 0x48(%rsp), %rax
jb 0x13e2d2
movq 0x4fdcff(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d7d68(%rip), %rsi    # 0x516013
leaq 0x40c93c(%rip), %rdx    # 0x54abee
leaq 0x40c94c(%rip), %rcx    # 0x54ac05
leaq 0x40c546(%rip), %r8     # 0x54a806
movl $0xde, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x13e2d4
movq 0x10(%rsp), %rdx
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
andq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x30(%rsp), %rdx
movl 0xc(%rsp), %eax
movl %eax, %ecx
shrq %cl, %rdx
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl 0xc(%rsp), %eax
movl %eax, %ecx
movq $-0x1, %rax
shrq %cl, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdx
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
andq 0x8(%rax,%rcx,8), %rdx
movq %rdx, 0x8(%rax,%rcx,8)
movq 0x30(%rsp), %rdx
movl $0x40, %eax
subl 0xc(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
shlq %cl, %rdx
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
orq 0x8(%rax,%rcx,8), %rdx
movq %rdx, 0x8(%rax,%rcx,8)
jmp 0x13e419
jmp 0x13e369
movq 0x20(%rsp), %rax
cmpq 0x48(%rsp), %rax
jb 0x13e3ad
movq 0x4fdc24(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3d7c8d(%rip), %rsi    # 0x516013
leaq 0x40c8a5(%rip), %rdx    # 0x54ac32
leaq 0x40c871(%rip), %rcx    # 0x54ac05
leaq 0x40c46b(%rip), %r8     # 0x54a806
movl $0xe9, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x13e3af
movl 0x2c(%rsp), %eax
addl 0x3c(%rsp), %eax
cmpl $0x40, %eax
je 0x13e3dc
movl 0x2c(%rsp), %eax
addl 0x3c(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
movq $-0x1, %rax
shrq %cl, %rax
orq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdx
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
andq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x30(%rsp), %rdx
movl 0x1c(%rsp), %eax
subl 0x3c(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
shlq %cl, %rdx
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
addq $0x58, %rsp
retq
nop