#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct WaveletTree {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ accessOp(struct WaveletTree *, char *, int);
struct WaveletTree *buildTree(char *, int, char *, int);
int /*<<< orphan*/ deleteTree(struct WaveletTree *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double);
int /*<<< orphan*/ getAlphabetFromFile(char *, char **, char **, int *, int *);
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ rankOp(struct WaveletTree *, char *, int, char);
int /*<<< orphan*/ selectOp(struct WaveletTree *, char *, char, int);
scalar_t__ sqrt(int);
scalar_t__ timerGetTimeSpan();
int /*<<< orphan*/ timerStart();
int /*<<< orphan*/ timerStop();
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);
}


x86 assembly (clang, -O0):
<generateFunctionTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1030 <getAlphabetFromFile@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%ecx
call   1090 <buildTree@plt>
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x29(%rbp)
lea    0xdd0(%rip),%rdi
movsbl -0x29(%rbp),%esi
call   1060 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x34(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   10d0 <sqrt@plt>
mov    %eax,-0x38(%rbp)
movl   $0x3e8,-0x3c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    12d6 <generateFunctionTest+0xf6>
mov    $0x0,%al
call   10c0 <timerStart@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x30(%rbp),%edx
call   10a0 <accessOp@plt>
mov    $0x0,%al
call   10e0 <timerStop@plt>
mov    $0x0,%al
call   1050 <timerGetTimeSpan@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1288 <generateFunctionTest+0xa8>
lea    0xd2e(%rip),%rdi
lea    0xd32(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
movsd  -0x48(%rbp),%xmm0
movsd  0xd02(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xd0f(%rip),%rsi
call   1080 <fprintf@plt>
mov    -0x58(%rbp),%rdi
call   1040 <fclose@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    1378 <generateFunctionTest+0x198>
mov    $0x0,%al
call   10c0 <timerStart@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x34(%rbp),%edx
movsbl -0x29(%rbp),%ecx
call   10f0 <rankOp@plt>
mov    $0x0,%al
call   10e0 <timerStop@plt>
mov    $0x0,%al
call   1050 <timerGetTimeSpan@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1326 <generateFunctionTest+0x146>
lea    0xc9c(%rip),%rdi
lea    0xc90(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rdi
movsd  -0x60(%rbp),%xmm0
movsd  0xc60(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xc6d(%rip),%rsi
call   1080 <fprintf@plt>
mov    -0x70(%rbp),%rdi
call   1040 <fclose@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    141c <generateFunctionTest+0x23c>
mov    $0x0,%al
call   10c0 <timerStart@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x29(%rbp),%al
mov    -0x38(%rbp),%ecx
movsbl %al,%edx
call   1100 <selectOp@plt>
mov    $0x0,%al
call   10e0 <timerStop@plt>
mov    $0x0,%al
call   1050 <timerGetTimeSpan@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    13c8 <generateFunctionTest+0x1e8>
lea    0xc01(%rip),%rdi
lea    0xbec(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
movsd  -0x78(%rbp),%xmm0
movsd  0xbb6(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xbc3(%rip),%rsi
call   1080 <fprintf@plt>
mov    -0x88(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1070 <deleteTree@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateFunctionTest>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0x10(%rsp),%rsi
lea    0x20(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x1c(%rsp),%r8
call   1030 <getAlphabetFromFile@plt>
mov    0x20(%rsp),%rdi
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%rdx
mov    0x1c(%rsp),%ecx
call   1090 <buildTree@plt>
mov    %rax,%r13
addl   $0xffffffff,0xc(%rsp)
mov    0x20(%rsp),%rax
movsbl (%rax),%r15d
lea    0xdd2(%rip),%rdi
mov    %r15d,%esi
call   1060 <printf@plt>
mov    0xc(%rsp),%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
mov    %ebp,%edi
call   10d0 <sqrt@plt>
mov    %rax,%r14
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   10c0 <timerStart@plt>
mov    0x10(%rsp),%rsi
mov    %r13,%rdi
mov    %ebp,%edx
call   10a0 <accessOp@plt>
xor    %eax,%eax
call   10e0 <timerStop@plt>
xor    %eax,%eax
call   1050 <timerGetTimeSpan@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
add    $0xffffffff,%ebx
jne    1270 <generateFunctionTest+0x90>
lea    0xd55(%rip),%rdi
lea    0xd59(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r12
movsd  (%rsp),%xmm0
divsd  0xd2e(%rip),%xmm0
lea    0xd3f(%rip),%rsi
mov    %rax,%rdi
call   1080 <fprintf@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
mov    $0x3e8,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10c0 <timerStart@plt>
mov    0x10(%rsp),%rsi
mov    %r13,%rdi
mov    %ebp,%edx
mov    %r15d,%ecx
call   10f0 <rankOp@plt>
xor    %eax,%eax
call   10e0 <timerStop@plt>
xor    %eax,%eax
call   1050 <timerGetTimeSpan@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
add    $0xffffffff,%ebx
jne    1300 <generateFunctionTest+0x120>
lea    0xcd2(%rip),%rdi
lea    0xcc6(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%rbp
movsd  (%rsp),%xmm0
divsd  0xc9b(%rip),%xmm0
lea    0xcac(%rip),%rsi
mov    %rax,%rdi
call   1080 <fprintf@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
mov    $0x3e8,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10c0 <timerStart@plt>
mov    0x10(%rsp),%rsi
mov    %r13,%rdi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1100 <selectOp@plt>
xor    %eax,%eax
call   10e0 <timerStop@plt>
xor    %eax,%eax
call   1050 <timerGetTimeSpan@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
add    $0xffffffff,%ebx
jne    1390 <generateFunctionTest+0x1b0>
lea    0xc4a(%rip),%rdi
lea    0xc35(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%rbp
movsd  (%rsp),%xmm0
divsd  0xc0a(%rip),%xmm0
lea    0xc1b(%rip),%rsi
mov    %rax,%rdi
call   1080 <fprintf@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    %r13,%rdi
call   1070 <deleteTree@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.WaveletTree = type { i32 }
@.str = [3 x i8] c"%c\00"
@.str.1 = [11 x i8] c"access.out\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [9 x i8] c"rank.out\00"
@.str.5 = [11 x i8] c"select.out\00"
define void @generateFunctionTest(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.WaveletTree*
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca i32
%15 = alloca i32*
%16 = alloca double
%17 = alloca i32
%18 = alloca i32*
%19 = alloca double
%20 = alloca i32
%21 = alloca i32*
store i8* %0, i8** %2
%22 = load i8*, i8** %2
%23 = call i32 @getAlphabetFromFile(i8* %22, i8** %4, i8** %3, i32* %5, i32* %6)
%24 = load i8*, i8** %3
%25 = load i32, i32* %5
%26 = load i8*, i8** %4
%27 = load i32, i32* %6
%28 = call %struct.WaveletTree* @buildTree(i8* %24, i32 %25, i8* %26, i32 %27)
store %struct.WaveletTree* %28, %struct.WaveletTree** %7
%29 = load i32, i32* %5
%30 = add nsw i32 %29, -1
store i32 %30, i32* %5
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i64 0
%33 = load i8, i8* %32
store i8 %33, i8* %8
%34 = load i8, i8* %8
%35 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %34)
%36 = load i32, i32* %5
%37 = sdiv i32 %36, 2
store i32 %37, i32* %9
%38 = load i32, i32* %5
%39 = sdiv i32 %38, 2
store i32 %39, i32* %10
%40 = load i32, i32* %5
%41 = sdiv i32 %40, 2
%42 = call i64 @sqrt(i32 %41)
%43 = trunc i64 %42 to i32
store i32 %43, i32* %11
store i32 1000, i32* %12
store double 0.000000e+00, double* %13
store i32 0, i32* %14
br label %44
44: ; preds = %59, %1
%45 = load i32, i32* %14
%46 = load i32, i32* %12
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %62
48: ; preds = %44
%49 = call i32 (...) @timerStart()
%50 = load %struct.WaveletTree*, %struct.WaveletTree** %7
%51 = load i8*, i8** %4
%52 = load i32, i32* %9
%53 = call i32 @accessOp(%struct.WaveletTree* %50, i8* %51, i32 %52)
%54 = call i32 (...) @timerStop()
%55 = call i64 (...) @timerGetTimeSpan()
%56 = sitofp i64 %55 to double
%57 = load double, double* %13
%58 = fadd double %57, %56
store double %58, double* %13
br label %59
59: ; preds = %48
%60 = load i32, i32* %14
%61 = add nsw i32 %60, 1
store i32 %61, i32* %14
br label %44
62: ; preds = %44
%63 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %63, i32** %15
%64 = load i32*, i32** %15
%65 = load double, double* %13
%66 = fdiv double %65, 1.000000e+03
%67 = call i32 @fprintf(i32* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double %66)
%68 = load i32*, i32** %15
%69 = call i32 @fclose(i32* %68)
store double 0.000000e+00, double* %16
store i32 0, i32* %17
br label %70
70: ; preds = %86, %62
%71 = load i32, i32* %17
%72 = load i32, i32* %12
%73 = icmp slt i32 %71, %72
br i1 %73, label %74, label %89
74: ; preds = %70
%75 = call i32 (...) @timerStart()
%76 = load %struct.WaveletTree*, %struct.WaveletTree** %7
%77 = load i8*, i8** %4
%78 = load i32, i32* %10
%79 = load i8, i8* %8
%80 = call i32 @rankOp(%struct.WaveletTree* %76, i8* %77, i32 %78, i8 signext %79)
%81 = call i32 (...) @timerStop()
%82 = call i64 (...) @timerGetTimeSpan()
%83 = sitofp i64 %82 to double
%84 = load double, double* %16
%85 = fadd double %84, %83
store double %85, double* %16
br label %86
86: ; preds = %74
%87 = load i32, i32* %17
%88 = add nsw i32 %87, 1
store i32 %88, i32* %17
br label %70
89: ; preds = %70
%90 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %90, i32** %18
%91 = load i32*, i32** %18
%92 = load double, double* %16
%93 = fdiv double %92, 1.000000e+03
%94 = call i32 @fprintf(i32* %91, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double %93)
%95 = load i32*, i32** %18
%96 = call i32 @fclose(i32* %95)
store double 0.000000e+00, double* %19
store i32 0, i32* %20
br label %97
97: ; preds = %113, %89
%98 = load i32, i32* %20
%99 = load i32, i32* %12
%100 = icmp slt i32 %98, %99
br i1 %100, label %101, label %116
101: ; preds = %97
%102 = call i32 (...) @timerStart()
%103 = load %struct.WaveletTree*, %struct.WaveletTree** %7
%104 = load i8*, i8** %4
%105 = load i8, i8* %8
%106 = load i32, i32* %11
%107 = call i32 @selectOp(%struct.WaveletTree* %103, i8* %104, i8 signext %105, i32 %106)
%108 = call i32 (...) @timerStop()
%109 = call i64 (...) @timerGetTimeSpan()
%110 = sitofp i64 %109 to double
%111 = load double, double* %19
%112 = fadd double %111, %110
store double %112, double* %19
br label %113
113: ; preds = %101
%114 = load i32, i32* %20
%115 = add nsw i32 %114, 1
store i32 %115, i32* %20
br label %97
116: ; preds = %97
%117 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %117, i32** %21
%118 = load i32*, i32** %21
%119 = load double, double* %19
%120 = fdiv double %119, 1.000000e+03
%121 = call i32 @fprintf(i32* %118, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double %120)
%122 = load i32*, i32** %21
%123 = call i32 @fclose(i32* %122)
%124 = load %struct.WaveletTree*, %struct.WaveletTree** %7
%125 = call i32 @deleteTree(%struct.WaveletTree* %124)
ret void
}

LLVM IR (-O2):
%struct.WaveletTree = type { i32 }
@.str = [3 x i8] c"%c\00"
@.str.1 = [11 x i8] c"access.out\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [9 x i8] c"rank.out\00"
@.str.5 = [11 x i8] c"select.out\00"
define void @generateFunctionTest(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i8** %2 to i8*
%7 = bitcast i8** %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = call i32 @getAlphabetFromFile(i8* %0, i8** %3, i8** %2, i32* %4, i32* %5)
%11 = load i8*, i8** %2
%12 = load i32, i32* %4
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = call %struct.WaveletTree* @buildTree(i8* %11, i32 %12, i8* %13, i32 %14)
%16 = load i32, i32* %4
%17 = add nsw i32 %16, -1
store i32 %17, i32* %4
%18 = load i8*, i8** %2
%19 = load i8, i8* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %19)
%21 = load i32, i32* %4
%22 = sdiv i32 %21, 2
%23 = call i64 @sqrt(i32 %22)
br label %29
24: ; preds = %29
%25 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%26 = fdiv double %38, 1.000000e+03
%27 = call i32 @fprintf(i32* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double %26)
%28 = call i32 @fclose(i32* %25)
br label %47
29: ; preds = %1, %29
%30 = phi double [ 0.000000e+00, %1 ], [ %38, %29 ]
%31 = phi i32 [ 0, %1 ], [ %39, %29 ]
%32 = call i32 (...) @timerStart()
%33 = load i8*, i8** %3
%34 = call i32 @accessOp(%struct.WaveletTree* %15, i8* %33, i32 %22)
%35 = call i32 (...) @timerStop()
%36 = call i64 (...) @timerGetTimeSpan()
%37 = sitofp i64 %36 to double
%38 = fadd double %30, %37
%39 = add nuw nsw i32 %31, 1
%40 = icmp eq i32 %39, 1000
br i1 %40, label %24, label %29
41: ; preds = %47
%42 = trunc i64 %23 to i32
%43 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%44 = fdiv double %56, 1.000000e+03
%45 = call i32 @fprintf(i32* %43, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double %44)
%46 = call i32 @fclose(i32* %43)
br label %65
47: ; preds = %24, %47
%48 = phi i32 [ 0, %24 ], [ %57, %47 ]
%49 = phi double [ 0.000000e+00, %24 ], [ %56, %47 ]
%50 = call i32 (...) @timerStart()
%51 = load i8*, i8** %3
%52 = call i32 @rankOp(%struct.WaveletTree* %15, i8* %51, i32 %22, i8 signext %19)
%53 = call i32 (...) @timerStop()
%54 = call i64 (...) @timerGetTimeSpan()
%55 = sitofp i64 %54 to double
%56 = fadd double %49, %55
%57 = add nuw nsw i32 %48, 1
%58 = icmp eq i32 %57, 1000
br i1 %58, label %41, label %47
59: ; preds = %65
%60 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%61 = fdiv double %74, 1.000000e+03
%62 = call i32 @fprintf(i32* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double %61)
%63 = call i32 @fclose(i32* %60)
%64 = call i32 @deleteTree(%struct.WaveletTree* %15)
ret void
65: ; preds = %41, %65
%66 = phi i32 [ 0, %41 ], [ %75, %65 ]
%67 = phi double [ 0.000000e+00, %41 ], [ %74, %65 ]
%68 = call i32 (...) @timerStart()
%69 = load i8*, i8** %3
%70 = call i32 @selectOp(%struct.WaveletTree* %15, i8* %69, i8 signext %19, i32 %42)
%71 = call i32 (...) @timerStop()
%72 = call i64 (...) @timerGetTimeSpan()
%73 = sitofp i64 %72 to double
%74 = fadd double %67, %73
%75 = add nuw nsw i32 %66, 1
%76 = icmp eq i32 %75, 1000
br i1 %76, label %59, label %65
}