#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 M_PI;
double OPTICSMATERIALS_n(int, double);
double OPTICSMATERIALS_pha_lambda(int material, double z, double lambda) {
  double n;
  double pha;
  double PressureRatio = 0.0;
  double nair;
  double lambdaum;
  lambdaum = lambda * 1.0e6;
  nair = 1.0 + PressureRatio *
                   ((5792105.0e-8 / (238.0185 - 1.0 / (lambdaum * lambdaum))) +
                    (167917.0e-8 / (57.362 - 1.0 / (lambdaum * lambdaum))));
  n = OPTICSMATERIALS_n(material, lambda);
  pha = 2.0 * M_PI * (n - nair) * z / lambda;
  return (pha);
}


x86 assembly (clang, -O0):
<OPTICSMATERIALS_pha_lambda>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xefb(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  -0x40(%rbp),%xmm2
movsd  0xeb2(%rip),%xmm1
divsd  %xmm2,%xmm1
movsd  0xec6(%rip),%xmm2
subsd  %xmm1,%xmm2
movsd  0xeb2(%rip),%xmm1
divsd  %xmm2,%xmm1
movsd  -0x40(%rbp),%xmm3
mulsd  -0x40(%rbp),%xmm3
movsd  0xe84(%rip),%xmm2
divsd  %xmm3,%xmm2
movsd  0xe88(%rip),%xmm3
subsd  %xmm2,%xmm3
movsd  0xe74(%rip),%xmm2
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe58(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
call   1030 <OPTICSMATERIALS_n@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xe2d(%rip),%xmm0
mov    0x2e0e(%rip),%rax
mulsd  (%rax),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x38(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPTICSMATERIALS_pha_lambda>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  0xede(%rip),%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm1,%xmm0
movsd  %xmm1,0x8(%rsp)
mulsd  %xmm3,%xmm3
movsd  0xecc(%rip),%xmm1
movapd %xmm1,%xmm2
divsd  %xmm3,%xmm2
unpcklpd %xmm2,%xmm2
movapd 0xec0(%rip),%xmm3
subpd  %xmm2,%xmm3
movapd 0xec4(%rip),%xmm2
divpd  %xmm3,%xmm2
movapd %xmm2,%xmm3
unpckhpd %xmm2,%xmm3
addsd  %xmm2,%xmm3
xorpd  %xmm2,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
call   1030 <OPTICSMATERIALS_n@plt>
mov    0x2e5f(%rip),%rax
movsd  (%rax),%xmm1
addsd  %xmm1,%xmm1
subsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @OPTICSMATERIALS_pha_lambda(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
store double %2, double* %6
store double 0.000000e+00, double* %9
%12 = load double, double* %6
%13 = fmul double %12, 1.000000e+06
store double %13, double* %11
%14 = load double, double* %9
%15 = load double, double* %11
%16 = load double, double* %11
%17 = fmul double %15, %16
%18 = fdiv double 1.000000e+00, %17
%19 = fsub double 0x406DC0978D4FDF3B, %18
%20 = fdiv double 0x3FADA7D3EEFFFD7C, %19
%21 = load double, double* %11
%22 = load double, double* %11
%23 = fmul double %21, %22
%24 = fdiv double 1.000000e+00, %23
%25 = fsub double 5.736200e+01, %24
%26 = fdiv double 1.679170e-03, %25
%27 = fadd double %20, %26
%28 = call double @llvm.fmuladd.f64(double %14, double %27, double 1.000000e+00)
store double %28, double* %10
%29 = load i32, i32* %4
%30 = load double, double* %6
%31 = call double @OPTICSMATERIALS_n(i32 %29, double %30)
store double %31, double* %7
%32 = load double, double* @M_PI
%33 = fmul double 2.000000e+00, %32
%34 = load double, double* %7
%35 = load double, double* %10
%36 = fsub double %34, %35
%37 = fmul double %33, %36
%38 = load double, double* %5
%39 = fmul double %37, %38
%40 = load double, double* %6
%41 = fdiv double %39, %40
store double %41, double* %8
%42 = load double, double* %8
ret double %42
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @OPTICSMATERIALS_pha_lambda(i32 %0, double %1, double %2) {
%4 = fmul double %2, 1.000000e+06
%5 = fmul double %4, %4
%6 = fdiv double 1.000000e+00, %5
%7 = insertelement <2 x double> poison, double %6, i64 0
%8 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> zeroinitializer
%9 = fsub <2 x double> <double 0x406DC0978D4FDF3B, double 5.736200e+01>, %8
%10 = fdiv <2 x double> <double 0x3FADA7D3EEFFFD7C, double 1.679170e-03>, %9
%11 = shufflevector <2 x double> %10, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%12 = fadd <2 x double> %10, %11
%13 = extractelement <2 x double> %12, i64 0
%14 = tail call double @llvm.fmuladd.f64(double %13, double 0.000000e+00, double 1.000000e+00)
%15 = tail call double @OPTICSMATERIALS_n(i32 %0, double %2)
%16 = load double, double* @M_PI
%17 = fmul double %16, 2.000000e+00
%18 = fsub double %15, %14
%19 = fmul double %18, %17
%20 = fmul double %19, %1
%21 = fdiv double %20, %2
ret double %21
}