// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq $0x0, 0x40(%rsp)
movl $0x0, 0x3c(%rsp)
movl $0x0, 0x38(%rsp)
cmpq $0x0, 0x50(%rsp)
je 0xa75b2
movq 0x50(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0xa757a
jmp 0xa75b2
movq 0x10ca57(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xb6adb(%rip), %rsi     # 0x15e066
leaq 0xb70b6(%rip), %rdx     # 0x15e648
leaq 0xcb472(%rip), %rcx     # 0x172a0b
leaq 0xcb3dc(%rip), %r8      # 0x17297c
movl $0xa7, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xa75b4
callq 0x18f00
movq %rax, 0x48(%rsp)
callq 0x18f00
movq %rax, 0x40(%rsp)
movq 0x50(%rsp), %r8
movl $0x9, %edi
leaq 0xcb44d(%rip), %rsi     # 0x172a26
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xa7900
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x3c(%rsp)
jne 0xa7611
movq 0x50(%rsp), %r8
movl $0x3b, %edi
leaq 0xcb398(%rip), %rsi     # 0x172999
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xa7900
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x3c(%rsp)
jne 0xa7639
movq 0x50(%rsp), %r8
movl $0x3d, %edi
leaq 0xcb374(%rip), %rsi     # 0x17299d
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xa7900
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x3c(%rsp)
jne 0xa7661
movq 0x50(%rsp), %r8
movl $0x25, %edi
leaq 0xcb350(%rip), %rsi     # 0x1729a1
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xa7900
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x3c(%rsp)
jne 0xa7689
movq 0x50(%rsp), %r8
movl $0x26, %edi
leaq 0xcb32c(%rip), %rsi     # 0x1729a5
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xa7900
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x3c(%rsp)
jne 0xa76b1
movq 0x50(%rsp), %r8
movl $0x2c, %edi
leaq 0xcb308(%rip), %rsi     # 0x1729a9
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xa7900
movl %eax, 0x3c(%rsp)
movl $0x20, 0x38(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x3c(%rsp)
movb %al, 0xf(%rsp)
jne 0xa76d2
cmpl $0x7f, 0x38(%rsp)
setl %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0xa76dc
jmp 0xa7726
leaq 0x2e(%rsp), %rdi
movl 0x38(%rsp), %ecx
movl $0xa, %esi
leaq 0xcb339(%rip), %rdx     # 0x172a2a
movb $0x0, %al
callq 0xb9d0
movl 0x38(%rsp), %eax
leaq 0x2e(%rsp), %rsi
movq 0x50(%rsp), %r8
xorl %edx, %edx
movl $0x1, %ecx
movsbl %al, %edi
callq 0xa7900
movl %eax, 0x3c(%rsp)
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0xa76b9
movl $0x1, 0x38(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x3c(%rsp)
movb %al, 0xe(%rsp)
jne 0xa7747
cmpl $0x20, 0x38(%rsp)
setl %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0xa7751
jmp 0xa779b
leaq 0x24(%rsp), %rdi
movl 0x38(%rsp), %ecx
movl $0xa, %esi
leaq 0xcb2c4(%rip), %rdx     # 0x172a2a
movb $0x0, %al
callq 0xb9d0
movl 0x38(%rsp), %eax
leaq 0x24(%rsp), %rsi
movq 0x50(%rsp), %r8
movl $0x1, %ecx
movsbl %al, %edi
movl %ecx, %edx
callq 0xa7900
movl %eax, 0x3c(%rsp)
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0xa772e
movl $0x7f, 0x38(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x3c(%rsp)
movb %al, 0xd(%rsp)
jne 0xa77bf
cmpl $0xff, 0x38(%rsp)
setle %al
movb %al, 0xd(%rsp)
movb 0xd(%rsp), %al
testb $0x1, %al
jne 0xa77cc
jmp 0xa787c
leaq 0x10(%rsp), %rdi
movl 0x38(%rsp), %ecx
movl $0x10, %esi
leaq 0xcb250(%rip), %rdx     # 0x172a31
movb $0x0, %al
callq 0xb9d0
movq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq 0x50(%rsp), %rcx
movl $0x10, %edx
callq 0xa7260
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x3c(%rsp)
jne 0xa7860
movq 0x40(%rsp), %rdi
callq 0x19940
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0xb850
cmpl $0x0, %eax
je 0xa785e
movq 0x50(%rsp), %rdi
leaq 0xb8943(%rip), %rsi     # 0x160177
leaq 0xcb201(%rip), %rdx     # 0x172a3c
leaq 0xcb1c9(%rip), %rcx     # 0x172a0b
leaq 0xcb133(%rip), %r8      # 0x17297c
movl $0xc6, %r9d
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x3c(%rsp) # imm = 0xFFFFFFFF
jmp 0xa7860
jmp 0xa7862
movq 0x40(%rsp), %rdi
callq 0x19b70
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0xa77a3
jmp 0xa787e
cmpl $0x0, 0x3c(%rsp)
jne 0xa78dc
movq 0x48(%rsp), %rdi
leaq 0xcb1d0(%rip), %rsi     # 0x172a61
movl $0x5, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0xa7260
cmpl $0x0, %eax
jne 0xa78da
movq 0x50(%rsp), %rdi
leaq 0xb88c7(%rip), %rsi     # 0x160177
leaq 0xcb1b0(%rip), %rdx     # 0x172a67
leaq 0xcb14d(%rip), %rcx     # 0x172a0b
leaq 0xcb0b7(%rip), %r8      # 0x17297c
movl $0xcb, %r9d
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x3c(%rsp) # imm = 0xFFFFFFFF
jmp 0xa78dc
jmp 0xa78de
movq 0x48(%rsp), %rdi
callq 0x1afc0
movq 0x40(%rsp), %rdi
callq 0x1afc0
movl 0x3c(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax,%rax)