// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/querymatch-display.c
// Function: gt_querymatch_display_flag_new
GtSeedExtendDisplayFlag *gt_querymatch_display_flag_new(
                           const GtStrArray *display_args,
                           GtSeedExtendDisplaySetMode setmode,
                           GtError *err)
{
  GtSeedExtendDisplayFlag *display_flag = gt_malloc(sizeof *display_flag);
  char copyspace[GT_MAX_DISPLAY_FLAG_LENGTH+1];
  bool haserr = false;
  size_t num_gfa2_default_flags = 0;
  GtUword da_idx;
  const uint64_t trace_mask = gt_display_mask(Gt_Trace_display) |
                              gt_display_mask(Gt_Dtrace_display);
  /* required implications:
      mandatory: S_seqnum, Q_seqnum, S_start, Q_start
                 either editdist or score
      either S_len or S_end must be set
      either Q_len or Q_end must be set
      if Strand is not set, then order of Q_start and Q_end gives strand
  */
  display_flag->alignmentwidth = 0;
  display_flag->trace_delta = 0;
  display_flag->nextfree = 0;
  display_flag->flags = 0;
  if (setmode != GT_SEED_EXTEND_DISPLAY_SET_NO)
  {
    if (gt_querymatch_display_args_contain(display_args,"blast"))
    {
      GtSeedExtendDisplay_enum blast_flags[] =
      {
        Gt_Queryid_display,
        Gt_Subjectid_display,
        Gt_Identity_display,
        Gt_Alignmentlength_display,
        Gt_Mismatches_display,
        Gt_Gapopens_display,
        Gt_Q_start_display,
        Gt_Q_end_display,
        Gt_S_start_display,
        Gt_S_end_display,
        Gt_Evalue_display,
        Gt_Bitscore_display
      };
      gt_querymatch_display_multi_flag_add(display_flag,blast_flags,
                                           sizeof blast_flags/
                                           sizeof blast_flags[0]);
    } else
    {
      if (gt_querymatch_display_args_contain(display_args,"gfa2"))
      {
        GtSeedExtendDisplay_enum gfa2_flags[] =
        {
          Gt_S_seqnum_display,
          Gt_Q_seqnum_display,
          Gt_S_start_display,
          Gt_S_end_display,
          Gt_Q_start_display,
          Gt_Q_end_display
        };
        gt_querymatch_display_multi_flag_add(display_flag,gfa2_flags,
                                             sizeof gfa2_flags/
                                             sizeof gfa2_flags[0]);
        num_gfa2_default_flags = sizeof gfa2_flags/sizeof gfa2_flags[0];
      } else
      {
        if (!gt_querymatch_display_args_contain(display_args,"custom"))
        {
          if (setmode == GT_SEED_EXTEND_DISPLAY_SET_STANDARD)
          {
            GtSeedExtendDisplay_enum standard_flags[] =
            {
              Gt_S_len_display,
              Gt_S_seqnum_display,
              Gt_S_start_display,
              Gt_Strand_display,
              Gt_Q_len_display,
              Gt_Q_seqnum_display,
              Gt_Q_start_display,
              Gt_Score_display,
              Gt_Editdist_display,
              Gt_Identity_display
            };
            gt_querymatch_display_multi_flag_add(display_flag,standard_flags,
                                                 sizeof standard_flags/
                                                 sizeof standard_flags[0]);
          } else
          {

            gt_assert(setmode == GT_SEED_EXTEND_DISPLAY_SET_EXACT);
            GtSeedExtendDisplay_enum exact_flags[] =
            {
              Gt_S_len_display,
              Gt_S_seqnum_display,
              Gt_S_start_display,
              Gt_Strand_display,
              Gt_Q_len_display,
              Gt_Q_seqnum_display,
              Gt_Q_start_display
            };
            gt_querymatch_display_multi_flag_add(display_flag,exact_flags,
                                                 sizeof exact_flags/
                                                 sizeof exact_flags[0]);
          }
        }
      }
    }
  }
  for (da_idx = 0; da_idx < gt_str_array_size(display_args); da_idx++)
  {
    const char *da = gt_str_array_get(display_args,da_idx);
    GtWord parameter;
    int ret = gt_querymatch_display_flag_set(copyspace,&parameter,
                                             display_flag,da,err);

    if (ret == -1)
    {
      haserr = true;
      break;
    }
    if (ret == 1)
    {
      /* the only flag with a parameter is Gt_Alignment_display */
      if (parameter < 0)
      {
        const char *key;

        if (display_flag->flags & gt_display_mask(Gt_Alignment_display))
        {
          key = "alignment";
        } else
        {
          if (display_flag->flags & gt_display_mask(Gt_Trace_display))
          {
            key = "trace";
          } else
          {
            gt_assert(display_flag->flags & gt_display_mask(Gt_Dtrace_display));
            key = "dtrace";
          }
        }
        gt_error_set(err,"integer following \"%s=\" must be positive",key);
        haserr = true;
        break;
      }
      if (display_flag->flags & gt_display_mask(Gt_Alignment_display))
      {
        display_flag->alignmentwidth = (GtUword) parameter;
      } else
      {
        gt_assert (display_flag->flags & trace_mask);
        display_flag->trace_delta = (GtUword) parameter;
      }
    }
  }
  if (!haserr)
  {
    if ((display_flag->flags & gt_display_mask(Gt_Alignment_display)) &&
         display_flag->alignmentwidth == 0)
    {
      display_flag->alignmentwidth = GT_SEED_EXTEND_DEFAULT_ALIGNMENT_WIDTH;
    }
    if ((display_flag->flags & trace_mask) && display_flag->trace_delta == 0)
    {
      display_flag->trace_delta = GT_SEED_EXTEND_DEFAULT_TRACE_DELTA;
    }
  }
  if (!haserr && num_gfa2_default_flags > 0)
  {
    if (gt_querymatch_options_order_check(display_flag,
                                          num_gfa2_default_flags,err) != 0)
    {
      haserr = true;
    }
  }
  if (haserr)
  {
    gt_querymatch_display_flag_delete(display_flag);
    return NULL;
  }
  return display_flag;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %r13
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x1f1628(%rip), %rsi    # 0x3b4402
movl $0xc0, %edi
movl $0x158, %edx            # imm = 0x158
callq 0x1092b2
xorl %ecx, %ecx
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0xa8(%rax)
movq %rax, 0x8(%rsp)
movq %rcx, 0xb8(%rax)
movb $0x1, %al
movl %eax, 0x1c(%rsp)
testl %ebp, %ebp
movq %rbx, 0x38(%rsp)
je 0x1c2ebc
leaq 0x1cdd2b(%rip), %rsi    # 0x390b49
movq %rbx, %rdi
callq 0x1c333b
testb %al, %al
je 0x1c2e5a
movq $0x0, 0x10(%rsp)
leaq 0x1f1cd6(%rip), %rbx    # 0x3b4b10
xorl %r14d, %r14d
movq 0x8(%rsp), %r15
movl (%r14,%rbx), %esi
movq %r15, %rdi
callq 0x1c36fd
addq $0x4, %r14
cmpq $0x30, %r14
jne 0x1c2e42
jmp 0x1c2eca
leaq 0x1f15c0(%rip), %rsi    # 0x3b4421
movq %rbx, %rdi
callq 0x1c333b
testb %al, %al
je 0x1c2ea5
xorl %ebx, %ebx
leaq 0x1f1cca(%rip), %r14    # 0x3b4b40
movq 0x8(%rsp), %r15
movl (%rbx,%r14), %esi
movq %r15, %rdi
callq 0x1c36fd
addq $0x4, %rbx
cmpq $0x18, %rbx
jne 0x1c2e7b
movl $0x6, %eax
movq %rax, 0x10(%rsp)
movl $0x0, 0x1c(%rsp)
jmp 0x1c2eca
leaq 0x1f157a(%rip), %rsi    # 0x3b4426
movq %rbx, %rdi
callq 0x1c333b
testb %al, %al
je 0x1c3259
movq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %r15
leaq 0xa8(%r15), %rax
movq %rax, 0x30(%rsp)
leaq 0xb0(%r15), %rax
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %r15
movq %r15, %rdi
callq 0x121e78
testq %rax, %rax
je 0x1c315d
xorl %ecx, %ecx
xorl %r14d, %r14d
movq %r13, 0x48(%rsp)
movq %rcx, 0x58(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x121cfa
movq 0x8(%rsp), %rbx
testq %rbx, %rbx
je 0x1c330c
movq %rax, %r12
movq %rax, %rdi
movl $0x3d, %esi
callq 0x17280
testq %rax, %rax
je 0x1c2f65
leaq 0x1(%rax), %rdi
leaq 0x1c26f4(%rip), %rsi    # 0x385634
leaq 0x40(%rsp), %rdx
movq %rax, %rbp
xorl %eax, %eax
callq 0x177f0
cmpl $0x1, %eax
jne 0x1c3053
movq %r14, 0x20(%rsp)
subq %r12, %rbp
movq %rbp, %rdx
jmp 0x1c2f6c
movq %r14, 0x20(%rsp)
xorl %edx, %edx
leaq 0x60(%rsp), %rdi
movq %r12, %rsi
movq %rdx, 0x50(%rsp)
callq 0x1c3777
testq %rax, %rax
je 0x1c306e
movq %rax, %r14
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0x1c36fd
cmpl $0x3, 0x8(%r14)
jne 0x1c2fc3
movq %rbx, %rdi
movl $0x20, %esi
callq 0x1c36fd
movq %rbx, %rdi
movl $0x21, %esi
callq 0x1c36fd
movq %rbx, %rdi
movl $0x22, %esi
callq 0x1c36fd
movq $-0x2, %rbx
leaq 0x2fc79f(%rip), %rax    # 0x4bf770
movq 0x10(%rax,%rbx,8), %r12
movq 0x18(%rax,%rbx,8), %r14
xorl %edi, %edi
movq %r12, %rsi
xorl %edx, %edx
callq 0x1c3777
movq %rax, %r13
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x1c3777
testq %r13, %r13
je 0x1c32fc
movq %rax, %r15
testq %rax, %rax
je 0x1c3304
movq 0x8(%rsp), %rax
movq (%rax), %rbp
movl 0x8(%r13), %edi
callq 0x1c3325
testq %rbp, %rax
movq 0x8(%rsp), %rax
je 0x1c3037
movq (%rax), %r13
movl 0x8(%r15), %edi
callq 0x1c3325
testq %r13, %rax
jne 0x1c3090
addq $0x2, %rbx
cmpq $0x1e, %rbx
jb 0x1c2fca
xorl %eax, %eax
cmpq $0x0, 0x50(%rsp)
setne %al
movq 0x48(%rsp), %r13
jmp 0x1c30b1
movq %r13, %rdi
leaq 0x1f1698(%rip), %rsi    # 0x3b46f5
movq %r12, %rdx
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1c30bb
movq %r13, %rdi
leaq 0x1f16c8(%rip), %rsi    # 0x3b4740
movq %r12, %rdx
leaq 0x1f1713(%rip), %rcx    # 0x3b4795
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1c30b6
movq 0x48(%rsp), %r13
movq %r13, %rdi
leaq 0x1f187e(%rip), %rsi    # 0x3b491d
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq 0x38(%rsp), %r15
movq 0x20(%rsp), %r14
movb $0x1, %bpl
cmpl $-0x1, %eax
je 0x1c3101
cmpl $0x1, %eax
jne 0x1c30f6
movq 0x40(%rsp), %rcx
movq 0x8(%rsp), %rax
movq (%rax), %rax
testq %rcx, %rcx
js 0x1c3105
movq 0x30(%rsp), %rdx
testb $0x1, %al
jne 0x1c30f3
movq 0x28(%rsp), %rdx
testl $0x3000, %eax           # imm = 0x3000
je 0x1c3311
movq %rcx, (%rdx)
movb $0x1, %bl
movq 0x58(%rsp), %rax
movl %eax, %ebp
jmp 0x1c3141
xorl %ebx, %ebx
jmp 0x1c3141
leaq 0x195aa1(%rip), %rdx    # 0x358bad
testb $0x1, %al
jne 0x1c312e
btl $0xc, %eax
leaq 0x22950b(%rip), %rdx    # 0x3ec626
jb 0x1c312e
btl $0xd, %eax
leaq 0x1f1389(%rip), %rdx    # 0x3b44b1
jae 0x1c3316
xorl %ebx, %ebx
movq %r13, %rdi
leaq 0x1f137e(%rip), %rsi    # 0x3b44b8
xorl %eax, %eax
callq 0x1019cf
testb %bl, %bl
je 0x1c315f
incq %r14
movq %r15, %rdi
callq 0x121e78
movl %ebp, %ecx
cmpq %rax, %r14
jb 0x1c2f02
jmp 0x1c315f
xorl %ebp, %ebp
testb $0x1, %bpl
jne 0x1c31a6
movq 0x8(%rsp), %rax
movq (%rax), %rax
testb $0x1, %al
je 0x1c3188
movq 0x30(%rsp), %rcx
cmpq $0x0, (%rcx)
jne 0x1c3188
movq 0x30(%rsp), %rcx
movq $0x3c, (%rcx)
testl $0x3000, %eax           # imm = 0x3000
je 0x1c31a6
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x1c31a6
movq 0x28(%rsp), %rax
movq $0x32, (%rax)
movl 0x1c(%rsp), %eax
orb %bpl, %al
testb $0x1, %al
jne 0x1c3220
leaq 0x40(%rsp), %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x1c2d55
testq %rbx, %rbx
je 0x1c320c
testb $0x14, 0x1(%rbx)
je 0x1c320c
movq 0x40(%rsp), %rcx
movq 0x10(%rsp), %r8
cmpq %r8, %rcx
jbe 0x1c331b
xorl %edx, %edx
movl (%rax,%r8,4), %edi
movb $0x1, %sil
cmpq $0xa, %rdi
je 0x1c3200
cmpl $0xc, %edi
je 0x1c3200
movl %edx, %esi
testb $0x1, %dl
je 0x1c329a
incq %r8
movl %esi, %edx
cmpq %r8, %rcx
jne 0x1c31e3
jmp 0x1c3220
leaq 0x1f1746(%rip), %rsi    # 0x3b4959
movq %r13, %rdi
xorl %eax, %eax
callq 0x1019cf
movb $0x1, %bpl
testb $0x1, %bpl
je 0x1c3245
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1c3241
leaq 0x1f11cb(%rip), %rsi    # 0x3b4402
movl $0x10b, %edx            # imm = 0x10B
callq 0x109670
xorl %eax, %eax
jmp 0x1c324a
movq 0x8(%rsp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x1, %ebp
je 0x1c32c9
cmpl $0x2, %ebp
jne 0x1c3320
movq $0x0, 0x10(%rsp)
leaq 0x1f1919(%rip), %rbx    # 0x3b4b90
xorl %r14d, %r14d
movq 0x8(%rsp), %r15
movl (%r14,%rbx), %esi
movq %r15, %rdi
callq 0x1c36fd
addq $0x4, %r14
cmpq $0x1c, %r14
jne 0x1c327f
jmp 0x1c2eca
leaq 0x1f190f(%rip), %rax    # 0x3b4bb0
movl (%rax,%rdi,4), %eax
shlq $0x4, %rax
leaq 0x302031(%rip), %rcx    # 0x4c52e0
movq (%rax,%rcx), %rdx
leaq 0x1f173c(%rip), %rsi    # 0x3b49f6
movq %r13, %rdi
xorl %eax, %eax
callq 0x1019cf
jmp 0x1c321d
movq $0x0, 0x10(%rsp)
leaq 0x1f1887(%rip), %rbx    # 0x3b4b60
xorl %r14d, %r14d
movq 0x8(%rsp), %r15
movl (%r14,%rbx), %esi
movq %r15, %rdi
callq 0x1c36fd
addq $0x4, %r14
cmpq $0x28, %r14
jne 0x1c32e1
jmp 0x1c2eca
movq %r12, %rdi
callq 0x69083
movq %r14, %rdi
callq 0x69053
callq 0x69125
callq 0x690b3
callq 0x690ec
callq 0x6915e
callq 0x6901a