#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 cos(double);
scalar_t__ pow(double, double);
double sin(double);
double sqrt(scalar_t__);
double is_normal(double t, double p, double d_obs) {
  double num, den;
  double cos_g;
  num = (d_obs * sin(t) * cos(p)) - 696000000.0;
  den = sqrt(pow(d_obs, 2.0) + pow(696000000.0, 2.0) -
             2.0 * 696000000.0 * d_obs * sin(t) * cos(p));
  cos_g = num / den;
  return 1.0 / cos_g;
}


x86 assembly (clang, -O0):
<is_normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe86(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe68(%rip),%xmm1
call   1050 <pow@plt>
mov    %rax,-0x50(%rbp)
movsd  0xe4f(%rip),%xmm0
movsd  0xe4f(%rip),%xmm1
call   1050 <pow@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
add    %rcx,%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe1e(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1060 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xd95(%rip),%xmm0
divsd  -0x30(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_normal>:
push   %rbx
sub    $0x30,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0xe7f(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xe79(%rip),%xmm1
movsd  0x18(%rsp),%xmm0
call   1050 <pow@plt>
mov    %rax,%rbx
movsd  0xe6b(%rip),%xmm0
movsd  0xe5b(%rip),%xmm1
call   1050 <pow@plt>
add    %rbx,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0x18(%rsp),%xmm1
mulsd  0xe2b(%rip),%xmm1
mulsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x28(%rsp),%xmm1
cvttsd2si %xmm1,%rdi
call   1060 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  0xe07(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @is_normal(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%10 = load double, double* %6
%11 = load double, double* %4
%12 = call double @sin(double %11)
%13 = fmul double %10, %12
%14 = load double, double* %5
%15 = call double @cos(double %14)
%16 = call double @llvm.fmuladd.f64(double %13, double %15, double -6.960000e+08)
store double %16, double* %7
%17 = load double, double* %6
%18 = call i64 @pow(double %17, double 2.000000e+00)
%19 = call i64 @pow(double 6.960000e+08, double 2.000000e+00)
%20 = add nsw i64 %18, %19
%21 = sitofp i64 %20 to double
%22 = load double, double* %6
%23 = fmul double 1.392000e+09, %22
%24 = load double, double* %4
%25 = call double @sin(double %24)
%26 = fmul double %23, %25
%27 = load double, double* %5
%28 = call double @cos(double %27)
%29 = fneg double %26
%30 = call double @llvm.fmuladd.f64(double %29, double %28, double %21)
%31 = fptosi double %30 to i64
%32 = call double @sqrt(i64 %31)
store double %32, double* %8
%33 = load double, double* %7
%34 = load double, double* %8
%35 = fdiv double %33, %34
store double %35, double* %9
%36 = load double, double* %9
%37 = fdiv double 1.000000e+00, %36
ret double %37
}

LLVM IR (-O2):
define double @is_normal(double %0, double %1, double %2) {
%4 = tail call double @sin(double %0)
%5 = fmul double %4, %2
%6 = tail call double @cos(double %1)
%7 = tail call double @llvm.fmuladd.f64(double %5, double %6, double -6.960000e+08)
%8 = tail call i64 @pow(double %2, double 2.000000e+00)
%9 = tail call i64 @pow(double 6.960000e+08, double 2.000000e+00)
%10 = add nsw i64 %9, %8
%11 = sitofp i64 %10 to double
%12 = tail call double @sin(double %0)
%13 = tail call double @cos(double %1)
%14 = fmul double %2, -1.392000e+09
%15 = fmul double %14, %12
%16 = tail call double @llvm.fmuladd.f64(double %15, double %13, double %11)
%17 = fptosi double %16 to i64
%18 = tail call double @sqrt(i64 %17)
%19 = fdiv double %7, %18
%20 = fdiv double 1.000000e+00, %19
ret double %20
}