unsigned long long variance(unsigned long long variance,
                            unsigned long long total,
                            unsigned long long rep_tests) {
  float media_cuadrados, quef1, quef2, cuadrado_media, vari;
  media_cuadrados = (variance / (float)(rep_tests - 1));
  quef1 = (total / (float)rep_tests);
  quef2 = (total / (float)(rep_tests - 1));
  cuadrado_media = quef1 * quef2;
  vari = media_cuadrados - cuadrado_media;
  return (unsigned long long)vari;
}


x86 assembly (clang, -O0):
<variance>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x34(%rbp)
test   %rax,%rax
movss  %xmm0,-0x30(%rbp)
js     114d <variance+0x4d>
movss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x3c(%rbp)
test   %rax,%rax
movss  %xmm0,-0x38(%rbp)
js     1198 <variance+0x98>
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x40(%rbp),%xmm0
movss  -0x38(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x48(%rbp)
test   %rax,%rax
movss  %xmm0,-0x44(%rbp)
js     11e8 <variance+0xe8>
movss  -0x48(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x54(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x50(%rbp)
test   %rax,%rax
movss  %xmm0,-0x4c(%rbp)
js     122f <variance+0x12f>
movss  -0x50(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x54(%rbp),%xmm0
movss  -0x4c(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x5c(%rbp)
test   %rax,%rax
movss  %xmm0,-0x58(%rbp)
js     127f <variance+0x17f>
movss  -0x5c(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
movss  -0x58(%rbp),%xmm0
movss  %xmm0,-0x68(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x64(%rbp)
test   %rax,%rax
movss  %xmm0,-0x60(%rbp)
js     12ca <variance+0x1ca>
movss  -0x64(%rbp),%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x68(%rbp),%xmm0
movss  -0x60(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x20(%rbp),%xmm0
movss  -0x24(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  -0x28(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
movss  0xcf0(%rip),%xmm2
movaps %xmm0,%xmm1
subss  %xmm2,%xmm1
cvttss2si %xmm1,%rcx
cvttss2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<variance>:
test   %rdi,%rdi
js     110c <variance+0xc>
cvtsi2ss %rdi,%xmm0
jmp    1121 <variance+0x21>
mov    %rdi,%rax
shr    %rax
and    $0x1,%edi
or     %rax,%rdi
cvtsi2ss %rdi,%xmm0
addss  %xmm0,%xmm0
mov    %rdx,%rax
add    $0xffffffffffffffff,%rax
js     114b <variance+0x4b>
cvtsi2ss %rax,%xmm1
test   %rsi,%rsi
jns    1165 <variance+0x65>
mov    %rsi,%rax
shr    %rax
and    $0x1,%esi
or     %rax,%rsi
cvtsi2ss %rsi,%xmm2
addss  %xmm2,%xmm2
jmp    116a <variance+0x6a>
mov    %rax,%rcx
shr    %rcx
and    $0x1,%eax
or     %rcx,%rax
cvtsi2ss %rax,%xmm1
addss  %xmm1,%xmm1
test   %rsi,%rsi
js     1134 <variance+0x34>
cvtsi2ss %rsi,%xmm2
divss  %xmm1,%xmm0
test   %rdx,%rdx
js     117a <variance+0x7a>
cvtsi2ss %rdx,%xmm3
jmp    118f <variance+0x8f>
mov    %rdx,%rax
shr    %rax
and    $0x1,%edx
or     %rax,%rdx
cvtsi2ss %rdx,%xmm3
addss  %xmm3,%xmm3
movaps %xmm2,%xmm4
divss  %xmm3,%xmm4
divss  %xmm1,%xmm2
mulss  %xmm4,%xmm2
subss  %xmm2,%xmm0
cvttss2si %xmm0,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subss  0xe4a(%rip),%xmm0
cvttss2si %xmm0,%rax
and    %rdx,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @variance(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%12 = load i64, i64* %4
%13 = uitofp i64 %12 to float
%14 = load i64, i64* %6
%15 = sub i64 %14, 1
%16 = uitofp i64 %15 to float
%17 = fdiv float %13, %16
store float %17, float* %7
%18 = load i64, i64* %5
%19 = uitofp i64 %18 to float
%20 = load i64, i64* %6
%21 = uitofp i64 %20 to float
%22 = fdiv float %19, %21
store float %22, float* %8
%23 = load i64, i64* %5
%24 = uitofp i64 %23 to float
%25 = load i64, i64* %6
%26 = sub i64 %25, 1
%27 = uitofp i64 %26 to float
%28 = fdiv float %24, %27
store float %28, float* %9
%29 = load float, float* %8
%30 = load float, float* %9
%31 = fmul float %29, %30
store float %31, float* %10
%32 = load float, float* %7
%33 = load float, float* %10
%34 = fsub float %32, %33
store float %34, float* %11
%35 = load float, float* %11
%36 = fptoui float %35 to i64
ret i64 %36
}

LLVM IR (-O2):
define i64 @variance(i64 %0, i64 %1, i64 %2) {
%4 = uitofp i64 %0 to float
%5 = add i64 %2, -1
%6 = uitofp i64 %5 to float
%7 = fdiv float %4, %6
%8 = uitofp i64 %1 to float
%9 = uitofp i64 %2 to float
%10 = fdiv float %8, %9
%11 = fdiv float %8, %6
%12 = fmul float %10, %11
%13 = fsub float %7, %12
%14 = fptoui float %13 to i64
ret i64 %14
}