// File: /workspace/github_c_makefile_star2_O1/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
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
testq %rdx, %rdx
je 0x9d34c
movq %rbx, %rdi
callq 0x101a9a
testb %al, %al
jne 0x9d5b1
testq %r14, %r14
je 0x9d5ac
movq 0x20(%r14), %rdi
callq 0x121e78
testq %rax, %rax
je 0x9d390
movq 0x18(%r14), %rdi
callq 0x120d4c
testq %rax, %rax
jne 0x9d46d
movq 0x20(%r14), %rdi
callq 0x121e78
cmpq $0x2, %rax
jb 0x9d39c
leaq 0x2b2b2b(%rip), %rsi    # 0x34feb6
jmp 0x9d4b9
leaq 0x2b2ad2(%rip), %rsi    # 0x34fe69
jmp 0x9d4b9
callq 0x11f0ac
movq %rax, %r15
movq 0x20(%r14), %rdi
xorl %esi, %esi
callq 0x121cfa
movq %rax, %rdi
callq 0xd6450
movq %rax, (%rsp)
movq %rax, %rdi
callq 0x120955
movq %rax, %r12
movq %rax, %rdi
callq 0x120d23
movq %rax, %rbp
movq %r12, %rdi
callq 0x120d4c
movq %r15, %rdi
movq %rbp, %rsi
movq %rax, %rdx
movl $0x2e, %ecx
callq 0x11f0c7
movq %r15, %rdi
callq 0x11f2e4
cmpq $0x1, %rax
je 0x9d448
xorl %ebp, %ebp
movq 0x18(%r14), %r13
movq %r15, %rdi
movq %rbp, %rsi
callq 0x11f2a8
movq %r13, %rdi
movq %rax, %rsi
callq 0x12097f
movq %r15, %rdi
callq 0x11f2e4
addq $-0x2, %rax
cmpq %rax, %rbp
jae 0x9d435
movq 0x18(%r14), %rdi
movl $0x2e, %esi
callq 0x120ba5
incq %rbp
movq %r15, %rdi
callq 0x11f2e4
decq %rax
cmpq %rax, %rbp
jb 0x9d3fc
leaq 0x2b273d(%rip), %rsi    # 0x34fb8c
movq (%rsp), %rdi
movl $0xaa, %edx
callq 0x109670
movq %r15, %rdi
callq 0x11f2f4
movq %r12, %rdi
callq 0x121b03
movq 0x10(%r14), %rdi
callq 0x120d23
movq %rax, %r15
leaq 0x342cf0(%rip), %rdi    # 0x3e0170
movq %rax, %rsi
callq 0x17a40
testl %eax, %eax
je 0x9d4d9
leaq 0x2e7c7e(%rip), %rdi    # 0x385111
movq %r15, %rsi
callq 0x17a40
testl %eax, %eax
je 0x9d4fb
leaq 0x2b2998(%rip), %rdi    # 0x34fe3e
movq %r15, %rsi
callq 0x17a40
testl %eax, %eax
je 0x9d519
leaq 0x2b2b2d(%rip), %rsi    # 0x34ffe6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %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 0x9d57f
cmpq $-0x1, %rax
jne 0x9d530
movq $0x64, 0x28(%r14)
jmp 0x9d530
movb $0x1, 0x2(%r14)
movq 0x28(%r14), %rax
testq %rax, %rax
je 0x9d588
cmpq $-0x1, %rax
jne 0x9d530
movq $0x2710, 0x28(%r14)     # imm = 0x2710
jmp 0x9d530
movq 0x28(%r14), %rdx
testq %rdx, %rdx
je 0x9d530
cmpq $-0x1, %rdx
jne 0x9d5a0
movq $0x0, 0x28(%r14)
movq 0x38(%r14), %rax
xorl %ebp, %ebp
cmpq $-0x1, %rax
je 0x9d4c8
movq %rax, %rcx
shrq $0x20, %rcx
jne 0x9d55f
movl %eax, 0x30(%r14)
movq 0x40(%r14), %rax
movq %rax, %rcx
shrq $0x20, %rcx
jne 0x9d55f
movl %eax, 0x34(%r14)
jmp 0x9d4c8
leaq 0x2b2aa7(%rip), %rsi    # 0x35000d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x1019cf
jmp 0x9d4c8
leaq 0x2b2974(%rip), %rsi    # 0x34fefa
jmp 0x9d58f
leaq 0x2b29b9(%rip), %rsi    # 0x34ff48
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x1019cf
jmp 0x9d4c3
leaq 0x2b29f3(%rip), %rsi    # 0x34ff9a
movq %rbx, %rdi
jmp 0x9d594
callq 0x188b7
callq 0x1887e