// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/tools/gt_chain2dim.c
// Function: gt_chain2dim_arguments_check
static int gt_chain2dim_arguments_check (GT_UNUSED int rest_argc,
                                         void *tool_arguments,
                                         GtError * err)
{
  GtChain2dimoptions *arguments = tool_arguments;
  const char *globalargs = NULL, *localargs = NULL;

  if (gt_option_is_set (arguments->refoptionmaxgap))
  {
    if (arguments->maxgap == 0)
    {
      gt_error_set(err,"argument of option -maxgap must be positive integer");
      return -1;
    }
  }
  if (gt_option_is_set (arguments->refoptionweightfactor))
  {
    if (arguments->weightfactor <= 0.0)
    {
      gt_error_set(err,"argument of option -wf must be positive real value");
      return -1;
    }
  }
  gt_assert(arguments->refoptionglobal != NULL);
  gt_assert(arguments->refoptionlocal != NULL);
  if (gt_option_is_set(arguments->refoptionglobal))
  {
    GtUword globalargsnum = gt_str_array_size(arguments->globalargs);
    if (globalargsnum > 1UL)
    {
      gt_error_set(err,"option -global can only have one optional argument");
      return -1;
    }
    if (globalargsnum == 1UL)
    {
      globalargs = gt_str_array_get(arguments->globalargs,0);
    }
  }
  if (gt_option_is_set(arguments->refoptionlocal))
  {
    GtUword localargsnum = gt_str_array_size(arguments->localargs);
    if (localargsnum > 1UL)
    {
      gt_error_set(err,"option -local can only have one optional argument");
      return -1;
    }
    if (localargsnum == 1UL)
    {
      localargs = gt_str_array_get(arguments->localargs,0);
    }
  }
  if (gt_option_is_set(arguments->refoptionweightfactor) &&
      !gt_option_is_set(arguments->refoptionlocal) &&
      globalargs == NULL)
  {
    gt_error_set(err,
                 "option wf requires either option -local or option -global "
                 "with argument %s or %s or %s",
                 GT_CHAIN2DIM_GAPCOSTSWITCH,
                 GT_CHAIN2DIM_OVERLAPSWITCH,
                 GT_CHAIN2DIM_ALLSWITCH);
    return -1;
  }
  arguments->gtchainmode
    = gt_chain_chainmode_new(arguments->maxgap,
                             gt_option_is_set(arguments->refoptionglobal),
                             globalargs,
                             gt_option_is_set(arguments->refoptionlocal),
                             localargs,
                             err);
  return (arguments->gtchainmode == NULL) ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq 0x30(%rsi), %rdi
callq 0x9b4cb
testb %al, %al
je 0x1b06a
cmpq $0x0, 0x10(%r14)
je 0x1b16f
movq 0x38(%r14), %rdi
callq 0x9b4cb
testb %al, %al
je 0x1b087
xorpd %xmm0, %xmm0
ucomisd 0x8(%r14), %xmm0
jae 0x1b166
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x1b1cc
cmpq $0x0, 0x48(%r14)
je 0x1b1fa
callq 0x9b4cb
testb %al, %al
je 0x1b0cd
movq 0x20(%r14), %rdi
callq 0xae61c
cmpq $0x1, %rax
ja 0x1b178
jne 0x1b0cd
movq 0x20(%r14), %rdi
xorl %esi, %esi
callq 0xae386
movq %rax, %r15
jmp 0x1b0d0
xorl %r15d, %r15d
movq 0x48(%r14), %rdi
callq 0x9b4cb
testb %al, %al
je 0x1b102
movq 0x28(%r14), %rdi
callq 0xae61c
cmpq $0x1, %rax
ja 0x1b181
jne 0x1b102
movq 0x28(%r14), %rdi
xorl %esi, %esi
callq 0xae386
movq %rax, %r12
jmp 0x1b105
xorl %r12d, %r12d
movq 0x38(%r14), %rdi
callq 0x9b4cb
testb %al, %al
je 0x1b125
movq 0x48(%r14), %rdi
callq 0x9b4cb
testq %r15, %r15
setne %cl
orb %al, %cl
je 0x1b1a4
movq 0x10(%r14), %r13
movq 0x40(%r14), %rdi
callq 0x9b4cb
movl %eax, %ebp
movq 0x48(%r14), %rdi
callq 0x9b4cb
movzbl %bpl, %esi
movzbl %al, %ecx
movq %r13, %rdi
movq %r15, %rdx
movq %r12, %r8
movq %rbx, %r9
callq 0x13752b
movq %rax, %rcx
movq %rax, 0x50(%r14)
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
jmp 0x1b195
leaq 0x2cb5ee(%rip), %rsi    # 0x2e675b
jmp 0x1b188
leaq 0x2cb5b1(%rip), %rsi    # 0x2e6727
jmp 0x1b188
leaq 0x2cb671(%rip), %rsi    # 0x2e67f0
jmp 0x1b188
leaq 0x2cb69b(%rip), %rsi    # 0x2e6823
movq %rbx, %rdi
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2cb6aa(%rip), %rsi    # 0x2e6855
leaq 0x349c7b(%rip), %rdx    # 0x364e2d
leaq 0x2cb4fc(%rip), %rcx    # 0x2e66b5
leaq 0x3445c6(%rip), %r8     # 0x35f786
movq %rbx, %rdi
xorl %eax, %eax
callq 0x89dbb
jmp 0x1b192
movq 0x41cd95(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2c9e36(%rip), %rsi    # 0x2e5013
leaq 0x2cb5aa(%rip), %rdx    # 0x2e678e
leaq 0x2cb5c6(%rip), %rcx    # 0x2e67b1
leaq 0x2cb061(%rip), %r8     # 0x2e6253
movl $0x90, %r9d
jmp 0x1b226
movq 0x41cd67(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2c9e08(%rip), %rsi    # 0x2e5013
leaq 0x2cb5bc(%rip), %rdx    # 0x2e67ce
leaq 0x2cb598(%rip), %rcx    # 0x2e67b1
leaq 0x2cb033(%rip), %r8     # 0x2e6253
movl $0x91, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390