// File: /workspace/github_c_makefile_star2_O2/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 0x1376c6
movq %r8, %r12
movq %rdx, %r15
movq %rdi, %r14
leaq 0x20781c(%rip), %rsi    # 0x33ed78
pushq $0x28
popq %rdi
movl $0x69a, %edx            # imm = 0x69A
callq 0x93160
movq %rax, %rbx
andl $0x0, (%rax)
movq %r14, 0x8(%rax)
testb %r13b, %r13b
je 0x1375d8
testq %r12, %r12
je 0x1375d2
leaq 0x1fd4e3(%rip), %rdi    # 0x334a67
movq %r12, %rsi
movq (%rsp), %rdx
callq 0x167eb4
testq %rax, %rax
je 0x13760d
movl (%rax), %ecx
cmpq $0x2, %rcx
ja 0x1375bc
leaq 0x2077ac(%rip), %rdx    # 0x33ed50
movl (%rdx,%rcx,4), %edx
leaq 0x2077b2(%rip), %rsi    # 0x33ed60
movq (%rsi,%rcx,8), %rcx
movl %edx, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, (%rbx,%rcx)
leaq 0x2077b5(%rip), %rsi    # 0x33ed78
movq %rax, %rdi
movl $0x667, %edx            # imm = 0x667
callq 0x936f9
jmp 0x1375d8
movl $0x4, (%rbx)
xorl %r14d, %r14d
testb %bpl, %bpl
je 0x137666
testq %r15, %r15
je 0x137609
movzbl (%r15), %eax
cmpl $0x6f, %eax
je 0x137612
cmpl $0x67, %eax
jne 0x137620
cmpb $0x63, 0x1(%r15)
jne 0x137620
cmpb $0x0, 0x2(%r15)
jne 0x137620
pushq $0x1
jmp 0x137663
xorl %eax, %eax
jmp 0x137664
movb $0x1, %r14b
jmp 0x1375db
cmpb $0x76, 0x1(%r15)
jne 0x137620
cmpb $0x0, 0x2(%r15)
je 0x137693
leaq 0x22815f(%rip), %rsi    # 0x35f786
movq %r15, %rdi
callq 0x179e0
testl %eax, %eax
je 0x137661
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x137697
leaq 0x207d4a(%rip), %rsi    # 0x33f38d
leaq 0x1aecd2(%rip), %rdx    # 0x2e631c
leaq 0x22d7dc(%rip), %rcx    # 0x364e2d
leaq 0x1af05d(%rip), %r8     # 0x2e66b5
xorl %eax, %eax
callq 0x89dbb
jmp 0x13766b
pushq $0x3
popq %rax
movl %eax, (%rbx)
testb %r14b, %r14b
je 0x137681
leaq 0x207706(%rip), %rsi    # 0x33ed78
movq %rbx, %rdi
movl $0x6ba, %edx            # imm = 0x6BA
callq 0x936f9
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x2
jmp 0x137663
movq 0x3008ca(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x207ce5(%rip), %rsi    # 0x33f38d
leaq 0x1aec6d(%rip), %rdx    # 0x2e631c
leaq 0x22d777(%rip), %rcx    # 0x364e2d
leaq 0x1aeff8(%rip), %r8     # 0x2e66b5
xorl %eax, %eax
callq 0x17a50
jmp 0x13766b
movq 0x30089b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1ad93c(%rip), %rsi    # 0x2e5013
leaq 0x207846(%rip), %rdx    # 0x33ef24
leaq 0x207858(%rip), %rcx    # 0x33ef3d
leaq 0x20768c(%rip), %r8     # 0x33ed78
movl $0x699, %r9d            # imm = 0x699
xorl %eax, %eax
callq 0x17a50
callq 0x17390