// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/tools/gt_compreads_compress.c
// Function: gt_compreads_compress_arguments_check
static int gt_compreads_compress_arguments_check(GT_UNUSED int rest_argc,
                                       void *tool_arguments,
                                       GtError *err)
{
  int had_err = 0;
  GtCsrHcrEncodeArguments *arguments = tool_arguments;
  GtSplitter *splitter = NULL;
  GtStr *buffer;
  gt_error_check(err);
  gt_assert(arguments);

  if (gt_str_array_size(arguments->files) == 0) {
    gt_error_set(err, "option \"-files\" is mandatory and requires"
                      " at least one filename as argument!");
    had_err = -1;
  }

  if (!had_err) {
    if (gt_str_length(arguments->name) == 0) {
      if (gt_str_array_size(arguments->files) > 1UL) {
        gt_error_set(err, "option \"-name\" needs to be specified"
                          " if more than one file is given");
        had_err = -1;
      }
      else {
        GtUword i;
        char *basename;
        splitter = gt_splitter_new();
        basename = gt_basename(gt_str_array_get(arguments->files, 0));
        buffer = gt_str_new_cstr(basename);
        gt_splitter_split(splitter, gt_str_get(buffer), gt_str_length(buffer),
                          '.');
        for (i = 0; i < gt_splitter_size(splitter) - 1; i++) {
          gt_str_append_cstr(arguments->name,
                             gt_splitter_get_token(splitter, i));
          if (i < gt_splitter_size(splitter) - 2)
            gt_str_append_char(arguments->name, '.');
        }
        gt_free(basename);
        gt_splitter_delete(splitter);
        gt_str_delete(buffer);
      }
    }
  }

  if (!had_err) {
    char *sampling_type = gt_str_get(arguments->method);
    static const char *methods[] = { "page", "regular", "none" };

    if (!strcmp(methods[0], sampling_type)) {
      arguments->pagewise = true;
      if (arguments->srate == GT_UNDEF_UWORD)
        arguments->srate = GT_SAMPLING_DEFAULT_PAGE_RATE;
      else if (arguments->srate == 0) {
        gt_error_set(err, "page sampling was chosen, but sampling"
                          " rate was set to "GT_WU"! this seems wrong.",
                     arguments->srate);
        had_err = -1;
      }
    }
    else if (!strcmp(methods[1], sampling_type)) {
      arguments->regular = true;
      if (arguments->srate == GT_UNDEF_UWORD)
        arguments->srate = GT_SAMPLING_DEFAULT_REGULAR_RATE;
      else if (arguments->srate == 0) {
        gt_error_set(err, "regular sampling was chosen, but sampling rate "
                          " was set to "GT_WU"! this seems wrong.",
                     arguments->srate);
        had_err = -1;
      }
    }
    else if (!strcmp(methods[2], sampling_type)) {
      if (arguments->srate == GT_UNDEF_UWORD)
        arguments->srate = 0;
      else if (arguments->srate != 0) {
        gt_error_set(err, "no sampling was chosen, but sampling rate was"
                          " set to "GT_WU"! this seems wrong.",
                          arguments->srate);
        had_err = -1;
      }
    }
    else {
      gt_error_set(err, "somethings wrong with the stype option");
      had_err = -1;
    }
  }

  if (!had_err) {
    if (arguments->arg_range.start != GT_UNDEF_UWORD) {
      if (arguments->arg_range.start <= (GtUword) UINT_MAX) {
        gt_safe_assign(arguments->qrng.start, arguments->arg_range.start);
        if (arguments->arg_range.end <= (GtUword) UINT_MAX)
          gt_safe_assign(arguments->qrng.end, arguments->arg_range.end);
        else
          had_err = -1;
      }
      else
        had_err = -1;
    }
    if (had_err)
      gt_error_set(err, "Range for qualities: value to large! larger than %u",
                   UINT_MAX);
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
testq %rdx, %rdx
je 0x1bd24
movq %rbx, %rdi
callq 0x89eb7
testb %al, %al
jne 0x1bfa3
testq %r14, %r14
je 0x1bf75
movq 0x20(%r14), %rdi
callq 0xae61c
testq %rax, %rax
je 0x1bd68
movq 0x18(%r14), %rdi
callq 0xad289
testq %rax, %rax
jne 0x1be40
movq 0x20(%r14), %rdi
callq 0xae61c
cmpq $0x2, %rax
jb 0x1bd74
leaq 0x2cb153(%rip), %rsi    # 0x2e6eb6
jmp 0x1be8c
leaq 0x2cb0fa(%rip), %rsi    # 0x2e6e69
jmp 0x1be8c
callq 0xab2f4
movq %rax, %r15
movq 0x20(%r14), %rdi
xorl %r12d, %r12d
xorl %esi, %esi
callq 0xae386
movq %rax, %rdi
callq 0x5a384
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0xacbd1
movq %rax, %rbp
movq %rax, %rdi
callq 0xad1fa
movq %rax, %r13
movq %rbp, 0x10(%rsp)
movq %rbp, %rdi
callq 0xad289
pushq $0x2e
popq %rbp
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
movl %ebp, %ecx
callq 0xab309
movq %r15, %rdi
callq 0xab625
decq %rax
cmpq %rax, %r12
jae 0x1be18
movq 0x18(%r14), %r13
movq %r15, %rdi
movq %r12, %rsi
callq 0xab58d
movq %r13, %rdi
movq %rax, %rsi
callq 0xacbfb
movq %r15, %rdi
callq 0xab625
addq $-0x2, %rax
cmpq %rax, %r12
jae 0x1be13
movq 0x18(%r14), %rdi
movl %ebp, %esi
callq 0xaced9
incq %r12
jmp 0x1bdcd
leaq 0x2cad6d(%rip), %rsi    # 0x2e6b8c
movq 0x8(%rsp), %rdi
movl $0xaa, %edx
callq 0x936f9
movq %r15, %rdi
callq 0xab666
movq 0x10(%rsp), %rdi
callq 0xae103
movq 0x10(%r14), %rdi
callq 0xad1fa
movq %rax, %r15
leaq 0x35aff0(%rip), %rdi    # 0x376e43
movq %rax, %rsi
callq 0x179e0
testl %eax, %eax
je 0x1beaa
leaq 0x3002db(%rip), %rdi    # 0x31c141
movq %r15, %rsi
callq 0x179e0
testl %eax, %eax
je 0x1becc
leaq 0x2cafc5(%rip), %rdi    # 0x2e6e3e
movq %r15, %rsi
callq 0x179e0
testl %eax, %eax
je 0x1beea
leaq 0x2cb15a(%rip), %rsi    # 0x2e6fe6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, 0x1(%r14)
movq 0x28(%r14), %rax
testq %rax, %rax
je 0x1bf48
cmpq $-0x1, %rax
jne 0x1befe
movq $0x64, 0x28(%r14)
jmp 0x1befe
movb $0x1, 0x2(%r14)
movq 0x28(%r14), %rax
testq %rax, %rax
je 0x1bf51
cmpq $-0x1, %rax
jne 0x1befe
movq $0x2710, 0x28(%r14)     # imm = 0x2710
jmp 0x1befe
movq 0x28(%r14), %rdx
testq %rdx, %rdx
je 0x1befe
cmpq $-0x1, %rdx
jne 0x1bf69
andq $0x0, 0x28(%r14)
movq 0x38(%r14), %rax
xorl %ebp, %ebp
cmpq $-0x1, %rax
je 0x1be99
movq %rax, %rcx
shrq $0x20, %rcx
jne 0x1bf2d
movl %eax, 0x30(%r14)
movq 0x40(%r14), %rax
movq %rax, %rcx
shrq $0x20, %rcx
jne 0x1bf2d
movl %eax, 0x34(%r14)
jmp 0x1be99
leaq 0x2cb0d9(%rip), %rsi    # 0x2e700d
pushq $-0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x89dbb
jmp 0x1be99
leaq 0x2cafab(%rip), %rsi    # 0x2e6efa
jmp 0x1bf58
leaq 0x2caff0(%rip), %rsi    # 0x2e6f48
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x89dbb
jmp 0x1be96
leaq 0x2cb02a(%rip), %rsi    # 0x2e6f9a
movq %rbx, %rdi
jmp 0x1bf5d
movq 0x41bfec(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2c908d(%rip), %rsi    # 0x2e5013
leaq 0x32c6c6(%rip), %rdx    # 0x348653
leaq 0x2caeaf(%rip), %rcx    # 0x2e6e43
leaq 0x2cabf1(%rip), %r8     # 0x2e6b8c
movl $0x8d, %r9d
jmp 0x1bfcf
movq 0x41bfbe(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2c905f(%rip), %rsi    # 0x2e5013
leaq 0x2c9204(%rip), %rdx    # 0x2e51bf
leaq 0x2cae81(%rip), %rcx    # 0x2e6e43
leaq 0x2cabc3(%rip), %r8     # 0x2e6b8c
movl $0x8c, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390