#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 */
int /*<<< orphan*/ acos(double);
int /*<<< orphan*/ asin(double);
int /*<<< orphan*/ atan(double);
double cos(int /*<<< orphan*/);
int /*<<< orphan*/ dtor(double);
int floor(double);
int /*<<< orphan*/ printf(char *);
int rtod(int /*<<< orphan*/);
double sin(int /*<<< orphan*/);
double tan(int /*<<< orphan*/);
double _suntime_get_time(double latitude, double longitude, double zenith,
                         int year, int month, int day, int sunrise) {
  double n1, n2, n3, n;
  n1 = floor(275 * month / 9);
  n2 = floor((month + 9) / 12);
  n3 = (1 + floor((year - 4 * floor(year / 4) + 2) / 3));
  n = n1 - (n2 * n3) + day - 30;
  ;
  double longitude_h, t;
  longitude_h = longitude / 15;
  if (sunrise)
    t = n + ((6 - longitude_h) / 24);
  else
    t = n + ((18 - longitude_h) / 24);
  ;
  double m;
  m = (0.9856 * t) - 3.289;
  double l;
  l = m + (1.916 * sin(dtor(m))) + (0.020 * sin(dtor(2 * m))) + 282.634;
  if (l < 0)
    l += 360;
  else if (360 < l)
    l -= 360;
  ;
  double ra;
  ra = rtod(atan(0.91764 * tan(dtor(l))));
  if (ra < 0)
    ra += 360;
  else if (360 < ra)
    ra -= 360;
  double l_quadrant, ra_quadrant;
  l_quadrant = (floor(l / 90)) * 90;
  ra_quadrant = (floor(ra / 90)) * 90;
  ra = ra + (l_quadrant - ra_quadrant);
  ra = ra / 15;
  ;
  double sin_dec, cos_dec;
  sin_dec = 0.39782 * sin(dtor(l));
  cos_dec = cos(asin(sin_dec));
  double cos_hour;
  cos_hour = (cos(dtor(zenith)) - (sin_dec * sin(dtor(latitude)))) /
             (cos_dec * cos(dtor(latitude)));
  if (1 < cos_hour) {
    printf("the sun never rises on this location (on the specified date)\n");
    return -1;
  } else if (cos_hour < -1) {
    printf("the sun never sets on this location (on the specified date)\n");
    return -1;
  }
  double h;
  if (sunrise)
    h = 360 - rtod(acos(cos_hour));
  else
    h = rtod(acos(cos_hour));
  h = h / 15;
  double time;
  time = h + ra - (0.06571 * t) - 6.622;
  ;
  double utc_time;
  utc_time = time - longitude_h;
  if (utc_time < 0)
    utc_time += 24;
  else if (24 < utc_time)
    utc_time -= 24;
  ;
  return utc_time;
}


