#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 */
double acos(float);
int /*<<< orphan*/ to_unit_vector(float *, int);
float get_strike(float nhat1, float nhat3) {
  float nproj[3];
  float surf_normal[3];
  float strike;
  float theta;
  nproj[0] = nhat1;
  nproj[1] = 0.0f;
  nproj[2] = nhat3;
  to_unit_vector(nproj, 3);
  theta = acos(nproj[0]) * 57.2957795131;
  strike = theta - 90.0;
  return strike;
}


x86 assembly (clang, -O0):
<get_strike>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x3,%esi
call   1030 <to_unit_vector@plt>
movss  -0x14(%rbp),%xmm0
call   1040 <acos@plt>
movsd  0xe9a(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe74(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_strike>:
sub    $0x18,%rsp
movss  %xmm0,0xc(%rsp)
movl   $0x0,0x10(%rsp)
movss  %xmm1,0x14(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x3,%esi
call   1030 <to_unit_vector@plt>
movss  0xc(%rsp),%xmm0
call   1040 <acos@plt>
mulsd  0xea6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
addss  0xea2(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @get_strike(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca [3 x float]
%6 = alloca [3 x float]
%7 = alloca float
%8 = alloca float
store float %0, float* %3
store float %1, float* %4
%9 = load float, float* %3
%10 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
store float %9, float* %10
%11 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 1
store float 0.000000e+00, float* %11
%12 = load float, float* %4
%13 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 2
store float %12, float* %13
%14 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%15 = call i32 @to_unit_vector(float* %14, i32 3)
%16 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%17 = load float, float* %16
%18 = call double @acos(float %17)
%19 = fmul double %18, 0x404CA5DC1A63CBB0
%20 = fptrunc double %19 to float
store float %20, float* %8
%21 = load float, float* %8
%22 = fpext float %21 to double
%23 = fsub double %22, 9.000000e+01
%24 = fptrunc double %23 to float
store float %24, float* %7
%25 = load float, float* %7
ret float %25
}

LLVM IR (-O2):
define float @get_strike(float %0, float %1) {
%3 = alloca [3 x float]
%4 = bitcast [3 x float]* %3 to i8*
%5 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
store float %0, float* %5
%6 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
store float 0.000000e+00, float* %6
%7 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
store float %1, float* %7
%8 = call i32 @to_unit_vector(float* %5, i32 3)
%9 = load float, float* %5
%10 = call double @acos(float %9)
%11 = fmul double %10, 0x404CA5DC1A63CBB0
%12 = fptrunc double %11 to float
%13 = fadd float %12, -9.000000e+01
ret float %13
}