// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movb $0x1, 0x5f(%rsp)
movq 0x68(%rsp), %rdi
callq 0x7c400
movq %rax, 0x50(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0x39a89
cmpq $0x0, 0x68(%rsp)
jne 0x39ac1
movq 0x17a548(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x1245cc(%rip), %rsi    # 0x15e066
leaq 0x12d9a0(%rip), %rdx    # 0x167441
leaq 0x12d9a6(%rip), %rcx    # 0x16744e
leaq 0x12d9b7(%rip), %r8     # 0x167466
movl $0x32, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x39ac3
jmp 0x39ac5
cmpq $0x0, 0x60(%rsp)
je 0x39b15
movq 0x60(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x39add
jmp 0x39b15
movq 0x17a4f4(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x124578(%rip), %rsi    # 0x15e066
leaq 0x124b53(%rip), %rdx    # 0x15e648
leaq 0x12d952(%rip), %rcx    # 0x16744e
leaq 0x12d963(%rip), %r8     # 0x167466
movl $0x33, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x39b17
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x16fa0
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rdi
callq 0xb240
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
movl $0x2c, %ecx
callq 0x16a30
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x17010
movq %rax, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
xorl %eax, %eax
testb $0x1, 0x5f(%rsp)
movb %al, 0x7(%rsp)
je 0x39b98
movq 0x28(%rsp), %rax
cmpq 0x30(%rsp), %rax
setb %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x39ba5
jmp 0x39df8
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x28(%rsp), %rsi
callq 0x16f20
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
movl $0x3a, %esi
callq 0xb1f0
movq %rax, 0x40(%rsp)
cmpq $0x0, %rax
jne 0x39bf4
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rdx
leaq 0x12d899(%rip), %rsi    # 0x167481
movb $0x0, %al
callq 0xc0d0
movb $0x0, 0x5f(%rsp)
testb $0x1, 0x5f(%rsp)
je 0x39c3c
movq 0x40(%rsp), %rax
movb $0x0, (%rax)
movq 0x40(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x40(%rsp)
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x39c3a
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rdx
leaq 0x12d876(%rip), %rsi    # 0x1674a4
movb $0x0, %al
callq 0xc0d0
movb $0x0, 0x5f(%rsp)
jmp 0x39c3c
testb $0x1, 0x5f(%rsp)
je 0x39cd4
jmp 0x39c49
cmpq $0x0, 0x48(%rsp)
je 0x39c59
cmpq $0x0, 0x40(%rsp)
jne 0x39c91
movq 0x17a378(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x1243fc(%rip), %rsi    # 0x15e066
leaq 0x12d862(%rip), %rdx    # 0x1674d3
leaq 0x12d7d6(%rip), %rcx    # 0x16744e
leaq 0x12d7e7(%rip), %r8     # 0x167466
movl $0x4a, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x39c93
movq 0x70(%rsp), %rax
movq (%rax), %rdi
movq 0x48(%rsp), %rsi
callq 0x86470
movq %rax, 0x38(%rsp)
cmpq $0x0, %rax
jne 0x39cd2
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rdx
movq 0x48(%rsp), %rcx
leaq 0x12d81d(%rip), %rsi    # 0x1674e3
movb $0x0, %al
callq 0xc0d0
movb $0x0, 0x5f(%rsp)
jmp 0x39cd4
testb $0x1, 0x5f(%rsp)
je 0x39de3
movq $0x0, 0x20(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x39d28
movq 0x17a2e1(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x124365(%rip), %rsi    # 0x15e066
leaq 0x1268b7(%rip), %rdx    # 0x1605bf
leaq 0x12d73f(%rip), %rcx    # 0x16744e
leaq 0x12d750(%rip), %r8     # 0x167466
movl $0x54, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x39d2a
movq 0x38(%rsp), %rdi
leaq 0x12d7db(%rip), %rsi    # 0x167511
callq 0xa9070
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x39de1
movb $0x0, 0x1f(%rsp)
movq 0x20(%rsp), %rsi
movq 0x40(%rsp), %rdx
leaq 0x1f(%rsp), %rdi
xorl %eax, %eax
movl %eax, %ecx
callq 0x855f0
movl %eax, 0x18(%rsp)
cmpl $0x0, 0x18(%rsp)
je 0x39daa
movq 0x17a25f(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x1242e3(%rip), %rsi    # 0x15e066
leaq 0x127985(%rip), %rdx    # 0x16170f
leaq 0x12d6bd(%rip), %rcx    # 0x16744e
leaq 0x12d6ce(%rip), %r8     # 0x167466
movl $0x59, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x39dac
testb $0x1, 0x1f(%rsp)
jne 0x39ddf
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq 0x20(%rsp), %r8
movq 0x48(%rsp), %r9
leaq 0x12d74e(%rip), %rsi    # 0x167521
movb $0x0, %al
callq 0xc0d0
movb $0x0, 0x5f(%rsp)
jmp 0x39de1
jmp 0x39de3
jmp 0x39de5
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x39b7a
movq 0x50(%rsp), %rdi
leaq 0x12d662(%rip), %rsi    # 0x167466
movl $0x65, %edx
callq 0xdab0
movb 0x5f(%rsp), %al
andb $0x1, %al
addq $0x78, %rsp
retq
nopl (%rax)