<|start_filename|>benchmarks/fib.c<|end_filename|>

int fib(int n) {
	if(n < 2)
		return n;
	else
		return fib(n - 1) + fib(n - 2);
}

int main(void) {
  printf("%d", fib(30));
  exit(0);
}


<|start_filename|>benchmarks/pi.lua<|end_filename|>

function pi()
    N = 14 * 5000
    NM = N - 14
    a = {}
    d = 0
    e = 0
    g = 0
    h = 0
    f = 10000
    cnt = 1
    c = NM
    while c > 0 do
        d = math.mod(d, f)
        e = d
        b = c - 1
        while b > 0 do
            g = 2 * b - 1
            if c ~= NM then
                if a[b] == nil then
                    a[b] = 0
                end
               
                d = d * b + f * a[b]
            else
                d = d * b + f * (f / 5)
            end
            a[b] = math.mod(d, g)
            d = d / g
            b = b - 1
        end
        io.write(string.format("%04d", e + d / f))
        if math.mod(cnt, 16) == 0 then
            print("")
        end
        cnt = cnt + 1
        c = c - 14;
    end
end
 
print(pi())


<|start_filename|>benchmarks/pi.c<|end_filename|>

#include <stdio.h>

void pi(void) {
  const int N = 14*5000;
  const int NM = N - 14;
  int * a = malloc(sizeof(int) * N), d = 0, g = 0, f = 10000, cnt = 1, c = NM, b;
  if(!a) {
    fputs("Out of memory.", stderr);
    return;
  }
  for(; c; c -= 14) {
    int e;
    d = d % f;
    e = d;
    for(b = c - 1; b > 0; b--) {
      g = 2 * b - 1;
      if(c != NM)
        d = d * b + f * a[b];
      else
        d = d * b + f * (f / 5);
      a[b] = d % g;
      d = d / g;
    }
    printf("%04d", e + d / f);

    if(cnt % 16 == 0)
      putchar('\n');
    cnt++;
  }
  free(a);
}

int main(void) {
    pi();
}


<|start_filename|>benchmarks/pi.js<|end_filename|>

function pi() {
    var N = 14 * 5000;
    var NM = N - 14;
    var a = {};
    var d = 0;
    var e = 0;
    var g = 0;
    var h = 0;
    var f = 10000;
    var cnt = 1;
    var c = NM;
    while(c > 0) {
        d = d % f;
        e = d;
        var b = c - 1;
        while(b > 0) {
            g = 2 * b - 1;
            if(c != NM) {
                if(!a[b]) {
                    a[b] = 0;
                }
                d = d * b + f * a[b];
            } else {
                d = d * b + f * (f / 5);
            }
            a[b] = d % g;
            d = d / g;
            b = b - 1;
        }
        process.stdout.write((Math.floor(e + d / f)).toString().padStart(4, "0"));
        if(cnt % 16 === 0) {
            console.log("");
        }
        cnt = cnt + 1;
        c = c - 14;
    }
}
 
console.log(pi());


<|start_filename|>benchmarks/fib.lua<|end_filename|>
function fib(n)
	if n < 2 then
		return n
	else
		return fib(n - 1) + fib(n - 2)
	end
end

print(fib(30))