// File: /workspace/github_c_makefile_star2_O1/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 0x10fe52
testb %al, %al
je 0x9c87e
cmpq $0x0, 0x10(%r14)
je 0x9c8ee
movq 0x38(%r14), %rdi
callq 0x10fe52
testb %al, %al
je 0x9c897
xorpd %xmm0, %xmm0
ucomisd 0x8(%r14), %xmm0
jae 0x9c8e5
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x9ca2b
cmpq $0x0, 0x48(%r14)
je 0x9ca30
callq 0x10fe52
testb %al, %al
je 0x9c8e0
movq 0x20(%r14), %rdi
callq 0x121e78
movq %rax, %r12
cmpq $0x2, %rax
jae 0x9c909
cmpq $0x1, %r12
jne 0x9c91f
movq 0x20(%r14), %rdi
xorl %esi, %esi
callq 0x121cfa
movq %rax, %r15
jmp 0x9c922
xorl %r15d, %r15d
jmp 0x9c931
leaq 0x2b2e6f(%rip), %rsi    # 0x34f75b
jmp 0x9c8f5
leaq 0x2b2e32(%rip), %rsi    # 0x34f727
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x9ca1c
leaq 0x2b2ee0(%rip), %rsi    # 0x34f7f0
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1019cf
jmp 0x9c922
xorl %r15d, %r15d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x1, %r12
ja 0x9ca1c
movq 0x48(%r14), %rdi
callq 0x10fe52
testb %al, %al
je 0x9c966
movq 0x28(%r14), %rdi
callq 0x121e78
movq %rax, %r13
cmpq $0x2, %rax
jae 0x9c96b
cmpq $0x1, %r13
jne 0x9c981
movq 0x28(%r14), %rdi
xorl %esi, %esi
callq 0x121cfa
movq %rax, %r12
jmp 0x9c984
xorl %r12d, %r12d
jmp 0x9c993
leaq 0x2b2eb1(%rip), %rsi    # 0x34f823
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1019cf
jmp 0x9c984
xorl %r12d, %r12d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x1, %r13
ja 0x9ca1c
movq 0x38(%r14), %rdi
callq 0x10fe52
testb %al, %al
je 0x9c9dd
movq 0x48(%r14), %rdi
callq 0x10fe52
testb %al, %al
jne 0x9c9dd
testq %r15, %r15
jne 0x9c9dd
leaq 0x2b2e9c(%rip), %rsi    # 0x34f855
leaq 0x331785(%rip), %rdx    # 0x3ce145
leaq 0x2b2cee(%rip), %rcx    # 0x34f6b5
leaq 0x32bfe8(%rip), %r8     # 0x3c89b6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1019cf
jmp 0x9c8ff
movq 0x10(%r14), %r13
movq 0x40(%r14), %rdi
callq 0x10fe52
movl %eax, %ebp
movq 0x48(%r14), %rdi
callq 0x10fe52
movzbl %bpl, %esi
movzbl %al, %ecx
movq %r13, %rdi
movq %r15, %rdx
movq %r12, %r8
movq %rbx, %r9
callq 0x196704
movq %rax, %rcx
movq %rax, 0x50(%r14)
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x185ab
callq 0x18572