#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(int);
int cos(float);
float fabs(double);
float floor(double);
int pow(int, double);
int NLtablelookup(double lat) {
  int NL;
  float NL2;
  int NZ;
  float pi = 3.1415926535898;
  NZ = 15;
  NL2 = floor(2.0 * pi /
              (acos(1 - ((1 - cos(pi / (2.0 * NZ))) /
                         pow(cos(pi * fabs(lat) / 180.0), 2.0)))));
  NL = NL2;
  return NL;
}


x86 assembly (clang, -O0):
<NLtablelookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movss  0xeab(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0xf,-0x14(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe7e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm2
movsd  0xe5f(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1050 <cos@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
movaps %xmm0,%xmm1
movss  -0x28(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe1e(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1050 <cos@plt>
mov    %eax,%edi
movsd  0xdff(%rip),%xmm0
call   1060 <pow@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
cltd
idiv   %ecx
mov    $0x1,%edi
sub    %eax,%edi
call   1030 <acos@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1070 <floor@plt>
movss  %xmm0,-0x10(%rbp)
cvttss2si -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NLtablelookup>:
push   %rbp
push   %rbx
push   %rax
movsd  %xmm0,(%rsp)
movss  0xea0(%rip),%xmm0
call   1050 <cos@plt>
mov    $0x1,%ebx
mov    $0x1,%ebp
sub    %eax,%ebp
movsd  (%rsp),%xmm0
call   1040 <fabs@plt>
mulss  0xe81(%rip),%xmm0
divss  0xe7d(%rip),%xmm0
call   1050 <cos@plt>
movsd  0xe78(%rip),%xmm0
mov    %eax,%edi
call   1060 <pow@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
sub    %eax,%ebx
mov    %ebx,%edi
call   1030 <acos@plt>
movsd  0xe61(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1070 <floor@plt>
cvttss2si %xmm0,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @NLtablelookup(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
%6 = alloca float
store double %0, double* %2
store float 0x400921FB60000000, float* %6
store i32 15, i32* %5
%7 = load float, float* %6
%8 = fpext float %7 to double
%9 = fmul double 2.000000e+00, %8
%10 = load float, float* %6
%11 = fpext float %10 to double
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = fmul double 2.000000e+00, %13
%15 = fdiv double %11, %14
%16 = fptrunc double %15 to float
%17 = call i32 @cos(float %16)
%18 = sub nsw i32 1, %17
%19 = load float, float* %6
%20 = load double, double* %2
%21 = call float @fabs(double %20)
%22 = fmul float %19, %21
%23 = fpext float %22 to double
%24 = fdiv double %23, 1.800000e+02
%25 = fptrunc double %24 to float
%26 = call i32 @cos(float %25)
%27 = call i32 @pow(i32 %26, double 2.000000e+00)
%28 = sdiv i32 %18, %27
%29 = sub nsw i32 1, %28
%30 = call double @acos(i32 %29)
%31 = fdiv double %9, %30
%32 = call float @floor(double %31)
store float %32, float* %4
%33 = load float, float* %4
%34 = fptosi float %33 to i32
store i32 %34, i32* %3
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @NLtablelookup(double %0) {
%2 = tail call i32 @cos(float 0x3FBACEEA00000000)
%3 = sub nsw i32 1, %2
%4 = tail call float @fabs(double %0)
%5 = fmul float %4, 0x400921FB60000000
%6 = fdiv float %5, 1.800000e+02
%7 = tail call i32 @cos(float %6)
%8 = tail call i32 @pow(i32 %7, double 2.000000e+00)
%9 = sdiv i32 %3, %8
%10 = sub nsw i32 1, %9
%11 = tail call double @acos(i32 %10)
%12 = fdiv double 0x401921FB60000000, %11
%13 = tail call float @floor(double %12)
%14 = fptosi float %13 to i32
ret i32 %14
}