// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %rdi, %rbx
testq %rdi, %rdi
je 0x85973
movq %rbx, %rdi
callq 0x3566a
testb %al, %al
jne 0x85c40
callq 0x3bfe0
movq %rax, %r14
callq 0x3bfe0
movq %rax, %r15
leaq 0x6ee71(%rip), %rsi     # 0xf47fb
movl $0x9, %edi
movl $0x1, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x85c45
movl %eax, %r12d
testl %eax, %eax
jne 0x859c3
leaq 0x6edc2(%rip), %rsi     # 0xf476e
movl $0x3b, %edi
movl $0x1, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x85c45
movl %eax, %r12d
testl %r12d, %r12d
jne 0x859e6
leaq 0x6eda3(%rip), %rsi     # 0xf4772
movl $0x3d, %edi
movl $0x1, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x85c45
movl %eax, %r12d
testl %r12d, %r12d
jne 0x85a09
leaq 0x6ed84(%rip), %rsi     # 0xf4776
movl $0x25, %edi
movl $0x1, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x85c45
movl %eax, %r12d
testl %r12d, %r12d
jne 0x85a2c
leaq 0x6ed65(%rip), %rsi     # 0xf477a
movl $0x26, %edi
movl $0x1, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x85c45
movl %eax, %r12d
testl %r12d, %r12d
jne 0x85a4f
leaq 0x6ed46(%rip), %rsi     # 0xf477e
movl $0x2c, %edi
movl $0x1, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x85c45
movl %eax, %r12d
movq %r14, 0x8(%rsp)
testl %r12d, %r12d
jne 0x85aaa
movl $0x20, %r13d
leaq 0x6ed99(%rip), %r14     # 0xf47ff
leaq 0x10(%rsp), %rbp
movl $0xa, %esi
movq %rbp, %rdi
movq %r14, %rdx
movl %r13d, %ecx
xorl %eax, %eax
callq 0xba10
movsbl %r13b, %edi
movq %rbp, %rsi
xorl %edx, %edx
movl $0x1, %ecx
movq %rbx, %r8
callq 0x85c45
movl %eax, %r12d
testl %eax, %eax
jne 0x85aaa
leal 0x1(%r13), %eax
cmpl $0x7e, %r13d
movl %eax, %r13d
jb 0x85a6b
testl %r12d, %r12d
jne 0x85b03
movl $0x1, %r13d
leaq 0x6ed43(%rip), %r14     # 0xf47ff
leaq 0x10(%rsp), %rbp
movl $0xa, %esi
movq %rbp, %rdi
movq %r14, %rdx
movl %r13d, %ecx
xorl %eax, %eax
callq 0xba10
movsbl %r13b, %edi
movq %rbp, %rsi
movl $0x1, %edx
movl $0x1, %ecx
movq %rbx, %r8
callq 0x85c45
movl %eax, %r12d
testl %eax, %eax
jne 0x85b03
leal 0x1(%r13), %eax
cmpl $0x1f, %r13d
movl %eax, %r13d
jb 0x85ac1
testl %r12d, %r12d
sete %r13b
je 0x85b87
testb %r13b, %r13b
movq 0x8(%rsp), %r14
je 0x85b65
leaq 0x6ed19(%rip), %rsi     # 0xf4836
xorl %r12d, %r12d
movl $0x5, %edx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x857ea
testl %eax, %eax
jne 0x85b65
leaq 0x5d63f(%rip), %rsi     # 0xe3179
leaq 0x6ecfb(%rip), %rdx     # 0xf483c
leaq 0x6ec98(%rip), %rcx     # 0xf47e0
leaq 0x6ec02(%rip), %r8      # 0xf4751
movq %rbx, %rdi
movl $0xcb, %r9d
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %r14, %rdi
callq 0x3d1eb
movq %r15, %rdi
callq 0x3d1eb
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x7f, %ebp
leaq 0x10(%rsp), %r14
xorl %r12d, %r12d
movl $0x10, %esi
movq %r14, %rdi
leaq 0x6ec63(%rip), %rdx     # 0xf4806
movl %ebp, %ecx
xorl %eax, %eax
callq 0xba10
movl $0x10, %edx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rcx
callq 0x857ea
testl %eax, %eax
je 0x85bc8
xorl %r13d, %r13d
jmp 0x85c0e
movq %r15, %rdi
callq 0x3c40b
movq %rax, %rdi
movq %r14, %rsi
callq 0xb890
testl %eax, %eax
je 0x85c3b
xorl %r13d, %r13d
movq %rbx, %rdi
leaq 0x5d58d(%rip), %rsi     # 0xe3179
leaq 0x6ec1e(%rip), %rdx     # 0xf4811
leaq 0x6ebe6(%rip), %rcx     # 0xf47e0
leaq 0x6eb50(%rip), %r8      # 0xf4751
movl $0xc6, %r9d
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %r15, %rdi
callq 0x3c49c
testb %r13b, %r13b
je 0x85b0c
leal 0x1(%rbp), %eax
cmpl $0xff, %ebp
movl %eax, %ebp
jb 0x85b91
jmp 0x85b0c
movb $0x1, %r13b
jmp 0x85c14
callq 0x1f9bc