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

/* Variables and functions */
int EOF;
int /*<<< orphan*/ elfwait(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/);
int getc(int /*<<< orphan*/ *);
int getopt(int, char **, char *);
int /*<<< orphan*/ isspace(int);
int megetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ meputc(int, int /*<<< orphan*/ *);
char *optarg;
int optind;
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  FILE *f = NULL, *fdev = NULL;
  time_t t0, t1;
  int c;
  int lastchar;
  while ((c = getopt(argc, argv, "d:")) != -1) {
    switch (c) {
    case 'd':
      fdev = fopen(optarg, "a+");
      break;
    default:
      fdev = NULL;
      break;
    }
  }
  time(&t0);
  for (int index = optind; index < argc; index++) {
    fprintf(stderr, "\033[4mReading %s\033[0m\n", argv[index]);
    f = fopen(argv[index], "r");
    if (!f) {
      fprintf(stderr, "No file\n");
      exit(1);
    }
    meputc('\r', fdev);
    meputc('\n', fdev);
    elfwait('\0', fdev);
    lastchar = '\n';
    while (lastchar != EOF) {
      int c1;
      c = getc(f);
      if (c == EOF && lastchar == '\n')
        break;
      if ((c == '\n' || c == '\r') && lastchar == '\n')
        continue;
      if (c == '\\' && lastchar == '\n') {
        while (c != '\n' && c != EOF)
          c = getc(f);
        if (c == EOF)
          break;
        continue;
      }
      if (c == EOF || lastchar != '\n' || !isspace(c))
        lastchar = c;
      if (c == '\t')
        c = ' ';
      if (c == '\r')
        c = '\n';
      if (c == EOF)
        c = '\n';
      meputc(c, fdev);
      do {
        c1 = megetc(fdev);
        fputc(c1, stderr);
      } while (c1 != c);
      if (c == '\r' || c == EOF) {
        elfwait('?', fdev);
      }
    }
  }
  time(&t1);
  fprintf(stderr, "\n\033[4mTransfer time=%ld seconds\033[0m\n", t1 - t0);
  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)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe1c(%rip),%rdx
