#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 */
scalar_t__ malloc(int);
float *RBR_vector_diff(float *V1, float *V2) {
  int i;
  float *V3;
  V3 = (float *)malloc(3 * sizeof(float));
  for (i = 0; i < 3; ++i) {
    V3[i] = V1[i] - V2[i];
  }
  return V3;
}


x86 assembly (clang, -O0):
<RBR_vector_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1174 <RBR_vector_diff+0x64>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <RBR_vector_diff+0x25>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RBR_vector_diff>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xc,%edi
call   1030 <malloc@plt>
movss  (%rbx),%xmm0
subss  (%r14),%xmm0
movss  %xmm0,(%rax)
movss  0x4(%rbx),%xmm0
subss  0x4(%r14),%xmm0
movss  %xmm0,0x4(%rax)
movss  0x8(%rbx),%xmm0
subss  0x8(%r14),%xmm0
movss  %xmm0,0x8(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float* @RBR_vector_diff(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i32
%6 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%7 = call i64 @malloc(i32 12)
%8 = inttoptr i64 %7 to float*
store float* %8, float** %6
store i32 0, i32* %5
br label %9
9: ; preds = %28, %2
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %31
12: ; preds = %9
%13 = load float*, float** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %13, i64 %15
%17 = load float, float* %16
%18 = load float*, float** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %18, i64 %20
%22 = load float, float* %21
%23 = fsub float %17, %22
%24 = load float*, float** %6
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds float, float* %24, i64 %26
store float %23, float* %27
br label %28
28: ; preds = %12
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %9
31: ; preds = %9
%32 = load float*, float** %6
ret float* %32
}

LLVM IR (-O2):
define float* @RBR_vector_diff(float* nocapture %0, float* nocapture %1) {
%3 = tail call i64 @malloc(i32 12)
%4 = inttoptr i64 %3 to float*
%5 = load float, float* %0
%6 = load float, float* %1
%7 = fsub float %5, %6
store float %7, float* %4
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = load float, float* %8
%10 = getelementptr inbounds float, float* %1, i64 1
%11 = load float, float* %10
%12 = fsub float %9, %11
%13 = getelementptr inbounds float, float* %4, i64 1
store float %12, float* %13
%14 = getelementptr inbounds float, float* %0, i64 2
%15 = load float, float* %14
%16 = getelementptr inbounds float, float* %1, i64 2
%17 = load float, float* %16
%18 = fsub float %15, %17
%19 = getelementptr inbounds float, float* %4, i64 2
store float %18, float* %19
ret float* %4
}