// File: /workspace/github_c_makefile_star2_O3/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 $0x68, %rsp
movq %rdx, (%rsp)
movl %esi, %ebp
movq %rdi, %r12
leaq 0x1f0cb6(%rip), %rsi    # 0x3aadf2
movl $0xc0, %edi
movl $0x158, %edx            # imm = 0x158
callq 0x104226
movq %rax, %rbx
xorl %eax, %eax
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xa8(%rbx)
movq %rax, 0xb8(%rbx)
movb $0x1, %al
testl %ebp, %ebp
je 0x1ba1ac
movl %eax, 0xc(%rsp)
leaq 0x1cd5fb(%rip), %rsi    # 0x387770
movq %r12, %rdi
callq 0x1ba60a
testb %al, %al
je 0x1ba1bb
movq $0x0, 0x10(%rsp)
leaq 0x1f136f(%rip), %r14    # 0x3ab500
xorl %r15d, %r15d
movl (%r15,%r14), %esi
movq %rbx, %rdi
callq 0x1ba9ac
addq $0x4, %r15
cmpq $0x30, %r15
jne 0x1ba194
jmp 0x1ba204
movl %eax, 0xc(%rsp)
movq $0x0, 0x10(%rsp)
jmp 0x1ba204
leaq 0x1f0c4f(%rip), %rsi    # 0x3aae11
movq %r12, %rdi
callq 0x1ba60a
testb %al, %al
je 0x1ba49a
xorl %r14d, %r14d
leaq 0x1f1354(%rip), %r15    # 0x3ab530
movl (%r14,%r15), %esi
movq %rbx, %rdi
callq 0x1ba9ac
addq $0x4, %r14
cmpq $0x18, %r14
jne 0x1ba1dc
movl $0x6, %eax
movq %rax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
leaq 0xa8(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0xb0(%rbx), %rax
movq %rax, 0x18(%rsp)
movq %r12, %rdi
callq 0x11c131
testq %rax, %rax
je 0x1ba3bf
xorl %r15d, %r15d
movq %r12, 0x38(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x11bfb3
testq %rbx, %rbx
je 0x1ba5db
movq %rax, %rbp
movq %rax, %rdi
movl $0x3d, %esi
callq 0x17280
testq %rax, %rax
je 0x1ba286
movq %rax, %r13
leaq 0x1(%rax), %rdi
leaq 0x1c2058(%rip), %rsi    # 0x37c2c4
leaq 0x28(%rsp), %rdx
xorl %eax, %eax
callq 0x177f0
cmpl $0x1, %eax
jne 0x1ba579
subq %rbp, %r13
jmp 0x1ba289
xorl %r13d, %r13d
leaq 0x50(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x1baa26
testq %rax, %rax
je 0x1ba504
movq %rax, %r14
movq %r13, 0x40(%rsp)
movq %r15, 0x48(%rsp)
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0x1ba9ac
cmpl $0x3, 0x8(%r14)
jne 0x1ba2e8
movq %rbx, %rdi
movl $0x20, %esi
callq 0x1ba9ac
movq %rbx, %rdi
movl $0x21, %esi
callq 0x1ba9ac
movq %rbx, %rdi
movl $0x22, %esi
callq 0x1ba9ac
movq $-0x2, %r13
leaq 0x2fa46a(%rip), %rax    # 0x4b4760
movq 0x10(%rax,%r13,8), %rbp
movq 0x18(%rax,%r13,8), %r12
xorl %edi, %edi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x1baa26
movq %rax, %r14
xorl %edi, %edi
movq %r12, %rsi
xorl %edx, %edx
callq 0x1baa26
testq %r14, %r14
je 0x1ba5d3
movq %rax, %r15
movq %r12, 0x30(%rsp)
testq %rax, %rax
je 0x1ba5c9
movq %rbx, %r12
movq (%rbx), %rbx
movl 0x8(%r14), %edi
callq 0x1ba5f4
testq %rbx, %rax
je 0x1ba35f
movq (%r12), %rbx
movl 0x8(%r15), %edi
callq 0x1ba5f4
testq %rbx, %rax
jne 0x1ba455
addq $0x2, %r13
cmpq $0x1e, %r13
movq %r12, %rbx
jb 0x1ba2ef
cmpq $0x0, 0x40(%rsp)
movq 0x38(%rsp), %r12
movq 0x48(%rsp), %r15
je 0x1ba3ab
movq 0x28(%rsp), %rcx
movq (%rbx), %rax
testq %rcx, %rcx
js 0x1ba589
movq 0x20(%rsp), %rdx
testb $0x1, %al
jne 0x1ba3a8
movq 0x18(%rsp), %rdx
testl $0x3000, %eax           # imm = 0x3000
je 0x1ba5e0
movq %rcx, (%rdx)
incq %r15
movq %r12, %rdi
callq 0x11c131
cmpq %rax, %r15
jb 0x1ba235
movq (%rbx), %rax
testb $0x1, %al
je 0x1ba3dd
movq 0x20(%rsp), %rcx
cmpq $0x0, (%rcx)
jne 0x1ba3dd
movq 0x20(%rsp), %rcx
movq $0x3c, (%rcx)
testl $0x3000, %eax           # imm = 0x3000
je 0x1ba3fb
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x1ba3fb
movq 0x18(%rsp), %rax
movq $0x32, (%rax)
cmpb $0x0, 0xc(%rsp)
jne 0x1ba488
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x1ba0b6
testb $0x14, 0x1(%rbx)
je 0x1ba4ed
movq 0x28(%rsp), %rcx
movq 0x10(%rsp), %rdi
cmpq %rdi, %rcx
jbe 0x1ba5e5
xorl %edx, %edx
movl (%rax,%rdi,4), %esi
cmpq $0xa, %rsi
je 0x1ba449
cmpl $0xc, %esi
je 0x1ba449
testb $0x1, %dl
je 0x1ba553
incq %rdi
movb $0x1, %dl
cmpq %rdi, %rcx
jne 0x1ba432
jmp 0x1ba488
leaq 0x1f0eb1(%rip), %rsi    # 0x3ab30d
movq (%rsp), %rdi
movq %rbp, %rdx
movq 0x30(%rsp), %rcx
xorl %eax, %eax
callq 0xfcb67
movq %r12, %rbx
leaq 0x1f0979(%rip), %rsi    # 0x3aadf2
movq %rbx, %rdi
movl $0x10b, %edx            # imm = 0x10B
callq 0x1045eb
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f0975(%rip), %rsi    # 0x3aae16
movq %r12, %rdi
callq 0x1ba60a
testb %al, %al
jne 0x1ba1b0
cmpl $0x1, %ebp
je 0x1ba525
cmpl $0x2, %ebp
jne 0x1ba5ea
movq $0x0, 0x10(%rsp)
leaq 0x1f10b1(%rip), %r14    # 0x3ab580
xorl %r15d, %r15d
movl (%r15,%r14), %esi
movq %rbx, %rdi
callq 0x1ba9ac
addq $0x4, %r15
cmpq $0x1c, %r15
jne 0x1ba4d2
jmp 0x1ba204
leaq 0x1f0e55(%rip), %rsi    # 0x3ab349
movq (%rsp), %rdi
xorl %eax, %eax
callq 0xfcb67
jmp 0x1ba472
leaq 0x1f0c25(%rip), %rsi    # 0x3ab130
leaq 0x1f0c73(%rip), %rcx    # 0x3ab185
movq (%rsp), %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xfcb67
jmp 0x1ba472
movq $0x0, 0x10(%rsp)
leaq 0x1f101b(%rip), %r14    # 0x3ab550
xorl %r15d, %r15d
movl (%r15,%r14), %esi
movq %rbx, %rdi
callq 0x1ba9ac
addq $0x4, %r15
cmpq $0x28, %r15
jne 0x1ba538
jmp 0x1ba204
leaq 0x1f1046(%rip), %rax    # 0x3ab5a0
movl (%rax,%rsi,4), %eax
shlq $0x4, %rax
leaq 0x2ffd78(%rip), %rcx    # 0x4ba2e0
movq (%rax,%rcx), %rdx
leaq 0x1f0e73(%rip), %rsi    # 0x3ab3e6
movq (%rsp), %rdi
jmp 0x1ba5bd
leaq 0x1f0b65(%rip), %rsi    # 0x3ab0e5
movq (%rsp), %rdi
movq %rbp, %rdx
jmp 0x1ba5bd
testb $0x1, %al
jne 0x1ba5a2
btl $0xc, %eax
jb 0x1ba5ab
btl $0xd, %eax
jae 0x1ba5ef
leaq 0x1f0901(%rip), %rdx    # 0x3aaea1
jmp 0x1ba5b2
leaq 0x1955d4(%rip), %rdx    # 0x34fb7d
jmp 0x1ba5b2
leaq 0x228920(%rip), %rdx    # 0x3e2ed2
movq (%rsp), %rdi
leaq 0x1f08eb(%rip), %rsi    # 0x3aaea8
xorl %eax, %eax
callq 0xfcb67
jmp 0x1ba472
movq 0x30(%rsp), %rdi
callq 0x6785d
movq %rbp, %rdi
callq 0x6788d
callq 0x678bd
callq 0x677eb
callq 0x678f6
callq 0x677b2
callq 0x67824