call   10b0 <getopt@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0xffffffff,%eax
je     1232 <main+0x82>
mov    -0x2c(%rbp),%eax
sub    $0x64,%eax
jne    1225 <main+0x75>
jmp    1206 <main+0x56>
mov    0x2deb(%rip),%rax
mov    (%rax),%rdi
lea    0xdec(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
jmp    122d <main+0x7d>
movq   $0x0,-0x20(%rbp)
jmp    11d6 <main+0x26>
lea    -0x24(%rbp),%rdi
call   1090 <time@plt>
mov    0x2d96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    14aa <main+0x2fa>
mov    0x2d6e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xd97(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd91(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12be <main+0x10e>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
lea    0xd6f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x20(%rbp),%rsi
mov    $0xd,%edi
call   1030 <meputc@plt>
mov    -0x20(%rbp),%rsi
mov    $0xa,%edi
call   1030 <meputc@plt>
mov    -0x20(%rbp),%rsi
xor    %edi,%edi
call   1080 <elfwait@plt>
movl   $0xa,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    0x2cea(%rip),%rcx
cmp    (%rcx),%eax
je     1497 <main+0x2e7>
mov    -0x18(%rbp),%rdi
call   10d0 <getc@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2ccc(%rip),%rcx
cmp    (%rcx),%eax
jne    132b <main+0x17b>
cmpl   $0xa,-0x30(%rbp)
jne    132b <main+0x17b>
jmp    1497 <main+0x2e7>
cmpl   $0xa,-0x2c(%rbp)
je     133f <main+0x18f>
cmpl   $0xd,-0x2c(%rbp)
jne    134e <main+0x19e>
cmpl   $0xa,-0x30(%rbp)
jne    134e <main+0x19e>
jmp    12ec <main+0x13c>
cmpl   $0x5c,-0x2c(%rbp)
jne    13c5 <main+0x215>
cmpl   $0xa,-0x30(%rbp)
jne    13c5 <main+0x215>
jmp    1367 <main+0x1b7>
xor    %eax,%eax
cmpl   $0xa,-0x2c(%rbp)
mov    %al,-0x39(%rbp)
je     1388 <main+0x1d8>
mov    -0x2c(%rbp),%eax
mov    0x2c60(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
test   $0x1,%al
jne    1398 <main+0x1e8>
jmp    13a9 <main+0x1f9>
mov    -0x18(%rbp),%rdi
call   10d0 <getc@plt>
mov    %eax,-0x2c(%rbp)
jmp    1367 <main+0x1b7>
mov    -0x2c(%rbp),%eax
mov    0x2c2d(%rip),%rcx
cmp    (%rcx),%eax
jne    13c0 <main+0x210>
jmp    1497 <main+0x2e7>
jmp    12ec <main+0x13c>
mov    -0x2c(%rbp),%eax
mov    0x2c11(%rip),%rcx
cmp    (%rcx),%eax
je     13f2 <main+0x242>
cmpl   $0xa,-0x30(%rbp)
jne    13f2 <main+0x242>
mov    -0x2c(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%eax
jne    13f8 <main+0x248>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x9,-0x2c(%rbp)
jne    1409 <main+0x259>
movl   $0x20,-0x2c(%rbp)
cmpl   $0xd,-0x2c(%rbp)
jne    141a <main+0x26a>
movl   $0xa,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2bbc(%rip),%rcx
cmp    (%rcx),%eax
jne    1433 <main+0x283>
movl   $0xa,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1030 <meputc@plt>
mov    -0x20(%rbp),%rdi
call   1070 <megetc@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%edi
mov    0x2b73(%rip),%rax
mov    (%rax),%esi
call   1050 <fputc@plt>
mov    -0x38(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jne    143f <main+0x28f>
cmpl   $0xd,-0x2c(%rbp)
je     1484 <main+0x2d4>
mov    -0x2c(%rbp),%eax
mov    0x2b64(%rip),%rcx
cmp    (%rcx),%eax
jne    1492 <main+0x2e2>
mov    -0x20(%rbp),%rsi
mov    $0x3f,%edi
call   1080 <elfwait@plt>
jmp    12ec <main+0x13c>
jmp    149c <main+0x2ec>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1247 <main+0x97>
lea    -0x28(%rbp),%rdi
call   1090 <time@plt>
mov    0x2b0e(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%edx
sub    -0x24(%rbp),%edx
lea    0xb5c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
xor    %eax,%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    $0x28,%rsp
mov    %rsi,%r12
mov    %edi,%ebx
xor    %eax,%eax
lea    0xe34(%rip),%r13
mov    0x2e25(%rip),%rbp
lea    0xe29(%rip),%r15
jmp    11ec <main+0x3c>
nopl   0x0(%rax)
mov    0x0(%rbp),%rdi
mov    %r15,%rsi
call   10a0 <fopen@plt>
mov    %rax,%r14
mov    %ebx,%edi
mov    %r12,%rsi
mov    %r13,%rdx
call   10b0 <getopt@plt>
cmp    $0x64,%eax
je     11e0 <main+0x30>
mov    %eax,%ecx
mov    $0x0,%eax
cmp    $0xffffffff,%ecx
jne    11ec <main+0x3c>
lea    0x14(%rsp),%rdi
call   1090 <time@plt>
mov    0x2dba(%rip),%rax
movslq (%rax),%rbp
cmp    %ebx,%ebp
jge    140f <main+0x25f>
mov    %r12,0x18(%rsp)
mov    %ebx,0xc(%rsp)
jmp    125a <main+0xaa>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x20(%rsp),%rbp
add    $0x1,%rbp
mov    0xc(%rsp),%ebx
cmp    %ebx,%ebp
mov    0x18(%rsp),%r12
je     140f <main+0x25f>
mov    0x2d67(%rip),%rax
mov    (%rax),%edi
mov    (%r12,%rbp,8),%rdx
lea    0xd98(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %rbp,0x20(%rsp)
mov    (%r12,%rbp,8),%rdi
lea    0xd95(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1449 <main+0x299>
mov    %rax,%r13
mov    $0xd,%edi
mov    %r14,%rsi
call   1030 <meputc@plt>
mov    $0xa,%edi
mov    %r14,%rsi
call   1030 <meputc@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1080 <elfwait@plt>
mov    0x2d1f(%rip),%rbx
cmpl   $0xa,(%rbx)
je     1240 <main+0x90>
mov    $0xa,%r12d
jmp    12ef <main+0x13f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x8(%rsp),%edx
mov    %edx,%r12d
cmp    %ebp,%edx
je     1240 <main+0x90>
mov    %r13,%rdi
call   10d0 <getc@plt>
mov    %eax,%r15d
mov    (%rbx),%ebp
cmp    %ebp,%eax
jne    130a <main+0x15a>
cmp    $0xa,%r12d
je     1240 <main+0x90>
cmp    $0xa,%r15d
setne  %al
cmp    $0xd,%r15d
setne  %cl
mov    $0xa,%edx
test   %cl,%al
jne    1327 <main+0x177>
cmp    $0xa,%r12d
je     12e4 <main+0x134>
cmp    $0x5c,%r15d
jne    1370 <main+0x1c0>
cmp    $0xa,%r12d
jne    1370 <main+0x1c0>
cmp    $0x5c,%ebp
je     1240 <main+0x90>
nopl   0x0(%rax)
mov    %r13,%rdi
call   10d0 <getc@plt>
mov    (%rbx),%ebp
cmp    $0xa,%eax
je     1353 <main+0x1a3>
cmp    %ebp,%eax
jne    1340 <main+0x190>
cmp    %ebp,%eax
mov    $0xa,%edx
jne    12e4 <main+0x134>
jmp    1240 <main+0x90>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %ebp,%r15d
je     138c <main+0x1dc>
cmp    $0xa,%r12d
jne    138c <main+0x1dc>
mov    %r15d,%edi
call   1040 <isspace@plt>
mov    $0xa,%ecx
test   %eax,%eax
jne    138f <main+0x1df>
mov    %r15d,%ecx
mov    %ecx,0x8(%rsp)
cmp    $0x9,%r15d
mov    $0x20,%eax
cmove  %eax,%r15d
cmp    $0xd,%r15d
mov    $0xa,%eax
cmove  %eax,%r15d
cmp    %ebp,%r15d
cmove  %eax,%r15d
mov    %r15d,%edi
mov    %r14,%rsi
call   1030 <meputc@plt>
mov    0x2c02(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1070 <megetc@plt>
mov    %eax,%r12d
mov    (%rbx),%esi
mov    %eax,%edi
call   1050 <fputc@plt>
cmp    %r15d,%r12d
jne    13d0 <main+0x220>
mov    0x2bf0(%rip),%rbx
mov    (%rbx),%ebp
cmp    %ebp,%r15d
jne    12e0 <main+0x130>
mov    $0x3f,%edi
mov    %r14,%rsi
call   1080 <elfwait@plt>
mov    (%rbx),%ebp
jmp    12e0 <main+0x130>
lea    0x10(%rsp),%rdi
call   1090 <time@plt>
mov    0x2ba8(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rsp),%edx
sub    0x14(%rsp),%edx
lea    0xbf4(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b78(%rip),%rax
mov    (%rax),%edi
lea    0xbc3(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"d:\00"
@optarg = global i8* null
@.str.1 = [3 x i8] c"a+\00"
@optind = global i32 0
@stderr = global i32 0
@.str.2 = [20 x i8] c"\1B[4mReading %s\1B[0m\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [9 x i8] c"No file\0A\00"
@EOF = global i32 0
@.str.5 = [36 x i8] c"\0A\1B[4mTransfer time=%ld seconds\1B[0m\0A\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 i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32* null, i32** %7
br label %14
14: ; preds = %25, %2
%15 = load i32, i32* %4
%16 = load i8**, i8*** %5
%17 = call i32 @getopt(i32 %15, i8** %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 %17, i32* %10
%18 = icmp ne i32 %17, -1
br i1 %18, label %19, label %26
19: ; preds = %14
%20 = load i32, i32* %10
switch i32 %20, label %24 [
i32 100, label %21
]
21: ; preds = %19
%22 = load i8*, i8** @optarg
%23 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %23, i32** %7
br label %25
24: ; preds = %19
store i32* null, i32** %7
br label %25
25: ; preds = %24, %21
br label %14
26: ; preds = %14
%27 = call i32 @time(i32* %8)
%28 = load i32, i32* @optind
store i32 %28, i32* %12
br label %29
29: ; preds = %161, %26
%30 = load i32, i32* %12
%31 = load i32, i32* %4
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %164
33: ; preds = %29
%34 = load i32, i32* @stderr
%35 = load i8**, i8*** %5
%36 = load i32, i32* %12
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8*, i8** %35, i64 %37
%39 = load i8*, i8** %38
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %39)
%41 = load i8**, i8*** %5
%42 = load i32, i32* %12
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %41, i64 %43
%45 = load i8*, i8** %44
%46 = call i32* @fopen(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %46, i32** %6
%47 = load i32*, i32** %6
%48 = icmp ne i32* %47, null
br i1 %48, label %53, label %49
49: ; preds = %33
%50 = load i32, i32* @stderr
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%52 = call i32 @exit(i32 1)
unreachable
53: ; preds = %33
%54 = load i32*, i32** %7
%55 = call i32 @meputc(i32 13, i32* %54)
%56 = load i32*, i32** %7
%57 = call i32 @meputc(i32 10, i32* %56)
%58 = load i32*, i32** %7
%59 = call i32 @elfwait(i8 signext 0, i32* %58)
store i32 10, i32* %11
br label %60
60: ; preds = %159, %108, %83, %53
%61 = load i32, i32* %11
%62 = load i32, i32* @EOF
%63 = icmp ne i32 %61, %62
br i1 %63, label %64, label %160
64: ; preds = %60
%65 = load i32*, i32** %6
%66 = call i32 @getc(i32* %65)
store i32 %66, i32* %10
%67 = load i32, i32* %10
%68 = load i32, i32* @EOF
%69 = icmp eq i32 %67, %68
br i1 %69, label %70, label %74
70: ; preds = %64
%71 = load i32, i32* %11
%72 = icmp eq i32 %71, 10
br i1 %72, label %73, label %74
73: ; preds = %70
br label %160
74: ; preds = %70, %64
%75 = load i32, i32* %10
%76 = icmp eq i32 %75, 10
br i1 %76, label %80, label %77
77: ; preds = %74
%78 = load i32, i32* %10
%79 = icmp eq i32 %78, 13
br i1 %79, label %80, label %84
80: ; preds = %77, %74
%81 = load i32, i32* %11
%82 = icmp eq i32 %81, 10
br i1 %82, label %83, label %84
83: ; preds = %80
br label %60
84: ; preds = %80, %77
%85 = load i32, i32* %10
%86 = icmp eq i32 %85, 92
br i1 %86, label %87, label %109
87: ; preds = %84
%88 = load i32, i32* %11
%89 = icmp eq i32 %88, 10
br i1 %89, label %90, label %109
90: ; preds = %87
br label %91
91: ; preds = %100, %90
%92 = load i32, i32* %10
%93 = icmp ne i32 %92, 10
br i1 %93, label %94, label %98
94: ; preds = %91
%95 = load i32, i32* %10
%96 = load i32, i32* @EOF
%97 = icmp ne i32 %95, %96
br label %98
98: ; preds = %94, %91
%99 = phi i1 [ false, %91 ], [ %97, %94 ]
br i1 %99, label %100, label %103
100: ; preds = %98
%101 = load i32*, i32** %6
%102 = call i32 @getc(i32* %101)
store i32 %102, i32* %10
br label %91
103: ; preds = %98
%104 = load i32, i32* %10
%105 = load i32, i32* @EOF
%106 = icmp eq i32 %104, %105
br i1 %106, label %107, label %108
107: ; preds = %103
br label %160
108: ; preds = %103
br label %60
109: ; preds = %87, %84
%110 = load i32, i32* %10
%111 = load i32, i32* @EOF
%112 = icmp eq i32 %110, %111
br i1 %112, label %120, label %113
113: ; preds = %109
%114 = load i32, i32* %11
%115 = icmp ne i32 %114, 10
br i1 %115, label %120, label %116
116: ; preds = %113
%117 = load i32, i32* %10
%118 = call i32 @isspace(i32 %117)
%119 = icmp ne i32 %118, 0
br i1 %119, label %122, label %120
120: ; preds = %116, %113, %109
%121 = load i32, i32* %10
store i32 %121, i32* %11
br label %122
122: ; preds = %120, %116
%123 = load i32, i32* %10
%124 = icmp eq i32 %123, 9
br i1 %124, label %125, label %126
125: ; preds = %122
store i32 32, i32* %10
br label %126
126: ; preds = %125, %122
%127 = load i32, i32* %10
%128 = icmp eq i32 %127, 13
br i1 %128, label %129, label %130
129: ; preds = %126
store i32 10, i32* %10
br label %130
130: ; preds = %129, %126
%131 = load i32, i32* %10
%132 = load i32, i32* @EOF
%133 = icmp eq i32 %131, %132
br i1 %133, label %134, label %135
134: ; preds = %130
store i32 10, i32* %10
br label %135
135: ; preds = %134, %130
%136 = load i32, i32* %10
%137 = load i32*, i32** %7
%138 = call i32 @meputc(i32 %136, i32* %137)
br label %139
139: ; preds = %145, %135
%140 = load i32*, i32** %7
%141 = call i32 @megetc(i32* %140)
store i32 %141, i32* %13
%142 = load i32, i32* %13
%143 = load i32, i32* @stderr
%144 = call i32 @fputc(i32 %142, i32 %143)
br label %145
145: ; preds = %139
%146 = load i32, i32* %13
%147 = load i32, i32* %10
%148 = icmp ne i32 %146, %147
br i1 %148, label %139, label %149
149: ; preds = %145
%150 = load i32, i32* %10
%151 = icmp eq i32 %150, 13
br i1 %151, label %156, label %152
152: ; preds = %149
%153 = load i32, i32* %10
%154 = load i32, i32* @EOF
%155 = icmp eq i32 %153, %154
br i1 %155, label %156, label %159
156: ; preds = %152, %149
%157 = load i32*, i32** %7
%158 = call i32 @elfwait(i8 signext 63, i32* %157)
br label %159
159: ; preds = %156, %152
br label %60
160: ; preds = %107, %73, %60
br label %161
161: ; preds = %160
%162 = load i32, i32* %12
%163 = add nsw i32 %162, 1
store i32 %163, i32* %12
br label %29
164: ; preds = %29
%165 = call i32 @time(i32* %9)
%166 = load i32, i32* @stderr
%167 = load i32, i32* %9
%168 = load i32, i32* %8
%169 = sub nsw i32 %167, %168
%170 = call i32 (i32, i8*, ...) @fprintf(i32 %166, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32 %169)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"d:\00"
@optarg = global i8* null
@.str.1 = [3 x i8] c"a+\00"
@optind = global i32 0
@stderr = global i32 0
@.str.2 = [20 x i8] c"\1B[4mReading %s\1B[0m\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [9 x i8] c"No file\0A\00"
@EOF = global i32 0
@.str.5 = [36 x i8] c"\0A\1B[4mTransfer time=%ld seconds\1B[0m\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
br label %7
7: ; preds = %10, %2
%8 = phi i32* [ null, %2 ], [ %11, %10 ]
%9 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
switch i32 %9, label %10 [
i32 -1, label %15
i32 100, label %12
]
10: ; preds = %7, %12
%11 = phi i32* [ %14, %12 ], [ null, %7 ]
br label %7
12: ; preds = %7
%13 = load i8*, i8** @optarg
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %10
15: ; preds = %7
%16 = call i32 @time(i32* %3)
%17 = load i32, i32* @optind
%18 = icmp slt i32 %17, %0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = sext i32 %17 to i64
br label %28
21: ; preds = %103, %15
%22 = call i32 @time(i32* %4)
%23 = load i32, i32* @stderr
%24 = load i32, i32* %4
%25 = load i32, i32* %3
%26 = sub nsw i32 %24, %25
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32 %26)
ret i32 0
28: ; preds = %19, %103
%29 = phi i64 [ %20, %19 ], [ %104, %103 ]
%30 = load i32, i32* @stderr
%31 = getelementptr inbounds i8*, i8** %1, i64 %29
%32 = load i8*, i8** %31
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %32)
%34 = load i8*, i8** %31
%35 = call i32* @fopen(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %41
37: ; preds = %28
%38 = load i32, i32* @stderr
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%40 = call i32 @exit(i32 1)
unreachable
41: ; preds = %28
%42 = call i32 @meputc(i32 13, i32* %8)
%43 = call i32 @meputc(i32 10, i32* %8)
%44 = call i32 @elfwait(i8 signext 0, i32* %8)
%45 = load i32, i32* @EOF
%46 = icmp eq i32 %45, 10
br i1 %46, label %103, label %47
47: ; preds = %41, %99
%48 = phi i32 [ %101, %99 ], [ 10, %41 ]
%49 = call i32 @getc(i32* %35)
%50 = load i32, i32* @EOF
%51 = icmp eq i32 %49, %50
%52 = icmp eq i32 %48, 10
%53 = and i1 %51, %52
br i1 %53, label %103, label %54
54: ; preds = %47
%55 = icmp eq i32 %49, 10
%56 = icmp eq i32 %49, 13
%57 = or i1 %55, %56
%58 = and i1 %57, %52
br i1 %58, label %99, label %59
59: ; preds = %54
%60 = icmp eq i32 %49, 92
%61 = and i1 %60, %52
br i1 %61, label %62, label %72
62: ; preds = %59
%63 = icmp eq i32 %50, 92
br i1 %63, label %103, label %64
64: ; preds = %62, %64
%65 = call i32 @getc(i32* %35)
%66 = icmp ne i32 %65, 10
%67 = load i32, i32* @EOF
%68 = icmp ne i32 %65, %67
%69 = select i1 %66, i1 %68, i1 false
br i1 %69, label %64, label %70
70: ; preds = %64
%71 = icmp eq i32 %65, %67
br i1 %71, label %103, label %99
72: ; preds = %59
%73 = icmp ne i32 %48, 10
%74 = or i1 %51, %73
br i1 %74, label %78, label %75
75: ; preds = %72
%76 = call i32 @isspace(i32 %49)
%77 = icmp eq i32 %76, 0
br i1 %77, label %78, label %79
78: ; preds = %75, %72
br label %79
79: ; preds = %78, %75
%80 = phi i32 [ %49, %78 ], [ 10, %75 ]
%81 = icmp eq i32 %49, 9
%82 = select i1 %81, i32 32, i32 %49
%83 = icmp eq i32 %82, 13
%84 = select i1 %83, i32 10, i32 %82
%85 = icmp eq i32 %84, %50
%86 = select i1 %85, i32 10, i32 %84
%87 = call i32 @meputc(i32 %86, i32* %8)
br label %88
88: ; preds = %88, %79
%89 = call i32 @megetc(i32* %8)
%90 = load i32, i32* @stderr
%91 = call i32 @fputc(i32 %89, i32 %90)
%92 = icmp eq i32 %89, %86
br i1 %92, label %93, label %88
93: ; preds = %88
%94 = load i32, i32* @EOF
%95 = icmp eq i32 %86, %94
br i1 %95, label %96, label %99
96: ; preds = %93
%97 = call i32 @elfwait(i8 signext 63, i32* %8)
%98 = load i32, i32* @EOF
br label %99
99: ; preds = %70, %96, %93, %54
%100 = phi i32 [ %50, %54 ], [ %67, %70 ], [ %94, %93 ], [ %98, %96 ]
%101 = phi i32 [ 10, %54 ], [ 10, %70 ], [ %80, %93 ], [ %80, %96 ]
%102 = icmp eq i32 %101, %100
br i1 %102, label %103, label %47
103: ; preds = %99, %47, %70, %62, %41
%104 = add nsw i64 %29, 1
%105 = trunc i64 %104 to i32
%106 = icmp eq i32 %105, %0
br i1 %106, label %21, label %28
}