#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 */
typedef int int32_t;

/* Variables and functions */
int deg_acos(float);
float deg_asin(float);
float deg_atan(double);
float deg_cos(float);
float deg_sin(float);
double deg_tan(float);
int floor(float);
float within(float, int);
float calculate(int32_t year, int32_t month, int32_t day, float lat, float lng,
                float utc_offset, int32_t is_sunrise) {
  float n1 = floor(275 * month / 9);
  float n2 = floor((month + 9) / 12);
  float n3 = 1 + floor((year - (4 * floor(year / 4)) + 2) / 3);
  float day_of_year = n1 - (n2 * n3) + day - 30;
  float approximate_time = 0.0;
  float lng_hour = lng / 15;
  if (is_sunrise) {
    approximate_time = day_of_year + ((6 - lng_hour) / 24);
  } else {
    approximate_time = day_of_year + ((18 - lng_hour) / 24);
  }
  float mean_anomaly = (0.9856 * approximate_time) - 3.289;
  float true_lng = mean_anomaly + (1.916 * deg_sin(mean_anomaly)) +
                   (0.020 * deg_sin(2 * mean_anomaly)) + 282.634;
  true_lng = within(true_lng, 360);
  float right_ascension = within(deg_atan(0.91764 * deg_tan(true_lng)), 360);
  float lquad = floor(true_lng / 90) * 90;
  float raquad = floor(right_ascension / 90) * 90;
  right_ascension = (right_ascension + (lquad - raquad)) / 15;
  float deg_sin_dec = 0.39782 * deg_sin(true_lng);
  float deg_cos_dec = deg_cos(deg_asin(deg_sin_dec));
  float deg_cos_h =
      (-deg_sin_dec * deg_sin(lat)) / (deg_cos_dec * deg_cos(lat));
  if (deg_cos_h > 1 || deg_cos_h < -1) {
    return 0.0f;
  }
  float local_hour_angle = 0;
  if (is_sunrise) {
    local_hour_angle = 360 - deg_acos(deg_cos_h);
  } else {
    local_hour_angle = deg_acos(deg_cos_h);
  }
  local_hour_angle /= 15;
  float time =
      local_hour_angle + right_ascension - (0.06571 * approximate_time) - 6.622;
  return within(time - lng_hour + utc_offset, 24);
}


