#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*/ fillRandomVec(int *);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ seqSum(int *, int *, int *);
int main() {
  int *a, *b, *c;
  a = (int *)malloc(10000000 * sizeof(int));
  b = (int *)malloc(10000000 * sizeof(int));
  c = (int *)malloc(10000000 * sizeof(int));
  fillRandomVec(a);
  fillRandomVec(b);
  seqSum(a, b, c);
  free(a);
  free(b);
  free(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2625a00,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x2625a00,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x2625a00,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fillRandomVec@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fillRandomVec@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1060 <seqSum@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x2625a00,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    $0x2625a00,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x2625a00,%edi
call   1050 <malloc@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <fillRandomVec@plt>
mov    %rbx,%rdi
call   1040 <fillRandomVec@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1060 <seqSum@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
%5 = call i64 @malloc(i32 40000000)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %2
%7 = call i64 @malloc(i32 40000000)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %3
%9 = call i64 @malloc(i32 40000000)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %4
%11 = load i32*, i32** %2
%12 = call i32 @fillRandomVec(i32* %11)
%13 = load i32*, i32** %3
%14 = call i32 @fillRandomVec(i32* %13)
%15 = load i32*, i32** %2
%16 = load i32*, i32** %3
%17 = load i32*, i32** %4
%18 = call i32 @seqSum(i32* %15, i32* %16, i32* %17)
%19 = load i32*, i32** %2
%20 = call i32 @free(i32* %19)
%21 = load i32*, i32** %3
%22 = call i32 @free(i32* %21)
%23 = load i32*, i32** %4
%24 = call i32 @free(i32* %23)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 40000000)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i64 @malloc(i32 40000000)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i64 @malloc(i32 40000000)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @fillRandomVec(i32* %2)
%8 = tail call i32 @fillRandomVec(i32* %4)
%9 = tail call i32 @seqSum(i32* %2, i32* %4, i32* %6)
%10 = tail call i32 @free(i32* %2)
%11 = tail call i32 @free(i32* %4)
%12 = tail call i32 @free(i32* %6)
ret i32 0
}