// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/compact_ulong_store.c
// Function: gt_compact_ulong_store_update
void gt_compact_ulong_store_update(GtCompactUlongStore *cus,
                                   GtUword idx, GtUword value)
{
  unsigned int unitoffset;
  GtUword unitindex;

  gt_assert(idx < cus->numofentries && value <= cus->maskright);
  idx *= cus->bitsperentry;
  unitoffset = (unsigned int) GT_MODWORDSIZE(idx);
  unitindex = GT_DIVWORDSIZE(idx);
  if (unitoffset <= (unsigned int) cus->bitsleft) {
    unsigned int shiftleft = cus->bitsleft - unitoffset;

    cus->tab[unitindex]
      = (GtUword) (cus->tab[unitindex] & ~(cus->maskright << shiftleft)) |
        (GtUword) (value << shiftleft);
  } else {
    unsigned int shift = unitoffset - cus->bitsleft;

    cus->tab[unitindex]
      = (GtUword) (cus->tab[unitindex] & ~(cus->maskright >> shift)) |
        (GtUword)(value >> shift);
    shift = (unsigned int) GT_INTWORDSIZE - shift;
    cus->tab[unitindex+1]
      = (GtUword) (cus->tab[unitindex+1] & ~(cus->maskright << shift)) |
        (GtUword) (value << shift);
  }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xa2223
movq 0x20(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0xa225b
movq 0x599d76(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x473ddf(%rip), %rsi    # 0x516013
leaq 0x491943(%rip), %rdx    # 0x533b7e
leaq 0x49196f(%rip), %rcx    # 0x533bb1
leaq 0x491899(%rip), %r8     # 0x533ae2
movl $0x74, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0xa225d
movq 0x30(%rsp), %rax
movl 0x18(%rax), %eax
imulq 0x28(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
andq $0x3f, %rax
movl %eax, 0x1c(%rsp)
movq 0x28(%rsp), %rax
shrq $0x6, %rax
movq %rax, 0x10(%rsp)
movl 0x1c(%rsp), %eax
movq 0x30(%rsp), %rcx
cmpl 0x1c(%rcx), %eax
ja 0xa22f6
movq 0x30(%rsp), %rax
movl 0x1c(%rax), %eax
subl 0x1c(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movl 0xc(%rsp), %ecx
shlq %cl, %rax
xorq $-0x1, %rax
andq %rax, %rdx
movq 0x20(%rsp), %rax
movl 0xc(%rsp), %ecx
shlq %cl, %rax
orq %rax, %rdx
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xa23a5
movl 0x1c(%rsp), %eax
movq 0x30(%rsp), %rcx
subl 0x1c(%rcx), %eax
movl %eax, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x8(%rsp), %ecx
shrq %cl, %rax
xorq $-0x1, %rax
andq %rax, %rdx
movq 0x20(%rsp), %rax
movl 0x8(%rsp), %ecx
shrq %cl, %rax
orq %rax, %rdx
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x40, %eax
subl 0x8(%rsp), %eax
movl %eax, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rdx
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x8(%rsp), %ecx
shlq %cl, %rax
xorq $-0x1, %rax
andq %rax, %rdx
movq 0x20(%rsp), %rax
movl 0x8(%rsp), %ecx
shlq %cl, %rax
orq %rax, %rdx
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movq %rdx, 0x8(%rax,%rcx,8)
addq $0x38, %rsp
retq
nopw (%rax,%rax)