#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*/ time_t;
typedef int /*<<< orphan*/ buff;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
double atof(char *);
char *ctime(int /*<<< orphan*/ const *);
int /*<<< orphan*/ *err_fopen(char const *, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
scalar_t__ memcmp(char *, char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ rename(char *, char const *);
int /*<<< orphan*/ sprintf(char *, char *, double, int);
int /*<<< orphan*/ sscanf(char *, char *, double *, double *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ unlink(char const *);
int main(const int argc, const char **argv) {
  FILE *old_file = err_fopen(argv[1], "rb");
  FILE *new_file = err_fopen(argv[2], "rb");
  FILE *temp_file = err_fopen("ickywax.ugh", "wb");
  double jd0_new, end_jd_new;
  char buff[200], new_end[200];
  const time_t t0 = time(NULL);
  int i;
  bool found_end = false;
  assert(argc >= 3);
  while (fgets(buff, sizeof(buff), new_file) &&
         memcmp(buff, "# Ephem range:", 14))
    ;
  sscanf(buff + 15, "%lf %lf", &jd0_new, &end_jd_new);
  for (i = 0; i < 3; i++)
    if (!fgets(buff, sizeof(buff), new_file))
      perror("Error reading 'new' file");
  strcpy(new_end, buff);
  while (!found_end && fgets(buff, sizeof(buff), old_file)) {
    if (!memcmp(buff, "# Ephem range:", 14))
      sprintf(buff + 28, "%f %f\n", end_jd_new, 1.);
    if (!memcmp(buff, "# Ephemeris end:", 16))
      strcpy(buff, new_end);
    if (!memcmp(buff, "# Last updated with", 19))
      strcpy(buff + 42, ctime(&t0));
    fputs(buff, temp_file);
    if (!memcmp(buff, "# MJD ", 6) && atof(buff + 6) == jd0_new - 1.)
      found_end = true;
  }
  assert(found_end);
  for (i = 0; i < 3 && fgets(buff, sizeof(buff), old_file); i++)
    fputs(buff, temp_file);
  fclose(old_file);
  while (fgets(buff, sizeof(buff), new_file))
    fputs(buff, temp_file);
  fclose(temp_file);
  fclose(new_file);
  unlink(argv[1]);
  rename("ickywax.ugh", argv[1]);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf0(%rip),%rsi
call   1100 <err_fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdd8(%rip),%rsi
call   1100 <err_fopen@plt>
mov    %rax,-0x20(%rbp)
lea    0xdcb(%rip),%rdi
lea    0xdd0(%rip),%rsi
call   1100 <err_fopen@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10c0 <time@plt>
mov    %eax,-0x1d4(%rbp)
movl   $0x0,-0x1dc(%rbp)
cmpl   $0x3,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
lea    -0x100(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0xc8,%esi
call   10a0 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1dd(%rbp)
je     12c9 <main+0xd9>
lea    -0x100(%rbp),%rdi
lea    0xd68(%rip),%rsi
mov    $0xe,%edx
call   1090 <memcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1dd(%rbp)
mov    -0x1dd(%rbp),%al
test   $0x1,%al
jne    12dc <main+0xec>
jmp    12e1 <main+0xf1>
jmp    127a <main+0x8a>
lea    -0x100(%rbp),%rdi
add    $0xf,%rdi
lea    0xd36(%rip),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   10d0 <sscanf@plt>
movl   $0x0,-0x1d8(%rbp)
cmpl   $0x3,-0x1d8(%rbp)
jge    135b <main+0x16b>
lea    -0x100(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0xc8,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
jne    1342 <main+0x152>
lea    0xcf4(%rip),%rdi
call   10e0 <perror@plt>
jmp    1347 <main+0x157>
mov    -0x1d8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d8(%rbp)
jmp    130a <main+0x11a>
lea    -0x1d0(%rbp),%rdi
lea    -0x100(%rbp),%rsi
call   1040 <strcpy@plt>
xor    %eax,%eax
cmpl   $0x0,-0x1dc(%rbp)
mov    %al,-0x1de(%rbp)
jne    13a5 <main+0x1b5>
lea    -0x100(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xc8,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1de(%rbp)
mov    -0x1de(%rbp),%al
test   $0x1,%al
jne    13b8 <main+0x1c8>
jmp    14f1 <main+0x301>
lea    -0x100(%rbp),%rdi
lea    0xc54(%rip),%rsi
mov    $0xe,%edx
call   1090 <memcmp@plt>
cmp    $0x0,%rax
jne    13fb <main+0x20b>
lea    -0x100(%rbp),%rdi
add    $0x1c,%rdi
movsd  -0x38(%rbp),%xmm0
lea    0xc59(%rip),%rsi
mov    $0x1,%edx
call   1110 <sprintf@plt>
lea    -0x100(%rbp),%rdi
lea    0xc48(%rip),%rsi
mov    $0x10,%edx
call   1090 <memcmp@plt>
cmp    $0x0,%rax
jne    1430 <main+0x240>
lea    -0x100(%rbp),%rdi
lea    -0x1d0(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x100(%rbp),%rdi
lea    0xc24(%rip),%rsi
mov    $0x13,%edx
call   1090 <memcmp@plt>
cmp    $0x0,%rax
jne    147f <main+0x28f>
lea    -0x100(%rbp),%rax
add    $0x2a,%rax
mov    %rax,-0x1e8(%rbp)
lea    -0x1d4(%rbp),%rdi
call   1070 <ctime@plt>
mov    -0x1e8(%rbp),%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
lea    -0x100(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <fputs@plt>
lea    -0x100(%rbp),%rdi
lea    0xbd9(%rip),%rsi
mov    $0x6,%edx
call   1090 <memcmp@plt>
cmp    $0x0,%rax
jne    14ec <main+0x2fc>
lea    -0x100(%rbp),%rdi
add    $0x6,%rdi
call   1050 <atof@plt>
movsd  -0x30(%rbp),%xmm1
movsd  0xb32(%rip),%xmm2
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    14ec <main+0x2fc>
jp     14ec <main+0x2fc>
movl   $0x1,-0x1dc(%rbp)
jmp    136e <main+0x17e>
mov    -0x1dc(%rbp),%edi
call   10b0 <assert@plt>
movl   $0x0,-0x1d8(%rbp)
xor    %eax,%eax
cmpl   $0x3,-0x1d8(%rbp)
mov    %al,-0x1e9(%rbp)
jge    153d <main+0x34d>
lea    -0x100(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xc8,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1e9(%rbp)
mov    -0x1e9(%rbp),%al
test   $0x1,%al
jne    1550 <main+0x360>
jmp    1574 <main+0x384>
lea    -0x100(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <fputs@plt>
mov    -0x1d8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d8(%rbp)
jmp    1506 <main+0x316>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
lea    -0x100(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0xc8,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
je     15b1 <main+0x3c1>
lea    -0x100(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <fputs@plt>
jmp    157d <main+0x38d>
mov    -0x28(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <unlink@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xa2c(%rip),%rdi
call   10f0 <rename@plt>
xor    %eax,%eax
add    $0x1f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1b8,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xdf7(%rip),%rbx
mov    %rbx,%rsi
call   1100 <err_fopen@plt>
mov    %rax,%r12
mov    0x10(%r14),%rdi
mov    %rbx,%rsi
call   1100 <err_fopen@plt>
mov    %rax,%r13
lea    0xdd9(%rip),%rdi
lea    0xdde(%rip),%rsi
call   1100 <err_fopen@plt>
mov    %rax,%r15
xor    %edi,%edi
call   10c0 <time@plt>
mov    %eax,0x4(%rsp)
xor    %edi,%edi
cmp    $0x3,%ebp
setge  %dil
call   10b0 <assert@plt>
lea    0x20(%rsp),%rbp
lea    0xdb4(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    $0xc8,%esi
mov    %r13,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     129a <main+0xaa>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0xe,%edx
call   1090 <memcmp@plt>
test   %rax,%rax
jne    1270 <main+0x80>
lea    0x2f(%rsp),%rdi
lea    0xd83(%rip),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   10d0 <sscanf@plt>
lea    0x20(%rsp),%rdi
mov    $0xc8,%esi
mov    %r13,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     154d <main+0x35d>
lea    0x20(%rsp),%rdi
mov    $0xc8,%esi
mov    %r13,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     155e <main+0x36e>
lea    0x20(%rsp),%rdi
mov    $0xc8,%esi
mov    %r13,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     156f <main+0x37f>
lea    0xf0(%rsp),%rdi
lea    0x20(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    %r12,%rdx
call   10a0 <fgets@plt>
xor    %edi,%edi
test   %rax,%rax
je     1452 <main+0x262>
mov    %r14,0x8(%rsp)
lea    0x20(%rsp),%r14
lea    0xd1b(%rip),%rbx
lea    0xd28(%rip),%rbp
jmp    1369 <main+0x179>
mov    %r14,%rdi
mov    $0xc8,%esi
mov    %r12,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     144b <main+0x25b>
mov    %r14,%rdi
lea    0xca7(%rip),%rsi
mov    $0xe,%edx
call   1090 <memcmp@plt>
test   %rax,%rax
jne    139e <main+0x1ae>
movsd  0x10(%rsp),%xmm0
lea    0x3c(%rsp),%rdi
lea    0xcb6(%rip),%rsi
mov    $0x1,%edx
call   1110 <sprintf@plt>
mov    %r14,%rdi
lea    0xca9(%rip),%rsi
mov    $0x10,%edx
call   1090 <memcmp@plt>
test   %rax,%rax
jne    13c7 <main+0x1d7>
mov    %r14,%rdi
lea    0xf0(%rsp),%rsi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x13,%edx
call   1090 <memcmp@plt>
test   %rax,%rax
jne    13f3 <main+0x203>
lea    0x4(%rsp),%rdi
call   1070 <ctime@plt>
lea    0x4a(%rsp),%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1080 <fputs@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
mov    $0x6,%edx
call   1090 <memcmp@plt>
test   %rax,%rax
jne    1350 <main+0x160>
lea    0x26(%rsp),%rdi
call   1050 <atof@plt>
movsd  0x18(%rsp),%xmm1
addsd  0xbd1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1350 <main+0x160>
jp     1350 <main+0x160>
mov    $0x1,%edi
mov    0x8(%rsp),%r14
jmp    1452 <main+0x262>
mov    0x8(%rsp),%r14
xor    %edi,%edi
call   10b0 <assert@plt>
lea    0x20(%rsp),%rdi
mov    $0xc8,%esi
mov    %r12,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     14c5 <main+0x2d5>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1080 <fputs@plt>
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    %r12,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     14c5 <main+0x2d5>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1080 <fputs@plt>
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    %r12,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     14c5 <main+0x2d5>
lea    0x20(%rsp),%rdi
mov    %r15,%rsi
call   1080 <fputs@plt>
mov    %r12,%rdi
call   1060 <fclose@plt>
lea    0x20(%rsp),%rdi
mov    $0xc8,%esi
mov    %r13,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     1510 <main+0x320>
lea    0x20(%rsp),%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r15,%rsi
call   1080 <fputs@plt>
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    %r13,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
jne    14f0 <main+0x300>
mov    %r15,%rdi
call   1060 <fclose@plt>
mov    %r13,%rdi
call   1060 <fclose@plt>
mov    0x8(%r14),%rdi
call   1030 <unlink@plt>
mov    0x8(%r14),%rsi
lea    0xad7(%rip),%rdi
call   10f0 <rename@plt>
xor    %eax,%eax
add    $0x1b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xadd(%rip),%rdi
call   10e0 <perror@plt>
jmp    12d0 <main+0xe0>
lea    0xacc(%rip),%rdi
call   10e0 <perror@plt>
jmp    12eb <main+0xfb>
lea    0xabb(%rip),%rdi
call   10e0 <perror@plt>
jmp    1306 <main+0x116>

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@.str.1 = [12 x i8] c"ickywax.ugh\00"
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [15 x i8] c"# Ephem range:\00"
@.str.4 = [8 x i8] c"%lf %lf\00"
@.str.5 = [25 x i8] c"Error reading 'new' file\00"
@.str.6 = [7 x i8] c"%f %f\0A\00"
@.str.7 = [17 x i8] c"# Ephemeris end:\00"
@.str.8 = [20 x i8] c"# Last updated with\00"
@.str.9 = [7 x i8] c"# MJD \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca double
%10 = alloca double
%11 = alloca [200 x i8]
%12 = alloca [200 x i8]
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32* @err_fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %19, i32** %6
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = call i32* @err_fopen(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %23, i32** %7
%24 = call i32* @err_fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %24, i32** %8
%25 = call i32 @time(i32* null)
store i32 %25, i32* %13
store i32 0, i32* %15
%26 = load i32, i32* %4
%27 = icmp sge i32 %26, 3
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
br label %30
30: ; preds = %41, %2
%31 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%32 = load i32*, i32** %7
%33 = call i64 @fgets(i8* %31, i32 200, i32* %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %30
%36 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%37 = call i64 @memcmp(i8* %36, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 14)
%38 = icmp ne i64 %37, 0
br label %39
39: ; preds = %35, %30
%40 = phi i1 [ false, %30 ], [ %38, %35 ]
br i1 %40, label %41, label %42
41: ; preds = %39
br label %30
42: ; preds = %39
%43 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%44 = getelementptr inbounds i8, i8* %43, i64 15
%45 = call i32 @sscanf(i8* %44, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double* %9, double* %10)
store i32 0, i32* %14
br label %46
46: ; preds = %57, %42
%47 = load i32, i32* %14
%48 = icmp slt i32 %47, 3
br i1 %48, label %49, label %60
49: ; preds = %46
%50 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%51 = load i32*, i32** %7
%52 = call i64 @fgets(i8* %50, i32 200, i32* %51)
%53 = icmp ne i64 %52, 0
br i1 %53, label %56, label %54
54: ; preds = %49
%55 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
br label %56
56: ; preds = %54, %49
br label %57
57: ; preds = %56
%58 = load i32, i32* %14
%59 = add nsw i32 %58, 1
store i32 %59, i32* %14
br label %46
60: ; preds = %46
%61 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%62 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%63 = call i32 @strcpy(i8* %61, i8* %62)
br label %64
64: ; preds = %115, %60
%65 = load i32, i32* %15
%66 = icmp ne i32 %65, 0
br i1 %66, label %72, label %67
67: ; preds = %64
%68 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%69 = load i32*, i32** %6
%70 = call i64 @fgets(i8* %68, i32 200, i32* %69)
%71 = icmp ne i64 %70, 0
br label %72
72: ; preds = %67, %64
%73 = phi i1 [ false, %64 ], [ %71, %67 ]
br i1 %73, label %74, label %116
74: ; preds = %72
%75 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%76 = call i64 @memcmp(i8* %75, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 14)
%77 = icmp ne i64 %76, 0
br i1 %77, label %83, label %78
78: ; preds = %74
%79 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%80 = getelementptr inbounds i8, i8* %79, i64 28
%81 = load double, double* %10
%82 = call i32 @sprintf(i8* %80, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), double %81, i32 1)
br label %83
83: ; preds = %78, %74
%84 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%85 = call i64 @memcmp(i8* %84, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 16)
%86 = icmp ne i64 %85, 0
br i1 %86, label %91, label %87
87: ; preds = %83
%88 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%89 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%90 = call i32 @strcpy(i8* %88, i8* %89)
br label %91
91: ; preds = %87, %83
%92 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%93 = call i64 @memcmp(i8* %92, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i32 19)
%94 = icmp ne i64 %93, 0
br i1 %94, label %100, label %95
95: ; preds = %91
%96 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%97 = getelementptr inbounds i8, i8* %96, i64 42
%98 = call i8* @ctime(i32* %13)
%99 = call i32 @strcpy(i8* %97, i8* %98)
br label %100
100: ; preds = %95, %91
%101 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%102 = load i32*, i32** %8
%103 = call i32 @fputs(i8* %101, i32* %102)
%104 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%105 = call i64 @memcmp(i8* %104, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 6)
%106 = icmp ne i64 %105, 0
br i1 %106, label %115, label %107
107: ; preds = %100
%108 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%109 = getelementptr inbounds i8, i8* %108, i64 6
%110 = call double @atof(i8* %109)
%111 = load double, double* %9
%112 = fsub double %111, 1.000000e+00
%113 = fcmp oeq double %110, %112
br i1 %113, label %114, label %115
114: ; preds = %107
store i32 1, i32* %15
br label %115
115: ; preds = %114, %107, %100
br label %64
116: ; preds = %72
%117 = load i32, i32* %15
%118 = call i32 @assert(i32 %117)
store i32 0, i32* %14
br label %119
119: ; preds = %133, %116
%120 = load i32, i32* %14
%121 = icmp slt i32 %120, 3
br i1 %121, label %122, label %127
122: ; preds = %119
%123 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%124 = load i32*, i32** %6
%125 = call i64 @fgets(i8* %123, i32 200, i32* %124)
%126 = icmp ne i64 %125, 0
br label %127
127: ; preds = %122, %119
%128 = phi i1 [ false, %119 ], [ %126, %122 ]
br i1 %128, label %129, label %136
129: ; preds = %127
%130 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%131 = load i32*, i32** %8
%132 = call i32 @fputs(i8* %130, i32* %131)
br label %133
133: ; preds = %129
%134 = load i32, i32* %14
%135 = add nsw i32 %134, 1
store i32 %135, i32* %14
br label %119
136: ; preds = %127
%137 = load i32*, i32** %6
%138 = call i32 @fclose(i32* %137)
br label %139
139: ; preds = %144, %136
%140 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%141 = load i32*, i32** %7
%142 = call i64 @fgets(i8* %140, i32 200, i32* %141)
%143 = icmp ne i64 %142, 0
br i1 %143, label %144, label %148
144: ; preds = %139
%145 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%146 = load i32*, i32** %8
%147 = call i32 @fputs(i8* %145, i32* %146)
br label %139
148: ; preds = %139
%149 = load i32*, i32** %8
%150 = call i32 @fclose(i32* %149)
%151 = load i32*, i32** %7
%152 = call i32 @fclose(i32* %151)
%153 = load i8**, i8*** %5
%154 = getelementptr inbounds i8*, i8** %153, i64 1
%155 = load i8*, i8** %154
%156 = call i32 @unlink(i8* %155)
%157 = load i8**, i8*** %5
%158 = getelementptr inbounds i8*, i8** %157, i64 1
%159 = load i8*, i8** %158
%160 = call i32 @rename(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %159)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@.str.1 = [12 x i8] c"ickywax.ugh\00"
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [15 x i8] c"# Ephem range:\00"
@.str.4 = [8 x i8] c"%lf %lf\00"
@.str.5 = [25 x i8] c"Error reading 'new' file\00"
@.str.6 = [7 x i8] c"%f %f\0A\00"
@.str.7 = [17 x i8] c"# Ephemeris end:\00"
@.str.8 = [20 x i8] c"# Last updated with\00"
@.str.9 = [7 x i8] c"# MJD \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca [200 x i8]
%6 = alloca [200 x i8]
%7 = alloca i32
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32* @err_fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32* @err_fopen(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32* @err_fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%15 = bitcast double* %3 to i8*
%16 = bitcast double* %4 to i8*
%17 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%18 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%19 = bitcast i32* %7 to i8*
%20 = tail call i32 @time(i32* null)
store i32 %20, i32* %7
%21 = icmp sgt i32 %0, 2
%22 = zext i1 %21 to i32
%23 = tail call i32 @assert(i32 %22)
br label %24
24: ; preds = %27, %2
%25 = call i64 @fgets(i8* %17, i32 200, i32* %13)
%26 = icmp eq i64 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = call i64 @memcmp(i8* %17, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 14)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %24
30: ; preds = %24, %27
%31 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 15
%32 = call i32 @sscanf(i8* %31, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double* %3, double* %4)
%33 = call i64 @fgets(i8* %17, i32 200, i32* %13)
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %30
%36 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
br label %37
37: ; preds = %30, %35
%38 = call i64 @fgets(i8* %17, i32 200, i32* %13)
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
br label %42
42: ; preds = %40, %37
%43 = call i64 @fgets(i8* %17, i32 200, i32* %13)
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
br label %47
47: ; preds = %45, %42
%48 = call i32 @strcpy(i8* %18, i8* %17)
%49 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 28
%50 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 42
%51 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 6
%52 = call i64 @fgets(i8* %17, i32 200, i32* %10)
%53 = icmp eq i64 %52, 0
br i1 %53, label %83, label %54
54: ; preds = %47, %80
%55 = call i64 @memcmp(i8* %17, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 14)
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %54
%58 = load double, double* %4
%59 = call i32 @sprintf(i8* %49, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), double %58, i32 1)
br label %60
60: ; preds = %57, %54
%61 = call i64 @memcmp(i8* %17, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 16)
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %60
%64 = call i32 @strcpy(i8* %17, i8* %18)
br label %65
65: ; preds = %63, %60
%66 = call i64 @memcmp(i8* %17, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i32 19)
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %65
%69 = call i8* @ctime(i32* %7)
%70 = call i32 @strcpy(i8* %50, i8* %69)
br label %71
71: ; preds = %68, %65
%72 = call i32 @fputs(i8* %17, i32* %14)
%73 = call i64 @memcmp(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 6)
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %80
75: ; preds = %71
%76 = call double @atof(i8* %51)
%77 = load double, double* %3
%78 = fadd double %77, -1.000000e+00
%79 = fcmp oeq double %76, %78
br i1 %79, label %83, label %80
80: ; preds = %75, %71
%81 = call i64 @fgets(i8* %17, i32 200, i32* %10)
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %54
83: ; preds = %80, %75, %47
%84 = phi i32 [ 0, %47 ], [ 0, %80 ], [ 1, %75 ]
%85 = call i32 @assert(i32 %84)
%86 = call i64 @fgets(i8* %17, i32 200, i32* %10)
%87 = icmp eq i64 %86, 0
br i1 %87, label %98, label %88
88: ; preds = %83
%89 = call i32 @fputs(i8* %17, i32* %14)
%90 = call i64 @fgets(i8* %17, i32 200, i32* %10)
%91 = icmp eq i64 %90, 0
br i1 %91, label %98, label %92
92: ; preds = %88
%93 = call i32 @fputs(i8* %17, i32* %14)
%94 = call i64 @fgets(i8* %17, i32 200, i32* %10)
%95 = icmp eq i64 %94, 0
br i1 %95, label %98, label %96
96: ; preds = %92
%97 = call i32 @fputs(i8* %17, i32* %14)
br label %98
98: ; preds = %96, %92, %88, %83
%99 = call i32 @fclose(i32* %10)
%100 = call i64 @fgets(i8* %17, i32 200, i32* %13)
%101 = icmp eq i64 %100, 0
br i1 %101, label %106, label %102
102: ; preds = %98, %102
%103 = call i32 @fputs(i8* %17, i32* %14)
%104 = call i64 @fgets(i8* %17, i32 200, i32* %13)
%105 = icmp eq i64 %104, 0
br i1 %105, label %106, label %102
106: ; preds = %102, %98
%107 = call i32 @fclose(i32* %14)
%108 = call i32 @fclose(i32* %13)
%109 = load i8*, i8** %8
%110 = call i32 @unlink(i8* %109)
%111 = load i8*, i8** %8
%112 = call i32 @rename(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %111)
ret i32 0
}