// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/bioseq_col.c
// Function: grep_desc
static int grep_desc(GtBioseqCol *bsc, GtUword *filenum,
                     GtUword *seqnum, GtStr *seqid, GtError *err)
{
  GtUword i, j, num_matches = 0;
  const GtSeqInfo *seq_info_ptr;
  GtSeqInfo seq_info;
  GtStr *pattern, *escaped;
  bool match = false;
  int had_err = 0;
  gt_error_check(err);
  gt_assert(bsc && filenum && seqnum && seqid);
  /* create cache */
  if (!bsc->grep_cache)
    bsc->grep_cache = gt_seq_info_cache_new();
  /* try to read from cache */
  seq_info_ptr = gt_seq_info_cache_get(bsc->grep_cache, gt_str_get(seqid));
  if (seq_info_ptr) {
    if (bsc->duplicates && gt_hashmap_get(bsc->duplicates, gt_str_get(seqid))) {
      gt_error_set(err, "query seqid '%s' could match more than one "
                        "sequence description", gt_str_get(seqid));
      return -1;
    }
    *filenum = seq_info_ptr->filenum;
    *seqnum = seq_info_ptr->seqnum;
    return 0;
  }
  pattern = gt_str_new();
  escaped = gt_str_new();
  gt_grep_escape_extended(escaped, gt_str_get(seqid), gt_str_length(seqid));
  if (bsc->matchdescstart)
    gt_str_append_cstr(pattern, "^");
  gt_str_append_str(pattern, escaped);
  if (bsc->matchdescstart)
    gt_str_append_cstr(pattern, "([[:space:]]|$)");
  for (i = 0; !had_err && i < bsc->num_of_seqfiles; i++) {
    GtBioseq *bioseq = bsc->bioseqs[i];
    for (j = 0; !had_err && j < gt_bioseq_number_of_sequences(bioseq); j++) {
      const char *desc = gt_bioseq_get_description(bioseq, j);
      had_err = gt_grep(&match, gt_str_get(pattern), desc, err);
      if (!had_err && match) {
        num_matches++;
        if (num_matches > 1) {
          gt_error_set(err, "query seqid '%s' could match more than one "
                            "sequence description", gt_str_get(seqid));
          had_err = -1;
          break;
        }
        *filenum = i;
        *seqnum = j;
        /* cache results */
        seq_info.filenum = i;
        seq_info.seqnum = j;
        gt_seq_info_cache_add(bsc->grep_cache, gt_str_get(seqid), &seq_info);
      }
    }
    if (match)
      break;
  }
  gt_str_delete(pattern);
  gt_str_delete(escaped);
  if (!had_err && num_matches == 0) {
    gt_error_set(err, "no description matched sequence ID '%s'",
                 gt_str_get(seqid));
    had_err = -1;
  }
  return had_err;
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xc8(%rsp)
movq %rsi, 0xc0(%rsp)
movq %rdx, 0xb8(%rsp)
movq %rcx, 0xb0(%rsp)
movq %r8, 0xa8(%rsp)
movq $0x0, 0x90(%rsp)
movb $0x0, 0x67(%rsp)
movl $0x0, 0x60(%rsp)
cmpq $0x0, 0xa8(%rsp)
je 0x10fa4e
movq 0xa8(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x10fa16
jmp 0x10fa4e
movq 0xa45bb(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x4e63f(%rip), %rsi     # 0x15e066
leaq 0x4ec1a(%rip), %rdx     # 0x15e648
leaq 0x7d2b9(%rip), %rcx     # 0x18ccee
leaq 0x74cc7(%rip), %r8      # 0x184703
movl $0x41, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x10fa50
jmp 0x10fa52
cmpq $0x0, 0xc8(%rsp)
je 0x10fa7e
cmpq $0x0, 0xc0(%rsp)
je 0x10fa7e
cmpq $0x0, 0xb8(%rsp)
je 0x10fa7e
cmpq $0x0, 0xb0(%rsp)
jne 0x10fab6
movq 0xa4553(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x4e5d7(%rip), %rsi     # 0x15e066
leaq 0x74de2(%rip), %rdx     # 0x184878
leaq 0x7d251(%rip), %rcx     # 0x18ccee
leaq 0x74c5f(%rip), %r8      # 0x184703
movl $0x42, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x10fab8
movq 0xc8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x10fadb
callq 0x14ad00
movq %rax, %rcx
movq 0xc8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0xc8(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x19940
movq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x14ad80
movq %rax, 0x88(%rsp)
cmpq $0x0, 0x88(%rsp)
je 0x10fbda
movq 0xc8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x10fb9d
movq 0xc8(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x19940
movq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0x86470
cmpq $0x0, %rax
je 0x10fb9d
movq 0xa8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x19940
movq 0x38(%rsp), %rdi
movq %rax, %rdx
leaq 0x74d14(%rip), %rsi     # 0x18489a
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0xd4(%rsp) # imm = 0xFFFFFFFF
jmp 0x10feed
movq 0x88(%rsp), %rax
movq (%rax), %rcx
movq 0xc0(%rsp), %rax
movq %rcx, (%rax)
movq 0x88(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0xb8(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0xd4(%rsp)
jmp 0x10feed
callq 0x18f00
movq %rax, 0x70(%rsp)
callq 0x18f00
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x19940
movq %rax, 0x30(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x19a00
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq %rax, %rdx
callq 0x851e0
movq 0xc8(%rsp), %rax
testb $0x1, 0x28(%rax)
je 0x10fc48
movq 0x70(%rsp), %rdi
leaq 0x74c97(%rip), %rsi     # 0x1848da
callq 0x18fb0
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x191b0
movq 0xc8(%rsp), %rax
testb $0x1, 0x28(%rax)
je 0x10fc76
movq 0x70(%rsp), %rdi
leaq 0x74c6b(%rip), %rsi     # 0x1848dc
callq 0x18fb0
movq $0x0, 0xa0(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x60(%rsp)
movb %al, 0x27(%rsp)
jne 0x10fcaa
movq 0xa0(%rsp), %rax
movq 0xc8(%rsp), %rcx
cmpq 0x10(%rcx), %rax
setb %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x10fcb7
jmp 0x10fe86
movq 0xc8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xa0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x58(%rsp)
movq $0x0, 0x98(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x60(%rsp)
movb %al, 0x26(%rsp)
jne 0x10fd16
movq 0x98(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rdi
callq 0x10d180
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
setb %al
movb %al, 0x26(%rsp)
movb 0x26(%rsp), %al
testb $0x1, %al
jne 0x10fd23
jmp 0x10fe62
movq 0x58(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x10c710
movq %rax, 0x50(%rsp)
movq 0x70(%rsp), %rdi
callq 0x19940
movq %rax, %rsi
movq 0x50(%rsp), %rdx
movq 0xa8(%rsp), %rcx
leaq 0x67(%rsp), %rdi
callq 0x855f0
movl %eax, 0x60(%rsp)
cmpl $0x0, 0x60(%rsp)
jne 0x10fe47
testb $0x1, 0x67(%rsp)
je 0x10fe47
movq 0x90(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x90(%rsp)
cmpq $0x1, 0x90(%rsp)
jbe 0x10fdd4
movq 0xa8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x19940
movq 0x10(%rsp), %rdi
movq %rax, %rdx
leaq 0x74ada(%rip), %rsi     # 0x18489a
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x60(%rsp) # imm = 0xFFFFFFFF
jmp 0x10fe62
movq 0xa0(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq %rcx, (%rax)
movq 0x98(%rsp), %rcx
movq 0xb8(%rsp), %rax
movq %rcx, (%rax)
movq 0xa0(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0xc8(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x19940
movq 0x8(%rsp), %rdi
movq %rax, %rsi
leaq 0x78(%rsp), %rdx
callq 0x14adf0
jmp 0x10fe49
movq 0x98(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x98(%rsp)
jmp 0x10fce0
testb $0x1, 0x67(%rsp)
je 0x10fe6b
jmp 0x10fe86
jmp 0x10fe6d
movq 0xa0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xa0(%rsp)
jmp 0x10fc82
movq 0x70(%rsp), %rdi
callq 0x1afc0
movq 0x68(%rsp), %rdi
callq 0x1afc0
cmpl $0x0, 0x60(%rsp)
jne 0x10fee2
cmpq $0x0, 0x90(%rsp)
jne 0x10fee2
movq 0xa8(%rsp), %rax
movq %rax, (%rsp)
movq 0xb0(%rsp), %rdi
callq 0x19940
movq (%rsp), %rdi
movq %rax, %rdx
leaq 0x74a19(%rip), %rsi     # 0x1848ec
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x60(%rsp) # imm = 0xFFFFFFFF
movl 0x60(%rsp), %eax
movl %eax, 0xd4(%rsp)
movl 0xd4(%rsp), %eax
addq $0xd8, %rsp
retq
nopl (%rax)