// File: /workspace/github_c_makefile_star2_O3/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 0x10ac3f
testb %al, %al
je 0x9a6a6
cmpq $0x0, 0x10(%r14)
je 0x9a7af
movq 0x38(%r14), %rdi
callq 0x10ac3f
testb %al, %al
je 0x9a6c3
xorpd %xmm0, %xmm0
ucomisd 0x8(%r14), %xmm0
jae 0x9a7a6
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x9a80e
cmpq $0x0, 0x48(%r14)
je 0x9a813
callq 0x10ac3f
testb %al, %al
je 0x9a709
movq 0x20(%r14), %rdi
callq 0x11c131
cmpq $0x1, %rax
ja 0x9a7b8
jne 0x9a709
movq 0x20(%r14), %rdi
xorl %esi, %esi
callq 0x11bfb3
movq %rax, %r15
jmp 0x9a70c
xorl %r15d, %r15d
movq 0x48(%r14), %rdi
callq 0x10ac3f
testb %al, %al
je 0x9a73e
movq 0x28(%r14), %rdi
callq 0x11c131
cmpq $0x1, %rax
ja 0x9a7c1
jne 0x9a73e
movq 0x28(%r14), %rdi
xorl %esi, %esi
callq 0x11bfb3
movq %rax, %r12
jmp 0x9a741
xorl %r12d, %r12d
movq 0x38(%r14), %rdi
callq 0x10ac3f
testb %al, %al
je 0x9a765
movq 0x48(%r14), %rdi
callq 0x10ac3f
testq %r15, %r15
setne %cl
orb %al, %cl
je 0x9a7e6
movq 0x10(%r14), %r13
movq 0x40(%r14), %rdi
callq 0x10ac3f
movl %eax, %ebp
movq 0x48(%r14), %rdi
callq 0x10ac3f
movzbl %bpl, %esi
movzbl %al, %ecx
movq %r13, %rdi
movq %r15, %rdx
movq %r12, %r8
movq %rbx, %r9
callq 0x18e100
movq %rax, %rcx
movq %rax, 0x50(%r14)
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
jmp 0x9a7d7
leaq 0x2abfae(%rip), %rsi    # 0x34675b
jmp 0x9a7c8
leaq 0x2abf71(%rip), %rsi    # 0x346727
jmp 0x9a7c8
leaq 0x2ac031(%rip), %rsi    # 0x3467f0
jmp 0x9a7c8
leaq 0x2ac05b(%rip), %rsi    # 0x346823
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2ac068(%rip), %rsi    # 0x346855
leaq 0x32a229(%rip), %rdx    # 0x3c4a1d
leaq 0x2abeba(%rip), %rcx    # 0x3466b5
leaq 0x324b34(%rip), %r8     # 0x3bf336
movq %rbx, %rdi
xorl %eax, %eax
callq 0xfcb67
jmp 0x9a7d2
callq 0x185ab
callq 0x18572