// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/reads2twobit.c
// Function: gt_reads2twobit_add_library
int gt_reads2twobit_add_library(GtReads2Twobit *r2t, const GtStr *libspec,
    GtError *err)
{
  GtSplitter *s1, *s2;
  char *libspec_copy;
  int had_err = 0;

  gt_assert(r2t != NULL);
  gt_assert(libspec != NULL);
  gt_assert(gt_str_length(libspec) > 0);
  libspec_copy = gt_malloc(sizeof (*libspec_copy) *
      (gt_str_length(libspec) + 1UL));
  (void)strcpy(libspec_copy, gt_str_get(libspec));
  s1 = gt_splitter_new();
  gt_splitter_split(s1, libspec_copy, gt_str_length(libspec),
      GT_READS2TWOBIT_LIBSPECSEP);
  gt_log_log("reads2twobit add library: %s", gt_str_get(libspec));
  if (gt_splitter_size(s1) == 1UL)
  {
    gt_reads2twobit_add(r2t, false, libspec, NULL, 0, 0);
  }
  else if (gt_splitter_size(s1) < 4UL)
  {
    GtStr *filename1, *filename2;
    GtUword insertlength = 0, stdev = 0;
    char *insertspec, *insertspec_copy;
    r2t->has_paired = true;
    filename1 = gt_str_new_cstr(gt_splitter_get_token(s1, 0));
    if (gt_splitter_size(s1) == 3UL)
    {
      filename2 = gt_str_new_cstr(gt_splitter_get_token(s1, 1UL));
      insertspec = gt_splitter_get_token(s1, 2UL);
    }
    else
    {
      filename2 = NULL;
      insertspec = gt_splitter_get_token(s1, 1UL);
    }
    s2 = gt_splitter_new();
    insertspec_copy = gt_malloc(sizeof (*insertspec_copy) *
        (strlen(insertspec) + 1UL));
    (void)strcpy(insertspec_copy, insertspec);
    gt_splitter_split(s2, insertspec_copy, (GtUword)strlen(insertspec),
      GT_READS2TWOBIT_INSERTSEP);
    if (gt_splitter_size(s2) <= 2UL)
    {
      had_err = gt_parse_uword(&insertlength, gt_splitter_get_token(s2, 0));
      if (gt_splitter_size(s2) == 2UL && !had_err)
      {
        had_err = gt_parse_uword(&stdev, gt_splitter_get_token(s2, 1UL));
      }
    }
    if (gt_splitter_size(s2) > 2UL || had_err)
    {
      gt_error_set(err, "insert specification not valid: %s\nthe correct "
          "syntax is \"insertlength[%cstdev]\"", insertspec,
          GT_READS2TWOBIT_INSERTSEP);
    }
    if (!had_err)
    {
      gt_reads2twobit_add(r2t, true, filename1, filename2, insertlength, stdev);
    }
    gt_str_delete(filename1);
    gt_str_delete(filename2);
    gt_free(insertspec_copy);
    gt_splitter_delete(s2);
  }
  else
  {
    gt_error_set(err, "library specification not valid: %s\nthe correct "
        "syntax is \"filename[[%cfilename2]%cinsertlength[%cstdev]]\"\n"
        "(filenames are not allowed to contain \"%c\"",
        gt_str_get(libspec),
      GT_READS2TWOBIT_LIBSPECSEP, GT_READS2TWOBIT_LIBSPECSEP,
      GT_READS2TWOBIT_INSERTSEP, GT_READS2TWOBIT_LIBSPECSEP);
    had_err = -1;
  }
  gt_free(libspec_copy);
  gt_splitter_delete(s1);
  return had_err;
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movl $0x0, 0x74(%rsp)
cmpq $0x0, 0xa0(%rsp)
jne 0x2a0b9a
movq 0x39b437(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2754a0(%rip), %rsi    # 0x516013
leaq 0x2e444f(%rip), %rdx    # 0x584fc9
leaq 0x2e449b(%rip), %rcx    # 0x58501c
leaq 0x2e4428(%rip), %r8     # 0x584fb0
movl $0xb2, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a0b9c
jmp 0x2a0b9e
cmpq $0x0, 0x98(%rsp)
jne 0x2a0be1
movq 0x39b3f0(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x275459(%rip), %rsi    # 0x516013
leaq 0x2e4477(%rip), %rdx    # 0x585038
leaq 0x2e4454(%rip), %rcx    # 0x58501c
leaq 0x2e43e1(%rip), %r8     # 0x584fb0
movl $0xb3, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a0be3
jmp 0x2a0be5
movq 0x98(%rsp), %rdi
callq 0x11dfa0
cmpq $0x0, %rax
ja 0x2a0c30
movq 0x39b3a1(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x27540a(%rip), %rsi    # 0x516013
leaq 0x2e4438(%rip), %rdx    # 0x585048
leaq 0x2e4405(%rip), %rcx    # 0x58501c
leaq 0x2e4392(%rip), %r8     # 0x584fb0
movl $0xb4, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a0c32
movq 0x98(%rsp), %rdi
callq 0x11dfa0
movq %rax, %rdi
addq $0x1, %rdi
shlq $0x0, %rdi
leaq 0x2e435f(%rip), %rsi    # 0x584fb0
movl $0xb6, %edx
callq 0xe80f0
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x98(%rsp), %rdi
callq 0x11dee0
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x19700
callq 0x11afb0
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x98(%rsp), %rdi
callq 0x11dfa0
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq %rax, %rdx
movl $0x3a, %ecx
callq 0x11afd0
movq 0x98(%rsp), %rdi
callq 0x11dee0
movq %rax, %rsi
leaq 0x2e4380(%rip), %rdi    # 0x585063
movb $0x0, %al
callq 0xe7740
movq 0x88(%rsp), %rdi
callq 0x11b5b0
cmpq $0x1, %rax
jne 0x2a0d24
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rdx
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %rcx
movq %r9, %r8
callq 0x2a09c0
jmp 0x2a0fc8
movq 0x88(%rsp), %rdi
callq 0x11b5b0
cmpq $0x4, %rax
jae 0x2a0f78
movq $0x0, 0x58(%rsp)
movq $0x0, 0x50(%rsp)
movq 0xa0(%rsp), %rax
movb $0x1, 0x90(%rax)
movq 0x88(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x11b4c0
movq %rax, %rdi
callq 0x11d510
movq %rax, 0x68(%rsp)
movq 0x88(%rsp), %rdi
callq 0x11b5b0
cmpq $0x3, %rax
jne 0x2a0dc5
movq 0x88(%rsp), %rdi
movl $0x1, %esi
callq 0x11b4c0
movq %rax, %rdi
callq 0x11d510
movq %rax, 0x60(%rsp)
movq 0x88(%rsp), %rdi
movl $0x2, %esi
callq 0x11b4c0
movq %rax, 0x48(%rsp)
jmp 0x2a0de5
movq $0x0, 0x60(%rsp)
movq 0x88(%rsp), %rdi
movl $0x1, %esi
callq 0x11b4c0
movq %rax, 0x48(%rsp)
callq 0x11afb0
movq %rax, 0x80(%rsp)
movq 0x48(%rsp), %rdi
callq 0x192b0
movq %rax, %rdi
addq $0x1, %rdi
shlq $0x0, %rdi
leaq 0x2e41a2(%rip), %rsi    # 0x584fb0
movl $0xd3, %edx
callq 0xe80f0
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x19700
movq 0x80(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rdi
callq 0x192b0
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rax, %rdx
movl $0x2c, %ecx
callq 0x11afd0
movq 0x80(%rsp), %rdi
callq 0x11b5b0
cmpq $0x2, %rax
ja 0x2a0ed8
movq 0x80(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x11b4c0
movq %rax, %rsi
leaq 0x58(%rsp), %rdi
callq 0xf86d0
movl %eax, 0x74(%rsp)
movq 0x80(%rsp), %rdi
callq 0x11b5b0
cmpq $0x2, %rax
jne 0x2a0ed6
cmpl $0x0, 0x74(%rsp)
jne 0x2a0ed6
movq 0x80(%rsp), %rdi
movl $0x1, %esi
callq 0x11b4c0
movq %rax, %rsi
leaq 0x50(%rsp), %rdi
callq 0xf86d0
movl %eax, 0x74(%rsp)
jmp 0x2a0ed8
movq 0x80(%rsp), %rdi
callq 0x11b5b0
cmpq $0x2, %rax
ja 0x2a0ef2
cmpl $0x0, 0x74(%rsp)
je 0x2a0f12
movq 0x90(%rsp), %rdi
movq 0x48(%rsp), %rdx
leaq 0x2e417a(%rip), %rsi    # 0x585080
movl $0x2c, %ecx
movb $0x0, %al
callq 0xd88c0
cmpl $0x0, 0x74(%rsp)
jne 0x2a0f3f
movq 0xa0(%rsp), %rdi
movq 0x68(%rsp), %rdx
movq 0x60(%rsp), %rcx
movq 0x58(%rsp), %r8
movq 0x50(%rsp), %r9
movl $0x1, %esi
callq 0x2a09c0
movq 0x68(%rsp), %rdi
callq 0x11f560
movq 0x60(%rsp), %rdi
callq 0x11f560
movq 0x40(%rsp), %rdi
leaq 0x2e4051(%rip), %rsi    # 0x584fb0
movl $0xeb, %edx
callq 0xe88c0
movq 0x80(%rsp), %rdi
callq 0x11b600
jmp 0x2a0fc6
movq 0x90(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x98(%rsp), %rdi
callq 0x11dee0
movq 0x10(%rsp), %rdi
movq %rax, %rdx
leaq 0x2e4130(%rip), %rsi    # 0x5850d1
movl $0x3a, %r8d
movl $0x2c, %r9d
movl %r8d, %ecx
movl $0x3a, (%rsp)
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x2a0fc8
movq 0x78(%rsp), %rdi
leaq 0x2e3fdc(%rip), %rsi    # 0x584fb0
movl $0xf8, %edx
callq 0xe88c0
movq 0x88(%rsp), %rdi
callq 0x11b600
movl 0x74(%rsp), %eax
addq $0xa8, %rsp
retq
nopw (%rax,%rax)