// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/xrf_checker.c
// Function: gt_xrf_checker_is_valid
bool gt_xrf_checker_is_valid(GtXRFChecker *xrc, const char *value, GtError *err)
{
  bool valid = true;
  char *myvalue = gt_cstr_dup(value),
       *dbid = NULL,
       *localid = NULL;
  GtXRFAbbrEntry *e;
  GtUword nof_tokens, i;
  gt_assert(xrc && value);
  gt_error_check(err);

  /* XXX: Thread safety! */
  gt_splitter_reset(xrc->splitter);
  gt_splitter_split(xrc->splitter, myvalue, strlen(myvalue), ',');
  nof_tokens = gt_splitter_size(xrc->splitter);

  for (i = 0; valid && i < nof_tokens; i++) {
    dbid = gt_splitter_get_token(xrc->splitter, i);

    if (!(localid = strchr(dbid, ':'))) {
      gt_error_set(err, "xref \"%s\": separator colon missing", value);
      valid = false;
    }
    if (valid) {
      *localid = '\0';
      if (*(++localid) == '\0') {
        gt_error_set(err, "xref \"%s\": local ID (part after colon) missing",
                     value);
        valid = false;
      }
    }
    if (valid) {
      gt_assert(dbid && localid);
      if (!(e = gt_hashmap_get(xrc->abbrvs, dbid))) {
        gt_error_set(err, "xref \"%s\": unknown database abbreviation \"%s\"",
                     value, dbid);
        valid = false;
      }
    }
    if (valid) {
      /* TODO: use #defines here. */
      const char *regex = NULL;
      gt_assert(e);
      if ((regex = gt_xrf_abbr_entry_get_value(e, "local_id_syntax"))) {
        bool match = false;
        GT_UNUSED int rval;
        rval = gt_grep(&match, regex, localid, NULL);
        gt_assert(rval == 0); /* regex format has been checked before */
        if (!match) {
          gt_error_set(err, "xref \"%s\": local ID \"%s\" does not "
                            "conform to syntax \"%s\" for the "
                            "%s database",
                       value, localid, regex, dbid);
          valid = false;
        }
      }
    }
  }

  gt_free(myvalue);
  return valid;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
movq %rsi, %rdi
callq 0x728c0
testq %r12, %r12
je 0x4b96c
testq %r15, %r15
je 0x4b96c
movq %rax, %r14
testq %r13, %r13
je 0x4b7ae
movq %r13, %rdi
callq 0x34fea
testb %al, %al
jne 0x4b971
movq 0x10(%r12), %rdi
callq 0x3a149
movq 0x10(%r12), %rbx
movq %r14, %rdi
callq 0xb260
movq %rbx, %rdi
movq %r14, 0x20(%rsp)
movq %r14, %rsi
movq %rax, %rdx
movl $0x2c, %ecx
callq 0x39f4f
movq 0x10(%r12), %rdi
callq 0x3a16c
testq %rax, %rax
je 0x4b8f0
movq %rax, %r14
movq %r13, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movb $0x1, %bpl
movl $0x1, %r13d
movq %r12, 0x18(%rsp)
leaq -0x1(%r13), %rsi
movq 0x10(%r12), %rdi
callq 0x3a130
movq %rax, %rbx
movq %rax, %rdi
movl $0x3a, %esi
callq 0xb210
testq %rax, %rax
je 0x4b8f5
testb $0x1, %bpl
je 0x4b8d8
movq %rax, %r15
movb $0x0, (%rax)
cmpb $0x0, 0x1(%rax)
je 0x4b8fe
testq %rbx, %rbx
je 0x4b962
movq (%r12), %rdi
movq %rbx, %rsi
callq 0x775ed
testq %rax, %rax
je 0x4b91a
movq %r14, %r12
movq %rax, %rdi
leaq 0x9eabe(%rip), %rsi     # 0xea335
callq 0x86699
testq %rax, %rax
je 0x4b8d0
movq %rax, %r14
incq %r15
movb $0x0, 0x7(%rsp)
leaq 0x7(%rsp), %rdi
movq %rax, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x76a19
testl %eax, %eax
jne 0x4b967
cmpb $0x0, 0x7(%rsp)
jne 0x4b8d0
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
leaq 0x9ea8a(%rip), %rsi     # 0xea345
movq 0x10(%rsp), %rdx
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x34f1f
movq %r12, %r14
movq 0x18(%rsp), %r12
testb $0x1, %bpl
je 0x4b937
leaq 0x1(%r13), %rax
cmpq %r14, %r13
movq %rax, %r13
jb 0x4b80b
jmp 0x4b937
movb $0x1, %bpl
jmp 0x4b937
leaq 0x9e9a9(%rip), %rsi     # 0xea2a5
jmp 0x4b905
leaq 0x9e9c3(%rip), %rsi     # 0xea2c8
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x34f1f
jmp 0x4b937
leaq 0x9e9e6(%rip), %rsi     # 0xea307
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x34f1f
leaq 0x9e94c(%rip), %rsi     # 0xea28a
movq 0x20(%rsp), %rdi
movl $0x65, %edx
callq 0x35c27
andb $0x1, %bpl
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x152f5
callq 0x152be
callq 0x15250
callq 0x15287