// File: /workspace/github_c_makefile_star2_O3/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 0x9b128
movq %rbx, %rdi
callq 0xfcc32
testb %al, %al
jne 0x9b38d
testq %r14, %r14
je 0x9b388
movq 0x20(%r14), %rdi
callq 0x11c131
testq %rax, %rax
je 0x9b16c
movq 0x18(%r14), %rdi
callq 0x11b0ca
testq %rax, %rax
jne 0x9b249
movq 0x20(%r14), %rdi
callq 0x11c131
cmpq $0x2, %rax
jb 0x9b178
leaq 0x2abd4f(%rip), %rsi    # 0x346eb6
jmp 0x9b295
leaq 0x2abcf6(%rip), %rsi    # 0x346e69
jmp 0x9b295
callq 0x119478
movq %rax, %r15
movq 0x20(%r14), %rdi
xorl %esi, %esi
callq 0x11bfb3
movq %rax, %rdi
callq 0xd3e84
movq %rax, (%rsp)
movq %rax, %rdi
callq 0x11acc9
movq %rax, %r12
movq %rax, %rdi
callq 0x11b0a1
movq %rax, %rbp
movq %r12, %rdi
callq 0x11b0ca
movq %r15, %rdi
movq %rbp, %rsi
movq %rax, %rdx
movl $0x2e, %ecx
callq 0x119493
movq %r15, %rdi
callq 0x1196b0
cmpq $0x1, %rax
je 0x9b224
xorl %ebp, %ebp
movq 0x18(%r14), %r13
movq %r15, %rdi
movq %rbp, %rsi
callq 0x119674
movq %r13, %rdi
movq %rax, %rsi
callq 0x11acf3
movq %r15, %rdi
callq 0x1196b0
addq $-0x2, %rax
cmpq %rax, %rbp
jae 0x9b211
movq 0x18(%r14), %rdi
movl $0x2e, %esi
callq 0x11af23
incq %rbp
movq %r15, %rdi
callq 0x1196b0
decq %rax
cmpq %rax, %rbp
jb 0x9b1d8
leaq 0x2ab961(%rip), %rsi    # 0x346b8c
movq (%rsp), %rdi
movl $0xaa, %edx
callq 0x1045eb
movq %r15, %rdi
callq 0x1196c0
movq %r12, %rdi
callq 0x11bdbf
movq 0x10(%r14), %rdi
callq 0x11b0a1
movq %rax, %r15
leaq 0x33b7c7(%rip), %rdi    # 0x3d6a23
movq %rax, %rsi
callq 0x17a40
testl %eax, %eax
je 0x9b2b5
leaq 0x2e0b32(%rip), %rdi    # 0x37bda1
movq %r15, %rsi
callq 0x17a40
testl %eax, %eax
je 0x9b2d7
leaq 0x2abbbc(%rip), %rdi    # 0x346e3e
movq %r15, %rsi
callq 0x17a40
testl %eax, %eax
je 0x9b2f5
leaq 0x2abd51(%rip), %rsi    # 0x346fe6
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfcb67
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 0x9b35b
cmpq $-0x1, %rax
jne 0x9b30c
movq $0x64, 0x28(%r14)
jmp 0x9b30c
movb $0x1, 0x2(%r14)
movq 0x28(%r14), %rax
testq %rax, %rax
je 0x9b364
cmpq $-0x1, %rax
jne 0x9b30c
movq $0x2710, 0x28(%r14)     # imm = 0x2710
jmp 0x9b30c
movq 0x28(%r14), %rdx
testq %rdx, %rdx
je 0x9b30c
cmpq $-0x1, %rdx
jne 0x9b37c
movq $0x0, 0x28(%r14)
movq 0x38(%r14), %rax
xorl %ebp, %ebp
cmpq $-0x1, %rax
je 0x9b2a4
movq %rax, %rcx
shrq $0x20, %rcx
jne 0x9b33b
movl %eax, 0x30(%r14)
movq 0x40(%r14), %rax
movq %rax, %rcx
shrq $0x20, %rcx
jne 0x9b33b
movl %eax, 0x34(%r14)
jmp 0x9b2a4
leaq 0x2abccb(%rip), %rsi    # 0x34700d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0xfcb67
jmp 0x9b2a4
leaq 0x2abb98(%rip), %rsi    # 0x346efa
jmp 0x9b36b
leaq 0x2abbdd(%rip), %rsi    # 0x346f48
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xfcb67
jmp 0x9b29f
leaq 0x2abc17(%rip), %rsi    # 0x346f9a
movq %rbx, %rdi
jmp 0x9b370
callq 0x188b7
callq 0x1887e