#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 pow(double, double);
double sqrt(double);
double tan(double);
double kbefunc(double x, double Psirad) {
  double tPsirad, numer, denom, K;
  tPsirad = tan(Psirad);
  numer = sqrt((x * x) + (tPsirad * tPsirad));
  denom = x + 1.774 * pow(x + 1.182, -0.733);
  K = numer / denom;
  return (K);
}


x86 assembly (clang, -O0):
<kbefunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <tan@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe87(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xe72(%rip),%xmm1
call   1040 <pow@plt>
movsd  -0x38(%rbp),%xmm1
movsd  0xe58(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kbefunc>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
call   1030 <tan@plt>
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1169 <kbefunc+0x39>
sqrtsd %xmm0,%xmm0
jmp    116e <kbefunc+0x3e>
call   1050 <sqrt@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0xe84(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  0xe7e(%rip),%xmm1
call   1040 <pow@plt>
mulsd  0xe79(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @kbefunc(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %3
store double %1, double* %4
%9 = load double, double* %4
%10 = call double @tan(double %9)
store double %10, double* %5
%11 = load double, double* %3
%12 = load double, double* %3
%13 = load double, double* %5
%14 = load double, double* %5
%15 = fmul double %13, %14
%16 = call double @llvm.fmuladd.f64(double %11, double %12, double %15)
%17 = call double @sqrt(double %16)
store double %17, double* %6
%18 = load double, double* %3
%19 = load double, double* %3
%20 = fadd double %19, 1.182000e+00
%21 = call double @pow(double %20, double -7.330000e-01)
%22 = call double @llvm.fmuladd.f64(double 1.774000e+00, double %21, double %18)
store double %22, double* %7
%23 = load double, double* %6
%24 = load double, double* %7
%25 = fdiv double %23, %24
store double %25, double* %8
%26 = load double, double* %8
ret double %26
}

LLVM IR (-O2):
define double @kbefunc(double %0, double %1) {
%3 = tail call double @tan(double %1)
%4 = fmul double %3, %3
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
%6 = tail call double @sqrt(double %5)
%7 = fadd double %0, 1.182000e+00
%8 = tail call double @pow(double %7, double -7.330000e-01)
%9 = tail call double @llvm.fmuladd.f64(double %8, double 1.774000e+00, double %0)
%10 = fdiv double %6, %9
ret double %10
}