void print_stats(int generation, int population, int worldSize, int width,
                 int height) {
  float density = (population * 1.) / worldSize;
  printf("\n\t\t\t%s%sGame Of Life : %s%s%s\n", "\033[1m", "\033[32m", "C-O.6",
         "\033[37m", "\033[0m");
  printf("\nWorld size : %s%s%d x %d = %d%s%s squares\t\t", "\033[1m",
         "\033[33m", width, height, worldSize, "\033[37m", "\033[0m");
  printf("Generation : %s%s%d%s%s\n", "\033[1m", "\033[33m", generation,
         "\033[37m", "\033[0m");
  printf("Population : %s%s%5d%s%s\t\t\t\t", "\033[1m", "\033[33m", population,
         "\033[37m", "\033[0m");
  printf("Density : %s%s%f%s%s\n\t\t\t\t\t\t", "\033[1m", "\033[33m", density,
         "\033[37m", "\033[0m");
  printf("An average of one cell every %s%s%.1f%s%s squares\n\n", "\033[1m",
         "\033[33m", 1 / density, "\033[37m", "\033[0m");
}


x86 assembly (clang, -O0):
<print_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xed3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xebe(%rip),%rdi
lea    0xed6(%rip),%rsi
lea    0xed4(%rip),%rdx
lea    0xed3(%rip),%rcx
lea    0xed2(%rip),%r8
lea    0xed1(%rip),%r9
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0xebd(%rip),%rdi
lea    0xe9a(%rip),%rsi
lea    0xedc(%rip),%rdx
lea    0xe9d(%rip),%r10
lea    0xe9c(%rip),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%ecx
lea    0xeba(%rip),%rdi
lea    0xe64(%rip),%rsi
lea    0xea6(%rip),%rdx
lea    0xe67(%rip),%r8
lea    0xe66(%rip),%r9
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%ecx
lea    0xea6(%rip),%rdi
lea    0xe37(%rip),%rsi
lea    0xe79(%rip),%rdx
lea    0xe3a(%rip),%r8
lea    0xe39(%rip),%r9
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe90(%rip),%rdi
lea    0xe04(%rip),%rsi
lea    0xe46(%rip),%rdx
lea    0xe07(%rip),%rcx
lea    0xe06(%rip),%r8
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xdb1(%rip),%xmm0
divss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe71(%rip),%rdi
lea    0xdc9(%rip),%rsi
lea    0xe0b(%rip),%rdx
lea    0xdcc(%rip),%rcx
lea    0xdcb(%rip),%r8
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_stats>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,%r13d
mov    %esi,0x14(%rsp)
cvtsi2sd %esi,%xmm0
cvtsi2sd %edx,%xmm1
mov    %r8d,0xc(%rsp)
mov    %ecx,%r15d
mov    %edi,0x10(%rsp)
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
lea    0xeb6(%rip),%rdi
lea    0xece(%rip),%rbx
lea    0xecc(%rip),%rdx
lea    0xecb(%rip),%rcx
lea    0xeca(%rip),%r12
lea    0xec9(%rip),%rbp
mov    %rbx,%rsi
mov    %r12,%r8
mov    %rbp,%r9
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    0xedd(%rip),%r14
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15d,%ecx
mov    0xc(%rsp),%r8d
mov    %r13d,%r9d
xor    %eax,%eax
push   %rbp
push   %r12
call   1030 <printf@plt>
add    $0x10,%rsp
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    0x10(%rsp),%ecx
mov    %r12,%r8
mov    %rbp,%r9
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    0x14(%rsp),%ecx
mov    %r12,%r8
mov    %rbp,%r9
xor    %eax,%eax
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %rbp,%r8
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xdea(%rip),%xmm0
divss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %rbp,%r8
mov    $0x1,%al
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"\0A\09\09\09%s%sGame Of Life : %s%s%s\0A\00"
@.str.1 = [5 x i8] c"\1B[1m\00"
@.str.2 = [6 x i8] c"\1B[32m\00"
@.str.3 = [6 x i8] c"C-O.6\00"
@.str.4 = [6 x i8] c"\1B[37m\00"
@.str.5 = [5 x i8] c"\1B[0m\00"
@.str.6 = [45 x i8] c"\0AWorld size : %s%s%d x %d = %d%s%s squares\09\09\00"
@.str.7 = [6 x i8] c"\1B[33m\00"
@.str.8 = [25 x i8] c"Generation : %s%s%d%s%s\0A\00"
@.str.9 = [29 x i8] c"Population : %s%s%5d%s%s\09\09\09\09\00"
@.str.10 = [28 x i8] c"Density : %s%s%f%s%s\0A\09\09\09\09\09\09\00"
@.str.11 = [52 x i8] c"An average of one cell every %s%s%.1f%s%s squares\0A\0A\00"
define void @print_stats(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %7
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 1.000000e+00
%15 = load i32, i32* %8
%16 = sitofp i32 %15 to double
%17 = fdiv double %14, %16
%18 = fptrunc double %17 to float
store float %18, float* %11
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%20 = load i32, i32* %9
%21 = load i32, i32* %10
%22 = load i32, i32* %8
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %20, i32 %21, i32 %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%24 = load i32, i32* %6
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%26 = load i32, i32* %7
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%28 = load float, float* %11
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%31 = load float, float* %11
%32 = fdiv float 1.000000e+00, %31
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %33, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0A\09\09\09%s%sGame Of Life : %s%s%s\0A\00"
@.str.1 = [5 x i8] c"\1B[1m\00"
@.str.2 = [6 x i8] c"\1B[32m\00"
@.str.3 = [6 x i8] c"C-O.6\00"
@.str.4 = [6 x i8] c"\1B[37m\00"
@.str.5 = [5 x i8] c"\1B[0m\00"
@.str.6 = [45 x i8] c"\0AWorld size : %s%s%d x %d = %d%s%s squares\09\09\00"
@.str.7 = [6 x i8] c"\1B[33m\00"
@.str.8 = [25 x i8] c"Generation : %s%s%d%s%s\0A\00"
@.str.9 = [29 x i8] c"Population : %s%s%5d%s%s\09\09\09\09\00"
@.str.10 = [28 x i8] c"Density : %s%s%f%s%s\0A\09\09\09\09\09\09\00"
@.str.11 = [52 x i8] c"An average of one cell every %s%s%.1f%s%s squares\0A\0A\00"
define void @print_stats(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sitofp i32 %1 to double
%7 = sitofp i32 %2 to double
%8 = fdiv double %6, %7
%9 = fptrunc double %8 to float
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %3, i32 %4, i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%14 = fpext float %9 to double
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%16 = fdiv float 1.000000e+00, %9
%17 = fpext float %16 to double
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret void
}