#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 */
int /*<<< orphan*/ free(float *);
int /*<<< orphan*/ functionAddTab(float *, float *, float *, size_t, size_t);
float *malloc(int);
int main(int argc, char **argv) {
  size_t sizeLine = 5;
  size_t sizeCol = 3;
  size_t size = sizeLine * sizeCol;
  float *tabResult = malloc(sizeof(float) * size);
  float *tabA = malloc(sizeof(float) * size);
  float *tabB = malloc(sizeof(float) * size);
  functionAddTab(tabResult, tabA, tabB, sizeLine, sizeCol);
  free(tabResult);
  free(tabA);
  free(tabB);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x5,-0x18(%rbp)
movq   $0x3,-0x20(%rbp)
mov    -0x18(%rbp),%rax
imul   -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1040 <functionAddTab@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x3c,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    $0x3c,%edi
call   1050 <malloc@plt>
mov    %rax,%r15
mov    $0x3c,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x5,%ecx
mov    $0x3,%r8d
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rax,%rdx
call   1040 <functionAddTab@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 5, i64* %6
store i64 3, i64* %7
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = mul i64 %12, %13
store i64 %14, i64* %8
%15 = load i64, i64* %8
%16 = mul i64 4, %15
%17 = trunc i64 %16 to i32
%18 = call float* @malloc(i32 %17)
store float* %18, float** %9
%19 = load i64, i64* %8
%20 = mul i64 4, %19
%21 = trunc i64 %20 to i32
%22 = call float* @malloc(i32 %21)
store float* %22, float** %10
%23 = load i64, i64* %8
%24 = mul i64 4, %23
%25 = trunc i64 %24 to i32
%26 = call float* @malloc(i32 %25)
store float* %26, float** %11
%27 = load float*, float** %9
%28 = load float*, float** %10
%29 = load float*, float** %11
%30 = load i64, i64* %6
%31 = load i64, i64* %7
%32 = call i32 @functionAddTab(float* %27, float* %28, float* %29, i64 %30, i64 %31)
%33 = load float*, float** %9
%34 = call i32 @free(float* %33)
%35 = load float*, float** %10
%36 = call i32 @free(float* %35)
%37 = load float*, float** %11
%38 = call i32 @free(float* %37)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call float* @malloc(i32 60)
%4 = tail call float* @malloc(i32 60)
%5 = tail call float* @malloc(i32 60)
%6 = tail call i32 @functionAddTab(float* %3, float* %4, float* %5, i64 5, i64 3)
%7 = tail call i32 @free(float* %3)
%8 = tail call i32 @free(float* %4)
%9 = tail call i32 @free(float* %5)
ret i32 0
}