#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 */
int a2s(char *);
int /*<<< orphan*/ analyzeIGC(int /*<<< orphan*/ *, int, double, int, int);
double atof(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fdopen(int /*<<< orphan*/, char *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ optimize(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int main(int ac, char *av[]) {
  int i, verbose = 0;
  int nocalc = 0;
  FILE *in;
  double maxspeed = 90.0;
  int starttime = 0;
  int endtime = 24 * 60 * 60;
  char *filename = 0;
  for (i = 1; i < ac; i++) {
    if (av[i][0] == '-') {
      if (av[i][1] == 'v')
        verbose = !0;
      else if (av[i][1] == 's')
        maxspeed = atof(&(av[i][2]));
      else if (av[i][1] == 'b')
        starttime = a2s(&(av[i][2]));
      else if (av[i][1] == 'n')
        nocalc = 1;
      else if (av[i][1] == 'e')
        endtime = a2s(&(av[i][2]));
      else if (av[i][1] == 'h') {
        printf("usage: %s [-v] [-n] [-s] [-bhh[:mm[:ss]]] [-ehh[:mm[:ss]]] "
               "[-help] [ name ]\n",
               av[0]);
        printf("  -v    : enable verbose mode\n");
        printf("  -n    : do not optimize\n");
        printf("  -s    : use another parameter for MaxSpeed Detection, "
               "default is: %lfkmh\n",
               maxspeed);
        printf("  -bhh[:mm[:ss]] : begin time (points before are skipped)\n");
        printf("  -ehh[:mm[:ss]] : end time (points after this time are "
               "skipped\n");
        printf("  -help : this help screen\n");
        printf("   name : igc filename, otherwise reading from stdin\n");
        printf("  release: %s %s\n\n", av[0],
               "$Revision: 1.3 $ $Date: 2008/06/04 14:12:40 $");
        return -1;
      } else
        printf("illegal option: %s\n", av[i]);
    } else {
      if (filename)
        printf("only the last filename is used\n");
      filename = av[i];
    }
  }
  if (filename) {
    if (!(in = fopen(filename, "r"))) {
      perror(filename);
      exit(1);
    }
  } else {
    fprintf(stderr, "reading from stdin..\n");
    if (!(in = fdopen(0, "r"))) {
      perror("STDIN");
      exit(1);
    }
  }
  analyzeIGC(in, verbose, maxspeed, starttime, endtime);
  fclose(in);
  optimize(nocalc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movsd  0xe24(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x15180,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1441 <main+0x291>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1405 <main+0x255>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
cmp    $0x76,%eax
jne    1247 <main+0x97>
movl   $0x1,-0x18(%rbp)
jmp    1400 <main+0x250>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
cmp    $0x73,%eax
jne    127f <main+0xcf>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x2,%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    13fb <main+0x24b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
cmp    $0x62,%eax
jne    12b5 <main+0x105>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x2,%rdi
call   1050 <a2s@plt>
mov    %eax,-0x34(%rbp)
jmp    13f6 <main+0x246>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6e,%eax
jne    12da <main+0x12a>
movl   $0x1,-0x1c(%rbp)
jmp    13f1 <main+0x241>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
cmp    $0x65,%eax
jne    1310 <main+0x160>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x2,%rdi
call   1050 <a2s@plt>
mov    %eax,-0x38(%rbp)
jmp    13ec <main+0x23c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
cmp    $0x68,%eax
jne    13cd <main+0x21d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xcd1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd21(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xd29(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
lea    0xd67(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xdc7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdf6(%rip),%rdi
lea    0xe02(%rip),%rdx
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14fd <main+0x34d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    13ec <main+0x23c>
jmp    13f1 <main+0x241>
jmp    13f6 <main+0x246>
jmp    13fb <main+0x24b>
jmp    1400 <main+0x250>
jmp    142e <main+0x27e>
cmpq   $0x0,-0x40(%rbp)
je     141e <main+0x26e>
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x40(%rbp)
jmp    1433 <main+0x283>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11fe <main+0x4e>
cmpq   $0x0,-0x40(%rbp)
je     1482 <main+0x2d2>
mov    -0x40(%rbp),%rdi
lea    0xdc7(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    147d <main+0x2cd>
mov    -0x40(%rbp),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
jmp    14ce <main+0x31e>
mov    0x2b57(%rip),%rax
mov    (%rax),%edi
lea    0xd8e(%rip),%rsi
call   1080 <fprintf@plt>
xor    %edi,%edi
lea    0xd7e(%rip),%rsi
call   10a0 <fdopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    14c9 <main+0x319>
lea    0xd7c(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
jmp    14ce <main+0x31e>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%esi
movsd  -0x30(%rbp),%xmm0
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
call   1030 <analyzeIGC@plt>
mov    -0x28(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x1c(%rbp),%edi
call   1090 <optimize@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x2,%edi
jl     12c6 <main+0x106>
mov    %rsi,%rbp
mov    %edi,%r15d
movsd  0xe1b(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movl   $0x15180,0xc(%rsp)
mov    $0x1,%r12d
xor    %ebx,%ebx
movl   $0x0,0x4(%rsp)
movl   $0x0,0x8(%rsp)
xor    %r14d,%r14d
jmp    1236 <main+0x76>
test   %rbx,%rbx
je     1278 <main+0xb8>
lea    0xf4c(%rip),%rdi
call   1030 <puts@plt>
mov    0x0(%rbp,%r12,8),%rbx
mov    %r13d,%r14d
add    $0x1,%r12
cmp    %r12,%r15
je     12e5 <main+0x125>
mov    %r14d,%r13d
mov    0x0(%rbp,%r12,8),%rsi
cmpb   $0x2d,(%rsi)
jne    1210 <main+0x50>
movzbl 0x1(%rsi),%eax
add    $0x9e,%al
cmp    $0x14,%al
ja     1280 <main+0xc0>
mov    $0x1,%r14d
movzbl %al,%eax
lea    0xdab(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
add    $0x2,%rsi
mov    %rsi,%rdi
call   1060 <a2s@plt>
mov    %eax,0x4(%rsp)
jmp    1226 <main+0x66>
mov    %r13d,%r14d
mov    %rsi,%rbx
jmp    1229 <main+0x69>
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    1226 <main+0x66>
add    $0x2,%rsi
mov    %rsi,%rdi
call   1060 <a2s@plt>
mov    %eax,0xc(%rsp)
jmp    1226 <main+0x66>
movl   $0x1,0x8(%rsp)
jmp    1226 <main+0x66>
add    $0x2,%rsi
mov    %rsi,%rdi
call   1050 <atof@plt>
movsd  %xmm0,0x10(%rsp)
jmp    1226 <main+0x66>
movsd  0xd32(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %r13d,%r13d
mov    $0x15180,%r15d
xor    %r12d,%r12d
xor    %r14d,%r14d
jmp    1327 <main+0x167>
test   %rbx,%rbx
je     1318 <main+0x158>
lea    0xe59(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <fopen@plt>
mov    %rax,%rbp
test   %rax,%rax
mov    0xc(%rsp),%r15d
mov    0x8(%rsp),%r12d
mov    0x4(%rsp),%r13d
jne    1356 <main+0x196>
mov    %rbx,%rdi
jmp    1426 <main+0x266>
mov    0xc(%rsp),%r15d
mov    0x8(%rsp),%r12d
mov    0x4(%rsp),%r13d
mov    0x2cb2(%rip),%rax
mov    (%rax),%edi
lea    0xe15(%rip),%rsi
call   1090 <fprintf@plt>
lea    0xe07(%rip),%rsi
xor    %edi,%edi
call   10b0 <fdopen@plt>
mov    %rax,%rbp
test   %rax,%rax
je     141f <main+0x25f>
mov    %rbp,%rdi
mov    %r14d,%esi
movsd  0x10(%rsp),%xmm0
mov    %r13d,%edx
mov    %r15d,%ecx
call   1040 <analyzeIGC@plt>
mov    %rbp,%rdi
call   1070 <fclose@plt>
mov    %r12d,%edi
call   10a0 <optimize@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x0(%rbp),%rsi
lea    0xcc3(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xde0(%rip),%rdi
call   1030 <puts@plt>
lea    0xdf2(%rip),%rdi
call   1030 <puts@plt>
lea    0xcea(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xdec(%rip),%rdi
call   1030 <puts@plt>
lea    0xe1a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe5d(%rip),%rdi
call   1030 <puts@plt>
mov    0x0(%rbp),%rsi
lea    0xcee(%rip),%rdi
lea    0xcfa(%rip),%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xffffffff,%eax
jmp    137f <main+0x1bf>
lea    0xd3c(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@.str = [77 x i8] c"usage: %s [-v] [-n] [-s] [-bhh[:mm[:ss]]] [-ehh[:mm[:ss]]] [-help] [ name ]\0A\00"
@.str.1 = [31 x i8] c" -v : enable verbose mode\0A\00"
@.str.2 = [27 x i8] c" -n : do not optimize\0A\00"
@.str.3 = [76 x i8] c" -s : use another parameter for MaxSpeed Detection, default is: %lfkmh\0A\00"
@.str.4 = [59 x i8] c" -bhh[:mm[:ss]] : begin time (points before are skipped)\0A\00"
@.str.5 = [65 x i8] c" -ehh[:mm[:ss]] : end time (points after this time are skipped\0A\00"
@.str.6 = [28 x i8] c" -help : this help screen\0A\00"
@.str.7 = [54 x i8] c" name : igc filename, otherwise reading from stdin\0A\00"
@.str.8 = [19 x i8] c" release: %s %s\0A\0A\00"
@.str.9 = [46 x i8] c"$Revision: 1.3 $ $Date: 2008/06/04 14:12:40 $\00"
@.str.10 = [20 x i8] c"illegal option: %s\0A\00"
@.str.11 = [32 x i8] c"only the last filename is used\0A\00"
@.str.12 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.13 = [22 x i8] c"reading from stdin..\0A\00"
@.str.14 = [6 x i8] c"STDIN\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 i32*
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %8
store double 9.000000e+01, double* %10
store i32 0, i32* %11
store i32 86400, i32* %12
store i8* null, i8** %13
store i32 1, i32* %6
br label %14
14: ; preds = %156, %2
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %159
18: ; preds = %14
%19 = load i8**, i8*** %5
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 45
br i1 %27, label %28, label %144
28: ; preds = %18
%29 = load i8**, i8*** %5
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = getelementptr inbounds i8, i8* %33, i64 1
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 118
br i1 %37, label %38, label %39
38: ; preds = %28
store i32 1, i32* %7
br label %143
39: ; preds = %28
%40 = load i8**, i8*** %5
%41 = load i32, i32* %6
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8*, i8** %40, i64 %42
%44 = load i8*, i8** %43
%45 = getelementptr inbounds i8, i8* %44, i64 1
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 115
br i1 %48, label %49, label %57
49: ; preds = %39
%50 = load i8**, i8*** %5
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8*, i8** %50, i64 %52
%54 = load i8*, i8** %53
%55 = getelementptr inbounds i8, i8* %54, i64 2
%56 = call double @atof(i8* %55)
store double %56, double* %10
br label %142
57: ; preds = %39
%58 = load i8**, i8*** %5
%59 = load i32, i32* %6
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8*, i8** %58, i64 %60
%62 = load i8*, i8** %61
%63 = getelementptr inbounds i8, i8* %62, i64 1
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 98
br i1 %66, label %67, label %75
67: ; preds = %57
%68 = load i8**, i8*** %5
%69 = load i32, i32* %6
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8*, i8** %68, i64 %70
%72 = load i8*, i8** %71
%73 = getelementptr inbounds i8, i8* %72, i64 2
%74 = call i32 @a2s(i8* %73)
store i32 %74, i32* %11
br label %141
75: ; preds = %57
%76 = load i8**, i8*** %5
%77 = load i32, i32* %6
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8*, i8** %76, i64 %78
%80 = load i8*, i8** %79
%81 = getelementptr inbounds i8, i8* %80, i64 1
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 110
br i1 %84, label %85, label %86
85: ; preds = %75
store i32 1, i32* %8
br label %140
86: ; preds = %75
%87 = load i8**, i8*** %5
%88 = load i32, i32* %6
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8*, i8** %87, i64 %89
%91 = load i8*, i8** %90
%92 = getelementptr inbounds i8, i8* %91, i64 1
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = icmp eq i32 %94, 101
br i1 %95, label %96, label %104
96: ; preds = %86
%97 = load i8**, i8*** %5
%98 = load i32, i32* %6
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i8*, i8** %97, i64 %99
%101 = load i8*, i8** %100
%102 = getelementptr inbounds i8, i8* %101, i64 2
%103 = call i32 @a2s(i8* %102)
store i32 %103, i32* %12
br label %139
104: ; preds = %86
%105 = load i8**, i8*** %5
%106 = load i32, i32* %6
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i8*, i8** %105, i64 %107
%109 = load i8*, i8** %108
%110 = getelementptr inbounds i8, i8* %109, i64 1
%111 = load i8, i8* %110
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %112, 104
br i1 %113, label %114, label %131
114: ; preds = %104
%115 = load i8**, i8*** %5
%116 = getelementptr inbounds i8*, i8** %115, i64 0
%117 = load i8*, i8** %116
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %117)
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%121 = load double, double* %10
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.3, i64 0, i64 0), double %121)
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0))
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0))
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0))
%127 = load i8**, i8*** %5
%128 = getelementptr inbounds i8*, i8** %127, i64 0
%129 = load i8*, i8** %128
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* %129, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.9, i64 0, i64 0))
store i32 -1, i32* %3
br label %191
131: ; preds = %104
%132 = load i8**, i8*** %5
%133 = load i32, i32* %6
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds i8*, i8** %132, i64 %134
%136 = load i8*, i8** %135
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i8* %136)
br label %138
138: ; preds = %131
br label %139
139: ; preds = %138, %96
br label %140
140: ; preds = %139, %85
br label %141
141: ; preds = %140, %67
br label %142
142: ; preds = %141, %49
br label %143
143: ; preds = %142, %38
br label %155
144: ; preds = %18
%145 = load i8*, i8** %13
%146 = icmp ne i8* %145, null
br i1 %146, label %147, label %149
147: ; preds = %144
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0))
br label %149
149: ; preds = %147, %144
%150 = load i8**, i8*** %5
%151 = load i32, i32* %6
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds i8*, i8** %150, i64 %152
%154 = load i8*, i8** %153
store i8* %154, i8** %13
br label %155
155: ; preds = %149, %143
br label %156
156: ; preds = %155
%157 = load i32, i32* %6
%158 = add nsw i32 %157, 1
store i32 %158, i32* %6
br label %14
159: ; preds = %14
%160 = load i8*, i8** %13
%161 = icmp ne i8* %160, null
br i1 %161, label %162, label %171
162: ; preds = %159
%163 = load i8*, i8** %13
%164 = call i32* @fopen(i8* %163, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i32* %164, i32** %9
%165 = icmp ne i32* %164, null
br i1 %165, label %170, label %166
166: ; preds = %162
%167 = load i8*, i8** %13
%168 = call i32 @perror(i8* %167)
%169 = call i32 @exit(i32 1)
unreachable
170: ; preds = %162
br label %180
171: ; preds = %159
%172 = load i32, i32* @stderr
%173 = call i32 @fprintf(i32 %172, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0))
%174 = call i32* @fdopen(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i32* %174, i32** %9
%175 = icmp ne i32* %174, null
br i1 %175, label %179, label %176
176: ; preds = %171
%177 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
%178 = call i32 @exit(i32 1)
unreachable
179: ; preds = %171
br label %180
180: ; preds = %179, %170
%181 = load i32*, i32** %9
%182 = load i32, i32* %7
%183 = load double, double* %10
%184 = load i32, i32* %11
%185 = load i32, i32* %12
%186 = call i32 @analyzeIGC(i32* %181, i32 %182, double %183, i32 %184, i32 %185)
%187 = load i32*, i32** %9
%188 = call i32 @fclose(i32* %187)
%189 = load i32, i32* %8
%190 = call i32 @optimize(i32 %189)
store i32 0, i32* %3
br label %191
191: ; preds = %180, %114
%192 = load i32, i32* %3
ret i32 %192
}

LLVM IR (-O2):
@.str = [77 x i8] c"usage: %s [-v] [-n] [-s] [-bhh[:mm[:ss]]] [-ehh[:mm[:ss]]] [-help] [ name ]\0A\00"
@.str.3 = [76 x i8] c" -s : use another parameter for MaxSpeed Detection, default is: %lfkmh\0A\00"
@.str.8 = [19 x i8] c" release: %s %s\0A\0A\00"
@.str.9 = [46 x i8] c"$Revision: 1.3 $ $Date: 2008/06/04 14:12:40 $\00"
@.str.10 = [20 x i8] c"illegal option: %s\0A\00"
@.str.12 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.13 = [22 x i8] c"reading from stdin..\0A\00"
@.str.14 = [6 x i8] c"STDIN\00"
@str = [31 x i8] c"only the last filename is used\00"
@str.15 = [30 x i8] c" -v : enable verbose mode\00"
@str.16 = [26 x i8] c" -n : do not optimize\00"
@str.17 = [58 x i8] c" -bhh[:mm[:ss]] : begin time (points before are skipped)\00"
@str.18 = [64 x i8] c" -ehh[:mm[:ss]] : end time (points after this time are skipped\00"
@str.19 = [27 x i8] c" -help : this help screen\00"
@str.20 = [53 x i8] c" name : igc filename, otherwise reading from stdin\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %67
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %50
%7 = phi i64 [ 1, %4 ], [ %57, %50 ]
%8 = phi i8* [ null, %4 ], [ %56, %50 ]
%9 = phi i32 [ 86400, %4 ], [ %55, %50 ]
%10 = phi i32 [ 0, %4 ], [ %54, %50 ]
%11 = phi double [ 9.000000e+01, %4 ], [ %53, %50 ]
%12 = phi i32 [ 0, %4 ], [ %52, %50 ]
%13 = phi i32 [ 0, %4 ], [ %51, %50 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %7
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 45
br i1 %17, label %18, label %45
18: ; preds = %6
%19 = getelementptr inbounds i8, i8* %15, i64 1
%20 = load i8, i8* %19
switch i8 %20, label %43 [
i8 118, label %50
i8 115, label %21
i8 98, label %24
i8 110, label %27
i8 101, label %28
i8 104, label %31
]
21: ; preds = %18
%22 = getelementptr inbounds i8, i8* %15, i64 2
%23 = tail call double @atof(i8* %22)
br label %50
24: ; preds = %18
%25 = getelementptr inbounds i8, i8* %15, i64 2
%26 = tail call i32 @a2s(i8* %25)
br label %50
27: ; preds = %18
br label %50
28: ; preds = %18
%29 = getelementptr inbounds i8, i8* %15, i64 2
%30 = tail call i32 @a2s(i8* %29)
br label %50
31: ; preds = %18
%32 = load i8*, i8** %1
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %32)
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.15, i64 0, i64 0))
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.16, i64 0, i64 0))
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str.3, i64 0, i64 0), double %11)
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.17, i64 0, i64 0))
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.18, i64 0, i64 0))
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.19, i64 0, i64 0))
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.20, i64 0, i64 0))
%41 = load i8*, i8** %1
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* %41, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.9, i64 0, i64 0))
br label %90
43: ; preds = %18
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i8* %15)
br label %50
45: ; preds = %6
%46 = icmp eq i8* %8, null
br i1 %46, label %50, label %47
47: ; preds = %45
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%49 = load i8*, i8** %14
br label %50
50: ; preds = %45, %47, %18, %21, %27, %43, %28, %24
%51 = phi i32 [ %13, %21 ], [ %13, %24 ], [ %13, %27 ], [ %13, %28 ], [ %13, %43 ], [ 1, %18 ], [ %13, %47 ], [ %13, %45 ]
%52 = phi i32 [ %12, %21 ], [ %12, %24 ], [ 1, %27 ], [ %12, %28 ], [ %12, %43 ], [ %12, %18 ], [ %12, %47 ], [ %12, %45 ]
%53 = phi double [ %23, %21 ], [ %11, %24 ], [ %11, %27 ], [ %11, %28 ], [ %11, %43 ], [ %11, %18 ], [ %11, %47 ], [ %11, %45 ]
%54 = phi i32 [ %10, %21 ], [ %26, %24 ], [ %10, %27 ], [ %10, %28 ], [ %10, %43 ], [ %10, %18 ], [ %10, %47 ], [ %10, %45 ]
%55 = phi i32 [ %9, %21 ], [ %9, %24 ], [ %9, %27 ], [ %30, %28 ], [ %9, %43 ], [ %9, %18 ], [ %9, %47 ], [ %9, %45 ]
%56 = phi i8* [ %8, %21 ], [ %8, %24 ], [ %8, %27 ], [ %8, %28 ], [ %8, %43 ], [ %8, %18 ], [ %49, %47 ], [ %15, %45 ]
%57 = add nuw nsw i64 %7, 1
%58 = icmp eq i64 %57, %5
br i1 %58, label %59, label %6
59: ; preds = %50
%60 = icmp eq i8* %56, null
br i1 %60, label %67, label %61
61: ; preds = %59
%62 = tail call i32* @fopen(i8* %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%63 = icmp eq i32* %62, null
br i1 %63, label %64, label %80
64: ; preds = %61
%65 = tail call i32 @perror(i8* %56)
%66 = tail call i32 @exit(i32 1)
unreachable
67: ; preds = %2, %59
%68 = phi i32 [ %55, %59 ], [ 86400, %2 ]
%69 = phi i32 [ %54, %59 ], [ 0, %2 ]
%70 = phi double [ %53, %59 ], [ 9.000000e+01, %2 ]
%71 = phi i32 [ %52, %59 ], [ 0, %2 ]
%72 = phi i32 [ %51, %59 ], [ 0, %2 ]
%73 = load i32, i32* @stderr
%74 = tail call i32 @fprintf(i32 %73, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0))
%75 = tail call i32* @fdopen(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%76 = icmp eq i32* %75, null
br i1 %76, label %77, label %80
77: ; preds = %67
%78 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
%79 = tail call i32 @exit(i32 1)
unreachable
80: ; preds = %67, %61
%81 = phi i32 [ %55, %61 ], [ %68, %67 ]
%82 = phi i32 [ %54, %61 ], [ %69, %67 ]
%83 = phi double [ %53, %61 ], [ %70, %67 ]
%84 = phi i32 [ %52, %61 ], [ %71, %67 ]
%85 = phi i32 [ %51, %61 ], [ %72, %67 ]
%86 = phi i32* [ %62, %61 ], [ %75, %67 ]
%87 = tail call i32 @analyzeIGC(i32* %86, i32 %85, double %83, i32 %82, i32 %81)
%88 = tail call i32 @fclose(i32* %86)
%89 = tail call i32 @optimize(i32 %84)
br label %90
90: ; preds = %80, %31
%91 = phi i32 [ -1, %31 ], [ 0, %80 ]
ret i32 %91
}