// File: /workspace/github_c_makefile_star2_O2/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 0x65203
movq %rbx, %rdi
callq 0xc103
testb %al, %al
jne 0x65487
callq 0x13d5c
movq %rax, (%rsp)
callq 0x13d5c
movq %rax, 0x8(%rsp)
leaq 0x788de(%rip), %rsi     # 0xddafb
pushq $0x9
popq %rdi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x654bf
pushq $-0x1
popq %rbp
testl %eax, %eax
jne 0x652bd
leaq 0x7882f(%rip), %rsi     # 0xdda6e
pushq $0x3b
popq %rdi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x654bf
testl %eax, %eax
jne 0x652bd
leaq 0x78818(%rip), %rsi     # 0xdda72
pushq $0x3d
popq %rdi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x654bf
testl %eax, %eax
jne 0x652bd
leaq 0x78801(%rip), %rsi     # 0xdda76
pushq $0x25
popq %rdi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x654bf
testl %eax, %eax
jne 0x652bd
leaq 0x787ea(%rip), %rsi     # 0xdda7a
pushq $0x26
popq %rdi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x654bf
testl %eax, %eax
jne 0x652bd
leaq 0x787d3(%rip), %rsi     # 0xdda7e
pushq $0x2c
popq %rdi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x654bf
movl %eax, %ebp
pushq $0x20
popq %r12
leaq 0x10(%rsp), %r15
pushq $0xa
popq %r13
pushq $0x1
popq %r14
testl %ebp, %ebp
jne 0x6530a
cmpl $0x7f, %r12d
jae 0x6530a
movq %r15, %rdi
movq %r13, %rsi
leaq 0x7881a(%rip), %rdx     # 0xddaff
movl %r12d, %ecx
xorl %eax, %eax
callq 0xba00
movsbl %r12b, %edi
movq %r15, %rsi
xorl %edx, %edx
movl %r14d, %ecx
movq %rbx, %r8
callq 0x654bf
movl %eax, %ebp
incl %r12d
jmp 0x652ce
leaq 0x10(%rsp), %r13
pushq $0xa
popq %r15
movl %r14d, %r12d
testl %ebp, %ebp
jne 0x65353
cmpl $0x20, %r14d
jae 0x65353
movq %r13, %rdi
movq %r15, %rsi
leaq 0x787d2(%rip), %rdx     # 0xddaff
movl %r14d, %ecx
xorl %eax, %eax
callq 0xba00
movsbl %r14b, %edi
movq %r13, %rsi
movl %r12d, %ecx
movl %r12d, %edx
movq %rbx, %r8
callq 0x654bf
movl %eax, %ebp
incl %r14d
jmp 0x65316
pushq $0x7f
popq %r12
leaq 0x10(%rsp), %r14
pushq $0x10
popq %r13
movq %rbx, %r15
movq 0x8(%rsp), %rbx
testl %ebp, %ebp
jne 0x65406
cmpl $0xff, %r12d
ja 0x65406
movq %r14, %rdi
movq %r13, %rsi
leaq 0x7877c(%rip), %rdx     # 0xddb06
movl %r12d, %ecx
xorl %eax, %eax
callq 0xba00
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x65081
pushq $-0x1
popq %rbp
testl %eax, %eax
jne 0x653f6
movq %rbx, %rdi
callq 0x143d2
movq %rax, %rdi
movq %r14, %rsi
callq 0xb880
testl %eax, %eax
je 0x653f4
movq %r15, %rdi
leaq 0x66d8c(%rip), %rsi     # 0xcc159
leaq 0x7873d(%rip), %rdx     # 0xddb11
leaq 0x78705(%rip), %rcx     # 0xddae0
leaq 0x7866f(%rip), %r8      # 0xdda51
movl $0xc6, %r9d
xorl %eax, %eax
callq 0xc007
pushq $-0x1
popq %rbp
jmp 0x653f6
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x1452f
incl %r12d
jmp 0x65368
pushq $-0x1
popq %r14
testl %ebp, %ebp
je 0x65417
movl %r14d, %ebx
movq (%rsp), %r12
jmp 0x65464
leaq 0x78718(%rip), %rsi     # 0xddb36
xorl %ebx, %ebx
pushq $0x5
popq %rdx
movq (%rsp), %r12
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x65081
testl %eax, %eax
jne 0x65464
leaq 0x66d1d(%rip), %rsi     # 0xcc159
leaq 0x786f9(%rip), %rdx     # 0xddb3c
leaq 0x78696(%rip), %rcx     # 0xddae0
leaq 0x78600(%rip), %r8      # 0xdda51
movq %r15, %rdi
movl $0xcb, %r9d
xorl %eax, %eax
callq 0xc007
movl %r14d, %ebx
movq %r12, %rdi
callq 0x152db
movq 0x8(%rsp), %rdi
callq 0x152db
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xc8b2a(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x64bce(%rip), %rsi     # 0xca066
leaq 0x651ba(%rip), %rdx     # 0xca659
leaq 0x7863a(%rip), %rcx     # 0xddae0
leaq 0x785a4(%rip), %r8      # 0xdda51
movl $0xa7, %r9d
xorl %eax, %eax
callq 0xb8c0
callq 0xb300