#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 /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int exec_bf(char *, long, int /*<<< orphan*/ *, int /*<<< orphan*/ *, int *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
size_t fread(char *, int, long, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
int /*<<< orphan*/ strcmp(char *, char *);
char *strstr(char *, char *);
char *strtok(char *, char *);
int main(int argc, char **argv) {
  int i;
  int caps[3];
  caps[0] = 0;
  caps[1] = 0;
  caps[2] = 0;
  char *a, *p, *filename, *infile, *outfile, *extensions;
  infile = outfile = filename = NULL;
  extensions = "";
  for (i = 1; i < argc; i++) {
    a = argv[i];
    p = strstr(a, "-i");
    if (p != NULL) {
      infile = (char *)p + 2;
      continue;
    }
    p = strstr(a, "-o");
    if (p != NULL) {
      outfile = (char *)p + 2;
      continue;
    }
    p = strstr(a, "-e");
    if (p != NULL) {
      extensions = (char *)p + 2;
      continue;
    }
    p = strstr(a, "-d");
    if (p != NULL) {
      caps[0] = 1;
      continue;
    }
    filename = a;
    break;
  }
  if (!filename) {
    printf("%s\n", "abfi"
                   " "
                   "0.1");
    printf("Usage: %s [switches] <filename>\n", argv[0]);
    printf(" -i [filename]  Input (defaults to stdin)\n");
    printf(" -o [filename]  Output (defaults to stdout)\n");
    printf(" -e [list seperated by ,]  activated Extensions\n");
    printf(" -d Debugging Mode\n");
    printf("Supported Extensions:\n");
    printf(" *        Will enable all available extensions.\n");
    printf("");
    printf("%s version %s, Copyright (C) 2013 sfan5 \n%s comes with ABSOLUTELY "
           "NO WARRANTY.  This is free software, and you are welcome \nto "
           "redistribute it under certain conditions.\n",
           "abfi", "0.1", "abfi");
    return 0;
  } else {
    FILE *f = fopen(filename, "r");
    if (!f) {
      fprintf(stderr, "Error opening File");
      return 1;
    }
    long fsize;
    char *buffer;
    size_t r;
    fseek(f, 0, SEEK_END);
    fsize = ftell(f);
    fseek(f, 0, SEEK_SET);
    buffer = (char *)malloc(sizeof(char) * fsize);
    if (buffer == NULL) {
      fprintf(stderr, "Could not allocate Memory for File");
      return 1;
    }
    r = fread(buffer, 1, fsize, f);
    if (r != fsize) {
      fprintf(stderr, "Reading Error");
      return 1;
    }
    fclose(f);
    FILE *in, *out;
    if (infile)
      in = fopen(infile, "rb");
    else
      in = stdin;
    if (outfile)
      out = fopen(outfile, "wb");
    else
      out = stdout;
    int ret;
    char *pch;
    pch = strtok(extensions, ",");
    while (pch != NULL) {
      if (!strcmp(pch, "*")) {
      }
      pch = strtok(NULL, ",");
    }
    ret = exec_bf(buffer, fsize, in, out, caps);
    free(buffer);
    return ret;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x40(%rbp)
lea    0xe47(%rip),%rax
mov    %rax,-0x50(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    131a <main+0x14a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xdb1(%rip),%rsi
call   10f0 <strstr@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1274 <main+0xa4>
mov    -0x30(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x40(%rbp)
jmp    130c <main+0x13c>
mov    -0x28(%rbp),%rdi
lea    0xd84(%rip),%rsi
call   10f0 <strstr@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     12a4 <main+0xd4>
mov    -0x30(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x48(%rbp)
jmp    130c <main+0x13c>
mov    -0x28(%rbp),%rdi
lea    0xd57(%rip),%rsi
call   10f0 <strstr@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     12d4 <main+0x104>
mov    -0x30(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x50(%rbp)
jmp    130c <main+0x13c>
mov    -0x28(%rbp),%rdi
lea    0xd2a(%rip),%rsi
call   10f0 <strstr@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     12ff <main+0x12f>
movl   $0x1,-0x20(%rbp)
jmp    130c <main+0x13c>
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    131a <main+0x14a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1228 <main+0x58>
cmpq   $0x0,-0x38(%rbp)
jne    13dc <main+0x20c>
lea    0xce0(%rip),%rdi
lea    0xcdd(%rip),%rsi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xcd1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xce4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd01(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd20(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd43(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd49(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd52(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xcba(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd67(%rip),%rdi
lea    0xe0a(%rip),%rcx
lea    0xc4f(%rip),%rdx
mov    %rcx,%rsi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15d9 <main+0x409>
mov    -0x38(%rbp),%rdi
lea    0xe29(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    141c <main+0x24c>
mov    0x2bce(%rip),%rax
mov    (%rax),%edi
lea    0xdc3(%rip),%rsi
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15d9 <main+0x409>
mov    -0x58(%rbp),%rdi
mov    0x2bc1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    -0x58(%rbp),%rdi
call   10a0 <ftell@plt>
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rdi
mov    0x2b80(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    -0x60(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jne    1490 <main+0x2c0>
mov    0x2b5a(%rip),%rax
mov    (%rax),%edi
lea    0xd62(%rip),%rsi
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15d9 <main+0x409>
mov    -0x68(%rbp),%rdi
mov    -0x60(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
cmp    -0x60(%rbp),%rax
je     14d9 <main+0x309>
mov    0x2b11(%rip),%rax
mov    (%rax),%edi
lea    0xd3c(%rip),%rsi
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15d9 <main+0x409>
mov    -0x58(%rbp),%rdi
call   1050 <fclose@plt>
cmpq   $0x0,-0x40(%rbp)
je     1506 <main+0x336>
mov    -0x40(%rbp),%rdi
lea    0xd1a(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x78(%rbp)
jmp    1514 <main+0x344>
mov    0x2ad3(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x78(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     1538 <main+0x368>
mov    -0x48(%rbp),%rdi
lea    0xceb(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x80(%rbp)
jmp    1546 <main+0x376>
mov    0x2a81(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x80(%rbp)
mov    -0x50(%rbp),%rdi
lea    0xcc7(%rip),%rsi
call   10e0 <strtok@plt>
mov    %rax,-0x90(%rbp)
cmpq   $0x0,-0x90(%rbp)
je     15a8 <main+0x3d8>
mov    -0x90(%rbp),%rdi
lea    0xca1(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    158c <main+0x3bc>
jmp    158c <main+0x3bc>
xor    %eax,%eax
mov    %eax,%edi
lea    0xc81(%rip),%rsi
call   10e0 <strtok@plt>
mov    %rax,-0x90(%rbp)
jmp    155d <main+0x38d>
mov    -0x68(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x78(%rbp),%rdx
mov    -0x80(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1070 <exec_bf@plt>
mov    %eax,-0x84(%rbp)
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
mov    -0x84(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%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,%rbx
movq   $0x0,0x20(%rsp)
movl   $0x0,0x4(%rsp)
cmp    $0x2,%edi
jl     12b4 <main+0xe4>
mov    %edi,%r15d
xor    %r12d,%r12d
lea    0xed7(%rip),%rax
mov    %rax,0x10(%rsp)
mov    $0x1,%ebp
lea    0xde7(%rip),%r13
xor    %eax,%eax
mov    %rax,0x8(%rsp)
movl   $0x0,0x4(%rsp)
jmp    1240 <main+0x70>
nopw   0x0(%rax,%rax,1)
add    $0x2,%rax
mov    %rax,%r12
add    $0x1,%rbp
cmp    %rbp,%r15
je     12b4 <main+0xe4>
mov    (%rbx,%rbp,8),%r14
mov    %r14,%rdi
mov    %r13,%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
jne    1230 <main+0x60>
mov    %r14,%rdi
lea    0xda5(%rip),%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
je     1273 <main+0xa3>
add    $0x2,%rax
mov    %rax,0x8(%rsp)
jmp    1237 <main+0x67>
mov    %r14,%rdi
lea    0xd89(%rip),%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
je     1292 <main+0xc2>
add    $0x2,%rax
mov    %rax,0x10(%rsp)
jmp    1237 <main+0x67>
mov    %r14,%rdi
lea    0xd6d(%rip),%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
je     1353 <main+0x183>
movl   $0x1,0x4(%rsp)
jmp    1237 <main+0x67>
mov    0x4(%rsp),%eax
mov    %eax,0x1c(%rsp)
lea    0xd49(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%rsi
lea    0xd43(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe4f(%rip),%rdi
call   1040 <puts@plt>
lea    0xe6d(%rip),%rdi
call   1040 <puts@plt>
lea    0xe8d(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb1(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
lea    0xd0c(%rip),%rdi
lea    0xce0(%rip),%rdx
lea    0xda8(%rip),%rcx
mov    %rcx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x4(%rsp),%eax
mov    %eax,0x1c(%rsp)
test   %r14,%r14
je     12bc <main+0xec>
lea    0xdbc(%rip),%rsi
mov    %r14,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     13fe <main+0x22e>
mov    %rax,%rbx
mov    0x2c62(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    %rbx,%rdi
call   10a0 <ftell@plt>
mov    %rax,%r14
mov    0x2c24(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    %r14d,%edi
call   10b0 <malloc@plt>
test   %rax,%rax
je     1410 <main+0x240>
mov    %rax,%r13
mov    $0x1,%ebp
mov    %rax,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1050 <fread@plt>
cmp    %r14,%rax
jne    142f <main+0x25f>
mov    %rbx,%rdi
call   1060 <fclose@plt>
test   %r12,%r12
je     1449 <main+0x279>
lea    0xd38(%rip),%rsi
mov    %r12,%rdi
call   10d0 <fopen@plt>
mov    %rax,%r12
jmp    1453 <main+0x283>
mov    0x2bcb(%rip),%rax
mov    (%rax),%edi
lea    0xcd7(%rip),%rsi
jmp    1420 <main+0x250>
mov    0x2bb9(%rip),%rax
mov    (%rax),%edi
lea    0xcd8(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%ebp
jmp    1342 <main+0x172>
mov    0x2b9a(%rip),%rax
mov    (%rax),%edi
lea    0xcdc(%rip),%rsi
call   1090 <fprintf@plt>
jmp    1342 <main+0x172>
mov    0x2b90(%rip),%rax
mov    (%rax),%r12
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     146e <main+0x29e>
lea    0xcc8(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%rbx
jmp    1478 <main+0x2a8>
mov    0x2b4b(%rip),%rax
mov    (%rax),%rbx
lea    0xcb0(%rip),%rsi
mov    0x10(%rsp),%rdi
call   10e0 <strtok@plt>
test   %rax,%rax
je     14a4 <main+0x2d4>
lea    0xc9a(%rip),%rbp
xor    %edi,%edi
mov    %rbp,%rsi
call   10e0 <strtok@plt>
test   %rax,%rax
jne    1495 <main+0x2c5>
lea    0x1c(%rsp),%r8
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1080 <exec_bf@plt>
mov    %eax,%ebp
mov    %r13,%rdi
call   1030 <free@plt>
jmp    1342 <main+0x172>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"-i\00"
@.str.2 = [3 x i8] c"-o\00"
@.str.3 = [3 x i8] c"-e\00"
@.str.4 = [3 x i8] c"-d\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [9 x i8] c"abfi 0.1\00"
@.str.7 = [33 x i8] c"Usage: %s [switches] <filename>\0A\00"
@.str.8 = [43 x i8] c" -i [filename] Input (defaults to stdin)\0A\00"
@.str.9 = [45 x i8] c" -o [filename] Output (defaults to stdout)\0A\00"
@.str.10 = [49 x i8] c" -e [list seperated by ,] activated Extensions\0A\00"
@.str.11 = [20 x i8] c" -d Debugging Mode\0A\00"
@.str.12 = [23 x i8] c"Supported Extensions:\0A\00"
@.str.13 = [49 x i8] c" * Will enable all available extensions.\0A\00"
@.str.14 = [170 x i8] c"%s version %s, Copyright (C) 2013 sfan5 \0A%s comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome \0Ato redistribute it under certain conditions.\0A\00"
@.str.15 = [5 x i8] c"abfi\00"
@.str.16 = [4 x i8] c"0.1\00"
@.str.17 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.18 = [19 x i8] c"Error opening File\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.19 = [35 x i8] c"Could not allocate Memory for File\00"
@.str.20 = [14 x i8] c"Reading Error\00"
@.str.21 = [3 x i8] c"rb\00"
@stdin = global i32* null
@.str.22 = [3 x i8] c"wb\00"
@stdout = global i32* null
@.str.23 = [2 x i8] c",\00"
@.str.24 = [2 x i8] c"*\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [3 x i32]
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32*
%15 = alloca i64
%16 = alloca i8*
%17 = alloca i64
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32
%21 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
store i32 0, i32* %22
%23 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 1
store i32 0, i32* %23
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 2
store i32 0, i32* %24
store i8* null, i8** %10
store i8* null, i8** %12
store i8* null, i8** %11
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %13
store i32 1, i32* %6
br label %25
25: ; preds = %67, %2
%26 = load i32, i32* %6
%27 = load i32, i32* %4
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %70
29: ; preds = %25
%30 = load i8**, i8*** %5
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %30, i64 %32
%34 = load i8*, i8** %33
store i8* %34, i8** %8
%35 = load i8*, i8** %8
%36 = call i8* @strstr(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i8* %36, i8** %9
%37 = load i8*, i8** %9
%38 = icmp ne i8* %37, null
br i1 %38, label %39, label %42
39: ; preds = %29
%40 = load i8*, i8** %9
%41 = getelementptr inbounds i8, i8* %40, i64 2
store i8* %41, i8** %11
br label %67
42: ; preds = %29
%43 = load i8*, i8** %8
%44 = call i8* @strstr(i8* %43, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i8* %44, i8** %9
%45 = load i8*, i8** %9
%46 = icmp ne i8* %45, null
br i1 %46, label %47, label %50
47: ; preds = %42
%48 = load i8*, i8** %9
%49 = getelementptr inbounds i8, i8* %48, i64 2
store i8* %49, i8** %12
br label %67
50: ; preds = %42
%51 = load i8*, i8** %8
%52 = call i8* @strstr(i8* %51, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i8* %52, i8** %9
%53 = load i8*, i8** %9
%54 = icmp ne i8* %53, null
br i1 %54, label %55, label %58
55: ; preds = %50
%56 = load i8*, i8** %9
%57 = getelementptr inbounds i8, i8* %56, i64 2
store i8* %57, i8** %13
br label %67
58: ; preds = %50
%59 = load i8*, i8** %8
%60 = call i8* @strstr(i8* %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i8* %60, i8** %9
%61 = load i8*, i8** %9
%62 = icmp ne i8* %61, null
br i1 %62, label %63, label %65
63: ; preds = %58
%64 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
store i32 1, i32* %64
br label %67
65: ; preds = %58
%66 = load i8*, i8** %8
store i8* %66, i8** %10
br label %70
67: ; preds = %63, %55, %47, %39
%68 = load i32, i32* %6
%69 = add nsw i32 %68, 1
store i32 %69, i32* %6
br label %25
70: ; preds = %65, %25
%71 = load i8*, i8** %10
%72 = icmp ne i8* %71, null
br i1 %72, label %87, label %73
73: ; preds = %70
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%75 = load i8**, i8*** %5
%76 = getelementptr inbounds i8*, i8** %75, i64 0
%77 = load i8*, i8** %76
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* %77)
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0))
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.10, i64 0, i64 0))
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0))
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0))
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.13, i64 0, i64 0))
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
store i32 0, i32* %3
br label %166
87: ; preds = %70
%88 = load i8*, i8** %10
%89 = call i32* @fopen(i8* %88, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
store i32* %89, i32** %14
%90 = load i32*, i32** %14
%91 = icmp ne i32* %90, null
br i1 %91, label %95, label %92
92: ; preds = %87
%93 = load i32, i32* @stderr
%94 = call i32 @fprintf(i32 %93, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.18, i64 0, i64 0))
store i32 1, i32* %3
br label %166
95: ; preds = %87
%96 = load i32*, i32** %14
%97 = load i32, i32* @SEEK_END
%98 = call i32 @fseek(i32* %96, i32 0, i32 %97)
%99 = load i32*, i32** %14
%100 = call i64 @ftell(i32* %99)
store i64 %100, i64* %15
%101 = load i32*, i32** %14
%102 = load i32, i32* @SEEK_SET
%103 = call i32 @fseek(i32* %101, i32 0, i32 %102)
%104 = load i64, i64* %15
%105 = mul i64 1, %104
%106 = trunc i64 %105 to i32
%107 = call i64 @malloc(i32 %106)
%108 = inttoptr i64 %107 to i8*
store i8* %108, i8** %16
%109 = load i8*, i8** %16
%110 = icmp eq i8* %109, null
br i1 %110, label %111, label %114
111: ; preds = %95
%112 = load i32, i32* @stderr
%113 = call i32 @fprintf(i32 %112, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.19, i64 0, i64 0))
store i32 1, i32* %3
br label %166
114: ; preds = %95
%115 = load i8*, i8** %16
%116 = load i64, i64* %15
%117 = load i32*, i32** %14
%118 = call i64 @fread(i8* %115, i32 1, i64 %116, i32* %117)
store i64 %118, i64* %17
%119 = load i64, i64* %17
%120 = load i64, i64* %15
%121 = icmp ne i64 %119, %120
br i1 %121, label %122, label %125
122: ; preds = %114
%123 = load i32, i32* @stderr
%124 = call i32 @fprintf(i32 %123, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.20, i64 0, i64 0))
store i32 1, i32* %3
br label %166
125: ; preds = %114
%126 = load i32*, i32** %14
%127 = call i32 @fclose(i32* %126)
%128 = load i8*, i8** %11
%129 = icmp ne i8* %128, null
br i1 %129, label %130, label %133
130: ; preds = %125
%131 = load i8*, i8** %11
%132 = call i32* @fopen(i8* %131, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0))
store i32* %132, i32** %18
br label %135
133: ; preds = %125
%134 = load i32*, i32** @stdin
store i32* %134, i32** %18
br label %135
135: ; preds = %133, %130
%136 = load i8*, i8** %12
%137 = icmp ne i8* %136, null
br i1 %137, label %138, label %141
138: ; preds = %135
%139 = load i8*, i8** %12
%140 = call i32* @fopen(i8* %139, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i64 0, i64 0))
store i32* %140, i32** %19
br label %143
141: ; preds = %135
%142 = load i32*, i32** @stdout
store i32* %142, i32** %19
br label %143
143: ; preds = %141, %138
%144 = load i8*, i8** %13
%145 = call i8* @strtok(i8* %144, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
store i8* %145, i8** %21
br label %146
146: ; preds = %154, %143
%147 = load i8*, i8** %21
%148 = icmp ne i8* %147, null
br i1 %148, label %149, label %156
149: ; preds = %146
%150 = load i8*, i8** %21
%151 = call i32 @strcmp(i8* %150, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.24, i64 0, i64 0))
%152 = icmp ne i32 %151, 0
br i1 %152, label %154, label %153
153: ; preds = %149
br label %154
154: ; preds = %153, %149
%155 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
store i8* %155, i8** %21
br label %146
156: ; preds = %146
%157 = load i8*, i8** %16
%158 = load i64, i64* %15
%159 = load i32*, i32** %18
%160 = load i32*, i32** %19
%161 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%162 = call i32 @exec_bf(i8* %157, i64 %158, i32* %159, i32* %160, i32* %161)
store i32 %162, i32* %20
%163 = load i8*, i8** %16
%164 = call i32 @free(i8* %163)
%165 = load i32, i32* %20
store i32 %165, i32* %3
br label %166
166: ; preds = %156, %122, %111, %92, %73
%167 = load i32, i32* %3
ret i32 %167
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"-i\00"
@.str.2 = [3 x i8] c"-o\00"
@.str.3 = [3 x i8] c"-e\00"
@.str.4 = [3 x i8] c"-d\00"
@.str.6 = [9 x i8] c"abfi 0.1\00"
@.str.7 = [33 x i8] c"Usage: %s [switches] <filename>\0A\00"
@.str.14 = [170 x i8] c"%s version %s, Copyright (C) 2013 sfan5 \0A%s comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome \0Ato redistribute it under certain conditions.\0A\00"
@.str.15 = [5 x i8] c"abfi\00"
@.str.16 = [4 x i8] c"0.1\00"
@.str.17 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.18 = [19 x i8] c"Error opening File\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.19 = [35 x i8] c"Could not allocate Memory for File\00"
@.str.20 = [14 x i8] c"Reading Error\00"
@.str.21 = [3 x i8] c"rb\00"
@stdin = global i32* null
@.str.22 = [3 x i8] c"wb\00"
@stdout = global i32* null
@.str.23 = [2 x i8] c",\00"
@str = [42 x i8] c" -i [filename] Input (defaults to stdin)\00"
@str.25 = [44 x i8] c" -o [filename] Output (defaults to stdout)\00"
@str.26 = [48 x i8] c" -e [list seperated by ,] activated Extensions\00"
@str.27 = [19 x i8] c" -d Debugging Mode\00"
@str.28 = [22 x i8] c"Supported Extensions:\00"
@str.29 = [48 x i8] c" * Will enable all available extensions.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %3 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
store i32 0, i32* %6
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
store i32 0, i32* %7
%8 = icmp sgt i32 %0, 1
br i1 %8, label %9, label %45
9: ; preds = %2
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %9, %36
%12 = phi i64 [ 1, %9 ], [ %41, %36 ]
%13 = phi i8* [ null, %9 ], [ %40, %36 ]
%14 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %9 ], [ %39, %36 ]
%15 = phi i8* [ null, %9 ], [ %38, %36 ]
%16 = phi i32 [ 0, %9 ], [ %37, %36 ]
%17 = getelementptr inbounds i8*, i8** %1, i64 %12
%18 = load i8*, i8** %17
%19 = tail call i8* @strstr(i8* dereferenceable(1) %18, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i8* %19, null
br i1 %20, label %23, label %21
21: ; preds = %11
%22 = getelementptr inbounds i8, i8* %19, i64 2
br label %36
23: ; preds = %11
%24 = tail call i8* @strstr(i8* dereferenceable(1) %18, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i8* %24, null
br i1 %25, label %28, label %26
26: ; preds = %23
%27 = getelementptr inbounds i8, i8* %24, i64 2
br label %36
28: ; preds = %23
%29 = tail call i8* @strstr(i8* dereferenceable(1) %18, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%30 = icmp eq i8* %29, null
br i1 %30, label %33, label %31
31: ; preds = %28
%32 = getelementptr inbounds i8, i8* %29, i64 2
br label %36
33: ; preds = %28
%34 = tail call i8* @strstr(i8* dereferenceable(1) %18, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%35 = icmp eq i8* %34, null
br i1 %35, label %43, label %36
36: ; preds = %33, %31, %26, %21
%37 = phi i32 [ %16, %21 ], [ %16, %26 ], [ %16, %31 ], [ 1, %33 ]
%38 = phi i8* [ %15, %21 ], [ %27, %26 ], [ %15, %31 ], [ %15, %33 ]
%39 = phi i8* [ %14, %21 ], [ %14, %26 ], [ %32, %31 ], [ %14, %33 ]
%40 = phi i8* [ %22, %21 ], [ %13, %26 ], [ %13, %31 ], [ %13, %33 ]
%41 = add nuw nsw i64 %12, 1
%42 = icmp eq i64 %41, %10
br i1 %42, label %45, label %11
43: ; preds = %33
store i32 %16, i32* %5
%44 = icmp eq i8* %18, null
br i1 %44, label %47, label %58
45: ; preds = %36, %2
%46 = phi i32 [ 0, %2 ], [ %37, %36 ]
store i32 %46, i32* %5
br label %47
47: ; preds = %45, %43
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%49 = load i8*, i8** %1
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* %49)
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%52 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.25, i64 0, i64 0))
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.26, i64 0, i64 0))
%54 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.27, i64 0, i64 0))
%55 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.28, i64 0, i64 0))
%56 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.29, i64 0, i64 0))
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([170 x i8], [170 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
br label %107
58: ; preds = %43
%59 = tail call i32* @fopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
%60 = icmp eq i32* %59, null
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = load i32, i32* @stderr
%63 = tail call i32 @fprintf(i32 %62, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.18, i64 0, i64 0))
br label %107
64: ; preds = %58
%65 = load i32, i32* @SEEK_END
%66 = tail call i32 @fseek(i32* %59, i32 0, i32 %65)
%67 = tail call i64 @ftell(i32* %59)
%68 = load i32, i32* @SEEK_SET
%69 = tail call i32 @fseek(i32* %59, i32 0, i32 %68)
%70 = trunc i64 %67 to i32
%71 = tail call i64 @malloc(i32 %70)
%72 = inttoptr i64 %71 to i8*
%73 = icmp eq i64 %71, 0
br i1 %73, label %74, label %77
74: ; preds = %64
%75 = load i32, i32* @stderr
%76 = tail call i32 @fprintf(i32 %75, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.19, i64 0, i64 0))
br label %107
77: ; preds = %64
%78 = tail call i64 @fread(i8* %72, i32 1, i64 %67, i32* %59)
%79 = icmp eq i64 %78, %67
br i1 %79, label %83, label %80
80: ; preds = %77
%81 = load i32, i32* @stderr
%82 = tail call i32 @fprintf(i32 %81, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.20, i64 0, i64 0))
br label %107
83: ; preds = %77
%84 = tail call i32 @fclose(i32* %59)
%85 = icmp eq i8* %13, null
br i1 %85, label %88, label %86
86: ; preds = %83
%87 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0))
br label %90
88: ; preds = %83
%89 = load i32*, i32** @stdin
br label %90
90: ; preds = %88, %86
%91 = phi i32* [ %87, %86 ], [ %89, %88 ]
%92 = icmp eq i8* %15, null
br i1 %92, label %95, label %93
93: ; preds = %90
%94 = tail call i32* @fopen(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i64 0, i64 0))
br label %97
95: ; preds = %90
%96 = load i32*, i32** @stdout
br label %97
97: ; preds = %95, %93
%98 = phi i32* [ %94, %93 ], [ %96, %95 ]
%99 = tail call i8* @strtok(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%100 = icmp eq i8* %99, null
br i1 %100, label %104, label %101
101: ; preds = %97, %101
%102 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%103 = icmp eq i8* %102, null
br i1 %103, label %104, label %101
104: ; preds = %101, %97
%105 = call i32 @exec_bf(i8* %72, i64 %67, i32* %91, i32* %98, i32* %5)
%106 = call i32 @free(i8* %72)
br label %107
107: ; preds = %61, %104, %80, %74, %47
%108 = phi i32 [ 0, %47 ], [ 1, %61 ], [ 1, %74 ], [ 1, %80 ], [ %105, %104 ]
ret i32 %108
}