x86 assembly (clang, -O0):
<calculate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movss  %xmm2,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
imul   $0x113,-0xc(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
call   10a0 <floor@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0xc(%rbp),%eax
add    $0x9,%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
call   10a0 <floor@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
call   10a0 <floor@plt>
mov    %eax,%ecx
mov    -0x64(%rbp),%eax
shl    $0x2,%ecx
sub    %ecx,%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
call   10a0 <floor@plt>
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x24(%rbp),%xmm1
movss  -0x28(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  0xda4(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x18(%rbp),%xmm0
movss  0xd82(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     12bd <calculate+0x13d>
movss  -0x30(%rbp),%xmm0
movss  0xd72(%rip),%xmm1
subss  -0x38(%rbp),%xmm1
movss  0xd5d(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
jmp    12e4 <calculate+0x164>
movss  -0x30(%rbp),%xmm0
movss  0xd42(%rip),%xmm1
subss  -0x38(%rbp),%xmm1
movss  0xd31(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd5b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd57(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movss  -0x3c(%rbp),%xmm0
call   1090 <deg_sin@plt>
movsd  -0x80(%rbp),%xmm1
cvtss2sd %xmm0,%xmm0
movsd  0xd11(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movss  0xcd0(%rip),%xmm0
mulss  -0x3c(%rbp),%xmm0
call   1090 <deg_sin@plt>
movsd  -0x78(%rbp),%xmm1
cvtss2sd %xmm0,%xmm0
movsd  0xcd9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xcc1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x40(%rbp),%xmm0
mov    $0x168,%edi
call   1050 <within@plt>
movss  %xmm0,-0x40(%rbp)
movss  -0x40(%rbp),%xmm0
call   1070 <deg_tan@plt>
movaps %xmm0,%xmm1
movsd  0xc83(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <deg_atan@plt>
mov    $0x168,%edi
call   1050 <within@plt>
movss  %xmm0,-0x44(%rbp)
movss  -0x40(%rbp),%xmm0
movss  0xc46(%rip),%xmm1
divss  %xmm1,%xmm0
call   10a0 <floor@plt>
imul   $0x5a,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0x44(%rbp),%xmm0
movss  0xc24(%rip),%xmm1
divss  %xmm1,%xmm0
call   10a0 <floor@plt>
imul   $0x5a,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x44(%rbp),%xmm0
movss  -0x48(%rbp),%xmm1
subss  -0x4c(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  0xbdc(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x40(%rbp),%xmm0
call   1090 <deg_sin@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xbe5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x50(%rbp),%xmm0
call   1040 <deg_asin@plt>
call   1080 <deg_cos@plt>
movss  %xmm0,-0x54(%rbp)
movss  -0x50(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x70(%rbp)
movss  -0x14(%rbp),%xmm0
call   1090 <deg_sin@plt>
movaps %xmm0,%xmm1
movss  -0x70(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x68(%rbp)
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  -0x14(%rbp),%xmm0
call   1080 <deg_cos@plt>
movss  -0x6c(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x68(%rbp),%xmm0
mulss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
movss  -0x58(%rbp),%xmm0
movss  0xb43(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     14ec <calculate+0x36c>
movss  0xb3e(%rip),%xmm0
ucomiss -0x58(%rbp),%xmm0
jbe    14f9 <calculate+0x379>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    15af <calculate+0x42f>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x5c(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     152c <calculate+0x3ac>
movss  -0x58(%rbp),%xmm0
call   1060 <deg_acos@plt>
mov    %eax,%ecx
mov    $0x168,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x5c(%rbp)
jmp    153f <calculate+0x3bf>
movss  -0x58(%rbp),%xmm0
call   1060 <deg_acos@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  -0x5c(%rbp),%xmm0
movss  0xab4(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  -0x5c(%rbp),%xmm0
addss  -0x44(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xaf4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xadc(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x60(%rbp),%xmm0
subss  -0x38(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
mov    $0x18,%edi
call   1050 <within@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x50,%rsp
mov    %ecx,%r14d
movss  %xmm2,0x28(%rsp)
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x24(%rsp)
mov    %edx,%r15d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %r12d,%r12d
test   %ecx,%ecx
sete   %r12b
imul   $0x113,%esi,%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
sar    %eax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   10a0 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x10(%rsp)
add    $0x9,%ebp
movslq %ebp,%rax
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
sar    %eax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   10a0 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x30(%rsp)
lea    0x3(%rbx),%eax
test   %ebx,%ebx
cmovns %ebx,%eax
sar    $0x2,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   10a0 <floor@plt>
shl    $0x2,%eax
neg    %eax
add    %ebx,%eax
add    $0x2,%eax
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   10a0 <floor@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x30(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
subss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2ss %r15d,%xmm0
addss  %xmm1,%xmm0
addss  0xd72(%rip),%xmm0
movss  0xc(%rsp),%xmm2
divss  0xd68(%rip),%xmm2
lea    0xd75(%rip),%rax
movss  (%rax,%r12,4),%xmm1
movss  %xmm2,0xc(%rsp)
subss  %xmm2,%xmm1
divss  0xd4d(%rip),%xmm1
addss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xd55(%rip),%xmm0
movsd  %xmm1,0x48(%rsp)
mulsd  %xmm1,%xmm0
addsd  0xd4b(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x30(%rsp)
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
call   1090 <deg_sin@plt>
cvtss2sd %xmm0,%xmm0
mulsd  0xd2b(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movss  0x30(%rsp),%xmm0
addss  %xmm0,%xmm0
call   1090 <deg_sin@plt>
cvtss2sd %xmm0,%xmm0
mulsd  0xd0c(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
addsd  0xd06(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    $0x168,%edi
call   1050 <within@plt>
movss  %xmm0,0x10(%rsp)
call   1070 <deg_tan@plt>
mulsd  0xced(%rip),%xmm0
call   1030 <deg_atan@plt>
mov    $0x168,%edi
call   1050 <within@plt>
movapd %xmm0,0x30(%rsp)
movss  0x10(%rsp),%xmm0
divss  0xc8e(%rip),%xmm0
call   10a0 <floor@plt>
mov    %eax,%ebx
movaps 0x30(%rsp),%xmm0
divss  0xc7a(%rip),%xmm0
call   10a0 <floor@plt>
mov    %eax,%ebp
movss  0x10(%rsp),%xmm0
call   1090 <deg_sin@plt>
cvtss2sd %xmm0,%xmm0
mulsd  0xca0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
call   1040 <deg_asin@plt>
call   1080 <deg_cos@plt>
movss  %xmm0,0x2c(%rsp)
movaps 0x10(%rsp),%xmm0
xorps  0xc9b(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movss  0x24(%rsp),%xmm0
call   1090 <deg_sin@plt>
mulss  0x10(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
movss  0x24(%rsp),%xmm0
call   1080 <deg_cos@plt>
movss  0x10(%rsp),%xmm1
mulss  0x2c(%rsp),%xmm0
divss  %xmm0,%xmm1
ucomiss 0xbfd(%rip),%xmm1
ja     14c3 <calculate+0x343>
movss  0xbf3(%rip),%xmm0
ucomiss %xmm1,%xmm0
ja     14c3 <calculate+0x343>
imul   $0x5a,%ebx,%ebx
imul   $0x5a,%ebp,%ebp
movaps %xmm1,%xmm0
call   1060 <deg_acos@plt>
mov    $0x168,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
test   %r14d,%r14d
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
subss  %xmm1,%xmm0
movaps 0x30(%rsp),%xmm1
addss  %xmm0,%xmm1
cmove  %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
unpcklps %xmm0,%xmm1
divps  0xc0f(%rip),%xmm1
movaps %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x48(%rsp),%xmm1
mulsd  0xbca(%rip),%xmm1
addsd  %xmm0,%xmm1
addsd  0xbc6(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
subss  0xc(%rsp),%xmm0
addss  0x28(%rsp),%xmm0
mov    $0x18,%edi
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <within@plt>
xorps  %xmm0,%xmm0
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define float @calculate(i32 %0, i32 %1, i32 %2, float %3, float %4, float %5, i32 %6) {
%8 = alloca float
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca i32
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca float
%26 = alloca float
%27 = alloca float
%28 = alloca float
%29 = alloca float
%30 = alloca float
%31 = alloca float
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store float %3, float* %12
store float %4, float* %13
store float %5, float* %14
store i32 %6, i32* %15
%32 = load i32, i32* %10
%33 = mul nsw i32 275, %32
%34 = sdiv i32 %33, 9
%35 = sitofp i32 %34 to float
%36 = call i32 @floor(float %35)
%37 = sitofp i32 %36 to float
store float %37, float* %16
%38 = load i32, i32* %10
%39 = add nsw i32 %38, 9
%40 = sdiv i32 %39, 12
%41 = sitofp i32 %40 to float
%42 = call i32 @floor(float %41)
%43 = sitofp i32 %42 to float
store float %43, float* %17
%44 = load i32, i32* %9
%45 = load i32, i32* %9
%46 = sdiv i32 %45, 4
%47 = sitofp i32 %46 to float
%48 = call i32 @floor(float %47)
%49 = mul nsw i32 4, %48
%50 = sub nsw i32 %44, %49
%51 = add nsw i32 %50, 2
%52 = sdiv i32 %51, 3
%53 = sitofp i32 %52 to float
%54 = call i32 @floor(float %53)
%55 = add nsw i32 1, %54
%56 = sitofp i32 %55 to float
store float %56, float* %18
%57 = load float, float* %16
%58 = load float, float* %17
%59 = load float, float* %18
%60 = fneg float %58
%61 = call float @llvm.fmuladd.f32(float %60, float %59, float %57)
%62 = load i32, i32* %11
%63 = sitofp i32 %62 to float
%64 = fadd float %61, %63
%65 = fsub float %64, 3.000000e+01
store float %65, float* %19
store float 0.000000e+00, float* %20
%66 = load float, float* %13
%67 = fdiv float %66, 1.500000e+01
store float %67, float* %21
%68 = load i32, i32* %15
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %76
70: ; preds = %7
%71 = load float, float* %19
%72 = load float, float* %21
%73 = fsub float 6.000000e+00, %72
%74 = fdiv float %73, 2.400000e+01
%75 = fadd float %71, %74
store float %75, float* %20
br label %82
76: ; preds = %7
%77 = load float, float* %19
%78 = load float, float* %21
%79 = fsub float 1.800000e+01, %78
%80 = fdiv float %79, 2.400000e+01
%81 = fadd float %77, %80
store float %81, float* %20
br label %82
82: ; preds = %76, %70
%83 = load float, float* %20
%84 = fpext float %83 to double
%85 = call double @llvm.fmuladd.f64(double 9.856000e-01, double %84, double -3.289000e+00)
%86 = fptrunc double %85 to float
store float %86, float* %22
%87 = load float, float* %22
%88 = fpext float %87 to double
%89 = load float, float* %22
%90 = call float @deg_sin(float %89)
%91 = fpext float %90 to double
%92 = call double @llvm.fmuladd.f64(double 1.916000e+00, double %91, double %88)
%93 = load float, float* %22
%94 = fmul float 2.000000e+00, %93
%95 = call float @deg_sin(float %94)
%96 = fpext float %95 to double
%97 = call double @llvm.fmuladd.f64(double 2.000000e-02, double %96, double %92)
%98 = fadd double %97, 2.826340e+02
%99 = fptrunc double %98 to float
store float %99, float* %23
%100 = load float, float* %23
%101 = call float @within(float %100, i32 360)
store float %101, float* %23
%102 = load float, float* %23
%103 = call double @deg_tan(float %102)
%104 = fmul double 9.176400e-01, %103
%105 = call float @deg_atan(double %104)
%106 = call float @within(float %105, i32 360)
store float %106, float* %24
%107 = load float, float* %23
%108 = fdiv float %107, 9.000000e+01
%109 = call i32 @floor(float %108)
%110 = mul nsw i32 %109, 90
%111 = sitofp i32 %110 to float
store float %111, float* %25
%112 = load float, float* %24
%113 = fdiv float %112, 9.000000e+01
%114 = call i32 @floor(float %113)
%115 = mul nsw i32 %114, 90
%116 = sitofp i32 %115 to float
store float %116, float* %26
%117 = load float, float* %24
%118 = load float, float* %25
%119 = load float, float* %26
%120 = fsub float %118, %119
%121 = fadd float %117, %120
%122 = fdiv float %121, 1.500000e+01
store float %122, float* %24
%123 = load float, float* %23
%124 = call float @deg_sin(float %123)
%125 = fpext float %124 to double
%126 = fmul double 3.978200e-01, %125
%127 = fptrunc double %126 to float
store float %127, float* %27
%128 = load float, float* %27
%129 = call float @deg_asin(float %128)
%130 = call float @deg_cos(float %129)
store float %130, float* %28
%131 = load float, float* %27
%132 = fneg float %131
%133 = load float, float* %12
%134 = call float @deg_sin(float %133)
%135 = fmul float %132, %134
%136 = load float, float* %28
%137 = load float, float* %12
%138 = call float @deg_cos(float %137)
%139 = fmul float %136, %138
%140 = fdiv float %135, %139
store float %140, float* %29
%141 = load float, float* %29
%142 = fcmp ogt float %141, 1.000000e+00
br i1 %142, label %146, label %143
143: ; preds = %82
%144 = load float, float* %29
%145 = fcmp olt float %144, -1.000000e+00
br i1 %145, label %146, label %147
146: ; preds = %143, %82
store float 0.000000e+00, float* %8
br label %177
147: ; preds = %143
store float 0.000000e+00, float* %30
%148 = load i32, i32* %15
%149 = icmp ne i32 %148, 0
br i1 %149, label %150, label %155
150: ; preds = %147
%151 = load float, float* %29
%152 = call i32 @deg_acos(float %151)
%153 = sub nsw i32 360, %152
%154 = sitofp i32 %153 to float
store float %154, float* %30
br label %159
155: ; preds = %147
%156 = load float, float* %29
%157 = call i32 @deg_acos(float %156)
%158 = sitofp i32 %157 to float
store float %158, float* %30
br label %159
159: ; preds = %155, %150
%160 = load float, float* %30
%161 = fdiv float %160, 1.500000e+01
store float %161, float* %30
%162 = load float, float* %30
%163 = load float, float* %24
%164 = fadd float %162, %163
%165 = fpext float %164 to double
%166 = load float, float* %20
%167 = fpext float %166 to double
%168 = call double @llvm.fmuladd.f64(double -6.571000e-02, double %167, double %165)
%169 = fsub double %168, 6.622000e+00
%170 = fptrunc double %169 to float
store float %170, float* %31
%171 = load float, float* %31
%172 = load float, float* %21
%173 = fsub float %171, %172
%174 = load float, float* %14
%175 = fadd float %173, %174
%176 = call float @within(float %175, i32 24)
store float %176, float* %8
br label %177
177: ; preds = %159, %146
%178 = load float, float* %8
ret float %178
}

LLVM IR (-O2):
define float @calculate(i32 %0, i32 %1, i32 %2, float %3, float %4, float %5, i32 %6) {
%8 = mul nsw i32 %1, 275
%9 = sdiv i32 %8, 9
%10 = sitofp i32 %9 to float
%11 = tail call i32 @floor(float %10)
%12 = sitofp i32 %11 to float
%13 = add nsw i32 %1, 9
%14 = sdiv i32 %13, 12
%15 = sitofp i32 %14 to float
%16 = tail call i32 @floor(float %15)
%17 = sitofp i32 %16 to float
%18 = sdiv i32 %0, 4
%19 = sitofp i32 %18 to float
%20 = tail call i32 @floor(float %19)
%21 = mul i32 %20, -4
%22 = add i32 %0, 2
%23 = add i32 %22, %21
%24 = sdiv i32 %23, 3
%25 = sitofp i32 %24 to float
%26 = tail call i32 @floor(float %25)
%27 = add nsw i32 %26, 1
%28 = sitofp i32 %27 to float
%29 = fneg float %17
%30 = tail call float @llvm.fmuladd.f32(float %29, float %28, float %12)
%31 = sitofp i32 %2 to float
%32 = fadd float %30, %31
%33 = fadd float %32, -3.000000e+01
%34 = fdiv float %4, 1.500000e+01
%35 = icmp eq i32 %6, 0
%36 = select i1 %35, float 1.800000e+01, float 6.000000e+00
%37 = fsub float %36, %34
%38 = fdiv float %37, 2.400000e+01
%39 = fadd float %38, %33
%40 = fpext float %39 to double
%41 = tail call double @llvm.fmuladd.f64(double %40, double 9.856000e-01, double -3.289000e+00)
%42 = fptrunc double %41 to float
%43 = fpext float %42 to double
%44 = tail call float @deg_sin(float %42)
%45 = fpext float %44 to double
%46 = tail call double @llvm.fmuladd.f64(double %45, double 1.916000e+00, double %43)
%47 = fmul float %42, 2.000000e+00
%48 = tail call float @deg_sin(float %47)
%49 = fpext float %48 to double
%50 = tail call double @llvm.fmuladd.f64(double %49, double 2.000000e-02, double %46)
%51 = fadd double %50, 2.826340e+02
%52 = fptrunc double %51 to float
%53 = tail call float @within(float %52, i32 360)
%54 = tail call double @deg_tan(float %53)
%55 = fmul double %54, 9.176400e-01
%56 = tail call float @deg_atan(double %55)
%57 = tail call float @within(float %56, i32 360)
%58 = fdiv float %53, 9.000000e+01
%59 = tail call i32 @floor(float %58)
%60 = fdiv float %57, 9.000000e+01
%61 = tail call i32 @floor(float %60)
%62 = tail call float @deg_sin(float %53)
%63 = fpext float %62 to double
%64 = fmul double %63, 3.978200e-01
%65 = fptrunc double %64 to float
%66 = tail call float @deg_asin(float %65)
%67 = tail call float @deg_cos(float %66)
%68 = fneg float %65
%69 = tail call float @deg_sin(float %3)
%70 = fmul float %69, %68
%71 = tail call float @deg_cos(float %3)
%72 = fmul float %67, %71
%73 = fdiv float %70, %72
%74 = fcmp ogt float %73, 1.000000e+00
%75 = fcmp olt float %73, -1.000000e+00
%76 = or i1 %74, %75
br i1 %76, label %101, label %77
77: ; preds = %7
%78 = mul nsw i32 %59, 90
%79 = sitofp i32 %78 to float
%80 = mul nsw i32 %61, 90
%81 = sitofp i32 %80 to float
%82 = fsub float %79, %81
%83 = fadd float %57, %82
%84 = tail call i32 @deg_acos(float %73)
%85 = sub nsw i32 360, %84
%86 = select i1 %35, i32 %84, i32 %85
%87 = sitofp i32 %86 to float
%88 = insertelement <2 x float> poison, float %83, i64 0
%89 = insertelement <2 x float> %88, float %87, i64 1
%90 = fdiv <2 x float> %89, <float 1.500000e+01, float 1.500000e+01>
%91 = shufflevector <2 x float> %90, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%92 = fadd <2 x float> %90, %91
%93 = extractelement <2 x float> %92, i64 0
%94 = fpext float %93 to double
%95 = tail call double @llvm.fmuladd.f64(double %40, double -6.571000e-02, double %94)
%96 = fadd double %95, -6.622000e+00
%97 = fptrunc double %96 to float
%98 = fsub float %97, %34
%99 = fadd float %98, %5
%100 = tail call float @within(float %99, i32 24)
br label %101
101: ; preds = %7, %77
%102 = phi float [ %100, %77 ], [ 0.000000e+00, %7 ]
ret float %102
}