#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 /*<<< orphan*/ FILE;

/* Variables and functions */
double atan(double);
double cos(double);
int /*<<< orphan*/ exit(int);
double fabs(double);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, ...);
char *getenv(char *);
int /*<<< orphan*/ printf(char *, ...);
double sgn(double);
double sin(double);
int /*<<< orphan*/ sprintf(char *, char *, char *);
double sqrt(double);
int /*<<< orphan*/ sscanf(char *, char *, double *);
int /*<<< orphan*/ stdin;
int main() {
  double l, g, dr, c, dc, ds, j, az, el, cd;
  char qthfile[50], input[7];
  FILE *fd;
  sprintf(qthfile, "%s/.predict/predict.qth", getenv("HOME"));
  fd = fopen(qthfile, "r");
  if (fd != NULL) {
    fscanf(fd, "%s", input);
    fscanf(fd, "%lf", &l);
    fscanf(fd, "%lf", &g);
    fclose(fd);
  } else {
    printf("%c\n*** ERROR!  \"%s\" not found!  Program aborted!\n", 7, qthfile);
    exit(-1);
  }
  input[0] = 0;
  dr = 3.141592653589793 / 180.0;
  l = l * dr;
  g = g * dr;
  printf("\nEnter Longitude of Satellite in Degrees West: ");
  fgets(input, 5, stdin);
  while (input[0] != '\n') {
    sscanf(input, "%lf", &cd);
    c = cd * dr;
    dc = cos(l) * cos(c - g);
    ds = sqrt(1.0 - (dc * dc));
    j = -sin(l) * dc / (cos(l) * ds);
    if (fabs(j) > 0.9999)
      j = sgn(j) * 0.9999;
    az = 90.0 - atan(j / sqrt(1.0 - j * j)) / dr;
    if (((c > g) && (c < (3.141592653589793 + g))) ||
        ((c > (2.0 * 3.141592653589793 + g))))
      az = 360.0 - az;
    el = atan((42171.0 * dc - 6371.0) / (42171.0 * ds)) / dr;
    printf("\nAzimuth   : %6.2f degrees\n", az);
    printf("Elevation : %6.2f degrees\n\n", el);
    printf("\nEnter Longitude of Satellite in Degrees West: ");
    fgets(input, 5, stdin);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0xa8(%rbp)
lea    0xe71(%rip),%rdi
call   1030 <getenv@plt>
mov    -0xa8(%rbp),%rdi
mov    %rax,%rdx
lea    0xe43(%rip),%rsi
call   10f0 <sprintf@plt>
lea    -0x90(%rbp),%rdi
lea    0xe4d(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0xa0(%rbp)
cmpq   $0x0,-0xa0(%rbp)
je     12a9 <main+0xc9>
mov    -0xa0(%rbp),%rdi
lea    -0x97(%rbp),%rdx
lea    0xe20(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    -0xa0(%rbp),%rdi
lea    0xe0e(%rip),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    -0xa0(%rbp),%rdi
lea    0xdf5(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    -0xa0(%rbp),%rdi
call   1040 <fclose@plt>
jmp    12cd <main+0xed>
lea    -0x90(%rbp),%rdx
lea    0xdcf(%rip),%rdi
mov    $0x7,%esi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>
movb   $0x0,-0x97(%rbp)
movsd  0xd24(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x97(%rbp),%rdi
mov    0x2ccd(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%esi
call   1070 <fgets@plt>
movsbl -0x97(%rbp),%eax
cmp    $0xa,%eax
je     15b5 <main+0x3d5>
lea    -0x97(%rbp),%rdi
lea    0xd3d(%rip),%rsi
lea    -0x58(%rbp),%rdx
call   10a0 <sscanf@plt>
movsd  -0x58(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   10c0 <cos@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   10c0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xc51(%rip),%xmm1
addsd  %xmm1,%xmm0
call   10e0 <sqrt@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1080 <sin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
call   10c0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  -0x38(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movaps 0xc26(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xbd2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    145b <main+0x27b>
movsd  -0x40(%rbp),%xmm0
call   10b0 <sgn@plt>
movsd  0xbb6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xb7b(%rip),%xmm1
addsd  %xmm1,%xmm0
call   10e0 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
call   1090 <atan@plt>
movaps %xmm0,%xmm1
divsd  -0x20(%rbp),%xmm1
movsd  0xb56(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    14f7 <main+0x317>
movsd  -0x28(%rbp),%xmm1
movsd  0xb38(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     1513 <main+0x333>
movsd  -0x28(%rbp),%xmm0
movsd  0xb24(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    1525 <main+0x345>
movsd  0xb15(%rip),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xb06(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb02(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xaee(%rip),%xmm1
mulsd  -0x38(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1090 <atan@plt>
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
lea    0xb7a(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x50(%rbp),%xmm0
lea    0xb83(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xb29(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x97(%rbp),%rdi
mov    0x2a44(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%esi
call   1070 <fgets@plt>
jmp    1327 <main+0x147>
xor    %edi,%edi
call   1100 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
lea    0xe90(%rip),%rdi
call   1030 <getenv@plt>
lea    0xe6c(%rip),%rsi
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
mov    %rax,%rdx
call   10f0 <sprintf@plt>
lea    0xe72(%rip),%rsi
mov    %rbx,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
jne    124a <main+0x6a>
lea    0xe67(%rip),%rdi
lea    0x60(%rsp),%rdx
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>
mov    %rax,%rbp
lea    0xe3b(%rip),%rsi
lea    0x19(%rsp),%r14
mov    %rax,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1060 <fscanf@plt>
lea    0xe25(%rip),%rbx
lea    0x10(%rsp),%rdx
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <fscanf@plt>
lea    0x20(%rsp),%rdx
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
movb   $0x0,0x19(%rsp)
movsd  0xd5a(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
lea    0xdfb(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2d0d(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
mov    $0x5,%esi
call   1070 <fgets@plt>
cmpb   $0xa,0x19(%rsp)
jne    12f8 <main+0x118>
xor    %edi,%edi
call   1100 <exit@plt>
lea    0xd93(%rip),%r14
lea    0x19(%rsp),%rbx
lea    0x58(%rsp),%r15
lea    0xde8(%rip),%r12
lea    0xdfd(%rip),%r13
lea    0xdaa(%rip),%rbp
jmp    1460 <main+0x280>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd %xmm2,0x40(%rsp)
call   10e0 <sqrt@plt>
movapd 0x40(%rsp),%xmm2
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
call   1090 <atan@plt>
movsd  0xcaa(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xcb6(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0x20(%rsp),%xmm0
movapd %xmm0,%xmm2
addsd  0xca8(%rip),%xmm2
movapd %xmm0,%xmm6
addsd  0xca4(%rip),%xmm6
movsd  0xca4(%rip),%xmm3
subsd  %xmm1,%xmm3
movsd  0x30(%rsp),%xmm5
movapd %xmm5,%xmm4
cmpltsd %xmm2,%xmm4
movapd %xmm4,%xmm2
andpd  %xmm3,%xmm2
andnpd %xmm1,%xmm4
orpd   %xmm2,%xmm4
cmpltsd %xmm5,%xmm0
andpd  %xmm0,%xmm4
andnpd %xmm1,%xmm0
orpd   %xmm4,%xmm0
cmpltsd %xmm5,%xmm6
movapd %xmm6,%xmm1
andnpd %xmm0,%xmm1
andpd  %xmm3,%xmm6
orpd   %xmm1,%xmm6
movapd %xmm6,0x30(%rsp)
movsd  0xc55(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xc4b(%rip),%xmm0
movsd  0x28(%rsp),%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
call   1090 <atan@plt>
divsd  0xbf0(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r12,%rdi
movaps 0x30(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %r13,%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2ba2(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1070 <fgets@plt>
cmpb   $0xa,0x19(%rsp)
je     12f1 <main+0x111>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   10a0 <sscanf@plt>
movsd  0x58(%rsp),%xmm0
mulsd  0xb84(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x10(%rsp),%xmm0
call   10c0 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x30(%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
call   10c0 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xb48(%rip),%xmm0
subsd  %xmm1,%xmm0
ucomisd 0xb7c(%rip),%xmm0
jb     14e0 <main+0x300>
sqrtsd %xmm0,%xmm0
jmp    14e5 <main+0x305>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   10e0 <sqrt@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x10(%rsp),%xmm0
call   1080 <sin@plt>
xorpd  0xb52(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movapd %xmm0,0x40(%rsp)
movsd  0x10(%rsp),%xmm0
call   10c0 <cos@plt>
movapd 0x40(%rsp),%xmm2
movsd  0x28(%rsp),%xmm1
mulsd  %xmm1,%xmm0
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
andpd  0xb2b(%rip),%xmm0
movsd  0xad3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1558 <main+0x378>
movapd %xmm2,%xmm0
call   10b0 <sgn@plt>
movapd %xmm0,%xmm2
mulsd  0xab8(%rip),%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xaa0(%rip),%xmm0
subsd  %xmm1,%xmm0
ucomisd 0xad4(%rip),%xmm0
jb     1330 <main+0x150>
sqrtsd %xmm0,%xmm0
jmp    1341 <main+0x161>

LLVM IR (-O0):
@.str = [24 x i8] c"%s/.predict/predict.qth\00"
@.str.1 = [5 x i8] c"HOME\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [4 x i8] c"%lf\00"
@.str.5 = [50 x i8] c"%c\0A*** ERROR! \22%s\22 not found! Program aborted!\0A\00"
@.str.6 = [48 x i8] c"\0AEnter Longitude of Satellite in Degrees West: \00"
@stdin = global i32 0
@.str.7 = [28 x i8] c"\0AAzimuth : %6.2f degrees\0A\00"
@.str.8 = [28 x i8] c"Elevation : %6.2f degrees\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%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 [50 x i8]
%13 = alloca [7 x i8]
%14 = alloca i32*
store i32 0, i32* %1
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %12, i64 0, i64 0
%16 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [50 x i8], [50 x i8]* %12, i64 0, i64 0
%19 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %19, i32** %14
%20 = load i32*, i32** %14
%21 = icmp ne i32* %20, null
br i1 %21, label %22, label %32
22: ; preds = %0
%23 = load i32*, i32** %14
%24 = getelementptr inbounds [7 x i8], [7 x i8]* %13, i64 0, i64 0
%25 = call i32 (i32*, i8*, ...) @fscanf(i32* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %24)
%26 = load i32*, i32** %14
%27 = call i32 (i32*, i8*, ...) @fscanf(i32* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %2)
%28 = load i32*, i32** %14
%29 = call i32 (i32*, i8*, ...) @fscanf(i32* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %3)
%30 = load i32*, i32** %14
%31 = call i32 @fclose(i32* %30)
br label %36
32: ; preds = %0
%33 = getelementptr inbounds [50 x i8], [50 x i8]* %12, i64 0, i64 0
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i32 7, i8* %33)
%35 = call i32 @exit(i32 -1)
unreachable
36: ; preds = %22
%37 = getelementptr inbounds [7 x i8], [7 x i8]* %13, i64 0, i64 0
store i8 0, i8* %37
store double 0x3F91DF46A2529D39, double* %4
%38 = load double, double* %2
%39 = load double, double* %4
%40 = fmul double %38, %39
store double %40, double* %2
%41 = load double, double* %3
%42 = load double, double* %4
%43 = fmul double %41, %42
store double %43, double* %3
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0))
%45 = getelementptr inbounds [7 x i8], [7 x i8]* %13, i64 0, i64 0
%46 = load i32, i32* @stdin
%47 = call i32 @fgets(i8* %45, i32 5, i32 %46)
br label %48
48: ; preds = %116, %36
%49 = getelementptr inbounds [7 x i8], [7 x i8]* %13, i64 0, i64 0
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp ne i32 %51, 10
br i1 %52, label %53, label %133
53: ; preds = %48
%54 = getelementptr inbounds [7 x i8], [7 x i8]* %13, i64 0, i64 0
%55 = call i32 @sscanf(i8* %54, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %11)
%56 = load double, double* %11
%57 = load double, double* %4
%58 = fmul double %56, %57
store double %58, double* %5
%59 = load double, double* %2
%60 = call double @cos(double %59)
%61 = load double, double* %5
%62 = load double, double* %3
%63 = fsub double %61, %62
%64 = call double @cos(double %63)
%65 = fmul double %60, %64
store double %65, double* %6
%66 = load double, double* %6
%67 = load double, double* %6
%68 = fneg double %66
%69 = call double @llvm.fmuladd.f64(double %68, double %67, double 1.000000e+00)
%70 = call double @sqrt(double %69)
store double %70, double* %7
%71 = load double, double* %2
%72 = call double @sin(double %71)
%73 = fneg double %72
%74 = load double, double* %6
%75 = fmul double %73, %74
%76 = load double, double* %2
%77 = call double @cos(double %76)
%78 = load double, double* %7
%79 = fmul double %77, %78
%80 = fdiv double %75, %79
store double %80, double* %8
%81 = load double, double* %8
%82 = call double @llvm.fabs.f64(double %81)
%83 = fcmp ogt double %82, 9.999000e-01
br i1 %83, label %84, label %88
84: ; preds = %53
%85 = load double, double* %8
%86 = call double @sgn(double %85)
%87 = fmul double %86, 9.999000e-01
store double %87, double* %8
br label %88
88: ; preds = %84, %53
%89 = load double, double* %8
%90 = load double, double* %8
%91 = load double, double* %8
%92 = fneg double %90
%93 = call double @llvm.fmuladd.f64(double %92, double %91, double 1.000000e+00)
%94 = call double @sqrt(double %93)
%95 = fdiv double %89, %94
%96 = call double @atan(double %95)
%97 = load double, double* %4
%98 = fdiv double %96, %97
%99 = fsub double 9.000000e+01, %98
store double %99, double* %9
%100 = load double, double* %5
%101 = load double, double* %3
%102 = fcmp ogt double %100, %101
br i1 %102, label %103, label %108
103: ; preds = %88
%104 = load double, double* %5
%105 = load double, double* %3
%106 = fadd double 0x400921FB54442D18, %105
%107 = fcmp olt double %104, %106
br i1 %107, label %113, label %108
108: ; preds = %103, %88
%109 = load double, double* %5
%110 = load double, double* %3
%111 = fadd double 0x401921FB54442D18, %110
%112 = fcmp ogt double %109, %111
br i1 %112, label %113, label %116
113: ; preds = %108, %103
%114 = load double, double* %9
%115 = fsub double 3.600000e+02, %114
store double %115, double* %9
br label %116
116: ; preds = %113, %108
%117 = load double, double* %6
%118 = call double @llvm.fmuladd.f64(double 4.217100e+04, double %117, double -6.371000e+03)
%119 = load double, double* %7
%120 = fmul double 4.217100e+04, %119
%121 = fdiv double %118, %120
%122 = call double @atan(double %121)
%123 = load double, double* %4
%124 = fdiv double %122, %123
store double %124, double* %10
%125 = load double, double* %9
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), double %125)
%127 = load double, double* %10
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), double %127)
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0))
%130 = getelementptr inbounds [7 x i8], [7 x i8]* %13, i64 0, i64 0
%131 = load i32, i32* @stdin
%132 = call i32 @fgets(i8* %130, i32 5, i32 %131)
br label %48
133: ; preds = %48
%134 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"%s/.predict/predict.qth\00"
@.str.1 = [5 x i8] c"HOME\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [4 x i8] c"%lf\00"
@.str.5 = [50 x i8] c"%c\0A*** ERROR! \22%s\22 not found! Program aborted!\0A\00"
@.str.6 = [48 x i8] c"\0AEnter Longitude of Satellite in Degrees West: \00"
@stdin = global i32 0
@.str.7 = [28 x i8] c"\0AAzimuth : %6.2f degrees\0A\00"
@.str.8 = [28 x i8] c"Elevation : %6.2f degrees\0A\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca [50 x i8]
%5 = alloca [7 x i8]
%6 = bitcast double* %1 to i8*
%7 = bitcast double* %2 to i8*
%8 = bitcast double* %3 to i8*
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%11 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %29, label %15
15: ; preds = %0
%16 = call i32 (i32*, i8*, ...) @fscanf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %10)
%17 = call i32 (i32*, i8*, ...) @fscanf(i32* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %1)
%18 = call i32 (i32*, i8*, ...) @fscanf(i32* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %2)
%19 = call i32 @fclose(i32* %13)
store i8 0, i8* %10
%20 = load double, double* %1
%21 = fmul double %20, 0x3F91DF46A2529D39
store double %21, double* %1
%22 = load double, double* %2
%23 = fmul double %22, 0x3F91DF46A2529D39
store double %23, double* %2
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0))
%25 = load i32, i32* @stdin
%26 = call i32 @fgets(i8* %10, i32 5, i32 %25)
%27 = load i8, i8* %10
%28 = icmp eq i8 %27, 10
br i1 %28, label %89, label %32
29: ; preds = %0
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i32 7, i8* %9)
%31 = call i32 @exit(i32 -1)
unreachable
32: ; preds = %15, %58
%33 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %3)
%34 = load double, double* %3
%35 = fmul double %34, 0x3F91DF46A2529D39
%36 = load double, double* %1
%37 = call double @cos(double %36)
%38 = load double, double* %2
%39 = fsub double %35, %38
%40 = call double @cos(double %39)
%41 = fmul double %37, %40
%42 = fneg double %41
%43 = call double @llvm.fmuladd.f64(double %42, double %41, double 1.000000e+00)
%44 = call double @sqrt(double %43)
%45 = load double, double* %1
%46 = call double @sin(double %45)
%47 = fneg double %46
%48 = fmul double %41, %47
%49 = load double, double* %1
%50 = call double @cos(double %49)
%51 = fmul double %44, %50
%52 = fdiv double %48, %51
%53 = call double @llvm.fabs.f64(double %52)
%54 = fcmp ogt double %53, 9.999000e-01
br i1 %54, label %55, label %58
55: ; preds = %32
%56 = call double @sgn(double %52)
%57 = fmul double %56, 9.999000e-01
br label %58
58: ; preds = %55, %32
%59 = phi double [ %57, %55 ], [ %52, %32 ]
%60 = fneg double %59
%61 = call double @llvm.fmuladd.f64(double %60, double %59, double 1.000000e+00)
%62 = call double @sqrt(double %61)
%63 = fdiv double %59, %62
%64 = call double @atan(double %63)
%65 = fdiv double %64, 0x3F91DF46A2529D39
%66 = fsub double 9.000000e+01, %65
%67 = load double, double* %2
%68 = fcmp ogt double %35, %67
%69 = fadd double %67, 0x400921FB54442D18
%70 = fcmp olt double %35, %69
%71 = and i1 %68, %70
%72 = fadd double %67, 0x401921FB54442D18
%73 = fcmp ogt double %35, %72
%74 = or i1 %73, %71
%75 = fsub double 3.600000e+02, %66
%76 = select i1 %74, double %75, double %66
%77 = call double @llvm.fmuladd.f64(double %41, double 4.217100e+04, double -6.371000e+03)
%78 = fmul double %44, 4.217100e+04
%79 = fdiv double %77, %78
%80 = call double @atan(double %79)
%81 = fdiv double %80, 0x3F91DF46A2529D39
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), double %76)
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), double %81)
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0))
%85 = load i32, i32* @stdin
%86 = call i32 @fgets(i8* %10, i32 5, i32 %85)
%87 = load i8, i8* %10
%88 = icmp eq i8 %87, 10
br i1 %88, label %89, label %32
89: ; preds = %58, %15
%90 = call i32 @exit(i32 0)
unreachable
}