user: Please show me the C implementation that matches the assembly code listed below:

```asm
<generateFunctionTest>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    $0x3e8,%ebx
  sub    $0x38,%rsp
  lea    0x14(%rsp),%r8
  lea    0x10(%rsp),%rcx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x18(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  call   <getAlphabetFromFile@plt>
  mov    0x14(%rsp),%ecx
  mov    0x20(%rsp),%rdx
  mov    0x10(%rsp),%esi
  mov    0x18(%rsp),%rdi
  call   <buildTree@plt>
  subl   $0x1,0x10(%rsp)
  lea    D89(%rip),%rdi
  mov    %rax,%rbp
  mov    0x18(%rsp),%rax
  movsbl (%rax),%r13d
  mov    %r13d,%esi
  call   <printf@plt>
  mov    0x10(%rsp),%eax
  mov    %eax,%r12d
  shr    $0x1f,%r12d
  add    %eax,%r12d
  sar    %r12d
  mov    %r12d,%edi
  call   <sqrt@plt>
  movq   $0x0,0x8(%rsp)
  mov    %eax,%r14d
  nopl   0x0(%rax)
L4:
  xor    %eax,%eax
  call   <timerStart@plt>
  mov    0x20(%rsp),%rsi
  mov    %r12d,%edx
  mov    %rbp,%rdi
  call   <accessOp@plt>
  xor    %eax,%eax
  call   <timerStop@plt>
  xor    %eax,%eax
  call   <timerGetTimeSpan@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  sub    $0x1,%ebx
  jne    L4
  lea    D7(%rip),%r15
  lea    D105(%rip),%rdi
  mov    %r15,%rsi
  call   <fopen@plt>
  lea    D13(%rip),%rsi
  movsd  0x8(%rsp),%xmm0
  divsd  D107(%rip),%xmm0
  mov    %rax,%rbx
  mov    %rax,%rdi
  call   <fprintf@plt>
  mov    %rbx,%rdi
  mov    $0x3e8,%ebx
  call   <fclose@plt>
  movq   $0x0,0x8(%rsp)
  nopl   0x0(%rax,%rax,1)
L0:
  xor    %eax,%eax
  call   <timerStart@plt>
  mov    0x20(%rsp),%rsi
  mov    %r13d,%ecx
  mov    %r12d,%edx
  mov    %rbp,%rdi
  call   <rankOp@plt>
  xor    %eax,%eax
  call   <timerStop@plt>
  xor    %eax,%eax
  call   <timerGetTimeSpan@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  sub    $0x1,%ebx
  jne    L0
  mov    %r15,%rsi
  lea    D1(%rip),%rdi
  mov    $0x3e8,%ebx
  call   <fopen@plt>
  lea    D13(%rip),%rsi
  movsd  0x8(%rsp),%xmm0
  divsd  D107(%rip),%xmm0
  mov    %rax,%r12
  mov    %rax,%rdi
  call   <fprintf@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  movq   $0x0,0x8(%rsp)
  nopw   0x0(%rax,%rax,1)
L2:
  xor    %eax,%eax
  call   <timerStart@plt>
  mov    0x20(%rsp),%rsi
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    %rbp,%rdi
  call   <selectOp@plt>
  xor    %eax,%eax
  call   <timerStop@plt>
  xor    %eax,%eax
  call   <timerGetTimeSpan@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  sub    $0x1,%ebx
  jne    L2
  mov    %r15,%rsi
  lea    D57(%rip),%rdi
  call   <fopen@plt>
  lea    D13(%rip),%rsi
  movsd  0x8(%rsp),%xmm0
  divsd  D107(%rip),%xmm0
  mov    %rax,%r12
  mov    %rax,%rdi
  call   <fprintf@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <deleteTree@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L24
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L24:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D89
type: string
name: extract_symbolic_data
arguments: label: D7
type: string
name: extract_symbolic_data
arguments: label: D105
type: string
name: extract_symbolic_data
arguments: label: D13
type: string
name: extract_symbolic_data
arguments: label: D107
type: f64
name: extract_symbolic_data
arguments: label: D1
type: string
name: extract_symbolic_data
arguments: label: D57
type: string

tool: D89: %c

tool: D7: w

tool: D105: access.out

tool: D13: %f

tool: D107: 1000

tool: D1: rank.out

tool: D57: select.out

assistant: ```c
void generateFunctionTest(char *input_file) {
  char *input;
  char *used_alphabet;
  int input_len;
  int alphabet_len;
  getAlphabetFromFile(input_file, &used_alphabet, &input, &input_len, &alphabet_len);
  struct WaveletTree *tree = buildTree(input, input_len, used_alphabet, alphabet_len);
  input_len--;
  char letter = input[0];
  printf("%c", letter);
  int access_index = input_len / 2;
  int rank_index = input_len / 2;
  int select_index = (int)sqrt(input_len / 2);
  int iter = 1000;
  double access_time = 0;
  for (int i = 0; i < iter; ++i) {
    timerStart();
    accessOp(tree, used_alphabet, access_index);
    timerStop();
    access_time += timerGetTimeSpan();
  }
  FILE *access_file = fopen("access.out", "w");
  fprintf(access_file, "%f", access_time / 1000.0);
  fclose(access_file);
  double rank_time = 0;
  for (int i = 0; i < iter; ++i) {
    timerStart();
    rankOp(tree, used_alphabet, rank_index, letter);
    timerStop();
    rank_time += timerGetTimeSpan();
  }
  FILE *rank_file = fopen("rank.out", "w");
  fprintf(rank_file, "%f", rank_time / 1000.0);
  fclose(rank_file);
  double select_time = 0;
  for (int i = 0; i < iter; ++i) {
    timerStart();
    selectOp(tree, used_alphabet, letter, select_index);
    timerStop();
    select_time += timerGetTimeSpan();
  }
  FILE *select_file = fopen("select.out", "w");
  fprintf(select_file, "%f", select_time / 1000.0);
  fclose(select_file);
  deleteTree(tree);
}
```