#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 */

/* Variables and functions */
double matrixMultiply(int, int);
int /*<<< orphan*/ printf(char *, ...);
void table() {
  printf("Size\tThreads\n");
  printf("\t1\t\t2\t\t4\n");
  printf("100\t%f\t%f\t%f\n", matrixMultiply(100, 1), matrixMultiply(100, 2),
         matrixMultiply(100, 4));
  printf("1000\t%f\t%f\t%f\n", matrixMultiply(1000, 1), matrixMultiply(1000, 2),
         matrixMultiply(1000, 4));
  printf("10000\t%f\t%f\t%f\n", matrixMultiply(10000, 1),
         matrixMultiply(10000, 2), matrixMultiply(10000, 4));
  printf("30000\t%f\t%f\t%f\n", matrixMultiply(30000, 1),
         matrixMultiply(30000, 2), matrixMultiply(30000, 4));
}


x86 assembly (clang, -O0):
<table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x64,%edi
mov    $0x1,%esi
call   1040 <matrixMultiply@plt>
movsd  %xmm0,-0x38(%rbp)
mov    $0x64,%edi
mov    $0x2,%esi
call   1040 <matrixMultiply@plt>
movsd  %xmm0,-0x40(%rbp)
mov    $0x64,%edi
mov    $0x4,%esi
call   1040 <matrixMultiply@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
lea    0xe89(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    $0x3e8,%edi
mov    $0x1,%esi
call   1040 <matrixMultiply@plt>
movsd  %xmm0,-0x28(%rbp)
mov    $0x3e8,%edi
mov    $0x2,%esi
call   1040 <matrixMultiply@plt>
movsd  %xmm0,-0x30(%rbp)
mov    $0x3e8,%edi
mov    $0x4,%esi
call   1040 <matrixMultiply@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
lea    0xe45(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    $0x2710,%edi
mov    $0x1,%esi
call   1040 <matrixMultiply@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x2710,%edi
mov    $0x2,%esi
call   1040 <matrixMultiply@plt>
movsd  %xmm0,-0x20(%rbp)
mov    $0x2710,%edi
mov    $0x4,%esi
call   1040 <matrixMultiply@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
lea    0xe02(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    $0x7530,%edi
mov    $0x1,%esi
call   1040 <matrixMultiply@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x7530,%edi
mov    $0x2,%esi
call   1040 <matrixMultiply@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x7530,%edi
mov    $0x4,%esi
call   1040 <matrixMultiply@plt>
movsd  -0x10(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x8(%rbp),%xmm0
lea    0xdc0(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<table>:
sub    $0x18,%rsp
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%edi
mov    $0x1,%esi
call   1050 <matrixMultiply@plt>
movsd  %xmm0,0x10(%rsp)
mov    $0x64,%edi
mov    $0x2,%esi
call   1050 <matrixMultiply@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x64,%edi
mov    $0x4,%esi
call   1050 <matrixMultiply@plt>
movaps %xmm0,%xmm2
lea    0xe71(%rip),%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x3,%al
call   1040 <printf@plt>
mov    $0x3e8,%edi
mov    $0x1,%esi
call   1050 <matrixMultiply@plt>
movsd  %xmm0,0x10(%rsp)
mov    $0x3e8,%edi
mov    $0x2,%esi
call   1050 <matrixMultiply@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x3e8,%edi
mov    $0x4,%esi
call   1050 <matrixMultiply@plt>
movaps %xmm0,%xmm2
lea    0xe29(%rip),%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x3,%al
call   1040 <printf@plt>
mov    $0x2710,%edi
mov    $0x1,%esi
call   1050 <matrixMultiply@plt>
movsd  %xmm0,0x10(%rsp)
mov    $0x2710,%edi
mov    $0x2,%esi
call   1050 <matrixMultiply@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x2710,%edi
mov    $0x4,%esi
call   1050 <matrixMultiply@plt>
movaps %xmm0,%xmm2
lea    0xde2(%rip),%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x3,%al
call   1040 <printf@plt>
mov    $0x7530,%edi
mov    $0x1,%esi
call   1050 <matrixMultiply@plt>
movsd  %xmm0,0x10(%rsp)
mov    $0x7530,%edi
mov    $0x2,%esi
call   1050 <matrixMultiply@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x7530,%edi
mov    $0x4,%esi
call   1050 <matrixMultiply@plt>
movaps %xmm0,%xmm2
lea    0xd9c(%rip),%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x3,%al
add    $0x18,%rsp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Size\09Threads\0A\00"
@.str.1 = [10 x i8] c"\091\09\092\09\094\0A\00"
@.str.2 = [14 x i8] c"100\09%f\09%f\09%f\0A\00"
@.str.3 = [15 x i8] c"1000\09%f\09%f\09%f\0A\00"
@.str.4 = [16 x i8] c"10000\09%f\09%f\09%f\0A\00"
@.str.5 = [16 x i8] c"30000\09%f\09%f\09%f\0A\00"
define void @table() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call double @matrixMultiply(i32 100, i32 1)
%4 = call double @matrixMultiply(i32 100, i32 2)
%5 = call double @matrixMultiply(i32 100, i32 4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %3, double %4, double %5)
%7 = call double @matrixMultiply(i32 1000, i32 1)
%8 = call double @matrixMultiply(i32 1000, i32 2)
%9 = call double @matrixMultiply(i32 1000, i32 4)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %7, double %8, double %9)
%11 = call double @matrixMultiply(i32 10000, i32 1)
%12 = call double @matrixMultiply(i32 10000, i32 2)
%13 = call double @matrixMultiply(i32 10000, i32 4)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %11, double %12, double %13)
%15 = call double @matrixMultiply(i32 30000, i32 1)
%16 = call double @matrixMultiply(i32 30000, i32 2)
%17 = call double @matrixMultiply(i32 30000, i32 4)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), double %15, double %16, double %17)
ret void
}

LLVM IR (-O2):
@.str.2 = [14 x i8] c"100\09%f\09%f\09%f\0A\00"
@.str.3 = [15 x i8] c"1000\09%f\09%f\09%f\0A\00"
@.str.4 = [16 x i8] c"10000\09%f\09%f\09%f\0A\00"
@.str.5 = [16 x i8] c"30000\09%f\09%f\09%f\0A\00"
@str = [13 x i8] c"Size\09Threads\00"
@str.6 = [9 x i8] c"\091\09\092\09\094\00"
define void @table() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.6, i64 0, i64 0))
%3 = tail call double @matrixMultiply(i32 100, i32 1)
%4 = tail call double @matrixMultiply(i32 100, i32 2)
%5 = tail call double @matrixMultiply(i32 100, i32 4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %3, double %4, double %5)
%7 = tail call double @matrixMultiply(i32 1000, i32 1)
%8 = tail call double @matrixMultiply(i32 1000, i32 2)
%9 = tail call double @matrixMultiply(i32 1000, i32 4)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %7, double %8, double %9)
%11 = tail call double @matrixMultiply(i32 10000, i32 1)
%12 = tail call double @matrixMultiply(i32 10000, i32 2)
%13 = tail call double @matrixMultiply(i32 10000, i32 4)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %11, double %12, double %13)
%15 = tail call double @matrixMultiply(i32 30000, i32 1)
%16 = tail call double @matrixMultiply(i32 30000, i32 2)
%17 = tail call double @matrixMultiply(i32 30000, i32 4)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), double %15, double %16, double %17)
ret void
}