#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*/ cross(float *, float *, float *);
int cross_vectors(float *u, float *v, float *w, size_t amount) {
  while (amount-- > 0) {
    cross(&u[amount * 3], &v[amount * 3], &w[amount * 3]);
  }
}


x86 assembly (clang, -O0):
<cross_vectors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x28(%rbp)
cmp    $0x0,%rax
jbe    117b <cross_vectors+0x6b>
mov    -0x10(%rbp),%rdi
imul   $0x3,-0x28(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
imul   $0x3,-0x28(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x20(%rbp),%rdx
imul   $0x3,-0x28(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
call   1030 <cross@plt>
jmp    1128 <cross_vectors+0x18>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cross_vectors>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rcx,%rcx
je     1160 <cross_vectors+0x50>
mov    %rcx,%r14
lea    (%rcx,%rcx,2),%rax
lea    (%rdx,%rax,4),%r15
add    $0xfffffffffffffff4,%r15
lea    (%rsi,%rax,4),%r12
add    $0xfffffffffffffff4,%r12
lea    (%rdi,%rax,4),%rbx
add    $0xfffffffffffffff4,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1030 <cross@plt>
add    $0xfffffffffffffff4,%r15
add    $0xfffffffffffffff4,%r12
add    $0xfffffffffffffff4,%rbx
add    $0xffffffffffffffff,%r14
jne    1140 <cross_vectors+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @cross_vectors(float* %0, float* %1, float* %2, i64 %3) {
%5 = icmp eq i64 %3, 0
br i1 %5, label %15, label %6
6: ; preds = %4, %6
%7 = phi i64 [ %8, %6 ], [ %3, %4 ]
%8 = add i64 %7, -1
%9 = mul i64 %8, 3
%10 = getelementptr inbounds float, float* %0, i64 %9
%11 = getelementptr inbounds float, float* %1, i64 %9
%12 = getelementptr inbounds float, float* %2, i64 %9
%13 = tail call i32 @cross(float* %10, float* %11, float* %12)
%14 = icmp eq i64 %8, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %4
ret i32 undef
}