// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_extracttarget.c
// Function: extracttarget_from_seqfiles
static int extracttarget_from_seqfiles(const char *target,
                                       GtStrArray *seqfiles,
                                       GtError *err)
{
  GtStr *unescaped_target;
  char *escaped_target;
  GtSplitter *splitter;
  GtUword i;
  int had_err = 0;
  gt_error_check(err);
  gt_assert(target && seqfiles);
  splitter = gt_splitter_new();
  unescaped_target = gt_str_new();
  escaped_target = gt_cstr_dup(target);
  gt_splitter_split(splitter, escaped_target, strlen(escaped_target), ',');
  for (i = 0; !had_err && i < gt_splitter_size(splitter); i++) {
    GtSplitter *blank_splitter;
    char *token = gt_splitter_get_token(splitter, i);
    blank_splitter = gt_splitter_new();
    gt_splitter_split(blank_splitter, token, strlen(token), ' ');
    had_err = gt_gff3_unescape(unescaped_target,
                               gt_splitter_get_token(blank_splitter, 0),
                               strlen(gt_splitter_get_token(blank_splitter, 0)),
                               err);
    if (!had_err) {
      GtUword j;
      for (j = 0; j < gt_str_array_size(seqfiles); j++) {
        GtUword k;
        GtBioseq *bioseq;
        if (!(bioseq =  gt_bioseq_new(gt_str_array_get(seqfiles, j), err))) {
          had_err = -1;
          break;
        }
        for (k = 0; k < gt_bioseq_number_of_sequences(bioseq); k++) {
          TargetInfo target_info;
          const char *desc = gt_bioseq_get_description(bioseq, k);
          target_info.bioseq = bioseq;
          target_info.seqnum = k;
          gt_string_matching_bmh(desc, strlen(desc),
                                 gt_str_get(unescaped_target),
                                 gt_str_length(unescaped_target), show_target,
                                 &target_info);
        }
        gt_bioseq_delete(bioseq);
      }
    }
    gt_splitter_delete(blank_splitter);
  }
  gt_free(escaped_target);
  gt_str_delete(unescaped_target);
  gt_splitter_delete(splitter);
  return had_err;
}

// Assembly:
subq $0xe8, %rsp
movq %rdi, 0xe0(%rsp)
movq %rsi, 0xd8(%rsp)
movq %rdx, 0xd0(%rsp)
movl $0x0, 0xac(%rsp)
cmpq $0x0, 0xd0(%rsp)
je 0x363b0
movq 0xd0(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x36378
jmp 0x363b0
movq 0x605c21(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4dfc8a(%rip), %rsi    # 0x516013
leaq 0x4dfe2f(%rip), %rdx    # 0x5161bf
leaq 0x4e7610(%rip), %rcx    # 0x51d9a7
leaq 0x4e74dc(%rip), %r8     # 0x51d87a
movl $0x6a, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x363b2
jmp 0x363b4
cmpq $0x0, 0xe0(%rsp)
je 0x363ca
cmpq $0x0, 0xd8(%rsp)
jne 0x36402
movq 0x605bcf(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4dfc38(%rip), %rsi    # 0x516013
leaq 0x4e75e1(%rip), %rdx    # 0x51d9c3
leaq 0x4e75be(%rip), %rcx    # 0x51d9a7
leaq 0x4e748a(%rip), %r8     # 0x51d87a
movl $0x6b, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x36404
callq 0x11afb0
movq %rax, 0xb8(%rsp)
callq 0x11d4a0
movq %rax, 0xc8(%rsp)
movq 0xe0(%rsp), %rdi
callq 0xa2db0
movq %rax, 0xc0(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0xc0(%rsp), %rdi
callq 0x192b0
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq %rax, %rdx
movl $0x2c, %ecx
callq 0x11afd0
movq $0x0, 0xb0(%rsp)
xorl %eax, %eax
cmpl $0x0, 0xac(%rsp)
movb %al, 0x57(%rsp)
jne 0x364b9
movq 0xb0(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0xb8(%rsp), %rdi
callq 0x11b5b0
movq %rax, %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
setb %al
movb %al, 0x57(%rsp)
movb 0x57(%rsp), %al
testb $0x1, %al
jne 0x364c6
jmp 0x3673e
movq 0xb8(%rsp), %rdi
movq 0xb0(%rsp), %rsi
callq 0x11b4c0
movq %rax, 0x98(%rsp)
callq 0x11afb0
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x98(%rsp), %rdi
callq 0x192b0
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq %rax, %rdx
movl $0x20, %ecx
callq 0x11afd0
movq 0xc8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xa0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x11b4c0
movq %rax, 0x40(%rsp)
movq 0xa0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x11b4c0
movq %rax, %rdi
callq 0x192b0
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq %rax, %rdx
movq 0xd0(%rsp), %rcx
callq 0x173740
movl %eax, 0xac(%rsp)
cmpl $0x0, 0xac(%rsp)
jne 0x36718
movq $0x0, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xd8(%rsp), %rdi
callq 0x11fcc0
movq %rax, %rcx
movq 0x20(%rsp), %rax
cmpq %rcx, %rax
jae 0x36716
movq 0xd8(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x11f8c0
movq %rax, %rdi
movq 0xd0(%rsp), %rsi
callq 0x84600
movq %rax, 0x80(%rsp)
cmpq $0x0, %rax
jne 0x36613
movl $0xffffffff, 0xac(%rsp) # imm = 0xFFFFFFFF
jmp 0x36716
movq $0x0, 0x88(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x80(%rsp), %rdi
callq 0x85910
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jae 0x366f0
movq 0x80(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0x84ea0
movq %rax, 0x68(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movq 0x68(%rsp), %rdi
callq 0x192b0
movq %rax, 0x8(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x11dee0
movq %rax, 0x10(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x11dfa0
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rax, %rcx
leaq 0xb3(%rip), %r8         # 0x36780
leaq 0x70(%rsp), %r9
callq 0x1e9a30
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0x3661f
movq 0x80(%rsp), %rdi
callq 0x84960
movq 0x90(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x90(%rsp)
jmp 0x365a5
jmp 0x36718
movq 0xa0(%rsp), %rdi
callq 0x11b600
movq 0xb0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xb0(%rsp)
jmp 0x3647d
movq 0xc0(%rsp), %rdi
leaq 0x4e712d(%rip), %rsi    # 0x51d87a
movl $0x91, %edx
callq 0xe88c0
movq 0xc8(%rsp), %rdi
callq 0x11f560
movq 0xb8(%rsp), %rdi
callq 0x11b600
movl 0xac(%rsp), %eax
addq $0xe8, %rsp
retq