// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/chain2dim.c
// Function: gt_chain_chainmode_new
GtChain2Dimmode *gt_chain_chainmode_new(GtUword maxgap,
                                        bool globalset,
                                        const char *globalargs,
                                        bool localset,
                                        const char *localargs,
                                        GtError *err)
{
  GtChain2Dimmode *chainmode;
  bool haserr = false;

  gt_assert(!(globalset && localset));
  chainmode = gt_malloc(sizeof (*chainmode));
  chainmode->chainkind = GLOBALCHAINING;
  chainmode->maxgapwidth = (GtChain2Dimpostype) maxgap;
  if (localset)
  {
    if (localargs == NULL)
    {
      chainmode->chainkind = LOCALCHAININGMAX;
    } else
    {
      if (parselocalchainingparameter(chainmode, "local", localargs, err) != 0)
      {
        haserr = true;
      }
    }
  }
  if (globalset)
  {
    if (globalargs == NULL)
    {
      chainmode->chainkind = GLOBALCHAINING;
    } else
    {
      if (parseglobalchainingparameter(chainmode, "global", globalargs,
                                       err) != 0)
      {
        haserr = true;
      }
    }
  }
  if (haserr)
  {
    gt_free(chainmode);
    return NULL;
  }
  return chainmode;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movl %ecx, %r13d
movl %esi, %ebp
movl %ebp, %eax
andb %r13b, %al
cmpb $0x1, %al
je 0x196890
movq %r8, %r12
movq %rdx, %r15
movq %rdi, %r14
leaq 0x211813(%rip), %rsi    # 0x3a7f48
movl $0x28, %edi
movl $0x69a, %edx            # imm = 0x69A
callq 0x1092b2
movq %rax, %rbx
movl $0x0, (%rax)
movq %r14, 0x8(%rax)
testb %r13b, %r13b
je 0x1967c3
testq %r12, %r12
je 0x1967bd
leaq 0x207433(%rip), %rdi    # 0x39db95
movq %r12, %rsi
movq (%rsp), %rdx
callq 0x1c1a18
movq %rax, %r12
testq %rax, %rax
je 0x1967b4
movl (%r12), %eax
cmpq $0x2, %rax
ja 0x1967a0
leaq 0x211799(%rip), %rcx    # 0x3a7f20
movl (%rcx,%rax,4), %ecx
leaq 0x21179f(%rip), %rdx    # 0x3a7f30
movq (%rdx,%rax,8), %rax
movl %ecx, (%rbx)
movq 0x8(%r12), %rcx
movq %rcx, (%rbx,%rax)
leaq 0x2117a1(%rip), %rsi    # 0x3a7f48
movq %r12, %rdi
movl $0x667, %edx            # imm = 0x667
callq 0x109670
testq %r12, %r12
sete %r14b
jmp 0x1967c6
movl $0x4, (%rbx)
xorl %r14d, %r14d
testb %bpl, %bpl
je 0x19685c
testq %r15, %r15
je 0x19683e
leaq 0x23796a(%rip), %rsi    # 0x3ce145
movq %r15, %rdi
callq 0x17a40
testl %eax, %eax
je 0x196846
leaq 0x1b8ec7(%rip), %rsi    # 0x34f6b5
movq %r15, %rdi
callq 0x17a40
testl %eax, %eax
je 0x19684e
leaq 0x2321b5(%rip), %rsi    # 0x3c89b6
movq %r15, %rdi
callq 0x17a40
testl %eax, %eax
je 0x196856
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x196889
leaq 0x211d69(%rip), %rsi    # 0x3a8586
leaq 0x1b8af8(%rip), %rdx    # 0x34f31c
leaq 0x23791a(%rip), %rcx    # 0x3ce145
leaq 0x1b8e83(%rip), %r8     # 0x34f6b5
xorl %eax, %eax
callq 0x1019cf
movb $0x1, %r14b
jmp 0x19685c
movl $0x0, (%rbx)
jmp 0x19685c
movl $0x1, (%rbx)
jmp 0x19685c
movl $0x2, (%rbx)
jmp 0x19685c
movl $0x3, (%rbx)
testb %r14b, %r14b
je 0x196877
leaq 0x2116e0(%rip), %rsi    # 0x3a7f48
movq %rbx, %rdi
movl $0x6ba, %edx            # imm = 0x6BA
callq 0x109670
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5d80d
jmp 0x196839
callq 0x5d83a