// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/kmer_database.c
// Function: gt_kmer_database_add_interval
void gt_kmer_database_add_interval(GtKmerDatabase *kdb,
                                   GtUword start, GtUword end,
                                   GtUword id)
{
  GtRange new;
  GtUword interval_size;

  gt_assert(kdb != NULL);
  gt_assert(start < end + 1 - (kdb->sb.kmer_size - 1));

  if (kdb->sb.intervals_kmer_count > 0) {
    GT_UNUSED GtUword prev = kdb->sb.intervals->nextfreeGtRange - 1;
    gt_assert(start > kdb->sb.intervals->spaceGtRange[prev].end);
  }

  /*
     K=5
     S         E
     0 1 2 3 4 5 6
     _________     kmer1
       _________   kmer2
     E+1-(K-1)-S = 2
   */
  interval_size = end + 1 - (kdb->sb.kmer_size - 1) - start;

  /* flush if sum is to large */
  if (kdb->sb.intervals_kmer_count != 0 &&
      interval_size + kdb->sb.intervals_kmer_count >= kdb->sb.max_nu_kmers) {
    gt_kmer_database_flush(kdb);
    kdb->sb.printed = false;
  }

  /* split overall to large, sb is empty because of code above */
  while (interval_size > kdb->sb.max_nu_kmers) {
    kdb->sb.printed = false;

    new.start = start;
    new.end = start + kdb->sb.max_nu_kmers + (kdb->sb.kmer_size - 1) - 1;

    GT_STOREINARRAY(kdb->sb.intervals, GtRange, 10, new);
    GT_STOREINARRAY(kdb->sb.ids, GtUword, 10, id);

    kdb->sb.intervals_kmer_count += kdb->sb.max_nu_kmers;
    gt_kmer_database_flush(kdb);
    interval_size -= kdb->sb.max_nu_kmers;
    start = start + kdb->sb.max_nu_kmers;
  }

  /* definitely fits, add */
  new.start = start;
  new.end = end;
  GT_STOREINARRAY(kdb->sb.intervals, GtRange, 10, new);
  GT_STOREINARRAY(kdb->sb.ids, GtUword, 10, id);
  kdb->sb.intervals_kmer_count += interval_size;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
cmpq $0x0, 0x60(%rsp)
jne 0x1989b8
movq 0x4a3619(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37d682(%rip), %rsi    # 0x516013
leaq 0x3bee0a(%rip), %rdx    # 0x5577a2
leaq 0x3beea0(%rip), %rcx    # 0x55783f
leaq 0x3bed95(%rip), %r8     # 0x55773b
movl $0x1a7, %r9d            # imm = 0x1A7
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1989ba
jmp 0x1989bc
movq 0x58(%rsp), %rax
movq 0x50(%rsp), %rcx
addq $0x1, %rcx
movq 0x60(%rsp), %rdx
movl 0xd0(%rdx), %edx
subl $0x1, %edx
movl %edx, %edx
subq %rdx, %rcx
cmpq %rcx, %rax
jb 0x198a1a
movq 0x4a35b7(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37d620(%rip), %rsi    # 0x516013
leaq 0x3bee63(%rip), %rdx    # 0x55785d
leaq 0x3bee3e(%rip), %rcx    # 0x55783f
leaq 0x3bed33(%rip), %r8     # 0x55773b
movl $0x1a8, %r9d            # imm = 0x1A8
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x198a1c
movq 0x60(%rsp), %rax
cmpq $0x0, 0xc8(%rax)
jbe 0x198aa6
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
movq 0x10(%rax), %rax
subq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rax
movq 0x60(%rsp), %rcx
movq 0x80(%rcx), %rcx
movq (%rcx), %rcx
movq 0x28(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
ja 0x198aa2
movq 0x4a352f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37d598(%rip), %rsi    # 0x516013
leaq 0x3bee05(%rip), %rdx    # 0x557887
leaq 0x3bedb6(%rip), %rcx    # 0x55783f
leaq 0x3becab(%rip), %r8     # 0x55773b
movl $0x1ac, %r9d            # imm = 0x1AC
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x198aa4
jmp 0x198aa6
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq 0x60(%rsp), %rcx
movl 0xd0(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
subq %rcx, %rax
subq 0x58(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x60(%rsp), %rax
cmpq $0x0, 0xc8(%rax)
je 0x198b10
movq 0x30(%rsp), %rax
movq 0x60(%rsp), %rcx
addq 0xc8(%rcx), %rax
movq 0x60(%rsp), %rcx
cmpq 0xa8(%rcx), %rax
jb 0x198b10
movq 0x60(%rsp), %rdi
callq 0x197f70
movq 0x60(%rsp), %rax
movb $0x0, 0xd4(%rax)
jmp 0x198b12
movq 0x30(%rsp), %rax
movq 0x60(%rsp), %rcx
cmpq 0xa8(%rcx), %rax
jbe 0x198e8e
movq 0x60(%rsp), %rax
movb $0x0, 0xd4(%rax)
movq 0x58(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x58(%rsp), %rax
movq 0x60(%rsp), %rcx
addq 0xa8(%rcx), %rax
movq 0x60(%rsp), %rcx
movl 0xd0(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
addq %rcx, %rax
subq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x198b6e
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
movq 0x10(%rax), %rax
addq $0x0, %rax
movq 0x60(%rsp), %rcx
movq 0x80(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jb 0x198c43
movq $0xa, 0x20(%rsp)
xorl %eax, %eax
cmpq 0x20(%rsp), %rax
jbe 0x198be2
movq 0x4a33ef(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37d458(%rip), %rsi    # 0x516013
leaq 0x3805e5(%rip), %rdx    # 0x5191a7
leaq 0x3bec76(%rip), %rcx    # 0x55783f
leaq 0x3beb6b(%rip), %r8     # 0x55773b
movl $0x1c7, %r9d            # imm = 0x1C7
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x198be4
movq 0x20(%rsp), %rcx
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
movq (%rax), %rdi
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
movq 0x8(%rax), %rsi
shlq $0x4, %rsi
leaq 0x3beb14(%rip), %rdx    # 0x55773b
movl $0x1c7, %ecx            # imm = 0x1C7
callq 0xe8540
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
movq %rcx, (%rax)
jmp 0x198c45
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
cmpq $0x0, (%rax)
jne 0x198c8f
movq 0x4a3342(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37d3ab(%rip), %rsi    # 0x516013
leaq 0x3bec4a(%rip), %rdx    # 0x5578b9
leaq 0x3bebc9(%rip), %rcx    # 0x55783f
leaq 0x3beabe(%rip), %r8     # 0x55773b
movl $0x1c7, %r9d            # imm = 0x1C7
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x198c91
jmp 0x198c93
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
movq (%rax), %rax
movq 0x60(%rsp), %rcx
movq 0x80(%rcx), %rdx
movq 0x10(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x10(%rdx)
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x38(%rsp), %rcx
movq %rcx, (%rax)
movq 0x40(%rsp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x198cd7
jmp 0x198cd9
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rax
movq 0x10(%rax), %rax
addq $0x0, %rax
movq 0x60(%rsp), %rcx
movq 0x88(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jb 0x198dae
movq $0xa, 0x18(%rsp)
xorl %eax, %eax
cmpq 0x18(%rsp), %rax
jbe 0x198d4d
movq 0x4a3284(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37d2ed(%rip), %rsi    # 0x516013
leaq 0x38047a(%rip), %rdx    # 0x5191a7
leaq 0x3beb0b(%rip), %rcx    # 0x55783f
leaq 0x3bea00(%rip), %r8     # 0x55773b
movl $0x1c8, %r9d            # imm = 0x1C8
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x198d4f
movq 0x18(%rsp), %rcx
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rax
movq (%rax), %rdi
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
leaq 0x3be9a9(%rip), %rdx    # 0x55773b
movl $0x1c8, %ecx            # imm = 0x1C8
callq 0xe8540
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rax
movq %rcx, (%rax)
jmp 0x198db0
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rax
cmpq $0x0, (%rax)
jne 0x198dfa
movq 0x4a31d7(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37d240(%rip), %rsi    # 0x516013
leaq 0x3beb09(%rip), %rdx    # 0x5578e3
leaq 0x3bea5e(%rip), %rcx    # 0x55783f
leaq 0x3be953(%rip), %r8     # 0x55773b
movl $0x1c8, %r9d            # imm = 0x1C8
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x198dfc
jmp 0x198dfe
movq 0x48(%rsp), %rdx
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rax
movq (%rax), %rax
movq 0x60(%rsp), %rcx
movq 0x88(%rcx), %rsi
movq 0x10(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x10(%rsi)
movq %rdx, (%rax,%rcx,8)
movq 0x60(%rsp), %rax
movq 0xa8(%rax), %rcx
movq 0x60(%rsp), %rax
addq 0xc8(%rax), %rcx
movq %rcx, 0xc8(%rax)
movq 0x60(%rsp), %rdi
callq 0x197f70
movq 0x60(%rsp), %rax
movq 0xa8(%rax), %rcx
movq 0x30(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x30(%rsp)
movq 0x58(%rsp), %rax
movq 0x60(%rsp), %rcx
addq 0xa8(%rcx), %rax
movq %rax, 0x58(%rsp)
jmp 0x198b12
movq 0x58(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x198ea4
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
movq 0x10(%rax), %rax
addq $0x0, %rax
movq 0x60(%rsp), %rcx
movq 0x80(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jb 0x198f79
movq $0xa, 0x10(%rsp)
xorl %eax, %eax
cmpq 0x10(%rsp), %rax
jbe 0x198f18
movq 0x4a30b9(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37d122(%rip), %rsi    # 0x516013
leaq 0x3802af(%rip), %rdx    # 0x5191a7
leaq 0x3be940(%rip), %rcx    # 0x55783f
leaq 0x3be835(%rip), %r8     # 0x55773b
movl $0x1d3, %r9d            # imm = 0x1D3
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x198f1a
movq 0x10(%rsp), %rcx
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
movq (%rax), %rdi
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
movq 0x8(%rax), %rsi
shlq $0x4, %rsi
leaq 0x3be7de(%rip), %rdx    # 0x55773b
movl $0x1d3, %ecx            # imm = 0x1D3
callq 0xe8540
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
movq %rcx, (%rax)
jmp 0x198f7b
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
cmpq $0x0, (%rax)
jne 0x198fc5
movq 0x4a300c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37d075(%rip), %rsi    # 0x516013
leaq 0x3be914(%rip), %rdx    # 0x5578b9
leaq 0x3be893(%rip), %rcx    # 0x55783f
leaq 0x3be788(%rip), %r8     # 0x55773b
movl $0x1d3, %r9d            # imm = 0x1D3
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x198fc7
jmp 0x198fc9
movq 0x60(%rsp), %rax
movq 0x80(%rax), %rax
movq (%rax), %rax
movq 0x60(%rsp), %rcx
movq 0x80(%rcx), %rdx
movq 0x10(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x10(%rdx)
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x38(%rsp), %rcx
movq %rcx, (%rax)
movq 0x40(%rsp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x19900d
jmp 0x19900f
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rax
movq 0x10(%rax), %rax
addq $0x0, %rax
movq 0x60(%rsp), %rcx
movq 0x88(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jb 0x1990e4
movq $0xa, 0x8(%rsp)
xorl %eax, %eax
cmpq 0x8(%rsp), %rax
jbe 0x199083
movq 0x4a2f4e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37cfb7(%rip), %rsi    # 0x516013
leaq 0x380144(%rip), %rdx    # 0x5191a7
leaq 0x3be7d5(%rip), %rcx    # 0x55783f
leaq 0x3be6ca(%rip), %r8     # 0x55773b
movl $0x1d4, %r9d            # imm = 0x1D4
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x199085
movq 0x8(%rsp), %rcx
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rax
movq (%rax), %rdi
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
leaq 0x3be673(%rip), %rdx    # 0x55773b
movl $0x1d4, %ecx            # imm = 0x1D4
callq 0xe8540
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rax
movq %rcx, (%rax)
jmp 0x1990e6
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rax
cmpq $0x0, (%rax)
jne 0x199130
movq 0x4a2ea1(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37cf0a(%rip), %rsi    # 0x516013
leaq 0x3be7d3(%rip), %rdx    # 0x5578e3
leaq 0x3be728(%rip), %rcx    # 0x55783f
leaq 0x3be61d(%rip), %r8     # 0x55773b
movl $0x1d4, %r9d            # imm = 0x1D4
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x199132
jmp 0x199134
movq 0x48(%rsp), %rdx
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rax
movq (%rax), %rax
movq 0x60(%rsp), %rcx
movq 0x88(%rcx), %rsi
movq 0x10(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x10(%rsi)
movq %rdx, (%rax,%rcx,8)
movq 0x30(%rsp), %rcx
movq 0x60(%rsp), %rax
addq 0xc8(%rax), %rcx
movq %rcx, 0xc8(%rax)
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)