x86 assembly (clang, -O0):
<_suntime_get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %edi,-0x24(%rbp)
mov    %esi,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
mov    %ecx,-0x30(%rbp)
imul   $0x113,-0x28(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
call   10c0 <floor@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%eax
add    $0x9,%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
call   10c0 <floor@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0xbc(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
call   10c0 <floor@plt>
mov    %eax,%ecx
mov    -0xbc(%rbp),%eax
shl    $0x2,%ecx
sub    %ecx,%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
call   10c0 <floor@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  0xd78(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xd5a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
cmpl   $0x0,-0x30(%rbp)
je     12e5 <_suntime_get_time+0x145>
movsd  -0x50(%rbp),%xmm0
movsd  0xd5a(%rip),%xmm1
subsd  -0x58(%rbp),%xmm1
movsd  0xd3d(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    130c <_suntime_get_time+0x16c>
movsd  -0x50(%rbp),%xmm0
movsd  0xd26(%rip),%xmm1
subsd  -0x58(%rbp),%xmm1
movsd  0xd11(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  0xd2f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd2b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
call   10b0 <dtor@plt>
mov    %eax,%edi
call   1050 <sin@plt>
movsd  -0xd0(%rbp),%xmm1
ff
movsd  0xce4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  0xcc4(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
call   10b0 <dtor@plt>
mov    %eax,%edi
call   1050 <sin@plt>
movsd  -0xc8(%rbp),%xmm1
ff
movsd  0xc9b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xc83(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    13d3 <_suntime_get_time+0x233>
movsd  0xc94(%rip),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    1405 <_suntime_get_time+0x265>
movsd  -0x70(%rbp),%xmm0
movsd  0xc78(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1400 <_suntime_get_time+0x260>
movsd  -0x70(%rbp),%xmm0
movsd  0xc61(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    1405 <_suntime_get_time+0x265>
movsd  -0x70(%rbp),%xmm0
call   10b0 <dtor@plt>
mov    %eax,%edi
call   1090 <tan@plt>
movaps %xmm0,%xmm1
movsd  0xc3f(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1070 <atan@plt>
mov    %eax,%edi
call   1060 <rtod@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x78(%rbp),%xmm0
jbe    145f <_suntime_get_time+0x2bf>
movsd  0xc08(%rip),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    1491 <_suntime_get_time+0x2f1>
movsd  -0x78(%rbp),%xmm0
movsd  0xbec(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    148c <_suntime_get_time+0x2ec>
movsd  -0x78(%rbp),%xmm0
movsd  0xbd5(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    1491 <_suntime_get_time+0x2f1>
movsd  -0x70(%rbp),%xmm0
movsd  0xbda(%rip),%xmm1
divsd  %xmm1,%xmm0
call   10c0 <floor@plt>
imul   $0x5a,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  0xbb8(%rip),%xmm1
divsd  %xmm1,%xmm0
call   10c0 <floor@plt>
imul   $0x5a,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
subsd  -0x88(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  0xb00(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
call   10b0 <dtor@plt>
mov    %eax,%edi
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xb4b(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
call   1080 <asin@plt>
mov    %eax,%edi
call   10a0 <cos@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   10b0 <dtor@plt>
mov    %eax,%edi
call   10a0 <cos@plt>
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
call   10b0 <dtor@plt>
mov    %eax,%edi
call   1050 <sin@plt>
movsd  -0xf0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xe8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
call   10b0 <dtor@plt>
mov    %eax,%edi
call   10a0 <cos@plt>
movsd  -0xe0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  0xa53(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    163d <_suntime_get_time+0x49d>
lea    0xa72(%rip),%rdi
call   1030 <printf@plt>
movsd  0xa4d(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    17ab <_suntime_get_time+0x60b>
movsd  0xa3b(%rip),%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jbe    1671 <_suntime_get_time+0x4d1>
lea    0xa7c(%rip),%rdi
call   1030 <printf@plt>
movsd  0xa19(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    17ab <_suntime_get_time+0x60b>
jmp    1676 <_suntime_get_time+0x4d6>
cmpl   $0x0,-0x30(%rbp)
je     16ae <_suntime_get_time+0x50e>
movsd  -0xa0(%rbp),%xmm0
ff
call   1040 <acos@plt>
mov    %eax,%edi
call   1060 <rtod@plt>
mov    %eax,%ecx
mov    $0x168,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    16ce <_suntime_get_time+0x52e>
movsd  -0xa0(%rbp),%xmm0
ff
call   1040 <acos@plt>
mov    %eax,%edi
call   1060 <rtod@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  0x922(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm1
ff
addsd  -0x78(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  0x98c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x974(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
subsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0xb8(%rbp),%xmm0
ff
jbe    1763 <_suntime_get_time+0x5c3>
movsd  0x8c2(%rip),%xmm0
addsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    179e <_suntime_get_time+0x5fe>
movsd  -0xb8(%rbp),%xmm0
ff
movsd  0x89d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1799 <_suntime_get_time+0x5f9>
movsd  -0xb8(%rbp),%xmm0
ff
movsd  0x883(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    179e <_suntime_get_time+0x5fe>
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_suntime_get_time>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebp
mov    %edi,%ebx
movsd  %xmm2,0x38(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x18(%rsp)
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
cvtsi2sd %eax,%xmm0
call   10c0 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%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
cvtsi2sd %eax,%xmm0
call   10c0 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x3(%rbx),%eax
test   %ebx,%ebx
cmovns %ebx,%eax
sar    $0x2,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   10c0 <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
cvtsi2sd %eax,%xmm0
call   10c0 <floor@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
cvtsi2sd %r15d,%xmm1
movsd  (%rsp),%xmm2
subsd  %xmm0,%xmm2
addsd  %xmm2,%xmm1
addsd  0xd57(%rip),%xmm1
movsd  0x10(%rsp),%xmm2
divsd  0xd51(%rip),%xmm2
lea    0xdd2(%rip),%rax
movsd  (%rax,%r12,8),%xmm3
movsd  %xmm2,0x10(%rsp)
subsd  %xmm2,%xmm3
divsd  0xd3a(%rip),%xmm3
addsd  %xmm1,%xmm3
movsd  0xd36(%rip),%xmm0
movsd  %xmm3,0x20(%rsp)
mulsd  %xmm3,%xmm0
addsd  0xd2c(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
call   10b0 <dtor@plt>
mov    %eax,%edi
call   1050 <sin@plt>
mulsd  0xd1a(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
addsd  %xmm1,%xmm1
movapd %xmm1,%xmm0
call   10b0 <dtor@plt>
mov    %eax,%edi
call   1050 <sin@plt>
mulsd  0xcf7(%rip),%xmm0
addsd  (%rsp),%xmm0
addsd  0xcf2(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    135a <_suntime_get_time+0x1ba>
addsd  0xce8(%rip),%xmm0
jmp    136c <_suntime_get_time+0x1cc>
ucomisd 0xcde(%rip),%xmm0
jbe    136c <_suntime_get_time+0x1cc>
addsd  0xcdc(%rip),%xmm0
movsd  %xmm0,(%rsp)
call   10b0 <dtor@plt>
mov    %eax,%edi
call   1090 <tan@plt>
mulsd  0xccb(%rip),%xmm0
call   1070 <atan@plt>
mov    %eax,%edi
call   1060 <rtod@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
cmp    $0x169,%eax
jge    13b7 <_suntime_get_time+0x217>
movapd %xmm0,%xmm1
test   %eax,%eax
jns    13c7 <_suntime_get_time+0x227>
addsd  0xc91(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
jmp    13cd <_suntime_get_time+0x22d>
movsd  0xc89(%rip),%xmm1
addsd  %xmm0,%xmm1
test   %eax,%eax
js     13a7 <_suntime_get_time+0x207>
movsd  %xmm1,0x8(%rsp)
movsd  (%rsp),%xmm0
divsd  0xc7e(%rip),%xmm0
call   10c0 <floor@plt>
mov    %eax,%ebp
movsd  0x8(%rsp),%xmm0
divsd  0xc69(%rip),%xmm0
call   10c0 <floor@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
call   10b0 <dtor@plt>
mov    %eax,%edi
call   1050 <sin@plt>
mulsd  0xc51(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
call   1080 <asin@plt>
mov    %eax,%edi
call   10a0 <cos@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x38(%rsp),%xmm0
call   10b0 <dtor@plt>
mov    %eax,%edi
call   10a0 <cos@plt>
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
call   10b0 <dtor@plt>
mov    %eax,%edi
call   1050 <sin@plt>
mulsd  0x28(%rsp),%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x18(%rsp),%xmm0
call   10b0 <dtor@plt>
mov    %eax,%edi
call   10a0 <cos@plt>
movsd  (%rsp),%xmm2
mulsd  0x30(%rsp),%xmm0
divsd  %xmm0,%xmm2
ucomisd 0xbdb(%rip),%xmm2
jbe    1498 <_suntime_get_time+0x2f8>
lea    0xc46(%rip),%rdi
jmp    14ad <_suntime_get_time+0x30d>
movsd  0xbd0(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    14cb <_suntime_get_time+0x32b>
lea    0xbf3(%rip),%rdi
call   1030 <puts@plt>
movsd  0xbb6(%rip),%xmm1
movapd %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
imul   $0x5a,%ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
imul   $0x5a,%ebx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
divsd  0xb13(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm2,%xmm0
call   1040 <acos@plt>
mov    %eax,%edi
call   1060 <rtod@plt>
mov    $0x168,%ecx
sub    %eax,%ecx
test   %r14d,%r14d
cmove  %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
divsd  0xae1(%rip),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  0xb43(%rip),%xmm1
addsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm1
addsd  0xb39(%rip),%xmm1
subsd  0x10(%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1564 <_suntime_get_time+0x3c4>
addsd  0xab1(%rip),%xmm1
jmp    14ba <_suntime_get_time+0x31a>
ucomisd 0xaa4(%rip),%xmm1
jbe    14ba <_suntime_get_time+0x31a>
addsd  0xb0e(%rip),%xmm1
jmp    14ba <_suntime_get_time+0x31a>

LLVM IR (-O0):
@.str = [62 x i8] c"the sun never rises on this location (on the specified date)\0A\00"
@.str.1 = [61 x i8] c"the sun never sets on this location (on the specified date)\0A\00"
define double @_suntime_get_time(double %0, double %1, double %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
store double %0, double* %9
store double %1, double* %10
store double %2, double* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
%33 = load i32, i32* %13
%34 = mul nsw i32 275, %33
%35 = sdiv i32 %34, 9
%36 = sitofp i32 %35 to double
%37 = call i32 @floor(double %36)
%38 = sitofp i32 %37 to double
store double %38, double* %16
%39 = load i32, i32* %13
%40 = add nsw i32 %39, 9
%41 = sdiv i32 %40, 12
%42 = sitofp i32 %41 to double
%43 = call i32 @floor(double %42)
%44 = sitofp i32 %43 to double
store double %44, double* %17
%45 = load i32, i32* %12
%46 = load i32, i32* %12
%47 = sdiv i32 %46, 4
%48 = sitofp i32 %47 to double
%49 = call i32 @floor(double %48)
%50 = mul nsw i32 4, %49
%51 = sub nsw i32 %45, %50
%52 = add nsw i32 %51, 2
%53 = sdiv i32 %52, 3
%54 = sitofp i32 %53 to double
%55 = call i32 @floor(double %54)
%56 = add nsw i32 1, %55
%57 = sitofp i32 %56 to double
store double %57, double* %18
%58 = load double, double* %16
%59 = load double, double* %17
%60 = load double, double* %18
%61 = fneg double %59
%62 = call double @llvm.fmuladd.f64(double %61, double %60, double %58)
%63 = load i32, i32* %14
%64 = sitofp i32 %63 to double
%65 = fadd double %62, %64
%66 = fsub double %65, 3.000000e+01
store double %66, double* %19
%67 = load double, double* %10
%68 = fdiv double %67, 1.500000e+01
store double %68, double* %20
%69 = load i32, i32* %15
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %77
71: ; preds = %7
%72 = load double, double* %19
%73 = load double, double* %20
%74 = fsub double 6.000000e+00, %73
%75 = fdiv double %74, 2.400000e+01
%76 = fadd double %72, %75
store double %76, double* %21
br label %83
77: ; preds = %7
%78 = load double, double* %19
%79 = load double, double* %20
%80 = fsub double 1.800000e+01, %79
%81 = fdiv double %80, 2.400000e+01
%82 = fadd double %78, %81
store double %82, double* %21
br label %83
83: ; preds = %77, %71
%84 = load double, double* %21
%85 = call double @llvm.fmuladd.f64(double 9.856000e-01, double %84, double -3.289000e+00)
store double %85, double* %22
%86 = load double, double* %22
%87 = load double, double* %22
%88 = call i32 @dtor(double %87)
%89 = call double @sin(i32 %88)
%90 = call double @llvm.fmuladd.f64(double 1.916000e+00, double %89, double %86)
%91 = load double, double* %22
%92 = fmul double 2.000000e+00, %91
%93 = call i32 @dtor(double %92)
%94 = call double @sin(i32 %93)
%95 = call double @llvm.fmuladd.f64(double 2.000000e-02, double %94, double %90)
%96 = fadd double %95, 2.826340e+02
store double %96, double* %23
%97 = load double, double* %23
%98 = fcmp olt double %97, 0.000000e+00
br i1 %98, label %99, label %102
99: ; preds = %83
%100 = load double, double* %23
%101 = fadd double %100, 3.600000e+02
store double %101, double* %23
br label %109
102: ; preds = %83
%103 = load double, double* %23
%104 = fcmp olt double 3.600000e+02, %103
br i1 %104, label %105, label %108
105: ; preds = %102
%106 = load double, double* %23
%107 = fsub double %106, 3.600000e+02
store double %107, double* %23
br label %108
108: ; preds = %105, %102
br label %109
109: ; preds = %108, %99
%110 = load double, double* %23
%111 = call i32 @dtor(double %110)
%112 = call double @tan(i32 %111)
%113 = fmul double 9.176400e-01, %112
%114 = call i32 @atan(double %113)
%115 = call i32 @rtod(i32 %114)
%116 = sitofp i32 %115 to double
store double %116, double* %24
%117 = load double, double* %24
%118 = fcmp olt double %117, 0.000000e+00
br i1 %118, label %119, label %122
119: ; preds = %109
%120 = load double, double* %24
%121 = fadd double %120, 3.600000e+02
store double %121, double* %24
br label %129
122: ; preds = %109
%123 = load double, double* %24
%124 = fcmp olt double 3.600000e+02, %123
br i1 %124, label %125, label %128
125: ; preds = %122
%126 = load double, double* %24
%127 = fsub double %126, 3.600000e+02
store double %127, double* %24
br label %128
128: ; preds = %125, %122
br label %129
129: ; preds = %128, %119
%130 = load double, double* %23
%131 = fdiv double %130, 9.000000e+01
%132 = call i32 @floor(double %131)
%133 = mul nsw i32 %132, 90
%134 = sitofp i32 %133 to double
store double %134, double* %25
%135 = load double, double* %24
%136 = fdiv double %135, 9.000000e+01
%137 = call i32 @floor(double %136)
%138 = mul nsw i32 %137, 90
%139 = sitofp i32 %138 to double
store double %139, double* %26
%140 = load double, double* %24
%141 = load double, double* %25
%142 = load double, double* %26
%143 = fsub double %141, %142
%144 = fadd double %140, %143
store double %144, double* %24
%145 = load double, double* %24
%146 = fdiv double %145, 1.500000e+01
store double %146, double* %24
%147 = load double, double* %23
%148 = call i32 @dtor(double %147)
%149 = call double @sin(i32 %148)
%150 = fmul double 3.978200e-01, %149
store double %150, double* %27
%151 = load double, double* %27
%152 = call i32 @asin(double %151)
%153 = call double @cos(i32 %152)
store double %153, double* %28
%154 = load double, double* %11
%155 = call i32 @dtor(double %154)
%156 = call double @cos(i32 %155)
%157 = load double, double* %27
%158 = load double, double* %9
%159 = call i32 @dtor(double %158)
%160 = call double @sin(i32 %159)
%161 = fneg double %157
%162 = call double @llvm.fmuladd.f64(double %161, double %160, double %156)
%163 = load double, double* %28
%164 = load double, double* %9
%165 = call i32 @dtor(double %164)
%166 = call double @cos(i32 %165)
%167 = fmul double %163, %166
%168 = fdiv double %162, %167
store double %168, double* %29
%169 = load double, double* %29
%170 = fcmp olt double 1.000000e+00, %169
br i1 %170, label %171, label %173
171: ; preds = %129
%172 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
store double -1.000000e+00, double* %8
br label %219
173: ; preds = %129
%174 = load double, double* %29
%175 = fcmp olt double %174, -1.000000e+00
br i1 %175, label %176, label %178
176: ; preds = %173
%177 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
store double -1.000000e+00, double* %8
br label %219
178: ; preds = %173
br label %179
179: ; preds = %178
%180 = load i32, i32* %15
%181 = icmp ne i32 %180, 0
br i1 %181, label %182, label %188
182: ; preds = %179
%183 = load double, double* %29
%184 = call i32 @acos(double %183)
%185 = call i32 @rtod(i32 %184)
%186 = sub nsw i32 360, %185
%187 = sitofp i32 %186 to double
store double %187, double* %30
br label %193
188: ; preds = %179
%189 = load double, double* %29
%190 = call i32 @acos(double %189)
%191 = call i32 @rtod(i32 %190)
%192 = sitofp i32 %191 to double
store double %192, double* %30
br label %193
193: ; preds = %188, %182
%194 = load double, double* %30
%195 = fdiv double %194, 1.500000e+01
store double %195, double* %30
%196 = load double, double* %30
%197 = load double, double* %24
%198 = fadd double %196, %197
%199 = load double, double* %21
%200 = call double @llvm.fmuladd.f64(double -6.571000e-02, double %199, double %198)
%201 = fsub double %200, 6.622000e+00
store double %201, double* %31
%202 = load double, double* %31
%203 = load double, double* %20
%204 = fsub double %202, %203
store double %204, double* %32
%205 = load double, double* %32
%206 = fcmp olt double %205, 0.000000e+00
br i1 %206, label %207, label %210
207: ; preds = %193
%208 = load double, double* %32
%209 = fadd double %208, 2.400000e+01
store double %209, double* %32
br label %217
210: ; preds = %193
%211 = load double, double* %32
%212 = fcmp olt double 2.400000e+01, %211
br i1 %212, label %213, label %216
213: ; preds = %210
%214 = load double, double* %32
%215 = fsub double %214, 2.400000e+01
store double %215, double* %32
br label %216
216: ; preds = %213, %210
br label %217
217: ; preds = %216, %207
%218 = load double, double* %32
store double %218, double* %8
br label %219
219: ; preds = %217, %176, %171
%220 = load double, double* %8
ret double %220
}

LLVM IR (-O2):
@str = [60 x i8] c"the sun never sets on this location (on the specified date)\00"
@str.2 = [61 x i8] c"the sun never rises on this location (on the specified date)\00"
define double @_suntime_get_time(double %0, double %1, double %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = mul nsw i32 %4, 275
%9 = sdiv i32 %8, 9
%10 = sitofp i32 %9 to double
%11 = tail call i32 @floor(double %10)
%12 = sitofp i32 %11 to double
%13 = add nsw i32 %4, 9
%14 = sdiv i32 %13, 12
%15 = sitofp i32 %14 to double
%16 = tail call i32 @floor(double %15)
%17 = sitofp i32 %16 to double
%18 = sdiv i32 %3, 4
%19 = sitofp i32 %18 to double
%20 = tail call i32 @floor(double %19)
%21 = mul i32 %20, -4
%22 = add i32 %3, 2
%23 = add i32 %22, %21
%24 = sdiv i32 %23, 3
%25 = sitofp i32 %24 to double
%26 = tail call i32 @floor(double %25)
%27 = add nsw i32 %26, 1
%28 = sitofp i32 %27 to double
%29 = fneg double %17
%30 = tail call double @llvm.fmuladd.f64(double %29, double %28, double %12)
%31 = sitofp i32 %5 to double
%32 = fadd double %30, %31
%33 = fadd double %32, -3.000000e+01
%34 = fdiv double %1, 1.500000e+01
%35 = icmp eq i32 %6, 0
%36 = select i1 %35, double 1.800000e+01, double 6.000000e+00
%37 = fsub double %36, %34
%38 = fdiv double %37, 2.400000e+01
%39 = fadd double %38, %33
%40 = tail call double @llvm.fmuladd.f64(double %39, double 9.856000e-01, double -3.289000e+00)
%41 = tail call i32 @dtor(double %40)
%42 = tail call double @sin(i32 %41)
%43 = tail call double @llvm.fmuladd.f64(double %42, double 1.916000e+00, double %40)
%44 = fmul double %40, 2.000000e+00
%45 = tail call i32 @dtor(double %44)
%46 = tail call double @sin(i32 %45)
%47 = tail call double @llvm.fmuladd.f64(double %46, double 2.000000e-02, double %43)
%48 = fadd double %47, 2.826340e+02
%49 = fcmp olt double %48, 0.000000e+00
br i1 %49, label %50, label %52
50: ; preds = %7
%51 = fadd double %48, 3.600000e+02
br label %56
52: ; preds = %7
%53 = fcmp ogt double %48, 3.600000e+02
br i1 %53, label %54, label %56
54: ; preds = %52
%55 = fadd double %48, -3.600000e+02
br label %56
56: ; preds = %52, %54, %50
%57 = phi double [ %51, %50 ], [ %55, %54 ], [ %48, %52 ]
%58 = tail call i32 @dtor(double %57)
%59 = tail call double @tan(i32 %58)
%60 = fmul double %59, 9.176400e-01
%61 = tail call i32 @atan(double %60)
%62 = tail call i32 @rtod(i32 %61)
%63 = sitofp i32 %62 to double
%64 = icmp slt i32 %62, 0
%65 = fadd double %63, 3.600000e+02
%66 = icmp sgt i32 %62, 360
%67 = fadd double %63, -3.600000e+02
%68 = select i1 %66, double %67, double %63
%69 = select i1 %64, double %65, double %68
%70 = fdiv double %57, 9.000000e+01
%71 = tail call i32 @floor(double %70)
%72 = mul nsw i32 %71, 90
%73 = sitofp i32 %72 to double
%74 = fdiv double %69, 9.000000e+01
%75 = tail call i32 @floor(double %74)
%76 = mul nsw i32 %75, 90
%77 = sitofp i32 %76 to double
%78 = fsub double %73, %77
%79 = fadd double %69, %78
%80 = fdiv double %79, 1.500000e+01
%81 = tail call i32 @dtor(double %57)
%82 = tail call double @sin(i32 %81)
%83 = fmul double %82, 3.978200e-01
%84 = tail call i32 @asin(double %83)
%85 = tail call double @cos(i32 %84)
%86 = tail call i32 @dtor(double %2)
%87 = tail call double @cos(i32 %86)
%88 = tail call i32 @dtor(double %0)
%89 = tail call double @sin(i32 %88)
%90 = fneg double %83
%91 = tail call double @llvm.fmuladd.f64(double %90, double %89, double %87)
%92 = tail call i32 @dtor(double %0)
%93 = tail call double @cos(i32 %92)
%94 = fmul double %85, %93
%95 = fdiv double %91, %94
%96 = fcmp ogt double %95, 1.000000e+00
br i1 %96, label %97, label %99
97: ; preds = %56
%98 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.2, i64 0, i64 0))
br label %121
99: ; preds = %56
%100 = fcmp olt double %95, -1.000000e+00
br i1 %100, label %101, label %103
101: ; preds = %99
%102 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
br label %121
103: ; preds = %99
%104 = tail call i32 @acos(double %95)
%105 = tail call i32 @rtod(i32 %104)
%106 = sub nsw i32 360, %105
%107 = select i1 %35, i32 %105, i32 %106
%108 = sitofp i32 %107 to double
%109 = fdiv double %108, 1.500000e+01
%110 = fadd double %80, %109
%111 = tail call double @llvm.fmuladd.f64(double %39, double -6.571000e-02, double %110)
%112 = fadd double %111, -6.622000e+00
%113 = fsub double %112, %34
%114 = fcmp olt double %113, 0.000000e+00
br i1 %114, label %115, label %117
115: ; preds = %103
%116 = fadd double %113, 2.400000e+01
br label %121
117: ; preds = %103
%118 = fcmp ogt double %113, 2.400000e+01
br i1 %118, label %119, label %121
119: ; preds = %117
%120 = fadd double %113, -2.400000e+01
br label %121
121: ; preds = %115, %119, %117, %101, %97
%122 = phi double [ -1.000000e+00, %97 ], [ -1.000000e+00, %101 ], [ %116, %115 ], [ %120, %119 ], [ %113, %117 ]
ret double %122
}