#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 */
struct stat {
  size_t st_size;
};

/* Variables and functions */
int MAP_SHARED;
int /*<<< orphan*/ PROT_READ;
int /*<<< orphan*/ errno;
int fstat(int, struct stat *);
scalar_t__ memcmp(char *, char *, int);
void *mmap(int /*<<< orphan*/, size_t, int /*<<< orphan*/, int, int,
           int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
char *strerror(int /*<<< orphan*/);
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    printf("usage: query <filename>\n");
    return 0;
  }
  printf("Phrase,Year,MatchCount,VolumeCount\n");
  char *phrase_cmp = "Auswanderung";
  size_t phrase_cmp_len = strlen(phrase_cmp);
  char line[1024 * 257];
  int fd = open(argv[1], 0);
  if (fd < 0)
    printf("errno = %s\n", strerror(errno));
  struct stat stat;
  int fsv = fstat(fd, &stat);
  if (fsv < 0)
    printf("errno = %s\n", strerror(errno));
  size_t len = stat.st_size;
  void *addr = mmap(0, len, PROT_READ, MAP_SHARED | MAP_SHARED, fd, 0);
  if (addr <= 0)
    printf("errno = %s\n", strerror(errno));
  char *end = addr + len;
  char *cur_line = addr;
  while (cur_line < end) {
    char *phrase_start = cur_line;
    char *phrase_end = phrase_start;
    while (*phrase_end++ != '\t')
      ;
    int phrase_len = phrase_end - phrase_start - 1;
    char *year_start = phrase_end;
    char *year_end = year_start;
    while (*year_end++ != '\t')
      ;
    int year_len = year_end - year_start - 1;
    char *match_start = year_end;
    char *match_end = match_start;
    while (*match_end++ != '\t')
      ;
    int match_len = match_end - match_start - 1;
    char *vol_start = match_end;
    char *vol_end = vol_start;
    while (*vol_end++ != '\n')
      ;
    int vol_len = vol_end - vol_start - 1;
    char *line_end = vol_end;
    if ((phrase_cmp_len == phrase_len) &&
        memcmp(phrase_cmp, phrase_start, phrase_len) == 0) {
      char *cur = line;
      strncpy(cur, phrase_start, phrase_len);
      cur += phrase_len;
      *cur++ = ',';
      strncpy(cur, year_start, year_len);
      cur += year_len;
      *cur++ = ',';
      strncpy(cur, match_start, match_len);
      cur += match_len;
      *cur++ = ',';
      strncpy(cur, vol_start, vol_len);
      cur += vol_len;
      *cur++ = '\0';
      puts(line);
    }
    cur_line = line_end;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x404d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11cd <main+0x3d>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1634 <main+0x4a4>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe5b(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %esi,%esi
call   1090 <open@plt>
mov    %eax,-0x40424(%rbp)
cmpl   $0x0,-0x40424(%rbp)
jge    1234 <main+0xa4>
mov    0x2db4(%rip),%rax
mov    (%rax),%edi
call   10a0 <strerror@plt>
mov    %rax,%rsi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x40424(%rbp),%edi
lea    -0x40430(%rbp),%rsi
call   10b0 <fstat@plt>
mov    %eax,-0x40434(%rbp)
cmpl   $0x0,-0x40434(%rbp)
jge    1278 <main+0xe8>
mov    0x2d70(%rip),%rax
mov    (%rax),%edi
call   10a0 <strerror@plt>
mov    %rax,%rsi
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x40430(%rbp),%rax
mov    %rax,-0x40440(%rbp)
mov    -0x40440(%rbp),%rsi
mov    0x2d64(%rip),%rax
mov    (%rax),%edx
mov    0x2d4b(%rip),%rax
mov    (%rax),%ecx
mov    0x2d42(%rip),%rax
or     (%rax),%ecx
mov    -0x40424(%rbp),%r8d
xor    %r9d,%r9d
mov    %r9d,%edi
call   1060 <mmap@plt>
mov    %rax,-0x40448(%rbp)
cmpq   $0x0,-0x40448(%rbp)
ja     12ee <main+0x15e>
mov    0x2cfa(%rip),%rax
mov    (%rax),%edi
call   10a0 <strerror@plt>
mov    %rax,%rsi
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x40448(%rbp),%rax
add    -0x40440(%rbp),%rax
mov    %rax,-0x40450(%rbp)
mov    -0x40448(%rbp),%rax
mov    %rax,-0x40458(%rbp)
mov    -0x40458(%rbp),%rax
cmp    -0x40450(%rbp),%rax
jae    1634 <main+0x4a4>
mov    -0x40458(%rbp),%rax
mov    %rax,-0x40460(%rbp)
mov    -0x40460(%rbp),%rax
mov    %rax,-0x40468(%rbp)
mov    -0x40468(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x40468(%rbp)
movsbl (%rax),%eax
cmp    $0x9,%eax
je     1367 <main+0x1d7>
jmp    1341 <main+0x1b1>
mov    -0x40468(%rbp),%rax
mov    -0x40460(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,-0x4046c(%rbp)
mov    -0x40468(%rbp),%rax
mov    %rax,-0x40478(%rbp)
mov    -0x40478(%rbp),%rax
mov    %rax,-0x40480(%rbp)
mov    -0x40480(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x40480(%rbp)
movsbl (%rax),%eax
cmp    $0x9,%eax
je     13c4 <main+0x234>
jmp    139e <main+0x20e>
mov    -0x40480(%rbp),%rax
mov    -0x40478(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,-0x40484(%rbp)
mov    -0x40480(%rbp),%rax
mov    %rax,-0x40490(%rbp)
mov    -0x40490(%rbp),%rax
mov    %rax,-0x40498(%rbp)
mov    -0x40498(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x40498(%rbp)
movsbl (%rax),%eax
cmp    $0x9,%eax
je     1421 <main+0x291>
jmp    13fb <main+0x26b>
mov    -0x40498(%rbp),%rax
mov    -0x40490(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,-0x4049c(%rbp)
mov    -0x40498(%rbp),%rax
mov    %rax,-0x404a8(%rbp)
mov    -0x404a8(%rbp),%rax
mov    %rax,-0x404b0(%rbp)
mov    -0x404b0(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x404b0(%rbp)
movsbl (%rax),%eax
cmp    $0xa,%eax
je     147e <main+0x2ee>
jmp    1458 <main+0x2c8>
mov    -0x404b0(%rbp),%rax
mov    -0x404a8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,-0x404b4(%rbp)
mov    -0x404b0(%rbp),%rax
mov    %rax,-0x404c0(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x4046c(%rbp),%rcx
cmp    %rcx,%rax
jne    1621 <main+0x491>
mov    -0x18(%rbp),%rdi
mov    -0x40460(%rbp),%rsi
mov    -0x4046c(%rbp),%edx
call   1080 <memcmp@plt>
cmp    $0x0,%rax
jne    1621 <main+0x491>
lea    -0x40420(%rbp),%rax
mov    %rax,-0x404c8(%rbp)
mov    -0x404c8(%rbp),%rdi
mov    -0x40460(%rbp),%rsi
mov    -0x4046c(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x4046c(%rbp),%ecx
mov    -0x404c8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x404c8(%rbp)
mov    -0x404c8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x404c8(%rbp)
movb   $0x2c,(%rax)
mov    -0x404c8(%rbp),%rdi
mov    -0x40478(%rbp),%rsi
mov    -0x40484(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x40484(%rbp),%ecx
mov    -0x404c8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x404c8(%rbp)
mov    -0x404c8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x404c8(%rbp)
movb   $0x2c,(%rax)
mov    -0x404c8(%rbp),%rdi
mov    -0x40490(%rbp),%rsi
mov    -0x4049c(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x4049c(%rbp),%ecx
mov    -0x404c8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x404c8(%rbp)
mov    -0x404c8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x404c8(%rbp)
movb   $0x2c,(%rax)
mov    -0x404c8(%rbp),%rdi
mov    -0x404a8(%rbp),%rsi
mov    -0x404b4(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x404b4(%rbp),%ecx
mov    -0x404c8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x404c8(%rbp)
mov    -0x404c8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x404c8(%rbp)
movb   $0x0,(%rax)
lea    -0x40420(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x404c0(%rbp),%rax
mov    %rax,-0x40458(%rbp)
jmp    1311 <main+0x181>
mov    -0x4(%rbp),%eax
add    $0x404d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40458,%rsp
cmp    $0x2,%edi
jne    1487 <main+0x307>
mov    %rsi,%rbx
lea    0xe75(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
call   1080 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    11d9 <main+0x59>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
lea    0xe3e(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x48(%rsp),%rsi
mov    %ebx,%edi
call   10a0 <fstat@plt>
test   %eax,%eax
jns    1208 <main+0x88>
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
lea    0xe0f(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x48(%rsp),%rbp
mov    0x2de4(%rip),%rax
mov    (%rax),%edx
mov    0x2dcb(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    %rbp,%rsi
mov    %ebx,%r8d
xor    %r9d,%r9d
call   1050 <mmap@plt>
mov    %rax,%rcx
test   %rax,%rax
jne    125c <main+0xdc>
mov    0x2d92(%rip),%rax
mov    (%rax),%edi
mov    %rcx,%rbx
call   1090 <strerror@plt>
lea    0xdbe(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rcx
add    %rcx,%rbp
cmp    %rbp,%rcx
jae    1493 <main+0x313>
mov    %rbp,%r8
movabs $0xffffffff00000000,%r11
ff ff ff
movabs $0x100000000,%r9
mov    %rbp,0x28(%rsp)
jmp    1299 <main+0x119>
cs nopw 0x0(%rax,%rax,1)
cmp    %r8,%rcx
jae    1493 <main+0x313>
mov    %rcx,%rsi
mov    $0x1,%ecx
mov    $0x2,%edi
xor    %r10d,%r10d
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %rdx,%rbx
add    %r11,%r10
cmpb   $0x9,(%rsi,%rdx,1)
mov    %rcx,%rbp
mov    %rdi,%rax
lea    0x1(%rdx),%rdx
lea    0x1(%rcx),%rcx
lea    0x1(%rdi),%rdi
jne    12b0 <main+0x130>
lea    (%rsi,%rdx,1),%rcx
mov    %rcx,0x40(%rsp)
mov    $0xffffffff,%edi
mov    %r11,%rcx
nop
mov    %rax,%rbx
add    %r9,%rcx
add    $0x1,%edi
cmpb   $0x9,(%rsi,%rbp,1)
lea    0x1(%rbp),%rbp
lea    0x1(%rax),%rax
jne    12e0 <main+0x160>
mov    %rcx,0x18(%rsp)
add    %rsi,%rbp
mov    $0xffffffff,%r15d
mov    %r11,%r14
nopl   0x0(%rax,%rax,1)
add    %r9,%r14
add    $0x1,%r15d
cmpb   $0x9,(%rsi,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1310 <main+0x190>
mov    %edi,0x24(%rsp)
add    $0xffffffffffffffff,%rdx
add    %rsi,%rbx
mov    $0xffffffff,%r13d
mov    %r11,%r12
mov    %rbx,%rcx
nopl   0x0(%rax,%rax,1)
add    %r9,%r12
add    $0x1,%r13d
cmpb   $0xa,(%rcx)
lea    0x1(%rcx),%rcx
jne    1340 <main+0x1c0>
movabs $0xfffffff300000000,%rax
ff ff ff
cmp    %rax,%r10
jne    1290 <main+0x110>
lea    0xc96(%rip),%rdi
mov    %rsi,0x10(%rsp)
mov    %rcx,0x30(%rsp)
mov    %r10,0x8(%rsp)
mov    %rdx,0x38(%rsp)
call   1070 <memcmp@plt>
mov    0x38(%rsp),%rdx
mov    0x8(%rsp),%r10
mov    0x30(%rsp),%rcx
mov    0x10(%rsp),%rsi
movabs $0x100000000,%r9
movabs $0xffffffff00000000,%r11
ff ff ff
mov    0x28(%rsp),%r8
test   %rax,%rax
jne    1290 <main+0x110>
sub    %r10,%r11
sar    $0x20,%r11
mov    %r11,0x8(%rsp)
lea    0x50(%rsp),%rdi
call   1030 <strncpy@plt>
mov    0x8(%rsp),%rax
lea    (%rsp,%rax,1),%rcx
add    $0x50,%rcx
mov    %rcx,0x10(%rsp)
lea    0x51(%rsp,%rax,1),%rdi
movb   $0x2c,0x50(%rsp,%rax,1)
mov    0x40(%rsp),%rsi
mov    0x24(%rsp),%edx
call   1030 <strncpy@plt>
mov    0x18(%rsp),%rax
sar    $0x20,%rax
mov    0x10(%rsp),%rcx
lea    (%rax,%rcx,1),%rdx
add    $0x1,%rdx
mov    %rdx,0x18(%rsp)
lea    0x2(%rax,%rcx,1),%rdi
movb   $0x2c,0x1(%rax,%rcx,1)
mov    %rbp,%rsi
mov    %r15d,%edx
call   1030 <strncpy@plt>
sar    $0x20,%r14
mov    0x18(%rsp),%rax
lea    (%r14,%rax,1),%rbp
add    $0x1,%rbp
lea    0x2(%r14,%rax,1),%rdi
movb   $0x2c,0x1(%r14,%rax,1)
mov    %rbx,%rsi
mov    %r13d,%edx
call   1030 <strncpy@plt>
sar    $0x20,%r12
movb   $0x0,0x1(%r12,%rbp,1)
lea    0x50(%rsp),%rdi
call   1040 <puts@plt>
mov    0x30(%rsp),%rcx
movabs $0x100000000,%r9
movabs $0xffffffff00000000,%r11
ff ff ff
mov    0x28(%rsp),%r8
jmp    1290 <main+0x110>
lea    0xbae(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x40458,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
@.str = [25 x i8] c"usage: query <filename>\0A\00"
@.str.1 = [36 x i8] c"Phrase,Year,MatchCount,VolumeCount\0A\00"
@.str.2 = [13 x i8] c"Auswanderung\00"
@.str.3 = [12 x i8] c"errno = %s\0A\00"
@errno = global i32 0
@PROT_READ = global i32 0
@MAP_SHARED = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca [263168 x i8]
%9 = alloca i32
%10 = alloca %struct.stat
%11 = alloca i32
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i32
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i32
%25 = alloca i8*
%26 = alloca i8*
%27 = alloca i32
%28 = alloca i8*
%29 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%30 = load i32, i32* %4
%31 = icmp ne i32 %30, 2
br i1 %31, label %32, label %34
32: ; preds = %2
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %208
34: ; preds = %2
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8** %6
%36 = load i8*, i8** %6
%37 = call i64 @strlen(i8* %36)
store i64 %37, i64* %7
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i32 @open(i8* %40, i32 0)
store i32 %41, i32* %9
%42 = load i32, i32* %9
%43 = icmp slt i32 %42, 0
br i1 %43, label %44, label %48
44: ; preds = %34
%45 = load i32, i32* @errno
%46 = call i8* @strerror(i32 %45)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %46)
br label %48
48: ; preds = %44, %34
%49 = load i32, i32* %9
%50 = call i32 @fstat(i32 %49, %struct.stat* %10)
store i32 %50, i32* %11
%51 = load i32, i32* %11
%52 = icmp slt i32 %51, 0
br i1 %52, label %53, label %57
53: ; preds = %48
%54 = load i32, i32* @errno
%55 = call i8* @strerror(i32 %54)
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %55)
br label %57
57: ; preds = %53, %48
%58 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%59 = load i64, i64* %58
store i64 %59, i64* %12
%60 = load i64, i64* %12
%61 = load i32, i32* @PROT_READ
%62 = load i32, i32* @MAP_SHARED
%63 = load i32, i32* @MAP_SHARED
%64 = or i32 %62, %63
%65 = load i32, i32* %9
%66 = call i8* @mmap(i32 0, i64 %60, i32 %61, i32 %64, i32 %65, i32 0)
store i8* %66, i8** %13
%67 = load i8*, i8** %13
%68 = icmp ule i8* %67, null
br i1 %68, label %69, label %73
69: ; preds = %57
%70 = load i32, i32* @errno
%71 = call i8* @strerror(i32 %70)
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %71)
br label %73
73: ; preds = %69, %57
%74 = load i8*, i8** %13
%75 = load i64, i64* %12
%76 = getelementptr i8, i8* %74, i64 %75
store i8* %76, i8** %14
%77 = load i8*, i8** %13
store i8* %77, i8** %15
br label %78
78: ; preds = %206, %73
%79 = load i8*, i8** %15
%80 = load i8*, i8** %14
%81 = icmp ult i8* %79, %80
br i1 %81, label %82, label %208
82: ; preds = %78
%83 = load i8*, i8** %15
store i8* %83, i8** %16
%84 = load i8*, i8** %16
store i8* %84, i8** %17
br label %85
85: ; preds = %91, %82
%86 = load i8*, i8** %17
%87 = getelementptr inbounds i8, i8* %86, i32 1
store i8* %87, i8** %17
%88 = load i8, i8* %86
%89 = sext i8 %88 to i32
%90 = icmp ne i32 %89, 9
br i1 %90, label %91, label %92
91: ; preds = %85
br label %85
92: ; preds = %85
%93 = load i8*, i8** %17
%94 = load i8*, i8** %16
%95 = ptrtoint i8* %93 to i64
%96 = ptrtoint i8* %94 to i64
%97 = sub i64 %95, %96
%98 = sub nsw i64 %97, 1
%99 = trunc i64 %98 to i32
store i32 %99, i32* %18
%100 = load i8*, i8** %17
store i8* %100, i8** %19
%101 = load i8*, i8** %19
store i8* %101, i8** %20
br label %102
102: ; preds = %108, %92
%103 = load i8*, i8** %20
%104 = getelementptr inbounds i8, i8* %103, i32 1
store i8* %104, i8** %20
%105 = load i8, i8* %103
%106 = sext i8 %105 to i32
%107 = icmp ne i32 %106, 9
br i1 %107, label %108, label %109
108: ; preds = %102
br label %102
109: ; preds = %102
%110 = load i8*, i8** %20
%111 = load i8*, i8** %19
%112 = ptrtoint i8* %110 to i64
%113 = ptrtoint i8* %111 to i64
%114 = sub i64 %112, %113
%115 = sub nsw i64 %114, 1
%116 = trunc i64 %115 to i32
store i32 %116, i32* %21
%117 = load i8*, i8** %20
store i8* %117, i8** %22
%118 = load i8*, i8** %22
store i8* %118, i8** %23
br label %119
119: ; preds = %125, %109
%120 = load i8*, i8** %23
%121 = getelementptr inbounds i8, i8* %120, i32 1
store i8* %121, i8** %23
%122 = load i8, i8* %120
%123 = sext i8 %122 to i32
%124 = icmp ne i32 %123, 9
br i1 %124, label %125, label %126
125: ; preds = %119
br label %119
126: ; preds = %119
%127 = load i8*, i8** %23
%128 = load i8*, i8** %22
%129 = ptrtoint i8* %127 to i64
%130 = ptrtoint i8* %128 to i64
%131 = sub i64 %129, %130
%132 = sub nsw i64 %131, 1
%133 = trunc i64 %132 to i32
store i32 %133, i32* %24
%134 = load i8*, i8** %23
store i8* %134, i8** %25
%135 = load i8*, i8** %25
store i8* %135, i8** %26
br label %136
136: ; preds = %142, %126
%137 = load i8*, i8** %26
%138 = getelementptr inbounds i8, i8* %137, i32 1
store i8* %138, i8** %26
%139 = load i8, i8* %137
%140 = sext i8 %139 to i32
%141 = icmp ne i32 %140, 10
br i1 %141, label %142, label %143
142: ; preds = %136
br label %136
143: ; preds = %136
%144 = load i8*, i8** %26
%145 = load i8*, i8** %25
%146 = ptrtoint i8* %144 to i64
%147 = ptrtoint i8* %145 to i64
%148 = sub i64 %146, %147
%149 = sub nsw i64 %148, 1
%150 = trunc i64 %149 to i32
store i32 %150, i32* %27
%151 = load i8*, i8** %26
store i8* %151, i8** %28
%152 = load i64, i64* %7
%153 = load i32, i32* %18
%154 = sext i32 %153 to i64
%155 = icmp eq i64 %152, %154
br i1 %155, label %156, label %206
156: ; preds = %143
%157 = load i8*, i8** %6
%158 = load i8*, i8** %16
%159 = load i32, i32* %18
%160 = call i64 @memcmp(i8* %157, i8* %158, i32 %159)
%161 = icmp eq i64 %160, 0
br i1 %161, label %162, label %206
162: ; preds = %156
%163 = getelementptr inbounds [263168 x i8], [263168 x i8]* %8, i64 0, i64 0
store i8* %163, i8** %29
%164 = load i8*, i8** %29
%165 = load i8*, i8** %16
%166 = load i32, i32* %18
%167 = call i32 @strncpy(i8* %164, i8* %165, i32 %166)
%168 = load i32, i32* %18
%169 = load i8*, i8** %29
%170 = sext i32 %168 to i64
%171 = getelementptr inbounds i8, i8* %169, i64 %170
store i8* %171, i8** %29
%172 = load i8*, i8** %29
%173 = getelementptr inbounds i8, i8* %172, i32 1
store i8* %173, i8** %29
store i8 44, i8* %172
%174 = load i8*, i8** %29
%175 = load i8*, i8** %19
%176 = load i32, i32* %21
%177 = call i32 @strncpy(i8* %174, i8* %175, i32 %176)
%178 = load i32, i32* %21
%179 = load i8*, i8** %29
%180 = sext i32 %178 to i64
%181 = getelementptr inbounds i8, i8* %179, i64 %180
store i8* %181, i8** %29
%182 = load i8*, i8** %29
%183 = getelementptr inbounds i8, i8* %182, i32 1
store i8* %183, i8** %29
store i8 44, i8* %182
%184 = load i8*, i8** %29
%185 = load i8*, i8** %22
%186 = load i32, i32* %24
%187 = call i32 @strncpy(i8* %184, i8* %185, i32 %186)
%188 = load i32, i32* %24
%189 = load i8*, i8** %29
%190 = sext i32 %188 to i64
%191 = getelementptr inbounds i8, i8* %189, i64 %190
store i8* %191, i8** %29
%192 = load i8*, i8** %29
%193 = getelementptr inbounds i8, i8* %192, i32 1
store i8* %193, i8** %29
store i8 44, i8* %192
%194 = load i8*, i8** %29
%195 = load i8*, i8** %25
%196 = load i32, i32* %27
%197 = call i32 @strncpy(i8* %194, i8* %195, i32 %196)
%198 = load i32, i32* %27
%199 = load i8*, i8** %29
%200 = sext i32 %198 to i64
%201 = getelementptr inbounds i8, i8* %199, i64 %200
store i8* %201, i8** %29
%202 = load i8*, i8** %29
%203 = getelementptr inbounds i8, i8* %202, i32 1
store i8* %203, i8** %29
store i8 0, i8* %202
%204 = getelementptr inbounds [263168 x i8], [263168 x i8]* %8, i64 0, i64 0
%205 = call i32 @puts(i8* %204)
br label %206
206: ; preds = %162, %156, %143
%207 = load i8*, i8** %28
store i8* %207, i8** %15
br label %78
208: ; preds = %32, %78
%209 = load i32, i32* %3
ret i32 %209
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@.str.2 = [13 x i8] c"Auswanderung\00"
@.str.3 = [12 x i8] c"errno = %s\0A\00"
@errno = global i32 0
@PROT_READ = global i32 0
@MAP_SHARED = global i32 0
@str = [35 x i8] c"Phrase,Year,MatchCount,VolumeCount\00"
@str.4 = [24 x i8] c"usage: query <filename>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [263168 x i8]
%4 = alloca %struct.stat
%5 = icmp eq i32 %0, 2
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.4, i64 0, i64 0))
br label %112
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%10 = getelementptr inbounds [263168 x i8], [263168 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @open(i8* %12, i32 0)
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %8
%16 = load i32, i32* @errno
%17 = tail call i8* @strerror(i32 %16)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %15, %8
%20 = bitcast %struct.stat* %4 to i8*
%21 = call i32 @fstat(i32 %13, %struct.stat* %4)
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i32, i32* @errno
%25 = tail call i8* @strerror(i32 %24)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %25)
br label %27
27: ; preds = %23, %19
%28 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%29 = load i64, i64* %28
%30 = load i32, i32* @PROT_READ
%31 = load i32, i32* @MAP_SHARED
%32 = tail call i8* @mmap(i32 0, i64 %29, i32 %30, i32 %31, i32 %13, i32 0)
%33 = icmp eq i8* %32, null
br i1 %33, label %34, label %38
34: ; preds = %27
%35 = load i32, i32* @errno
%36 = tail call i8* @strerror(i32 %35)
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %36)
br label %38
38: ; preds = %34, %27
%39 = getelementptr i8, i8* %32, i64 %29
%40 = icmp ult i8* %32, %39
br i1 %40, label %41, label %111
41: ; preds = %38, %109
%42 = phi i8* [ %74, %109 ], [ %32, %38 ]
br label %43
43: ; preds = %41, %43
%44 = phi i8* [ %45, %43 ], [ %42, %41 ]
%45 = getelementptr inbounds i8, i8* %44, i64 1
%46 = load i8, i8* %44
%47 = icmp eq i8 %46, 9
br i1 %47, label %48, label %43
48: ; preds = %43
%49 = ptrtoint i8* %45 to i64
%50 = ptrtoint i8* %42 to i64
%51 = xor i64 %50, -1
%52 = add i64 %49, %51
br label %53
53: ; preds = %53, %48
%54 = phi i8* [ %45, %48 ], [ %55, %53 ]
%55 = getelementptr inbounds i8, i8* %54, i64 1
%56 = load i8, i8* %54
%57 = icmp eq i8 %56, 9
br i1 %57, label %58, label %53
58: ; preds = %53
%59 = ptrtoint i8* %55 to i64
%60 = xor i64 %49, -1
%61 = add i64 %59, %60
br label %62
62: ; preds = %62, %58
%63 = phi i8* [ %55, %58 ], [ %64, %62 ]
%64 = getelementptr inbounds i8, i8* %63, i64 1
%65 = load i8, i8* %63
%66 = icmp eq i8 %65, 9
br i1 %66, label %67, label %62
67: ; preds = %62
%68 = trunc i64 %52 to i32
%69 = ptrtoint i8* %64 to i64
%70 = xor i64 %59, -1
%71 = add i64 %69, %70
br label %72
72: ; preds = %72, %67
%73 = phi i8* [ %64, %67 ], [ %74, %72 ]
%74 = getelementptr inbounds i8, i8* %73, i64 1
%75 = load i8, i8* %73
%76 = icmp eq i8 %75, 10
br i1 %76, label %77, label %72
77: ; preds = %72
%78 = trunc i64 %61 to i32
%79 = trunc i64 %71 to i32
%80 = ptrtoint i8* %74 to i64
%81 = xor i64 %69, -1
%82 = add i64 %80, %81
%83 = trunc i64 %82 to i32
%84 = shl i64 %52, 32
%85 = ashr exact i64 %84, 32
%86 = icmp eq i64 %84, 51539607552
br i1 %86, label %87, label %109
87: ; preds = %77
%88 = call i64 @memcmp(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %42, i32 %68)
%89 = icmp eq i64 %88, 0
br i1 %89, label %90, label %109
90: ; preds = %87
%91 = call i32 @strncpy(i8* %10, i8* %42, i32 %68)
%92 = getelementptr inbounds [263168 x i8], [263168 x i8]* %3, i64 0, i64 %85
%93 = getelementptr inbounds i8, i8* %92, i64 1
store i8 44, i8* %92
%94 = call i32 @strncpy(i8* %93, i8* %45, i32 %78)
%95 = shl i64 %61, 32
%96 = ashr exact i64 %95, 32
%97 = getelementptr inbounds i8, i8* %93, i64 %96
%98 = getelementptr inbounds i8, i8* %97, i64 1
store i8 44, i8* %97
%99 = call i32 @strncpy(i8* %98, i8* %55, i32 %79)
%100 = shl i64 %71, 32
%101 = ashr exact i64 %100, 32
%102 = getelementptr inbounds i8, i8* %98, i64 %101
%103 = getelementptr inbounds i8, i8* %102, i64 1
store i8 44, i8* %102
%104 = call i32 @strncpy(i8* %103, i8* %64, i32 %83)
%105 = shl i64 %82, 32
%106 = ashr exact i64 %105, 32
%107 = getelementptr inbounds i8, i8* %103, i64 %106
store i8 0, i8* %107
%108 = call i32 @puts(i8* %10)
br label %109
109: ; preds = %90, %87, %77
%110 = icmp ult i8* %74, %39
br i1 %110, label %41, label %111
111: ; preds = %109, %38
br label %112
112: ; preds = %111, %6
ret i32 0
}