#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 __daylen__(int, int, int, double, double, double, int);
int __sunriset__(int, int, int, double, double, double, int, double *,
                 double *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, ...);
int /*<<< orphan*/ stdin;
main() {
  int year, month, day;
  double lon, lat;
  double daylen, civlen, nautlen, astrlen;
  double rise, set, civ_start, civ_end, naut_start, naut_end, astr_start,
      astr_end;
  int rs, civ, naut, astr;
  char buf[80];
  printf("Longitude (+ is east) and latitude (+ is north) : ");
  fgets(buf, 80, stdin);
  sscanf(buf, "%lf %lf", &lon, &lat);
  for (;;) {
    printf("Input date ( yyyy mm dd ) (ctrl-C exits): ");
    fgets(buf, 80, stdin);
    sscanf(buf, "%d %d %d", &year, &month, &day);
    daylen = __daylen__(year, month, day, lon, lat, -35.0 / 60.0, 1);
    civlen = __daylen__(year, month, day, lon, lat, -6.0, 0);
    nautlen = __daylen__(year, month, day, lon, lat, -12.0, 0);
    astrlen = __daylen__(year, month, day, lon, lat, -18.0, 0);
    printf("Day length:                 %5.2f hours\n", daylen);
    printf("With civil twilight         %5.2f hours\n", civlen);
    printf("With nautical twilight      %5.2f hours\n", nautlen);
    printf("With astronomical twilight  %5.2f hours\n", astrlen);
    printf("Length of twilight: civil   %5.2f hours\n",
           (civlen - daylen) / 2.0);
    printf("                  nautical  %5.2f hours\n",
           (nautlen - daylen) / 2.0);
    printf("              astronomical  %5.2f hours\n",
           (astrlen - daylen) / 2.0);
    rs = __sunriset__(year, month, day, lon, lat, -35.0 / 60.0, 1, &rise, &set);
    civ =
        __sunriset__(year, month, day, lon, lat, -6.0, 0, &civ_start, &civ_end);
    naut = __sunriset__(year, month, day, lon, lat, -12.0, 0, &naut_start,
                        &naut_end);
    astr = __sunriset__(year, month, day, lon, lat, -18.0, 0, &astr_start,
                        &astr_end);
    printf("Sun at south %5.2fh UT\n", (rise + set) / 2.0);
    switch (rs) {
    case 0:
      printf("Sun rises %5.2fh UT, sets %5.2fh UT\n", rise, set);
      break;
    case +1:
      printf("Sun above horizon\n");
      break;
    case -1:
      printf("Sun below horizon\n");
      break;
    }
    switch (civ) {
    case 0:
      printf("Civil twilight starts %5.2fh, "
             "ends %5.2fh UT\n",
             civ_start, civ_end);
      break;
    case +1:
      printf("Never darker than civil twilight\n");
      break;
    case -1:
      printf("Never as bright as civil twilight\n");
      break;
    }
    switch (naut) {
    case 0:
      printf("Nautical twilight starts %5.2fh, "
             "ends %5.2fh UT\n",
             naut_start, naut_end);
      break;
    case +1:
      printf("Never darker than nautical twilight\n");
      break;
    case -1:
      printf("Never as bright as nautical twilight\n");
      break;
    }
    switch (astr) {
    case 0:
      printf("Astronomical twilight starts %5.2fh, "
             "ends %5.2fh UT\n",
             astr_start, astr_end);
      break;
    case +1:
      printf("Never darker than astronomical twilight\n");
      break;
    case -1:
      printf("Never as bright as astronomical twilight\n");
      break;
    }
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xe0(%rbp),%rdi
mov    0x2e6a(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    -0xe0(%rbp),%rdi
lea    0xec3(%rip),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1060 <sscanf@plt>
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
mov    %eax,-0xf4(%rbp)
mov    %al,-0x121(%rbp)
call   1040 <printf@plt>
mov    0x2e20(%rip),%rax
mov    (%rax),%edx
lea    -0xe0(%rbp),%rdi
mov    %rdi,-0x130(%rbp)
mov    $0x50,%esi
call   1050 <fgets@plt>
mov    -0x130(%rbp),%rdi
mov    -0x121(%rbp),%al
lea    0xe98(%rip),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1060 <sscanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xdde(%rip),%xmm2
movsd  %xmm2,-0x120(%rbp)
ff
mov    $0x1,%ecx
mov    %ecx,-0x114(%rbp)
call   1030 <__daylen__@plt>
mov    -0xf4(%rbp),%ecx
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xda8(%rip),%xmm2
movsd  %xmm2,-0x110(%rbp)
ff
call   1030 <__daylen__@plt>
mov    -0xf4(%rbp),%ecx
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xd7d(%rip),%xmm2
movsd  %xmm2,-0x108(%rbp)
ff
call   1030 <__daylen__@plt>
mov    -0xf4(%rbp),%ecx
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xd52(%rip),%xmm2
movsd  %xmm2,-0x100(%rbp)
ff
call   1030 <__daylen__@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xdb3(%rip),%rdi
mov    $0x1,%al
mov    %al,-0xe5(%rbp)
call   1040 <printf@plt>
mov    -0xe5(%rbp),%al
movsd  -0x30(%rbp),%xmm0
lea    0xdbd(%rip),%rdi
call   1040 <printf@plt>
mov    -0xe5(%rbp),%al
movsd  -0x38(%rbp),%xmm0
lea    0xdcf(%rip),%rdi
call   1040 <printf@plt>
mov    -0xe5(%rbp),%al
movsd  -0x40(%rbp),%xmm0
lea    0xde1(%rip),%rdi
call   1040 <printf@plt>
mov    -0xe5(%rbp),%al
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xcce(%rip),%xmm1
movsd  %xmm1,-0xf0(%rbp)
ff
divsd  %xmm1,%xmm0
lea    0xdd6(%rip),%rdi
call   1040 <printf@plt>
movsd  -0xf0(%rbp),%xmm1
ff
mov    -0xe5(%rbp),%al
movsd  -0x38(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
subsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
lea    0xdd3(%rip),%rdi
call   1040 <printf@plt>
movsd  -0xf0(%rbp),%xmm1
ff
mov    -0xe5(%rbp),%al
movsd  -0x40(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
subsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
lea    0xdd0(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x120(%rbp),%xmm2
ff
mov    -0x114(%rbp),%ecx
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    -0x48(%rbp),%r8
lea    -0x50(%rbp),%r9
call   1070 <__sunriset__@plt>
movsd  -0x110(%rbp),%xmm2
ff
mov    -0xf4(%rbp),%ecx
mov    %eax,-0x84(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    -0x58(%rbp),%r8
lea    -0x60(%rbp),%r9
call   1070 <__sunriset__@plt>
movsd  -0x108(%rbp),%xmm2
ff
mov    -0xf4(%rbp),%ecx
mov    %eax,-0x88(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    -0x68(%rbp),%r8
lea    -0x70(%rbp),%r9
call   1070 <__sunriset__@plt>
movsd  -0x100(%rbp),%xmm2
ff
mov    -0xf4(%rbp),%ecx
mov    %eax,-0x8c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    -0x78(%rbp),%r8
lea    -0x80(%rbp),%r9
call   1070 <__sunriset__@plt>
movsd  -0xf0(%rbp),%xmm1
ff
mov    %eax,%ecx
mov    -0xe5(%rbp),%al
mov    %ecx,-0x90(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
addsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
lea    0xcfb(%rip),%rdi
call   1040 <printf@plt>
mov    -0x84(%rbp),%eax
mov    %eax,-0xe4(%rbp)
sub    $0xffffffff,%eax
je     1531 <main+0x3e1>
jmp    14da <main+0x38a>
mov    -0xe4(%rbp),%eax
test   %eax,%eax
je     1501 <main+0x3b1>
jmp    14ed <main+0x39d>
mov    -0xe4(%rbp),%eax
sub    $0x1,%eax
je     151e <main+0x3ce>
jmp    153f <main+0x3ef>
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
lea    0xcbc(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    153f <main+0x3ef>
lea    0xcce(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    153f <main+0x3ef>
lea    0xcce(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x88(%rbp),%eax
mov    %eax,-0x134(%rbp)
sub    $0xffffffff,%eax
je     15b0 <main+0x460>
jmp    1559 <main+0x409>
mov    -0x134(%rbp),%eax
test   %eax,%eax
je     1580 <main+0x430>
jmp    156c <main+0x41c>
mov    -0x134(%rbp),%eax
sub    $0x1,%eax
je     159d <main+0x44d>
jmp    15be <main+0x46e>
movsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
lea    0xc88(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    15be <main+0x46e>
lea    0xca3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15be <main+0x46e>
lea    0xcb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8c(%rbp),%eax
mov    %eax,-0x138(%rbp)
sub    $0xffffffff,%eax
je     162f <main+0x4df>
jmp    15d8 <main+0x488>
mov    -0x138(%rbp),%eax
test   %eax,%eax
je     15ff <main+0x4af>
jmp    15eb <main+0x49b>
mov    -0x138(%rbp),%eax
sub    $0x1,%eax
je     161c <main+0x4cc>
jmp    163d <main+0x4ed>
movsd  -0x68(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
lea    0xc7c(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    163d <main+0x4ed>
lea    0xc9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    163d <main+0x4ed>
lea    0xcac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x90(%rbp),%eax
mov    %eax,-0x13c(%rbp)
sub    $0xffffffff,%eax
je     16ae <main+0x55e>
jmp    1657 <main+0x507>
mov    -0x13c(%rbp),%eax
test   %eax,%eax
je     167e <main+0x52e>
jmp    166a <main+0x51a>
mov    -0x13c(%rbp),%eax
sub    $0x1,%eax
je     169b <main+0x54b>
jmp    16bc <main+0x56c>
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
lea    0xc79(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    16bc <main+0x56c>
lea    0xc9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    16bc <main+0x56c>
lea    0xcb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e66(%rip),%rbp
mov    0x0(%rbp),%edx
lea    0x80(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1060 <fgets@plt>
lea    0xeba(%rip),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <sscanf@plt>
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%rbp),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1060 <fgets@plt>
lea    0xeb4(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <sscanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0xded(%rip),%xmm2
mov    $0x1,%ecx
call   1030 <__daylen__@plt>
movsd  %xmm0,0x20(%rsp)
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0xdc5(%rip),%xmm2
xor    %ecx,%ecx
call   1030 <__daylen__@plt>
movsd  %xmm0,0x38(%rsp)
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0xda0(%rip),%xmm2
xor    %ecx,%ecx
call   1030 <__daylen__@plt>
movsd  %xmm0,0x30(%rsp)
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0xd7b(%rip),%xmm2
xor    %ecx,%ecx
call   1030 <__daylen__@plt>
movsd  %xmm0,0x28(%rsp)
lea    0xde6(%rip),%rdi
movsd  0x20(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xdfb(%rip),%rdi
movsd  0x38(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe10(%rip),%rdi
movsd  0x30(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe25(%rip),%rdi
movsd  0x28(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x38(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
mulsd  0xd12(%rip),%xmm0
lea    0xe26(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x30(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
mulsd  0xcf0(%rip),%xmm0
lea    0xe2d(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x28(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
mulsd  0xcce(%rip),%xmm0
lea    0xe34(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
lea    0x48(%rsp),%r8
lea    0x40(%rsp),%r9
movsd  0xc76(%rip),%xmm2
mov    $0x1,%ecx
call   1080 <__sunriset__@plt>
mov    %eax,%ebp
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
lea    0x78(%rsp),%r8
lea    0x70(%rsp),%r9
movsd  0xc48(%rip),%xmm2
xor    %ecx,%ecx
call   1080 <__sunriset__@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
lea    0x68(%rsp),%r8
lea    0x60(%rsp),%r9
movsd  0xc1d(%rip),%xmm2
xor    %ecx,%ecx
call   1080 <__sunriset__@plt>
mov    %eax,%r15d
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
lea    0x58(%rsp),%r8
lea    0x50(%rsp),%r9
movsd  0xbf1(%rip),%xmm2
xor    %ecx,%ecx
call   1080 <__sunriset__@plt>
mov    %eax,%r14d
movsd  0x48(%rsp),%xmm0
addsd  0x40(%rsp),%xmm0
mulsd  0xbdb(%rip),%xmm0
lea    0xd6a(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cmp    $0xffffffff,%ebp
je     147d <main+0x31d>
cmp    $0x1,%ebp
je     1486 <main+0x326>
test   %ebp,%ebp
jne    1492 <main+0x332>
movsd  0x48(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
lea    0xd5a(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
jmp    1492 <main+0x332>
lea    0xe03(%rip),%rdi
jmp    148d <main+0x32d>
lea    0xee9(%rip),%rdi
call   1040 <puts@plt>
cmp    $0xffffffff,%ebx
je     14bc <main+0x35c>
cmp    $0x1,%ebx
je     14c5 <main+0x365>
test   %ebx,%ebx
jne    14d1 <main+0x371>
movsd  0x78(%rsp),%xmm0
movsd  0x70(%rsp),%xmm1
lea    0xd40(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
jmp    14d1 <main+0x371>
lea    0xdd6(%rip),%rdi
jmp    14cc <main+0x36c>
lea    0xe89(%rip),%rdi
call   1040 <puts@plt>
cmp    $0xffffffff,%r15d
je     14fe <main+0x39e>
cmp    $0x1,%r15d
je     1507 <main+0x3a7>
test   %r15d,%r15d
jne    1513 <main+0x3b3>
movsd  0x68(%rsp),%xmm0
movsd  0x60(%rsp),%xmm1
lea    0xd2c(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
jmp    1513 <main+0x3b3>
lea    0xdb6(%rip),%rdi
jmp    150e <main+0x3ae>
lea    0xe23(%rip),%rdi
call   1040 <puts@plt>
cmp    $0xffffffff,%r14d
je     1540 <main+0x3e0>
cmp    $0x1,%r14d
je     1549 <main+0x3e9>
test   %r14d,%r14d
jne    1555 <main+0x3f5>
movsd  0x58(%rsp),%xmm0
movsd  0x50(%rsp),%xmm1
lea    0xd1b(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
jmp    1555 <main+0x3f5>
lea    0xd99(%rip),%rdi
jmp    1550 <main+0x3f0>
lea    0xdb9(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Longitude (+ is east) and latitude (+ is north) : \00"
@stdin = global i32 0
@.str.1 = [8 x i8] c"%lf %lf\00"
@.str.2 = [43 x i8] c"Input date ( yyyy mm dd ) (ctrl-C exits): \00"
@.str.3 = [9 x i8] c"%d %d %d\00"
@.str.4 = [41 x i8] c"Day length: %5.2f hours\0A\00"
@.str.5 = [41 x i8] c"With civil twilight %5.2f hours\0A\00"
@.str.6 = [41 x i8] c"With nautical twilight %5.2f hours\0A\00"
@.str.7 = [41 x i8] c"With astronomical twilight %5.2f hours\0A\00"
@.str.8 = [41 x i8] c"Length of twilight: civil %5.2f hours\0A\00"
@.str.9 = [41 x i8] c" nautical %5.2f hours\0A\00"
@.str.10 = [41 x i8] c" astronomical %5.2f hours\0A\00"
@.str.11 = [24 x i8] c"Sun at south %5.2fh UT\0A\00"
@.str.12 = [37 x i8] c"Sun rises %5.2fh UT, sets %5.2fh UT\0A\00"
@.str.13 = [19 x i8] c"Sun above horizon\0A\00"
@.str.14 = [19 x i8] c"Sun below horizon\0A\00"
@.str.15 = [46 x i8] c"Civil twilight starts %5.2fh, ends %5.2fh UT\0A\00"
@.str.16 = [34 x i8] c"Never darker than civil twilight\0A\00"
@.str.17 = [35 x i8] c"Never as bright as civil twilight\0A\00"
@.str.18 = [49 x i8] c"Nautical twilight starts %5.2fh, ends %5.2fh UT\0A\00"
@.str.19 = [37 x i8] c"Never darker than nautical twilight\0A\00"
@.str.20 = [38 x i8] c"Never as bright as nautical twilight\0A\00"
@.str.21 = [53 x i8] c"Astronomical twilight starts %5.2fh, ends %5.2fh UT\0A\00"
@.str.22 = [41 x i8] c"Never darker than astronomical twilight\0A\00"
@.str.23 = [42 x i8] c"Never as bright as astronomical twilight\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca [80 x i8]
store i32 0, i32* %1
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%25 = getelementptr inbounds [80 x i8], [80 x i8]* %23, i64 0, i64 0
%26 = load i32, i32* @stdin
%27 = call i32 @fgets(i8* %25, i32 80, i32 %26)
%28 = getelementptr inbounds [80 x i8], [80 x i8]* %23, i64 0, i64 0
%29 = call i32 (i8*, i8*, ...) @sscanf(i8* %28, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %5, double* %6)
br label %30
30: ; preds = %0
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%32 = getelementptr inbounds [80 x i8], [80 x i8]* %23, i64 0, i64 0
%33 = load i32, i32* @stdin
%34 = call i32 @fgets(i8* %32, i32 80, i32 %33)
%35 = getelementptr inbounds [80 x i8], [80 x i8]* %23, i64 0, i64 0
%36 = call i32 (i8*, i8*, ...) @sscanf(i8* %35, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%37 = load i32, i32* %2
%38 = load i32, i32* %3
%39 = load i32, i32* %4
%40 = load double, double* %5
%41 = load double, double* %6
%42 = call double @__daylen__(i32 %37, i32 %38, i32 %39, double %40, double %41, double 0xBFE2AAAAAAAAAAAB, i32 1)
store double %42, double* %7
%43 = load i32, i32* %2
%44 = load i32, i32* %3
%45 = load i32, i32* %4
%46 = load double, double* %5
%47 = load double, double* %6
%48 = call double @__daylen__(i32 %43, i32 %44, i32 %45, double %46, double %47, double -6.000000e+00, i32 0)
store double %48, double* %8
%49 = load i32, i32* %2
%50 = load i32, i32* %3
%51 = load i32, i32* %4
%52 = load double, double* %5
%53 = load double, double* %6
%54 = call double @__daylen__(i32 %49, i32 %50, i32 %51, double %52, double %53, double -1.200000e+01, i32 0)
store double %54, double* %9
%55 = load i32, i32* %2
%56 = load i32, i32* %3
%57 = load i32, i32* %4
%58 = load double, double* %5
%59 = load double, double* %6
%60 = call double @__daylen__(i32 %55, i32 %56, i32 %57, double %58, double %59, double -1.800000e+01, i32 0)
store double %60, double* %10
%61 = load double, double* %7
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), double %61)
%63 = load double, double* %8
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), double %63)
%65 = load double, double* %9
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0), double %65)
%67 = load double, double* %10
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), double %67)
%69 = load double, double* %8
%70 = load double, double* %7
%71 = fsub double %69, %70
%72 = fdiv double %71, 2.000000e+00
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), double %72)
%74 = load double, double* %9
%75 = load double, double* %7
%76 = fsub double %74, %75
%77 = fdiv double %76, 2.000000e+00
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), double %77)
%79 = load double, double* %10
%80 = load double, double* %7
%81 = fsub double %79, %80
%82 = fdiv double %81, 2.000000e+00
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.10, i64 0, i64 0), double %82)
%84 = load i32, i32* %2
%85 = load i32, i32* %3
%86 = load i32, i32* %4
%87 = load double, double* %5
%88 = load double, double* %6
%89 = call i32 @__sunriset__(i32 %84, i32 %85, i32 %86, double %87, double %88, double 0xBFE2AAAAAAAAAAAB, i32 1, double* %11, double* %12)
store i32 %89, i32* %19
%90 = load i32, i32* %2
%91 = load i32, i32* %3
%92 = load i32, i32* %4
%93 = load double, double* %5
%94 = load double, double* %6
%95 = call i32 @__sunriset__(i32 %90, i32 %91, i32 %92, double %93, double %94, double -6.000000e+00, i32 0, double* %13, double* %14)
store i32 %95, i32* %20
%96 = load i32, i32* %2
%97 = load i32, i32* %3
%98 = load i32, i32* %4
%99 = load double, double* %5
%100 = load double, double* %6
%101 = call i32 @__sunriset__(i32 %96, i32 %97, i32 %98, double %99, double %100, double -1.200000e+01, i32 0, double* %15, double* %16)
store i32 %101, i32* %21
%102 = load i32, i32* %2
%103 = load i32, i32* %3
%104 = load i32, i32* %4
%105 = load double, double* %5
%106 = load double, double* %6
%107 = call i32 @__sunriset__(i32 %102, i32 %103, i32 %104, double %105, double %106, double -1.800000e+01, i32 0, double* %17, double* %18)
store i32 %107, i32* %22
%108 = load double, double* %11
%109 = load double, double* %12
%110 = fadd double %108, %109
%111 = fdiv double %110, 2.000000e+00
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), double %111)
%113 = load i32, i32* %19
switch i32 %113, label %122 [
i32 0, label %114
i32 1, label %118
i32 -1, label %120
]
114: ; preds = %30
%115 = load double, double* %11
%116 = load double, double* %12
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0), double %115, double %116)
br label %122
118: ; preds = %30
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0))
br label %122
120: ; preds = %30
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0))
br label %122
122: ; preds = %30, %120, %118, %114
%123 = load i32, i32* %20
switch i32 %123, label %132 [
i32 0, label %124
i32 1, label %128
i32 -1, label %130
]
124: ; preds = %122
%125 = load double, double* %13
%126 = load double, double* %14
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.15, i64 0, i64 0), double %125, double %126)
br label %132
128: ; preds = %122
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.16, i64 0, i64 0))
br label %132
130: ; preds = %122
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.17, i64 0, i64 0))
br label %132
132: ; preds = %122, %130, %128, %124
%133 = load i32, i32* %21
switch i32 %133, label %142 [
i32 0, label %134
i32 1, label %138
i32 -1, label %140
]
134: ; preds = %132
%135 = load double, double* %15
%136 = load double, double* %16
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.18, i64 0, i64 0), double %135, double %136)
br label %142
138: ; preds = %132
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.19, i64 0, i64 0))
br label %142
140: ; preds = %132
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.20, i64 0, i64 0))
br label %142
142: ; preds = %132, %140, %138, %134
%143 = load i32, i32* %22
switch i32 %143, label %152 [
i32 0, label %144
i32 1, label %148
i32 -1, label %150
]
144: ; preds = %142
%145 = load double, double* %17
%146 = load double, double* %18
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.21, i64 0, i64 0), double %145, double %146)
br label %152
148: ; preds = %142
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.22, i64 0, i64 0))
br label %152
150: ; preds = %142
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.23, i64 0, i64 0))
br label %152
152: ; preds = %142, %150, %148, %144
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"Longitude (+ is east) and latitude (+ is north) : \00"
@stdin = global i32 0
@.str.1 = [8 x i8] c"%lf %lf\00"
@.str.2 = [43 x i8] c"Input date ( yyyy mm dd ) (ctrl-C exits): \00"
@.str.3 = [9 x i8] c"%d %d %d\00"
@.str.4 = [41 x i8] c"Day length: %5.2f hours\0A\00"
@.str.5 = [41 x i8] c"With civil twilight %5.2f hours\0A\00"
@.str.6 = [41 x i8] c"With nautical twilight %5.2f hours\0A\00"
@.str.7 = [41 x i8] c"With astronomical twilight %5.2f hours\0A\00"
@.str.8 = [41 x i8] c"Length of twilight: civil %5.2f hours\0A\00"
@.str.9 = [41 x i8] c" nautical %5.2f hours\0A\00"
@.str.10 = [41 x i8] c" astronomical %5.2f hours\0A\00"
@.str.11 = [24 x i8] c"Sun at south %5.2fh UT\0A\00"
@.str.12 = [37 x i8] c"Sun rises %5.2fh UT, sets %5.2fh UT\0A\00"
@.str.15 = [46 x i8] c"Civil twilight starts %5.2fh, ends %5.2fh UT\0A\00"
@.str.18 = [49 x i8] c"Nautical twilight starts %5.2fh, ends %5.2fh UT\0A\00"
@.str.21 = [53 x i8] c"Astronomical twilight starts %5.2fh, ends %5.2fh UT\0A\00"
@str = [18 x i8] c"Sun below horizon\00"
@str.24 = [34 x i8] c"Never as bright as civil twilight\00"
@str.25 = [37 x i8] c"Never as bright as nautical twilight\00"
@str.26 = [41 x i8] c"Never as bright as astronomical twilight\00"
@str.27 = [40 x i8] c"Never darker than astronomical twilight\00"
@str.28 = [36 x i8] c"Never darker than nautical twilight\00"
@str.29 = [33 x i8] c"Never darker than civil twilight\00"
@str.30 = [18 x i8] c"Sun above horizon\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca [80 x i8]
%15 = bitcast i32* %1 to i8*
%16 = bitcast i32* %2 to i8*
%17 = bitcast i32* %3 to i8*
%18 = bitcast double* %4 to i8*
%19 = bitcast double* %5 to i8*
%20 = bitcast double* %6 to i8*
%21 = bitcast double* %7 to i8*
%22 = bitcast double* %8 to i8*
%23 = bitcast double* %9 to i8*
%24 = bitcast double* %10 to i8*
%25 = bitcast double* %11 to i8*
%26 = bitcast double* %12 to i8*
%27 = bitcast double* %13 to i8*
%28 = getelementptr inbounds [80 x i8], [80 x i8]* %14, i64 0, i64 0
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%30 = load i32, i32* @stdin
%31 = call i32 @fgets(i8* %28, i32 80, i32 %30)
%32 = call i32 (i8*, i8*, ...) @sscanf(i8* %28, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %4, double* %5)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%34 = load i32, i32* @stdin
%35 = call i32 @fgets(i8* %28, i32 80, i32 %34)
%36 = call i32 (i8*, i8*, ...) @sscanf(i8* %28, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%37 = load i32, i32* %1
%38 = load i32, i32* %2
%39 = load i32, i32* %3
%40 = load double, double* %4
%41 = load double, double* %5
%42 = call double @__daylen__(i32 %37, i32 %38, i32 %39, double %40, double %41, double 0xBFE2AAAAAAAAAAAB, i32 1)
%43 = load i32, i32* %1
%44 = load i32, i32* %2
%45 = load i32, i32* %3
%46 = load double, double* %4
%47 = load double, double* %5
%48 = call double @__daylen__(i32 %43, i32 %44, i32 %45, double %46, double %47, double -6.000000e+00, i32 0)
%49 = load i32, i32* %1
%50 = load i32, i32* %2
%51 = load i32, i32* %3
%52 = load double, double* %4
%53 = load double, double* %5
%54 = call double @__daylen__(i32 %49, i32 %50, i32 %51, double %52, double %53, double -1.200000e+01, i32 0)
%55 = load i32, i32* %1
%56 = load i32, i32* %2
%57 = load i32, i32* %3
%58 = load double, double* %4
%59 = load double, double* %5
%60 = call double @__daylen__(i32 %55, i32 %56, i32 %57, double %58, double %59, double -1.800000e+01, i32 0)
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), double %42)
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), double %48)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0), double %54)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), double %60)
%65 = fsub double %48, %42
%66 = fmul double %65, 5.000000e-01
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), double %66)
%68 = fsub double %54, %42
%69 = fmul double %68, 5.000000e-01
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), double %69)
%71 = fsub double %60, %42
%72 = fmul double %71, 5.000000e-01
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.10, i64 0, i64 0), double %72)
%74 = load i32, i32* %1
%75 = load i32, i32* %2
%76 = load i32, i32* %3
%77 = load double, double* %4
%78 = load double, double* %5
%79 = call i32 @__sunriset__(i32 %74, i32 %75, i32 %76, double %77, double %78, double 0xBFE2AAAAAAAAAAAB, i32 1, double* %6, double* %7)
%80 = load i32, i32* %1
%81 = load i32, i32* %2
%82 = load i32, i32* %3
%83 = load double, double* %4
%84 = load double, double* %5
%85 = call i32 @__sunriset__(i32 %80, i32 %81, i32 %82, double %83, double %84, double -6.000000e+00, i32 0, double* %8, double* %9)
%86 = load i32, i32* %1
%87 = load i32, i32* %2
%88 = load i32, i32* %3
%89 = load double, double* %4
%90 = load double, double* %5
%91 = call i32 @__sunriset__(i32 %86, i32 %87, i32 %88, double %89, double %90, double -1.200000e+01, i32 0, double* %10, double* %11)
%92 = load i32, i32* %1
%93 = load i32, i32* %2
%94 = load i32, i32* %3
%95 = load double, double* %4
%96 = load double, double* %5
%97 = call i32 @__sunriset__(i32 %92, i32 %93, i32 %94, double %95, double %96, double -1.800000e+01, i32 0, double* %12, double* %13)
%98 = load double, double* %6
%99 = load double, double* %7
%100 = fadd double %98, %99
%101 = fmul double %100, 5.000000e-01
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), double %101)
switch i32 %79, label %111 [
i32 0, label %103
i32 1, label %107
i32 -1, label %109
]
103: ; preds = %0
%104 = load double, double* %6
%105 = load double, double* %7
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0), double %104, double %105)
br label %111
107: ; preds = %0
%108 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.30, i64 0, i64 0))
br label %111
109: ; preds = %0
%110 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %111
111: ; preds = %0, %109, %107, %103
switch i32 %85, label %120 [
i32 0, label %112
i32 1, label %116
i32 -1, label %118
]
112: ; preds = %111
%113 = load double, double* %8
%114 = load double, double* %9
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.15, i64 0, i64 0), double %113, double %114)
br label %120
116: ; preds = %111
%117 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.29, i64 0, i64 0))
br label %120
118: ; preds = %111
%119 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.24, i64 0, i64 0))
br label %120
120: ; preds = %111, %118, %116, %112
switch i32 %91, label %129 [
i32 0, label %121
i32 1, label %125
i32 -1, label %127
]
121: ; preds = %120
%122 = load double, double* %10
%123 = load double, double* %11
%124 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.18, i64 0, i64 0), double %122, double %123)
br label %129
125: ; preds = %120
%126 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.28, i64 0, i64 0))
br label %129
127: ; preds = %120
%128 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.25, i64 0, i64 0))
br label %129
129: ; preds = %120, %127, %125, %121
switch i32 %97, label %138 [
i32 0, label %130
i32 1, label %134
i32 -1, label %136
]
130: ; preds = %129
%131 = load double, double* %12
%132 = load double, double* %13
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.21, i64 0, i64 0), double %131, double %132)
br label %138
134: ; preds = %129
%135 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.27, i64 0, i64 0))
br label %138
136: ; preds = %129
%137 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.26, i64 0, i64 0))
br label %138
138: ; preds = %129, %136, %134, %130
ret i32 0
}