// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x168, %rsp            # imm = 0x168
movq %rdi, 0x158(%rsp)
movl %esi, 0x154(%rsp)
movq %rdx, 0x148(%rsp)
movl $0xc0, %edi
leaq 0x317b1c(%rip), %rsi    # 0x57d896
movl $0x158, %edx            # imm = 0x158
callq 0xe80f0
movq %rax, 0x140(%rsp)
movb $0x0, 0x11f(%rsp)
movq $0x0, 0x110(%rsp)
movl $0xc, %edi
callq 0x266380
movq %rax, 0x38(%rsp)
movl $0xd, %edi
callq 0x266380
movq %rax, %rcx
movq 0x38(%rsp), %rax
orq %rcx, %rax
movq %rax, 0x100(%rsp)
movq 0x140(%rsp), %rax
movq $0x0, 0xa8(%rax)
movq 0x140(%rsp), %rax
movq $0x0, 0xb0(%rax)
movq 0x140(%rsp), %rax
movq $0x0, 0xb8(%rax)
movq 0x140(%rsp), %rax
movq $0x0, (%rax)
cmpl $0x0, 0x154(%rsp)
je 0x265fd7
movq 0x158(%rsp), %rdi
leaq 0x2f40b8(%rip), %rsi    # 0x559ee9
callq 0x2663e0
testb $0x1, %al
jne 0x265e3c
jmp 0x265e74
leaq 0xd0(%rsp), %rdi
leaq 0x3181a5(%rip), %rsi    # 0x57dff0
movl $0x30, %edx
callq 0x19610
movq 0x140(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movl $0xc, %edx
callq 0x266460
jmp 0x265fd5
movq 0x158(%rsp), %rdi
leaq 0x317a32(%rip), %rsi    # 0x57d8b5
callq 0x2663e0
testb $0x1, %al
jne 0x265e8e
jmp 0x265ee6
movq 0x31818b(%rip), %rax    # 0x57e020
movq %rax, 0xb0(%rsp)
movq 0x318184(%rip), %rax    # 0x57e028
movq %rax, 0xb8(%rsp)
movq 0x31817d(%rip), %rax    # 0x57e030
movq %rax, 0xc0(%rsp)
movq 0x140(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
movl $0x6, %edx
callq 0x266460
movq $0x6, 0x110(%rsp)
jmp 0x265fd3
movq 0x158(%rsp), %rdi
leaq 0x3179c5(%rip), %rsi    # 0x57d8ba
callq 0x2663e0
testb $0x1, %al
jne 0x265fd1
cmpl $0x1, 0x154(%rsp)
jne 0x265f44
leaq 0x80(%rsp), %rdi
leaq 0x318125(%rip), %rsi    # 0x57e040
movl $0x28, %edx
callq 0x19610
movq 0x140(%rsp), %rdi
leaq 0x80(%rsp), %rsi
movl $0xa, %edx
callq 0x266460
jmp 0x265fcf
jmp 0x265f46
cmpl $0x2, 0x154(%rsp)
je 0x265f88
movq 0x3d6049(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2b00b2(%rip), %rsi    # 0x516013
leaq 0x317959(%rip), %rdx    # 0x57d8c1
leaq 0x31797e(%rip), %rcx    # 0x57d8ed
leaq 0x317920(%rip), %r8     # 0x57d896
movl $0x1aa, %r9d            # imm = 0x1AA
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x265f8a
movq 0x3180df(%rip), %rax    # 0x57e070
movq %rax, 0x60(%rsp)
movq 0x3180db(%rip), %rax    # 0x57e078
movq %rax, 0x68(%rsp)
movq 0x3180d7(%rip), %rax    # 0x57e080
movq %rax, 0x70(%rsp)
movl 0x3180d4(%rip), %eax    # 0x57e088
movl %eax, 0x78(%rsp)
movq 0x140(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movl $0x7, %edx
callq 0x266460
jmp 0x265fd1
jmp 0x265fd3
jmp 0x265fd5
jmp 0x265fd7
movq $0x0, 0x108(%rsp)
movq 0x108(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x158(%rsp), %rdi
callq 0x11fcc0
movq %rax, %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
jae 0x266251
movq 0x158(%rsp), %rdi
movq 0x108(%rsp), %rsi
callq 0x11f8c0
movq %rax, 0x58(%rsp)
leaq 0x120(%rsp), %rdi
movq 0x140(%rsp), %rdx
movq 0x58(%rsp), %rcx
movq 0x148(%rsp), %r8
leaq 0x50(%rsp), %rsi
callq 0x2664c0
movl %eax, 0x4c(%rsp)
cmpl $-0x1, 0x4c(%rsp)
jne 0x266067
movb $0x1, 0x11f(%rsp)
jmp 0x266251
cmpl $0x1, 0x4c(%rsp)
jne 0x266236
cmpq $0x0, 0x50(%rsp)
jge 0x26618d
movq 0x140(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
xorl %edi, %edi
callq 0x266380
movq %rax, %rcx
movq 0x28(%rsp), %rax
andq %rcx, %rax
cmpq $0x0, %rax
je 0x2660b7
leaq 0x2bab30(%rip), %rax    # 0x520bdd
movq %rax, 0x40(%rsp)
jmp 0x266165
movq 0x140(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movl $0xc, %edi
callq 0x266380
movq %rax, %rcx
movq 0x20(%rsp), %rax
andq %rcx, %rax
cmpq $0x0, %rax
je 0x2660f0
leaq 0x3525db(%rip), %rax    # 0x5b86c4
movq %rax, 0x40(%rsp)
jmp 0x266163
jmp 0x2660f2
movq 0x140(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movl $0xd, %edi
callq 0x266380
movq %rax, %rcx
movq 0x18(%rsp), %rax
andq %rcx, %rax
cmpq $0x0, %rax
jne 0x266155
movq 0x3d5e7c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2afee5(%rip), %rsi    # 0x516013
leaq 0x3177d7(%rip), %rdx    # 0x57d90c
leaq 0x3177b1(%rip), %rcx    # 0x57d8ed
leaq 0x317753(%rip), %r8     # 0x57d896
movl $0x1da, %r9d            # imm = 0x1DA
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x266157
leaq 0x3177e7(%rip), %rax    # 0x57d945
movq %rax, 0x40(%rsp)
jmp 0x266165
movq 0x148(%rsp), %rdi
movq 0x40(%rsp), %rdx
leaq 0x3177d3(%rip), %rsi    # 0x57d94c
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0x11f(%rsp)
jmp 0x266251
movq 0x140(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
xorl %edi, %edi
callq 0x266380
movq %rax, %rcx
movq 0x10(%rsp), %rax
andq %rcx, %rax
cmpq $0x0, %rax
je 0x2661cb
movq 0x50(%rsp), %rcx
movq 0x140(%rsp), %rax
movq %rcx, 0xa8(%rax)
jmp 0x266234
jmp 0x2661cd
movq 0x140(%rsp), %rax
movq (%rax), %rax
andq 0x100(%rsp), %rax
cmpq $0x0, %rax
jne 0x26621e
movq 0x3d5db3(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2afe1c(%rip), %rsi    # 0x516013
leaq 0x317777(%rip), %rdx    # 0x57d975
leaq 0x3176e8(%rip), %rcx    # 0x57d8ed
leaq 0x31768a(%rip), %r8     # 0x57d896
movl $0x1e7, %r9d            # imm = 0x1E7
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x266220
movq 0x50(%rsp), %rcx
movq 0x140(%rsp), %rax
movq %rcx, 0xb0(%rax)
jmp 0x266236
jmp 0x266238
movq 0x108(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x108(%rsp)
jmp 0x265fe3
testb $0x1, 0x11f(%rsp)
jne 0x2662ec
movq 0x140(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
xorl %edi, %edi
callq 0x266380
movq %rax, %rcx
movq 0x8(%rsp), %rax
andq %rcx, %rax
cmpq $0x0, %rax
je 0x2662ac
movq 0x140(%rsp), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x2662ac
movq 0x140(%rsp), %rax
movq $0x3c, 0xa8(%rax)
movq 0x140(%rsp), %rax
movq (%rax), %rax
andq 0x100(%rsp), %rax
cmpq $0x0, %rax
je 0x2662ea
movq 0x140(%rsp), %rax
cmpq $0x0, 0xb0(%rax)
jne 0x2662ea
movq 0x140(%rsp), %rax
movq $0x32, 0xb0(%rax)
jmp 0x2662ec
testb $0x1, 0x11f(%rsp)
jne 0x26632d
cmpq $0x0, 0x110(%rsp)
jbe 0x26632d
movq 0x140(%rsp), %rdi
movq 0x110(%rsp), %rsi
movq 0x148(%rsp), %rdx
callq 0x266850
cmpl $0x0, %eax
je 0x26632b
movb $0x1, 0x11f(%rsp)
jmp 0x26632d
testb $0x1, 0x11f(%rsp)
je 0x266352
movq 0x140(%rsp), %rdi
callq 0x265d20
movq $0x0, 0x160(%rsp)
jmp 0x266362
movq 0x140(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0x160(%rsp), %rax
addq $0x168, %rsp            # imm = 0x168
retq
nopw %cs:(%rax,%rax)