// File: /workspace/github_c_makefile_star2_O3/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 0x18e280
movq %r8, %r12
movq %rdx, %r15
movq %rdi, %r14
leaq 0x210947(%rip), %rsi    # 0x39ea78
movl $0x28, %edi
movl $0x69a, %edx            # imm = 0x69A
callq 0x104226
movq %rax, %rbx
movl $0x0, (%rax)
movq %r14, 0x8(%rax)
testb %r13b, %r13b
je 0x18e1b2
testq %r12, %r12
je 0x18e1ac
leaq 0x20659a(%rip), %rdi    # 0x3946f8
movq %r12, %rsi
movq (%rsp), %rdx
callq 0x1b8ec0
testq %rax, %rax
je 0x18e1ea
movl (%rax), %ecx
cmpq $0x2, %rcx
ja 0x18e196
leaq 0x2108d2(%rip), %rdx    # 0x39ea50
movl (%rdx,%rcx,4), %edx
leaq 0x2108d8(%rip), %rsi    # 0x39ea60
movq (%rsi,%rcx,8), %rcx
movl %edx, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, (%rbx,%rcx)
leaq 0x2108db(%rip), %rsi    # 0x39ea78
movq %rax, %rdi
movl $0x667, %edx            # imm = 0x667
callq 0x1045eb
jmp 0x18e1b2
movl $0x4, (%rbx)
xorl %r14d, %r14d
testb %bpl, %bpl
je 0x18e245
testq %r15, %r15
je 0x18e1e6
movzbl (%r15), %eax
cmpl $0x6f, %eax
je 0x18e1ef
cmpl $0x67, %eax
jne 0x18e1fd
cmpb $0x63, 0x1(%r15)
jne 0x18e1fd
cmpb $0x0, 0x2(%r15)
jne 0x18e1fd
movl $0x1, %eax
jmp 0x18e243
xorl %eax, %eax
jmp 0x18e243
movb $0x1, %r14b
jmp 0x18e1b5
cmpb $0x76, 0x1(%r15)
jne 0x18e1fd
cmpb $0x0, 0x2(%r15)
je 0x18e272
leaq 0x231132(%rip), %rsi    # 0x3bf336
movq %r15, %rdi
callq 0x17a40
testl %eax, %eax
je 0x18e23e
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x18e279
leaq 0x210e6d(%rip), %rsi    # 0x39f08d
leaq 0x1b80f5(%rip), %rdx    # 0x34631c
leaq 0x2367ef(%rip), %rcx    # 0x3c4a1d
leaq 0x1b8480(%rip), %r8     # 0x3466b5
xorl %eax, %eax
callq 0xfcb67
jmp 0x18e24a
movl $0x3, %eax
movl %eax, (%rbx)
testb %r14b, %r14b
je 0x18e260
leaq 0x210827(%rip), %rsi    # 0x39ea78
movq %rbx, %rdi
movl $0x6ba, %edx            # imm = 0x6BA
callq 0x1045eb
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x2, %eax
jmp 0x18e243
callq 0x5c4b6
jmp 0x18e24a
callq 0x5c4e3