#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*/ kfVecCross(float *, float *, float *, int);
float kfVecDot(float *, float *, int);
int /*<<< orphan*/ printf(char *, float, ...);
float rf();
int succeed(void) {
  float up[3] = {rf(), rf(), rf()};
  float left[3] = {rf(), rf(), rf()};
  float forward[3] = {};
  kfVecCross(forward, up, left, 3);
  printf("{ %f, %f, %f } x { %f, %f, %f } = { %f, %f, %f }\n", up[0], up[1],
         up[2], left[0], left[1], left[2], forward[0], forward[1], forward[2]);
  float dot = kfVecDot(up, forward, 3);
  printf("dot: %f\n", dot);
  if (dot > 0.00001f) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<succeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    $0x0,%al
call   1070 <rf@plt>
movss  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1070 <rf@plt>
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1070 <rf@plt>
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1070 <rf@plt>
movss  %xmm0,-0x1c(%rbp)
mov    $0x0,%al
call   1070 <rf@plt>
movss  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1070 <rf@plt>
movss  %xmm0,-0x14(%rbp)
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
lea    -0x28(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x3,%ecx
call   1050 <kfVecCross@plt>
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x8(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x1c(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
movss  -0x18(%rbp),%xmm4
cvtss2sd %xmm4,%xmm4
movss  -0x14(%rbp),%xmm5
cvtss2sd %xmm5,%xmm5
movss  -0x28(%rbp),%xmm6
cvtss2sd %xmm6,%xmm6
movss  -0x24(%rbp),%xmm7
cvtss2sd %xmm7,%xmm7
movss  -0x20(%rbp),%xmm8
cvtss2sd %xmm8,%xmm8
lea    0xde8(%rip),%rdi
movsd  %xmm8,(%rsp)
mov    $0x8,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x3,%edx
call   1060 <kfVecDot@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xdea(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x2c(%rbp),%xmm0
movss  0xda0(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1275 <succeed+0x125>
movl   $0xffffffff,-0x4(%rbp)
jmp    127c <succeed+0x12c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<succeed>:
push   %r14
push   %rbx
sub    $0x38,%rsp
xor    %eax,%eax
call   1060 <rf@plt>
movss  %xmm0,0x1c(%rsp)
xor    %eax,%eax
call   1060 <rf@plt>
movss  %xmm0,0x20(%rsp)
xor    %eax,%eax
call   1060 <rf@plt>
movss  %xmm0,0x24(%rsp)
xor    %eax,%eax
call   1060 <rf@plt>
movss  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1060 <rf@plt>
movss  %xmm0,0x14(%rsp)
xor    %eax,%eax
call   1060 <rf@plt>
movss  %xmm0,0x18(%rsp)
movl   $0x0,0x30(%rsp)
movq   $0x0,0x28(%rsp)
lea    0x28(%rsp),%r14
lea    0x1c(%rsp),%rbx
lea    0x10(%rsp),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x3,%ecx
call   1040 <kfVecCross@plt>
movss  0x1c(%rsp),%xmm0
movss  0x20(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x24(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  0x10(%rsp),%xmm3
movss  0x14(%rsp),%xmm4
cvtss2sd %xmm3,%xmm3
cvtss2sd %xmm4,%xmm4
movss  0x18(%rsp),%xmm5
cvtss2sd %xmm5,%xmm5
movss  0x28(%rsp),%xmm6
movss  0x2c(%rsp),%xmm7
cvtss2sd %xmm6,%xmm6
cvtss2sd %xmm7,%xmm7
movss  0x30(%rsp),%xmm8
cvtss2sd %xmm8,%xmm8
movsd  %xmm8,(%rsp)
lea    0xdda(%rip),%rdi
mov    $0x8,%al
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   1050 <kfVecDot@plt>
movss  %xmm0,0x34(%rsp)
lea    0xde8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
movss  0x34(%rsp),%xmm0
ucomiss 0xd9c(%rip),%xmm0
seta   %al
neg    %eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [50 x i8] c"{ %f, %f, %f } x { %f, %f, %f } = { %f, %f, %f }\0A\00"
@.str.1 = [9 x i8] c"dot: %f\0A\00"
define i32 @succeed() {
%1 = alloca i32
%2 = alloca [3 x float]
%3 = alloca [3 x float]
%4 = alloca [3 x float]
%5 = alloca float
%6 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%7 = call float (...) @rf()
store float %7, float* %6
%8 = getelementptr inbounds float, float* %6, i64 1
%9 = call float (...) @rf()
store float %9, float* %8
%10 = getelementptr inbounds float, float* %8, i64 1
%11 = call float (...) @rf()
store float %11, float* %10
%12 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%13 = call float (...) @rf()
store float %13, float* %12
%14 = getelementptr inbounds float, float* %12, i64 1
%15 = call float (...) @rf()
store float %15, float* %14
%16 = getelementptr inbounds float, float* %14, i64 1
%17 = call float (...) @rf()
store float %17, float* %16
%18 = bitcast [3 x float]* %4 to i8*
%19 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 0
%20 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%21 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%22 = call i32 @kfVecCross(float* %19, float* %20, float* %21, i32 3)
%23 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%24 = load float, float* %23
%25 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
%26 = load float, float* %25
%27 = fpext float %26 to double
%28 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 2
%29 = load float, float* %28
%30 = fpext float %29 to double
%31 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%32 = load float, float* %31
%33 = fpext float %32 to double
%34 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
%35 = load float, float* %34
%36 = fpext float %35 to double
%37 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
%38 = load float, float* %37
%39 = fpext float %38 to double
%40 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 0
%41 = load float, float* %40
%42 = fpext float %41 to double
%43 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 1
%44 = load float, float* %43
%45 = fpext float %44 to double
%46 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 2
%47 = load float, float* %46
%48 = fpext float %47 to double
%49 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), float %24, double %27, double %30, double %33, double %36, double %39, double %42, double %45, double %48)
%50 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%51 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 0
%52 = call float @kfVecDot(float* %50, float* %51, i32 3)
store float %52, float* %5
%53 = load float, float* %5
%54 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float %53)
%55 = load float, float* %5
%56 = fcmp ogt float %55, 0x3EE4F8B580000000
br i1 %56, label %57, label %58
57: ; preds = %0
store i32 -1, i32* %1
br label %59
58: ; preds = %0
store i32 0, i32* %1
br label %59
59: ; preds = %58, %57
%60 = load i32, i32* %1
ret i32 %60
}

LLVM IR (-O2):
@.str = [50 x i8] c"{ %f, %f, %f } x { %f, %f, %f } = { %f, %f, %f }\0A\00"
@.str.1 = [9 x i8] c"dot: %f\0A\00"
define i32 @succeed() {
%1 = alloca [3 x float]
%2 = alloca [3 x float]
%3 = alloca [3 x float]
%4 = bitcast [3 x float]* %1 to i8*
%5 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 0
%6 = tail call float (...) @rf()
store float %6, float* %5
%7 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 1
%8 = tail call float (...) @rf()
store float %8, float* %7
%9 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 2
%10 = tail call float (...) @rf()
store float %10, float* %9
%11 = bitcast [3 x float]* %2 to i8*
%12 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%13 = tail call float (...) @rf()
store float %13, float* %12
%14 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
%15 = tail call float (...) @rf()
store float %15, float* %14
%16 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 2
%17 = tail call float (...) @rf()
store float %17, float* %16
%18 = bitcast [3 x float]* %3 to i8*
%19 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%20 = call i32 @kfVecCross(float* %19, float* %5, float* %12, i32 3)
%21 = load float, float* %5
%22 = load float, float* %7
%23 = fpext float %22 to double
%24 = load float, float* %9
%25 = fpext float %24 to double
%26 = load float, float* %12
%27 = fpext float %26 to double
%28 = load float, float* %14
%29 = fpext float %28 to double
%30 = load float, float* %16
%31 = fpext float %30 to double
%32 = load float, float* %19
%33 = fpext float %32 to double
%34 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
%35 = load float, float* %34
%36 = fpext float %35 to double
%37 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
%38 = load float, float* %37
%39 = fpext float %38 to double
%40 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), float %21, double %23, double %25, double %27, double %29, double %31, double %33, double %36, double %39)
%41 = call float @kfVecDot(float* %5, float* %19, i32 3)
%42 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float %41)
%43 = fcmp ogt float %41, 0x3EE4F8B580000000
%44 = sext i1 %43 to i32
ret i32 %44
}