// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movq %rsi, %rdi
callq 0x4f8ae
movq %rbx, 0x10(%rsp)
testq %rbx, %rbx
je 0x299d1
testq %r15, %r15
je 0x299d1
movq %rax, %r12
testq %r13, %r13
je 0x297db
movq %r13, %rdi
callq 0xc103
testb %al, %al
jne 0x299fb
movq 0x10(%rsp), %r14
movq 0x10(%r14), %rdi
callq 0x127af
movq 0x10(%r14), %rbx
movq %r12, %rdi
callq 0xb260
pushq $0x2c
popq %rcx
movq %rbx, %rdi
movq %r12, 0x18(%rsp)
movq %r12, %rsi
movq %rax, %rdx
callq 0x124e1
movq 0x10(%r14), %rdi
callq 0x127fd
movq %rax, 0x20(%rsp)
movb $0x1, %bpl
xorl %r12d, %r12d
movq %r15, 0x8(%rsp)
testb $0x1, %bpl
je 0x29948
cmpq 0x20(%rsp), %r12
jae 0x29948
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
movq %r12, %rsi
callq 0x12765
movq %rax, %rbx
movq %rax, %rdi
pushq $0x3a
popq %rsi
callq 0xb210
testq %rax, %rax
je 0x29901
movq %rax, %r14
movb $0x0, (%rax)
cmpb $0x0, 0x1(%rax)
je 0x2990f
testq %rbx, %rbx
je 0x29971
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x55ef6
testq %rax, %rax
je 0x2992d
movq %r13, %r15
movq %rax, %rdi
leaq 0xa9a85(%rip), %rsi     # 0xd3325
callq 0x66632
testq %rax, %rax
je 0x298f7
movq %rax, %r13
incq %r14
movb $0x0, 0x7(%rsp)
leaq 0x7(%rsp), %rdi
movq %rax, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x554b5
testl %eax, %eax
jne 0x2999b
cmpb $0x0, 0x7(%rsp)
jne 0x298f7
xorl %ebp, %ebp
movq %r15, %rdi
leaq 0xa9a53(%rip), %rsi     # 0xd3335
movq 0x8(%rsp), %rdx
movq %r14, %rcx
movq %r13, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0xc007
movq %r15, %r13
movq 0x8(%rsp), %r15
jmp 0x29925
xorl %ebp, %ebp
movq %r13, %rdi
leaq 0xa9988(%rip), %rsi     # 0xd3295
jmp 0x2991b
xorl %ebp, %ebp
movq %r13, %rdi
leaq 0xa999d(%rip), %rsi     # 0xd32b8
movq %r15, %rdx
xorl %eax, %eax
callq 0xc007
incq %r12
jmp 0x29824
xorl %ebp, %ebp
movq %r13, %rdi
leaq 0xa99be(%rip), %rsi     # 0xd32f7
movq %r15, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0xc007
jmp 0x29925
leaq 0xa992b(%rip), %rsi     # 0xd327a
pushq $0x65
popq %rdx
movq 0x18(%rsp), %rdi
callq 0xd249
andb $0x1, %bpl
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x104640(%rip), %rax    # 0x12dfb8
movq (%rax), %rdi
leaq 0xa06e4(%rip), %rsi     # 0xca066
leaq 0xa995e(%rip), %rdx     # 0xd32e7
leaq 0xa98d2(%rip), %rcx     # 0xd3262
leaq 0xa98e3(%rip), %r8      # 0xd327a
pushq $0x4a
jmp 0x299c3
movq 0x104616(%rip), %rax    # 0x12dfb8
movq (%rax), %rdi
leaq 0xa06ba(%rip), %rsi     # 0xca066
leaq 0xa3cec(%rip), %rdx     # 0xcd69f
leaq 0xa98a8(%rip), %rcx     # 0xd3262
leaq 0xa98b9(%rip), %r8      # 0xd327a
pushq $0x59
popq %r9
xorl %eax, %eax
callq 0xb8c0
callq 0xb300
movq 0x1045e0(%rip), %rax    # 0x12dfb8
movq (%rax), %rdi
leaq 0xa0684(%rip), %rsi     # 0xca066
leaq 0xa986c(%rip), %rdx     # 0xd3255
leaq 0xa9872(%rip), %rcx     # 0xd3262
leaq 0xa9883(%rip), %r8      # 0xd327a
pushq $0x32
jmp 0x299c3
movq 0x1045b6(%rip), %rax    # 0x12dfb8
movq (%rax), %rdi
leaq 0xa065a(%rip), %rsi     # 0xca066
leaq 0xa0c46(%rip), %rdx     # 0xca659
leaq 0xa9848(%rip), %rcx     # 0xd3262
leaq 0xa9859(%rip), %r8      # 0xd327a
pushq $0x33
jmp 0x299c3