// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/tools/gt_wtree_bench.c
// Function: gt_wtree_bench_bench_wtree
static int gt_wtree_bench_bench_wtree(GtWtree *wt,
                                      GtError *err,
                                      GtTimer *timer)
{
  int had_err = 0;
  GtUword idx,
                length = gt_wtree_length(wt),
                syms = gt_wtree_num_of_symbols(wt),
                tmp, pos, *max_ranks;
  char c;
  GtWtreeSymbol symbol;
  gt_error_check(err);
  gt_timer_show_progress(timer, "1M random access", stderr);
  printf("\n");
  for (idx = 0; !had_err && idx < WAVELET_BENCH_SIZE; idx++) {
    symbol = gt_wtree_access(wt, gt_rand_max(length-1));
    c = gt_wtree_encseq_unmap_decoded(wt, symbol);
    switch (c) {
      case (char) GT_SEPARATOR:
        printf("$");
        break;
      case (char) GT_UNDEFCHAR:
        gt_error_set(err, "undefined char in sequence, can't print");
        had_err = 1;
        break;
      default:
        printf("%c",c);
    }
  }
  gt_timer_show_progress(timer, "1M random rank", stderr);
  printf("\n");
  for (idx = 0; !had_err && idx < WAVELET_BENCH_SIZE; idx++) {
    symbol = gt_rand_max(syms-1);
    pos = gt_rand_max(length-1);
    tmp = gt_wtree_rank(wt, pos, symbol);
    c = gt_wtree_encseq_unmap_decoded(wt, symbol);
    if (isprint(c))
      printf("rank of %c at "GT_WU": "GT_WU"\n", c, pos, tmp);
    else
      printf("rank of %d at "GT_WU": "GT_WU"\n", c, pos, tmp);
  }
  printf("\n");
  gt_timer_show_progress(timer, "1M random select", stderr);
  max_ranks = gt_malloc((size_t) syms * sizeof (*max_ranks));
  for (idx = 0; !had_err && idx < syms; idx++) {
    max_ranks[idx] = gt_wtree_rank(wt, length - 1, idx);
  }
  printf("\n");
  for (idx = 0; !had_err && idx < WAVELET_BENCH_SIZE; idx++) {
    do {
    symbol = gt_rand_max(syms-1);
    } while (max_ranks[symbol] == 0);
    do {
    pos = gt_rand_max(max_ranks[symbol]);
    } while (pos == 0);
    tmp = gt_wtree_select(wt, pos, symbol);
    c = gt_wtree_encseq_unmap_decoded(wt, symbol);
    if (isprint(c))
      printf("select "GT_WU"th %c: at "GT_WU"\n", pos, c, tmp);
    else
      printf("select "GT_WU"th %d: at "GT_WU"\n", pos, c, tmp);
  }
  printf("\n");
  gt_free(max_ranks);
  return had_err;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movl $0x0, 0x5c(%rsp)
movq 0x70(%rsp), %rdi
callq 0x1f70b0
movq %rax, 0x48(%rsp)
movq 0x70(%rsp), %rdi
callq 0x1f70d0
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x68(%rsp)
je 0x7d5f9
movq 0x68(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x7d5c1
jmp 0x7d5f9
movq 0x5be9d8(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x498a41(%rip), %rsi    # 0x516013
leaq 0x498be6(%rip), %rdx    # 0x5161bf
leaq 0x4b1b1a(%rip), %rcx    # 0x52f0fa
leaq 0x4b19bb(%rip), %r8     # 0x52efa2
movl $0x7f, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x7d5fb
movq 0x60(%rsp), %rdi
movq 0x5be999(%rip), %rax    # 0x63bfa0
movq (%rax), %rdx
leaq 0x4b1b04(%rip), %rsi    # 0x52f115
callq 0x121930
leaq 0x515c56(%rip), %rdi    # 0x593273
movb $0x0, %al
callq 0x19070
movq $0x0, 0x50(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x5c(%rsp)
movb %al, 0x17(%rsp)
jne 0x7d64a
cmpq $0xf4240, 0x50(%rsp)    # imm = 0xF4240
setb %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x7d657
jmp 0x7d703
movq 0x70(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x48(%rsp), %rdi
decq %rdi
callq 0xec350
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x1f6df0
movq %rax, 0x18(%rsp)
movq 0x70(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x1f7250
movb %al, 0x27(%rsp)
movsbl 0x27(%rsp), %eax
movl %eax, 0x10(%rsp)
subl $-0x3, %eax
je 0x7d6be
jmp 0x7d6a3
movl 0x10(%rsp), %eax
subl $-0x1, %eax
jne 0x7d6db
jmp 0x7d6ae
leaq 0x4c1774(%rip), %rdi    # 0x53ee29
movb $0x0, %al
callq 0x19070
jmp 0x7d6ee
movq 0x68(%rsp), %rdi
leaq 0x4b1a5c(%rip), %rsi    # 0x52f126
movb $0x0, %al
callq 0xd88c0
movl $0x1, 0x5c(%rsp)
jmp 0x7d6ee
movsbl 0x27(%rsp), %esi
leaq 0x4e45e5(%rip), %rdi    # 0x561ccc
movb $0x0, %al
callq 0x19070
jmp 0x7d6f0
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x7d62d
movq 0x60(%rsp), %rdi
movq 0x5be891(%rip), %rax    # 0x63bfa0
movq (%rax), %rdx
leaq 0x4b1a35(%rip), %rsi    # 0x52f14e
callq 0x121930
leaq 0x515b4e(%rip), %rdi    # 0x593273
movb $0x0, %al
callq 0x19070
movq $0x0, 0x50(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x5c(%rsp)
movb %al, 0x7(%rsp)
jne 0x7d752
cmpq $0xf4240, 0x50(%rsp)    # imm = 0xF4240
setb %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x7d75f
jmp 0x7d820
movq 0x40(%rsp), %rdi
subq $0x1, %rdi
callq 0xec350
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rdi
subq $0x1, %rdi
callq 0xec350
movq %rax, 0x30(%rsp)
movq 0x70(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x1f6ed0
movq %rax, 0x38(%rsp)
movq 0x70(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x1f7250
movb %al, 0x27(%rsp)
callq 0x197c0
movq (%rax), %rax
movsbl 0x27(%rsp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x7d7ee
movsbl 0x27(%rsp), %esi
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rcx
leaq 0x4b1978(%rip), %rdi    # 0x52f15d
movb $0x0, %al
callq 0x19070
jmp 0x7d80b
movsbl 0x27(%rsp), %esi
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rcx
leaq 0x4b1971(%rip), %rdi    # 0x52f175
movb $0x0, %al
callq 0x19070
jmp 0x7d80d
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x7d735
leaq 0x515a4c(%rip), %rdi    # 0x593273
movb $0x0, %al
callq 0x19070
movq 0x60(%rsp), %rdi
movq 0x5be766(%rip), %rax    # 0x63bfa0
movq (%rax), %rdx
leaq 0x4b1949(%rip), %rsi    # 0x52f18d
callq 0x121930
movq 0x40(%rsp), %rdi
shlq $0x3, %rdi
leaq 0x4b1749(%rip), %rsi    # 0x52efa2
movl $0x9f, %edx
callq 0xe80f0
movq %rax, 0x28(%rsp)
movq $0x0, 0x50(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x5c(%rsp)
movb %al, 0x6(%rsp)
jne 0x7d88f
movq 0x50(%rsp), %rax
cmpq 0x40(%rsp), %rax
setb %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
testb $0x1, %al
jne 0x7d899
jmp 0x7d8d2
movq 0x70(%rsp), %rdi
movq 0x48(%rsp), %rsi
subq $0x1, %rsi
movq 0x50(%rsp), %rdx
callq 0x1f6ed0
movq %rax, %rdx
movq 0x28(%rsp), %rax
movq 0x50(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x7d871
leaq 0x51599a(%rip), %rdi    # 0x593273
movb $0x0, %al
callq 0x19070
movq $0x0, 0x50(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x5c(%rsp)
movb %al, 0x5(%rsp)
jne 0x7d906
cmpq $0xf4240, 0x50(%rsp)    # imm = 0xF4240
setb %al
movb %al, 0x5(%rsp)
movb 0x5(%rsp), %al
testb $0x1, %al
jne 0x7d913
jmp 0x7d9f6
jmp 0x7d915
movq 0x40(%rsp), %rdi
subq $0x1, %rdi
callq 0xec350
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq 0x18(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x7d915
jmp 0x7d93b
movq 0x28(%rsp), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xec350
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x7d93b
movq 0x70(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x1f6fc0
movq %rax, 0x38(%rsp)
movq 0x70(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x1f7250
movb %al, 0x27(%rsp)
callq 0x197c0
movq (%rax), %rax
movsbl 0x27(%rsp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x7d9c4
movq 0x30(%rsp), %rsi
movsbl 0x27(%rsp), %edx
movq 0x38(%rsp), %rcx
leaq 0x4b17e3(%rip), %rdi    # 0x52f19e
movb $0x0, %al
callq 0x19070
jmp 0x7d9e1
movq 0x30(%rsp), %rsi
movsbl 0x27(%rsp), %edx
movq 0x38(%rsp), %rcx
leaq 0x4b17dd(%rip), %rdi    # 0x52f1b7
movb $0x0, %al
callq 0x19070
jmp 0x7d9e3
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0x7d8e9
leaq 0x515876(%rip), %rdi    # 0x593273
movb $0x0, %al
callq 0x19070
movq 0x28(%rsp), %rdi
leaq 0x4b1592(%rip), %rsi    # 0x52efa2
movl $0xb3, %edx
callq 0xe88c0
movl 0x5c(%rsp), %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)