// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/gff3_escaping.c
// Function: gt_gff3_escaping_unit_test
int gt_gff3_escaping_unit_test(GtError *err)
{
  GtStr *seq,
        *unescaped = NULL;
  int had_err = 0;
  int i = 0;
  gt_error_check(err);
  seq = gt_str_new();
  unescaped = gt_str_new();

  /* explicitly reserved characters, must be escaped and unescaped */
  had_err = test_single_escaping('\t', TAB, true, false, err);
  if (!had_err) had_err = test_single_escaping(';', SEMICOLON, true, false,err);
  if (!had_err) had_err = test_single_escaping('=', EQUALS, true, false,err);
  if (!had_err) had_err = test_single_escaping('%', PERCENT, true, false,err);
  if (!had_err) had_err = test_single_escaping('&', AND, true, false,err);
  if (!had_err) had_err = test_single_escaping(',', COMMA, true, false,err);

  /* test allowed chars, need not be escaped but should be unescaped */
  for (i = ' '; !had_err && i < 0x7F; i++) {
    char code[10];
    snprintf(code, 10, "%%%02X", i);
    had_err = test_single_escaping((char) i, code, false, true, err);
  }

  /* control characters, must be escaped and unescaped */
  for (i = 1; !had_err && i < ' '; i++) {
    char code[10];
    snprintf(code, 10, "%%%02X", i);
    had_err = test_single_escaping((char) i, code, true, true, err);
  }

  /* non-hex codes (e.g. '%ZS') should be ignored altogether */
  for (i = 0x7F; !had_err && i <= 0xFF; i++) {
    char code[16];
    snprintf(code, 16, "foo%%%Xbar", i);
    had_err = gt_gff3_unescape(unescaped, code, 16, err);
    gt_ensure(!strcmp(gt_str_get(unescaped), code));
    gt_str_reset(unescaped);
  }

  /* error cases */
  gt_ensure(gt_gff3_unescape(seq, "foo%2", 5, NULL));

  gt_str_delete(seq);
  gt_str_delete(unescaped);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r15
testq %rdi, %rdi
je 0x85479
movq %r15, %rdi
callq 0x34fea
testb %al, %al
jne 0x85715
callq 0x3b728
movq %rax, %rbx
callq 0x3b728
movq %rax, %r14
leaq 0x6f333(%rip), %rsi     # 0xf479b
movl $0x9, %edi
movl $0x1, %edx
xorl %ecx, %ecx
movq %r15, %r8
jmp 0x8549f
callq 0x3b728
movq %rax, %rbx
callq 0x3b728
movq %rax, %r14
leaq 0x6f30b(%rip), %rsi     # 0xf479b
movl $0x9, %edi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x8571a
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x856f3
leaq 0x6f255(%rip), %rsi     # 0xf470e
movl $0x3b, %edi
movl $0x1, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x8571a
testl %eax, %eax
jne 0x856f3
leaq 0x6f236(%rip), %rsi     # 0xf4712
movl $0x3d, %edi
movl $0x1, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x8571a
testl %eax, %eax
jne 0x856f3
leaq 0x6f217(%rip), %rsi     # 0xf4716
movl $0x25, %edi
movl $0x1, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x8571a
testl %eax, %eax
jne 0x856f3
leaq 0x6f1f8(%rip), %rsi     # 0xf471a
movl $0x26, %edi
movl $0x1, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x8571a
testl %eax, %eax
jne 0x856f3
leaq 0x6f1d9(%rip), %rsi     # 0xf471e
movl $0x2c, %edi
movl $0x1, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x8571a
testl %eax, %eax
jne 0x856f3
movl $0x20, %ebp
movq %rsp, %r13
movl $0xa, %esi
movq %r13, %rdi
leaq 0x6f227(%rip), %rdx     # 0xf479f
movl %ebp, %ecx
xorl %eax, %eax
callq 0xba10
movsbl %bpl, %edi
movq %r13, %rsi
xorl %edx, %edx
movl $0x1, %ecx
movq %r15, %r8
callq 0x8571a
testl %eax, %eax
jne 0x855a5
leal 0x1(%rbp), %ecx
cmpl $0x7e, %ebp
movl %ecx, %ebp
jb 0x85569
testl %eax, %eax
jne 0x856f3
movl $0x1, %ebp
movq %rsp, %r13
movl $0xa, %esi
movq %r13, %rdi
leaq 0x6f1db(%rip), %rdx     # 0xf479f
movl %ebp, %ecx
xorl %eax, %eax
callq 0xba10
movsbl %bpl, %edi
movq %r13, %rsi
movl $0x1, %edx
movl $0x1, %ecx
movq %r15, %r8
callq 0x8571a
testl %eax, %eax
jne 0x855f4
leal 0x1(%rbp), %ecx
cmpl $0x1f, %ebp
movl %ecx, %ebp
jb 0x855b5
testl %eax, %eax
jne 0x856f3
movl $0x7f, %ebp
movl $0x10, %esi
movq %rsp, %r13
movq %r13, %rdi
leaq 0x6f193(%rip), %rdx     # 0xf47a6
movl %ebp, %ecx
xorl %eax, %eax
callq 0xba10
movl $0x10, %edx
movq %r14, %rdi
movq %r13, %rsi
xorl %r13d, %r13d
movq %r15, %rcx
callq 0x8533e
testl %eax, %eax
jne 0x85681
movq %r14, %rdi
callq 0x3bb5d
movq %rax, %rdi
movq %rsp, %rsi
callq 0xb890
testl %eax, %eax
je 0x8567e
xorl %r13d, %r13d
movq %r15, %rdi
leaq 0x5daff(%rip), %rsi     # 0xe3159
leaq 0x6f150(%rip), %rdx     # 0xf47b1
leaq 0x6f118(%rip), %rcx     # 0xf4780
leaq 0x6f082(%rip), %r8      # 0xf46f1
movl $0xc6, %r9d
xorl %eax, %eax
callq 0x34f1f
jmp 0x85681
movb $0x1, %r13b
movq %r14, %rdi
callq 0x3bbee
testb %r13b, %r13b
je 0x8569f
leal 0x1(%rbp), %eax
cmpl $0xff, %ebp
movl %eax, %ebp
jb 0x85601
testb %r13b, %r13b
je 0x856f3
leaq 0x6f12b(%rip), %rsi     # 0xf47d6
xorl %r12d, %r12d
movl $0x5, %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x8533e
testl %eax, %eax
jne 0x856f3
leaq 0x5da91(%rip), %rsi     # 0xe3159
leaq 0x6f10d(%rip), %rdx     # 0xf47dc
leaq 0x6f0aa(%rip), %rcx     # 0xf4780
leaq 0x6f014(%rip), %r8      # 0xf46f1
movq %r15, %rdi
movl $0xcb, %r9d
xorl %eax, %eax
callq 0x34f1f
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x3c87b
movq %r14, %rdi
callq 0x3c87b
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1f956