#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 */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
scalar_t__ _mm_malloc(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sumvetsse(float *, float *, float *, int);
int main() {
  float *a, *b, *c;
  long i;
  __m128 v1, v2, v3;
  a = (float *)_mm_malloc(100000000 * sizeof(float), 16);
  b = (float *)_mm_malloc(100000000 * sizeof(float), 16);
  c = (float *)_mm_malloc(100000000 * sizeof(float), 16);
  a[0] = 1.2;
  b[0] = 4.5;
  a[1] = 0.5;
  b[1] = 0.7;
  a[2] = 1.5;
  b[2] = 1.7;
  printf("Alocacao efetuada\n");
  sumvetsse(a, b, c, 100000000);
  printf("%f\n%f\n%f\n", c[0], c[1], c[2]);
  printf("Fim\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x17d78400,%edi
mov    $0x10,%esi
call   1050 <_mm_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x17d78400,%edi
mov    $0x10,%esi
call   1050 <_mm_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x17d78400,%edi
mov    $0x10,%esi
call   1050 <_mm_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movss  0xe90(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0xe7c(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0xe68(%rip),%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x18(%rbp),%rax
movss  0xe53(%rip),%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0xe3e(%rip),%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movss  0xe29(%rip),%xmm0
movss  %xmm0,0x8(%rax)
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x5f5e100,%ecx
call   1040 <sumvetsse@plt>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x20(%rbp),%rax
movss  0x4(%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x20(%rbp),%rax
movss  0x8(%rax),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xdfe(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x17d78400,%edi
mov    $0x10,%esi
call   1060 <_mm_malloc@plt>
mov    %rax,%r14
mov    $0x17d78400,%edi
mov    $0x10,%esi
call   1060 <_mm_malloc@plt>
mov    %rax,%rbx
mov    $0x17d78400,%edi
mov    $0x10,%esi
call   1060 <_mm_malloc@plt>
mov    %rax,%r15
movl   $0x3f99999a,(%r14)
movl   $0x40900000,(%rbx)
movl   $0x3f000000,0x4(%r14)
3f
movl   $0x3f333333,0x4(%rbx)
movl   $0x3fc00000,0x8(%r14)
3f
movl   $0x3fd9999a,0x8(%rbx)
lea    0xe5d(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    $0x5f5e100,%ecx
call   1050 <sumvetsse@plt>
movss  (%r15),%xmm0
movss  0x4(%r15),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movss  0x8(%r15),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe17(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
lea    0xe25(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Alocacao efetuada\0A\00"
@.str.1 = [10 x i8] c"%f\0A%f\0A%f\0A\00"
@.str.2 = [5 x i8] c"Fim\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float*
%3 = alloca float*
%4 = alloca float*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i64 @_mm_malloc(i32 400000000, i32 16)
%10 = inttoptr i64 %9 to float*
store float* %10, float** %2
%11 = call i64 @_mm_malloc(i32 400000000, i32 16)
%12 = inttoptr i64 %11 to float*
store float* %12, float** %3
%13 = call i64 @_mm_malloc(i32 400000000, i32 16)
%14 = inttoptr i64 %13 to float*
store float* %14, float** %4
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 0
store float 0x3FF3333340000000, float* %16
%17 = load float*, float** %3
%18 = getelementptr inbounds float, float* %17, i64 0
store float 4.500000e+00, float* %18
%19 = load float*, float** %2
%20 = getelementptr inbounds float, float* %19, i64 1
store float 5.000000e-01, float* %20
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 1
store float 0x3FE6666660000000, float* %22
%23 = load float*, float** %2
%24 = getelementptr inbounds float, float* %23, i64 2
store float 1.500000e+00, float* %24
%25 = load float*, float** %3
%26 = getelementptr inbounds float, float* %25, i64 2
store float 0x3FFB333340000000, float* %26
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%28 = load float*, float** %2
%29 = load float*, float** %3
%30 = load float*, float** %4
%31 = call i32 @sumvetsse(float* %28, float* %29, float* %30, i32 100000000)
%32 = load float*, float** %4
%33 = getelementptr inbounds float, float* %32, i64 0
%34 = load float, float* %33
%35 = fpext float %34 to double
%36 = load float*, float** %4
%37 = getelementptr inbounds float, float* %36, i64 1
%38 = load float, float* %37
%39 = fpext float %38 to double
%40 = load float*, float** %4
%41 = getelementptr inbounds float, float* %40, i64 2
%42 = load float, float* %41
%43 = fpext float %42 to double
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %35, double %39, double %43)
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"%f\0A%f\0A%f\0A\00"
@str = [18 x i8] c"Alocacao efetuada\00"
@str.3 = [4 x i8] c"Fim\00"
define i32 @main() {
%1 = tail call i64 @_mm_malloc(i32 400000000, i32 16)
%2 = inttoptr i64 %1 to float*
%3 = tail call i64 @_mm_malloc(i32 400000000, i32 16)
%4 = inttoptr i64 %3 to float*
%5 = tail call i64 @_mm_malloc(i32 400000000, i32 16)
%6 = inttoptr i64 %5 to float*
store float 0x3FF3333340000000, float* %2
store float 4.500000e+00, float* %4
%7 = getelementptr inbounds float, float* %2, i64 1
store float 5.000000e-01, float* %7
%8 = getelementptr inbounds float, float* %4, i64 1
store float 0x3FE6666660000000, float* %8
%9 = getelementptr inbounds float, float* %2, i64 2
store float 1.500000e+00, float* %9
%10 = getelementptr inbounds float, float* %4, i64 2
store float 0x3FFB333340000000, float* %10
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @sumvetsse(float* %2, float* %4, float* %6, i32 100000000)
%13 = load float, float* %6
%14 = fpext float %13 to double
%15 = getelementptr inbounds float, float* %6, i64 1
%16 = load float, float* %15
%17 = fpext float %16 to double
%18 = getelementptr inbounds float, float* %6, i64 2
%19 = load float, float* %18
%20 = fpext float %19 to double
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %14, double %17, double %20)
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}