#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 BUFSIZ;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int rename(char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
char tolower(char);
int main(int argc, char **argv) {
  int n, i, len;
  int status, line;
  FILE *fpin, *fpout;
  char input_filename[BUFSIZ], output_filename[BUFSIZ];
  char buffer[BUFSIZ];
  if (argc < 2) {
    printf("Usage: fix [sourcefilenames]\n");
    return 1;
  }
  for (n = 1; n < argc; n++) {
    strcpy(output_filename, argv[n]);
    strcpy(input_filename, argv[n]);
    if ((fpin = fopen(input_filename, "r")) == NULL) {
      printf("Error opening input file %s\n", input_filename);
      printf("Continuing with next file\n");
      continue;
    }
    strcat(input_filename, ".orig");
    if (rename(output_filename, input_filename) == -1) {
      printf("Error renaming %s to %s\n", output_filename, input_filename);
      printf("Continuing with next file\n");
      continue;
    }
    if ((fpout = fopen(output_filename, "w")) == NULL) {
      printf("Error opening output file %s\n", output_filename);
      printf("Continuing with next file\n");
      continue;
    }
    status = 0;
    line = 1;
    ;
    while (fgets(buffer, BUFSIZ, fpin) != NULL) {
      ;
      len = strlen(buffer);
      if (buffer[len - 1] == '\n')
        len--;
      while (len && (buffer[len - 1] == 0x0D || buffer[len - 1] == 0x1A))
        len--;
      if (strncmp(buffer, "#include", 8) == 0) {
        ;
        for (i = 8; i < len && buffer[i] != '<' && buffer[i] != '\"'; i++) {
        }
        for (i++; i < len && buffer[i] != '>' && buffer[i] != '\"'; i++)
          if (buffer[i] == '\\')
            buffer[i] = '/';
          else
            buffer[i] = tolower(buffer[i]);
        if (i >= len) {
          fprintf(stderr, "File: %s, Malformed #include at line %d, aborting\n",
                  output_filename, line);
          exit(1);
        }
      }
      for (i = 0; i < len; i++) {
        switch (status) {
        case 0:
          switch (buffer[i]) {
          case '/':;
            status = 1;
            break;
          case '\"':
          case '\'': {
            int escapes = 0;
            while (i && buffer[i - 1] == '\\') {
              escapes++;
              i--;
            }
            i += escapes;
            if (escapes & 0x01)
              break;
            ;
            if (buffer[i] == '\"')
              status = 7;
            else
              status = 8;
            break;
          }
          }
          break;
        case 1:
          switch (buffer[i]) {
          case '*':;
            status = 2;
            break;
          case '/':;
            buffer[i] = '*';
            buffer[len] = ' ';
            buffer[len + 1] = '*';
            buffer[len + 2] = '/';
            len += 3;
            status = 4;
            break;
          default:
            status = 0;
            break;
          }
          break;
        case 2:
          if (buffer[i] == '*') {
            ;
            status = 3;
          }
          break;
        case 3:
          switch (buffer[i]) {
          case '/':
            if (i > 0) {
              ;
              status = 0;
            } else
              status = 2;
            break;
          case '*':;
            break;
          default:
            status = 2;
            break;
          }
          break;
        case 4:
          if (buffer[i] == '/') {
            ;
            status = 5;
          }
          if (buffer[i] == '*') {
            ;
            status = 6;
          }
          break;
        case 5:
          if (buffer[i] == '*') {
            ;
            buffer[i - 1] = ' ';
            buffer[i] = ' ';
            status = 4;
          } else if (buffer[i] != '/')
            status = 4;
          break;
        case 6:
          if (buffer[i] == '/' && i < (len - 1)) {
            ;
            buffer[i - 1] = ' ';
            buffer[i] = ' ';
            status = 4;
          } else if (buffer[i] == '/' && i == (len - 1)) {
            ;
            status = 0;
          } else if (buffer[i] != '*')
            status = 4;
          break;
        case 7:
        case 8:
          if ((status == 7 && buffer[i] == '\"') ||
              (status == 8 && buffer[i] == '\'')) {
            int escapes = 0;
            while (i && buffer[i - 1] == '\\') {
              escapes++;
              i--;
            }
            i += escapes;
            if (escapes & 0x01)
              break;
            ;
            status = 0;
          }
          break;
        }
      }
      buffer[len] = '\n';
      buffer[len + 1] = 0;
      fputs(buffer, fpout);
      line++;
    }
    if (status)
      printf("Warning, file ends abnormally: %s\n", output_filename);
    fclose(fpout);
    fclose(fpin);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2de8(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rdx
mov    %rdx,-0x40(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x80(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x48(%rbp)
mov    (%rax),%ecx
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x78(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x50(%rbp)
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x58(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    127c <main+0xac>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x5c(%rbp)
jmp    1ae8 <main+0x918>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1ada <main+0x90a>
mov    -0x78(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcpy@plt>
mov    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcpy@plt>
mov    -0x80(%rbp),%rdi
lea    0xd7e(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    12fc <main+0x12c>
mov    -0x80(%rbp),%rsi
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd71(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1acc <main+0x8fc>
mov    -0x80(%rbp),%rdi
lea    0xd75(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x78(%rbp),%rdi
mov    -0x80(%rbp),%rsi
call   10d0 <rename@plt>
cmp    $0xffffffff,%eax
jne    134b <main+0x17b>
mov    -0x80(%rbp),%rdx
mov    -0x78(%rbp),%rsi
lea    0xd51(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1acc <main+0x8fc>
mov    -0x78(%rbp),%rdi
lea    0xd45(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    138e <main+0x1be>
mov    -0x78(%rbp),%rsi
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xcdf(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1acc <main+0x8fc>
movl   $0x0,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x70(%rbp),%rdi
mov    0x2c31(%rip),%rax
mov    (%rax),%esi
mov    -0x30(%rbp),%rdx
call   1090 <fgets@plt>
cmp    $0x0,%rax
je     1a9e <main+0x8ce>
mov    -0x70(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x70(%rbp),%rax
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    13ed <main+0x21d>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    13f2 <main+0x222>
xor    %eax,%eax
cmpl   $0x0,-0x1c(%rbp)
mov    %al,-0x81(%rbp)
je     144f <main+0x27f>
mov    -0x70(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x82(%rbp)
je     1443 <main+0x273>
mov    -0x70(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x1a,%eax
sete   %al
mov    %al,-0x82(%rbp)
mov    -0x82(%rbp),%al
mov    %al,-0x81(%rbp)
mov    -0x81(%rbp),%al
test   $0x1,%al
jne    1462 <main+0x292>
jmp    1470 <main+0x2a0>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    13f2 <main+0x222>
mov    -0x70(%rbp),%rdi
lea    0xc40(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    15f8 <main+0x428>
movl   $0x8,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
cmp    -0x1c(%rbp),%ecx
mov    %al,-0x83(%rbp)
jge    14df <main+0x30f>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x3c,%ecx
mov    %al,-0x83(%rbp)
je     14df <main+0x30f>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
setne  %al
mov    %al,-0x83(%rbp)
mov    -0x83(%rbp),%al
test   $0x1,%al
jne    14f2 <main+0x322>
jmp    1505 <main+0x335>
jmp    14f7 <main+0x327>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1496 <main+0x2c6>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
cmp    -0x1c(%rbp),%ecx
mov    %al,-0x84(%rbp)
jge    1557 <main+0x387>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x3e,%ecx
mov    %al,-0x84(%rbp)
je     1557 <main+0x387>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
setne  %al
mov    %al,-0x84(%rbp)
mov    -0x84(%rbp),%al
test   $0x1,%al
jne    156a <main+0x39a>
jmp    15c1 <main+0x3f1>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    1590 <main+0x3c0>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x2f,(%rax,%rcx,1)
jmp    15ae <main+0x3de>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   10b0 <tolower@plt>
mov    %al,%dl
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    15b3 <main+0x3e3>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    150e <main+0x33e>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jl     15f3 <main+0x423>
mov    -0x78(%rbp),%rdx
mov    0x2a08(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%ecx
lea    0xae0(%rip),%rsi
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
jmp    15f8 <main+0x428>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1a6f <main+0x89f>
mov    -0x20(%rbp),%eax
mov    %rax,-0x90(%rbp)
sub    $0x8,%rax
ja     1a5c <main+0x88c>
mov    -0x90(%rbp),%rax
lea    0x9d3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x94(%rbp)
sub    $0x22,%eax
je     168a <main+0x4ba>
jmp    1656 <main+0x486>
mov    -0x94(%rbp),%eax
sub    $0x27,%eax
je     168a <main+0x4ba>
jmp    166a <main+0x49a>
mov    -0x94(%rbp),%eax
sub    $0x2f,%eax
jne    1734 <main+0x564>
jmp    167e <main+0x4ae>
movl   $0x1,-0x20(%rbp)
jmp    1734 <main+0x564>
movl   $0x0,-0x60(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x95(%rbp)
je     16c0 <main+0x4f0>
mov    -0x70(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
sete   %al
mov    %al,-0x95(%rbp)
mov    -0x95(%rbp),%al
test   $0x1,%al
jne    16d3 <main+0x503>
jmp    16ea <main+0x51a>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1691 <main+0x4c1>
mov    -0x60(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x60(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1707 <main+0x537>
jmp    1734 <main+0x564>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
jne    1728 <main+0x558>
movl   $0x7,-0x20(%rbp)
jmp    172f <main+0x55f>
movl   $0x8,-0x20(%rbp)
jmp    1734 <main+0x564>
jmp    1a5c <main+0x88c>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x9c(%rbp)
sub    $0x2a,%eax
je     176d <main+0x59d>
jmp    1759 <main+0x589>
mov    -0x9c(%rbp),%eax
sub    $0x2f,%eax
je     1779 <main+0x5a9>
jmp    17bc <main+0x5ec>
movl   $0x2,-0x20(%rbp)
jmp    17c3 <main+0x5f3>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x2a,(%rax,%rcx,1)
movslq -0x1c(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x2a,(%rax,%rcx,1)
mov    -0x1c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movb   $0x2f,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x4,-0x20(%rbp)
jmp    17c3 <main+0x5f3>
movl   $0x0,-0x20(%rbp)
jmp    1a5c <main+0x88c>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    17e4 <main+0x614>
movl   $0x3,-0x20(%rbp)
jmp    1a5c <main+0x88c>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0xa0(%rbp)
sub    $0x2a,%eax
je     183f <main+0x66f>
jmp    1809 <main+0x639>
mov    -0xa0(%rbp),%eax
sub    $0x2f,%eax
jne    1844 <main+0x674>
jmp    181d <main+0x64d>
cmpl   $0x0,-0x18(%rbp)
jle    1833 <main+0x663>
movl   $0x0,-0x20(%rbp)
jmp    183a <main+0x66a>
movl   $0x2,-0x20(%rbp)
jmp    184b <main+0x67b>
jmp    184b <main+0x67b>
movl   $0x2,-0x20(%rbp)
jmp    1a5c <main+0x88c>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    186c <main+0x69c>
movl   $0x5,-0x20(%rbp)
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    1888 <main+0x6b8>
movl   $0x6,-0x20(%rbp)
jmp    1a5c <main+0x88c>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    18c7 <main+0x6f7>
mov    -0x70(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x20,(%rax,%rcx,1)
movslq -0x18(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
movl   $0x4,-0x20(%rbp)
jmp    18e8 <main+0x718>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     18e3 <main+0x713>
movl   $0x4,-0x20(%rbp)
jmp    18e8 <main+0x718>
jmp    1a5c <main+0x88c>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1938 <main+0x768>
mov    -0x18(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1938 <main+0x768>
mov    -0x70(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x20,(%rax,%rcx,1)
movslq -0x18(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
movl   $0x4,-0x20(%rbp)
jmp    1990 <main+0x7c0>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    196a <main+0x79a>
mov    -0x18(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    196a <main+0x79a>
movl   $0x0,-0x20(%rbp)
jmp    198b <main+0x7bb>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
je     1986 <main+0x7b6>
movl   $0x4,-0x20(%rbp)
jmp    198b <main+0x7bb>
jmp    1990 <main+0x7c0>
jmp    1a5c <main+0x88c>
cmpl   $0x7,-0x20(%rbp)
jne    19b4 <main+0x7e4>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
je     19d3 <main+0x803>
cmpl   $0x8,-0x20(%rbp)
jne    1a57 <main+0x887>
mov    -0x70(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x27,%eax
jne    1a57 <main+0x887>
movl   $0x0,-0x64(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0xa1(%rbp)
je     1a09 <main+0x839>
mov    -0x70(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
sete   %al
mov    %al,-0xa1(%rbp)
mov    -0xa1(%rbp),%al
test   $0x1,%al
jne    1a1c <main+0x84c>
jmp    1a33 <main+0x863>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    19da <main+0x80a>
mov    -0x64(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x64(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1a50 <main+0x880>
jmp    1a5c <main+0x88c>
movl   $0x0,-0x20(%rbp)
jmp    1a5c <main+0x88c>
jmp    1a61 <main+0x891>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    15ff <main+0x42f>
mov    -0x70(%rbp),%rdi
movslq -0x1c(%rbp),%rax
movb   $0xa,(%rdi,%rax,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x0,(%rdi,%rax,1)
mov    -0x38(%rbp),%rsi
call   1080 <fputs@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    139c <main+0x1cc>
cmpl   $0x0,-0x20(%rbp)
je     1aba <main+0x8ea>
mov    -0x78(%rbp),%rsi
lea    0x644(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x30(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1283 <main+0xb3>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x5c(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    0x2de0(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r13
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    %rsp,%r15
sub    %rax,%r15
mov    %r15,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,%rsp
cmp    $0x2,%edi
jge    1238 <main+0x58>
lea    0xed2(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%eax
jmp    17b5 <main+0x5d5>
mov    %rsi,%r14
mov    %edi,%r12d
mov    %rcx,-0x30(%rbp)
lea    -0x1(%rcx),%rax
mov    %rax,-0x40(%rbp)
mov    $0x1,%ebx
mov    %rsi,-0x70(%rbp)
mov    %r15,-0x50(%rbp)
mov    %r13,-0x68(%rbp)
mov    %r12,-0x60(%rbp)
jmp    129d <main+0xbd>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xdd2(%rip),%rdi
mov    %r15,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe56(%rip),%rdi
call   1050 <puts@plt>
add    $0x1,%rbx
cmp    %r12,%rbx
je     17b3 <main+0x5d3>
mov    (%r14,%rbx,8),%rsi
mov    %r15,%rdi
call   1040 <strcpy@plt>
mov    (%r14,%rbx,8),%rsi
mov    %r13,%rdi
call   1040 <strcpy@plt>
mov    %r13,%rdi
lea    0xd65(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x48(%rbp)
test   %rax,%rax
je     1750 <main+0x570>
mov    %r13,%rdi
lea    0xd68(%rip),%rsi
call   10f0 <strcat@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   10e0 <rename@plt>
cmp    $0xffffffff,%eax
je     1270 <main+0x90>
mov    %r15,%rdi
lea    0xd68(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x58(%rbp)
test   %rax,%rax
je     179d <main+0x5bd>
mov    0x2cc5(%rip),%rax
mov    (%rax),%esi
mov    -0x30(%rbp),%rdi
mov    -0x48(%rbp),%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     1786 <main+0x5a6>
mov    %rbx,-0x78(%rbp)
mov    $0x1,%ebx
xor    %r12d,%r12d
mov    -0x30(%rbp),%r14
mov    -0x40(%rbp),%r15
jmp    1392 <main+0x1b2>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0x30(%rbp),%r14
mov    -0x40(%rbp),%r15
movslq %r13d,%rax
movw   $0xa,(%r14,%rax,1)
mov    %r14,%rdi
mov    -0x58(%rbp),%rsi
call   1090 <fputs@plt>
mov    -0x34(%rbp),%ebx
add    $0x1,%ebx
mov    0x2c5d(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
mov    -0x48(%rbp),%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     175c <main+0x57c>
mov    %ebx,-0x34(%rbp)
mov    %r14,%rdi
call   1070 <strlen@plt>
cltq
lea    -0x1(%rax),%rcx
cmpb   $0xa,-0x1(%r14,%rax,1)
cmove  %ecx,%eax
mov    $0x0,%r13d
test   %eax,%eax
je     13e3 <main+0x203>
movslq %eax,%rcx
add    %r15,%rcx
jmp    13c9 <main+0x1e9>
xchg   %ax,%ax
add    $0xffffffffffffffff,%rcx
add    $0xffffffff,%eax
je     13e0 <main+0x200>
movzbl (%rcx),%edx
cmp    $0x1a,%dl
je     13c0 <main+0x1e0>
cmp    $0xd,%dl
je     13c0 <main+0x1e0>
mov    %eax,%r13d
jmp    13e3 <main+0x203>
nopl   0x0(%rax,%rax,1)
xor    %r13d,%r13d
mov    %r14,%rdi
lea    0xc95(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
lea    0xbff(%rip),%r8
je     16a0 <main+0x4c0>
test   %r13d,%r13d
jle    1350 <main+0x170>
xor    %eax,%eax
mov    -0x30(%rbp),%r14
mov    -0x40(%rbp),%r15
jmp    144c <main+0x26c>
movslq %eax,%rcx
mov    (%r14,%rcx,1),%cl
xor    %r12d,%r12d
cmp    $0x2f,%cl
sete   %r12b
or     $0x4,%r12d
cmp    $0x2a,%cl
mov    $0x6,%ecx
cmove  %ecx,%r12d
nopl   (%rax)
add    $0x1,%eax
cmp    %r13d,%eax
jge    1358 <main+0x178>
cmp    $0x8,%r12d
ja     1440 <main+0x260>
mov    %eax,%ecx
mov    %r12d,%edx
movslq (%r8,%rdx,4),%rdx
add    %r8,%rdx
jmp    *%rdx
movslq %eax,%rdx
movsbl (%r14,%rdx,1),%esi
cmp    $0x22,%esi
je     15c6 <main+0x3e6>
cmp    $0x27,%esi
je     15c6 <main+0x3e6>
xor    %r12d,%r12d
cmp    $0x2f,%esi
jne    1440 <main+0x260>
mov    $0x1,%r12d
jmp    1440 <main+0x260>
movslq %eax,%rcx
movsbl (%r14,%rcx,1),%edx
cmp    $0x2a,%edx
je     15bb <main+0x3db>
cmp    $0x2f,%edx
jne    162a <main+0x44a>
movb   $0x2a,(%r14,%rcx,1)
movslq %r13d,%rcx
movw   $0x2a20,(%r14,%rcx,1)
movb   $0x2f,0x2(%r14,%rcx,1)
add    $0x3,%r13d
mov    $0x4,%r12d
jmp    1440 <main+0x260>
movslq %eax,%rcx
xor    %r12d,%r12d
cmpb   $0x2a,(%r14,%rcx,1)
sete   %r12b
or     $0x2,%r12d
jmp    1440 <main+0x260>
movslq %eax,%rcx
movsbl (%r14,%rcx,1),%ecx
cmp    $0x2a,%ecx
je     1632 <main+0x452>
cmp    $0x2f,%ecx
jne    15bb <main+0x3db>
xor    %r12d,%r12d
test   %eax,%eax
setle  %r12b
add    %r12d,%r12d
jmp    1440 <main+0x260>
movslq %eax,%rcx
mov    (%r14,%rcx,1),%dl
cmp    $0x2f,%dl
je     163d <main+0x45d>
cmp    $0x2a,%dl
jne    152b <main+0x34b>
movb   $0x20,-0x1(%rcx,%r14,1)
movb   $0x20,(%r14,%rcx,1)
mov    $0x4,%r12d
jmp    1440 <main+0x260>
movslq %eax,%rsi
mov    (%r14,%rsi,1),%cl
lea    -0x1(%r13),%edx
cmp    $0x2f,%cl
jne    15f6 <main+0x416>
cmp    %edx,%eax
jge    15f6 <main+0x416>
movb   $0x20,-0x1(%rsi,%r14,1)
movb   $0x20,(%r14,%rsi,1)
mov    $0x4,%r12d
jmp    1440 <main+0x260>
movslq %eax,%rdx
cmpb   $0x22,(%r14,%rdx,1)
je     158b <main+0x3ab>
mov    $0x7,%r12d
jmp    1440 <main+0x260>
movslq %eax,%rdx
cmpb   $0x27,(%r14,%rdx,1)
jne    161b <main+0x43b>
xor    %edx,%edx
test   %eax,%eax
je     1626 <main+0x446>
movslq %eax,%rdi
add    %r15,%rdi
xor    %esi,%esi
nopl   (%rax)
cmpb   $0x5c,(%rdi,%rsi,1)
jne    1648 <main+0x468>
add    $0xffffffffffffffff,%rsi
mov    %esi,%ebx
add    %ecx,%ebx
jne    15a0 <main+0x3c0>
mov    %ecx,%esi
jmp    164e <main+0x46e>
mov    $0x2,%r12d
jmp    1440 <main+0x260>
test   %eax,%eax
je     165f <main+0x47f>
add    %r15,%rdx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x5c,(%rdx,%rsi,1)
jne    1663 <main+0x483>
add    $0xffffffffffffffff,%rsi
mov    %esi,%edi
add    %ecx,%edi
jne    15e0 <main+0x400>
xor    %eax,%eax
mov    %ecx,%esi
jmp    1667 <main+0x487>
cmp    $0x2f,%cl
jne    1606 <main+0x426>
xor    %r12d,%r12d
cmp    %edx,%eax
je     1440 <main+0x260>
xor    %edx,%edx
cmp    $0x2a,%cl
sete   %dl
lea    (%rdx,%rdx,1),%r12d
add    $0x4,%r12d
jmp    1440 <main+0x260>
mov    $0x8,%r12d
jmp    1440 <main+0x260>
xor    %esi,%esi
jmp    164e <main+0x46e>
xor    %r12d,%r12d
jmp    1440 <main+0x260>
mov    $0x3,%r12d
jmp    1440 <main+0x260>
mov    $0x5,%r12d
jmp    1440 <main+0x260>
add    %esi,%eax
neg    %esi
mov    %eax,%edx
add    %esi,%edx
and    $0x1,%esi
neg    %esi
and    %esi,%r12d
mov    %edx,%eax
jmp    1440 <main+0x260>
xor    %eax,%eax
jmp    1676 <main+0x496>
add    %esi,%eax
neg    %esi
add    %esi,%eax
xor    %r12d,%r12d
test   $0x1,%sil
jne    1440 <main+0x260>
movslq %eax,%rcx
xor    %edx,%edx
cmpb   $0x22,(%r14,%rcx,1)
sete   %dl
mov    $0x8,%r12d
sub    %edx,%r12d
jmp    1440 <main+0x260>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x8,%r15d
cmp    $0x9,%r13d
jl     16e0 <main+0x500>
mov    %r13d,%eax
mov    $0x8,%r15d
mov    -0x30(%rbp),%rdx
nopl   0x0(%rax)
movzbl (%rdx,%r15,1),%ecx
cmp    $0x22,%cl
je     16e0 <main+0x500>
cmp    $0x3c,%cl
je     16e0 <main+0x500>
add    $0x1,%r15
cmp    %r15,%rax
jne    16c0 <main+0x4e0>
mov    %eax,%r15d
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15d
cmp    %r13d,%r15d
jge    17c4 <main+0x5e4>
mov    %r15d,%r14d
add    -0x30(%rbp),%r14
jmp    1714 <main+0x534>
cs nopw 0x0(%rax,%rax,1)
mov    %al,(%r14)
add    $0x1,%r14
add    $0x1,%r15d
cmp    %r15d,%r13d
jle    17c4 <main+0x5e4>
movzbl (%r14),%ecx
mov    $0x2f,%al
cmp    $0x5c,%cl
je     1700 <main+0x520>
cmp    $0x22,%cl
je     1407 <main+0x227>
cmp    $0x3e,%cl
je     1407 <main+0x227>
movsbl %cl,%edi
call   10c0 <tolower@plt>
lea    0x8c0(%rip),%r8
jmp    1700 <main+0x520>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x8cf(%rip),%rdi
mov    %r13,%rsi
jmp    17a7 <main+0x5c7>
test   %r12d,%r12d
mov    -0x70(%rbp),%r14
mov    -0x50(%rbp),%r15
mov    -0x68(%rbp),%r13
mov    -0x60(%rbp),%r12
mov    -0x78(%rbp),%rbx
je     1786 <main+0x5a6>
lea    0x942(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    -0x58(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1060 <fclose@plt>
jmp    1290 <main+0xb0>
lea    0x8c0(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    1284 <main+0xa4>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2815(%rip),%rax
mov    (%rax),%edi
lea    0x8b7(%rip),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x34(%rbp),%ecx
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
@BUFSIZ = global i32 0
@.str = [30 x i8] c"Usage: fix [sourcefilenames]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [29 x i8] c"Error opening input file %s\0A\00"
@.str.3 = [27 x i8] c"Continuing with next file\0A\00"
@.str.4 = [6 x i8] c".orig\00"
@.str.5 = [25 x i8] c"Error renaming %s to %s\0A\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [30 x i8] c"Error opening output file %s\0A\00"
@.str.8 = [9 x i8] c"#include\00"
@stderr = global i32 0
@.str.9 = [51 x i8] c"File: %s, Malformed #include at line %d, aborting\0A\00"
@.str.10 = [35 x i8] c"Warning, file ends abnormally: %s\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 i8*
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = load i32, i32* @BUFSIZ
%21 = zext i32 %20 to i64
%22 = call i8* @llvm.stacksave()
store i8* %22, i8** %13
%23 = alloca i8, i64 %21
store i64 %21, i64* %14
%24 = load i32, i32* @BUFSIZ
%25 = zext i32 %24 to i64
%26 = alloca i8, i64 %25
store i64 %25, i64* %15
%27 = load i32, i32* @BUFSIZ
%28 = zext i32 %27 to i64
%29 = alloca i8, i64 %28
store i64 %28, i64* %16
%30 = load i32, i32* %4
%31 = icmp slt i32 %30, 2
br i1 %31, label %32, label %34
32: ; preds = %2
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
store i32 1, i32* %17
br label %467
34: ; preds = %2
store i32 1, i32* %6
br label %35
35: ; preds = %463, %34
%36 = load i32, i32* %6
%37 = load i32, i32* %4
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %466
39: ; preds = %35
%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 = call i32 @strcpy(i8* %26, i8* %44)
%46 = load i8**, i8*** %5
%47 = load i32, i32* %6
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8*, i8** %46, i64 %48
%50 = load i8*, i8** %49
%51 = call i32 @strcpy(i8* %23, i8* %50)
%52 = call i32* @fopen(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %52, i32** %11
%53 = icmp eq i32* %52, null
br i1 %53, label %54, label %57
54: ; preds = %39
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
br label %463
57: ; preds = %39
%58 = call i32 @strcat(i8* %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%59 = call i32 @rename(i8* %26, i8* %23)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %64
61: ; preds = %57
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %26, i8* %23)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
br label %463
64: ; preds = %57
%65 = call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %65, i32** %12
%66 = icmp eq i32* %65, null
br i1 %66, label %67, label %70
67: ; preds = %64
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i8* %26)
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
br label %463
70: ; preds = %64
store i32 0, i32* %9
store i32 1, i32* %10
br label %71
71: ; preds = %441, %70
%72 = load i32, i32* @BUFSIZ
%73 = load i32*, i32** %11
%74 = call i32* @fgets(i8* %29, i32 %72, i32* %73)
%75 = icmp ne i32* %74, null
br i1 %75, label %76, label %453
76: ; preds = %71
%77 = call i32 @strlen(i8* %29)
store i32 %77, i32* %8
%78 = load i32, i32* %8
%79 = sub nsw i32 %78, 1
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i8, i8* %29, i64 %80
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 10
br i1 %84, label %85, label %88
85: ; preds = %76
%86 = load i32, i32* %8
%87 = add nsw i32 %86, -1
store i32 %87, i32* %8
br label %88
88: ; preds = %85, %76
br label %89
89: ; preds = %112, %88
%90 = load i32, i32* %8
%91 = icmp ne i32 %90, 0
br i1 %91, label %92, label %110
92: ; preds = %89
%93 = load i32, i32* %8
%94 = sub nsw i32 %93, 1
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8, i8* %29, i64 %95
%97 = load i8, i8* %96
%98 = sext i8 %97 to i32
%99 = icmp eq i32 %98, 13
br i1 %99, label %108, label %100
100: ; preds = %92
%101 = load i32, i32* %8
%102 = sub nsw i32 %101, 1
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8, i8* %29, i64 %103
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = icmp eq i32 %106, 26
br label %108
108: ; preds = %100, %92
%109 = phi i1 [ true, %92 ], [ %107, %100 ]
br label %110
110: ; preds = %108, %89
%111 = phi i1 [ false, %89 ], [ %109, %108 ]
br i1 %111, label %112, label %115
112: ; preds = %110
%113 = load i32, i32* %8
%114 = add nsw i32 %113, -1
store i32 %114, i32* %8
br label %89
115: ; preds = %110
%116 = call i64 @strncmp(i8* %29, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 8)
%117 = icmp eq i64 %116, 0
br i1 %117, label %118, label %200
118: ; preds = %115
store i32 8, i32* %7
br label %119
119: ; preds = %140, %118
%120 = load i32, i32* %7
%121 = load i32, i32* %8
%122 = icmp slt i32 %120, %121
br i1 %122, label %123, label %137
123: ; preds = %119
%124 = load i32, i32* %7
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds i8, i8* %29, i64 %125
%127 = load i8, i8* %126
%128 = sext i8 %127 to i32
%129 = icmp ne i32 %128, 60
br i1 %129, label %130, label %137
130: ; preds = %123
%131 = load i32, i32* %7
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i8, i8* %29, i64 %132
%134 = load i8, i8* %133
%135 = sext i8 %134 to i32
%136 = icmp ne i32 %135, 34
br label %137
137: ; preds = %130, %123, %119
%138 = phi i1 [ false, %123 ], [ false, %119 ], [ %136, %130 ]
br i1 %138, label %139, label %143
139: ; preds = %137
br label %140
140: ; preds = %139
%141 = load i32, i32* %7
%142 = add nsw i32 %141, 1
store i32 %142, i32* %7
br label %119
143: ; preds = %137
%144 = load i32, i32* %7
%145 = add nsw i32 %144, 1
store i32 %145, i32* %7
br label %146
146: ; preds = %187, %143
%147 = load i32, i32* %7
%148 = load i32, i32* %8
%149 = icmp slt i32 %147, %148
br i1 %149, label %150, label %164
150: ; preds = %146
%151 = load i32, i32* %7
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds i8, i8* %29, i64 %152
%154 = load i8, i8* %153
%155 = sext i8 %154 to i32
%156 = icmp ne i32 %155, 62
br i1 %156, label %157, label %164
157: ; preds = %150
%158 = load i32, i32* %7
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds i8, i8* %29, i64 %159
%161 = load i8, i8* %160
%162 = sext i8 %161 to i32
%163 = icmp ne i32 %162, 34
br label %164
164: ; preds = %157, %150, %146
%165 = phi i1 [ false, %150 ], [ false, %146 ], [ %163, %157 ]
br i1 %165, label %166, label %190
166: ; preds = %164
%167 = load i32, i32* %7
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds i8, i8* %29, i64 %168
%170 = load i8, i8* %169
%171 = sext i8 %170 to i32
%172 = icmp eq i32 %171, 92
br i1 %172, label %173, label %177
173: ; preds = %166
%174 = load i32, i32* %7
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds i8, i8* %29, i64 %175
store i8 47, i8* %176
br label %186
177: ; preds = %166
%178 = load i32, i32* %7
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds i8, i8* %29, i64 %179
%181 = load i8, i8* %180
%182 = call signext i8 @tolower(i8 signext %181)
%183 = load i32, i32* %7
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds i8, i8* %29, i64 %184
store i8 %182, i8* %185
br label %186
186: ; preds = %177, %173
br label %187
187: ; preds = %186
%188 = load i32, i32* %7
%189 = add nsw i32 %188, 1
store i32 %189, i32* %7
br label %146
190: ; preds = %164
%191 = load i32, i32* %7
%192 = load i32, i32* %8
%193 = icmp sge i32 %191, %192
br i1 %193, label %194, label %199
194: ; preds = %190
%195 = load i32, i32* @stderr
%196 = load i32, i32* %10
%197 = call i32 @fprintf(i32 %195, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0), i8* %26, i32 %196)
%198 = call i32 @exit(i32 1)
unreachable
199: ; preds = %190
br label %200
200: ; preds = %199, %115
store i32 0, i32* %7
br label %201
201: ; preds = %438, %200
%202 = load i32, i32* %7
%203 = load i32, i32* %8
%204 = icmp slt i32 %202, %203
br i1 %204, label %205, label %441
205: ; preds = %201
%206 = load i32, i32* %9
switch i32 %206, label %437 [
i32 0, label %207
i32 1, label %252
i32 2, label %278
i32 3, label %287
i32 4, label %302
i32 5, label %319
i32 6, label %344
i32 7, label %388
i32 8, label %388
]
207: ; preds = %205
%208 = load i32, i32* %7
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds i8, i8* %29, i64 %209
%211 = load i8, i8* %210
%212 = sext i8 %211 to i32
switch i32 %212, label %251 [
i32 47, label %213
i32 34, label %214
i32 39, label %214
]
213: ; preds = %207
store i32 1, i32* %9
br label %251
214: ; preds = %207, %207
store i32 0, i32* %18
br label %215
215: ; preds = %228, %214
%216 = load i32, i32* %7
%217 = icmp ne i32 %216, 0
br i1 %217, label %218, label %226
218: ; preds = %215
%219 = load i32, i32* %7
%220 = sub nsw i32 %219, 1
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds i8, i8* %29, i64 %221
%223 = load i8, i8* %222
%224 = sext i8 %223 to i32
%225 = icmp eq i32 %224, 92
br label %226
226: ; preds = %218, %215
%227 = phi i1 [ false, %215 ], [ %225, %218 ]
br i1 %227, label %228, label %233
228: ; preds = %226
%229 = load i32, i32* %18
%230 = add nsw i32 %229, 1
store i32 %230, i32* %18
%231 = load i32, i32* %7
%232 = add nsw i32 %231, -1
store i32 %232, i32* %7
br label %215
233: ; preds = %226
%234 = load i32, i32* %18
%235 = load i32, i32* %7
%236 = add nsw i32 %235, %234
store i32 %236, i32* %7
%237 = load i32, i32* %18
%238 = and i32 %237, 1
%239 = icmp ne i32 %238, 0
br i1 %239, label %240, label %241
240: ; preds = %233
br label %251
241: ; preds = %233
%242 = load i32, i32* %7
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds i8, i8* %29, i64 %243
%245 = load i8, i8* %244
%246 = sext i8 %245 to i32
%247 = icmp eq i32 %246, 34
br i1 %247, label %248, label %249
248: ; preds = %241
store i32 7, i32* %9
br label %250
249: ; preds = %241
store i32 8, i32* %9
br label %250
250: ; preds = %249, %248
br label %251
251: ; preds = %207, %250, %240, %213
br label %437
252: ; preds = %205
%253 = load i32, i32* %7
%254 = sext i32 %253 to i64
%255 = getelementptr inbounds i8, i8* %29, i64 %254
%256 = load i8, i8* %255
%257 = sext i8 %256 to i32
switch i32 %257, label %276 [
i32 42, label %258
i32 47, label %259
]
258: ; preds = %252
store i32 2, i32* %9
br label %277
259: ; preds = %252
%260 = load i32, i32* %7
%261 = sext i32 %260 to i64
%262 = getelementptr inbounds i8, i8* %29, i64 %261
store i8 42, i8* %262
%263 = load i32, i32* %8
%264 = sext i32 %263 to i64
%265 = getelementptr inbounds i8, i8* %29, i64 %264
store i8 32, i8* %265
%266 = load i32, i32* %8
%267 = add nsw i32 %266, 1
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds i8, i8* %29, i64 %268
store i8 42, i8* %269
%270 = load i32, i32* %8
%271 = add nsw i32 %270, 2
%272 = sext i32 %271 to i64
%273 = getelementptr inbounds i8, i8* %29, i64 %272
store i8 47, i8* %273
%274 = load i32, i32* %8
%275 = add nsw i32 %274, 3
store i32 %275, i32* %8
store i32 4, i32* %9
br label %277
276: ; preds = %252
store i32 0, i32* %9
br label %277
277: ; preds = %276, %259, %258
br label %437
278: ; preds = %205
%279 = load i32, i32* %7
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds i8, i8* %29, i64 %280
%282 = load i8, i8* %281
%283 = sext i8 %282 to i32
%284 = icmp eq i32 %283, 42
br i1 %284, label %285, label %286
285: ; preds = %278
store i32 3, i32* %9
br label %286
286: ; preds = %285, %278
br label %437
287: ; preds = %205
%288 = load i32, i32* %7
%289 = sext i32 %288 to i64
%290 = getelementptr inbounds i8, i8* %29, i64 %289
%291 = load i8, i8* %290
%292 = sext i8 %291 to i32
switch i32 %292, label %300 [
i32 47, label %293
i32 42, label %299
]
293: ; preds = %287
%294 = load i32, i32* %7
%295 = icmp sgt i32 %294, 0
br i1 %295, label %296, label %297
296: ; preds = %293
store i32 0, i32* %9
br label %298
297: ; preds = %293
store i32 2, i32* %9
br label %298
298: ; preds = %297, %296
br label %301
299: ; preds = %287
br label %301
300: ; preds = %287
store i32 2, i32* %9
br label %301
301: ; preds = %300, %299, %298
br label %437
302: ; preds = %205
%303 = load i32, i32* %7
%304 = sext i32 %303 to i64
%305 = getelementptr inbounds i8, i8* %29, i64 %304
%306 = load i8, i8* %305
%307 = sext i8 %306 to i32
%308 = icmp eq i32 %307, 47
br i1 %308, label %309, label %310
309: ; preds = %302
store i32 5, i32* %9
br label %310
310: ; preds = %309, %302
%311 = load i32, i32* %7
%312 = sext i32 %311 to i64
%313 = getelementptr inbounds i8, i8* %29, i64 %312
%314 = load i8, i8* %313
%315 = sext i8 %314 to i32
%316 = icmp eq i32 %315, 42
br i1 %316, label %317, label %318
317: ; preds = %310
store i32 6, i32* %9
br label %318
318: ; preds = %317, %310
br label %437
319: ; preds = %205
%320 = load i32, i32* %7
%321 = sext i32 %320 to i64
%322 = getelementptr inbounds i8, i8* %29, i64 %321
%323 = load i8, i8* %322
%324 = sext i8 %323 to i32
%325 = icmp eq i32 %324, 42
br i1 %325, label %326, label %334
326: ; preds = %319
%327 = load i32, i32* %7
%328 = sub nsw i32 %327, 1
%329 = sext i32 %328 to i64
%330 = getelementptr inbounds i8, i8* %29, i64 %329
store i8 32, i8* %330
%331 = load i32, i32* %7
%332 = sext i32 %331 to i64
%333 = getelementptr inbounds i8, i8* %29, i64 %332
store i8 32, i8* %333
store i32 4, i32* %9
br label %343
334: ; preds = %319
%335 = load i32, i32* %7
%336 = sext i32 %335 to i64
%337 = getelementptr inbounds i8, i8* %29, i64 %336
%338 = load i8, i8* %337
%339 = sext i8 %338 to i32
%340 = icmp ne i32 %339, 47
br i1 %340, label %341, label %342
341: ; preds = %334
store i32 4, i32* %9
br label %342
342: ; preds = %341, %334
br label %343
343: ; preds = %342, %326
br label %437
344: ; preds = %205
%345 = load i32, i32* %7
%346 = sext i32 %345 to i64
%347 = getelementptr inbounds i8, i8* %29, i64 %346
%348 = load i8, i8* %347
%349 = sext i8 %348 to i32
%350 = icmp eq i32 %349, 47
br i1 %350, label %351, label %364
351: ; preds = %344
%352 = load i32, i32* %7
%353 = load i32, i32* %8
%354 = sub nsw i32 %353, 1
%355 = icmp slt i32 %352, %354
br i1 %355, label %356, label %364
356: ; preds = %351
%357 = load i32, i32* %7
%358 = sub nsw i32 %357, 1
%359 = sext i32 %358 to i64
%360 = getelementptr inbounds i8, i8* %29, i64 %359
store i8 32, i8* %360
%361 = load i32, i32* %7
%362 = sext i32 %361 to i64
%363 = getelementptr inbounds i8, i8* %29, i64 %362
store i8 32, i8* %363
store i32 4, i32* %9
br label %387
364: ; preds = %351, %344
%365 = load i32, i32* %7
%366 = sext i32 %365 to i64
%367 = getelementptr inbounds i8, i8* %29, i64 %366
%368 = load i8, i8* %367
%369 = sext i8 %368 to i32
%370 = icmp eq i32 %369, 47
br i1 %370, label %371, label %377
371: ; preds = %364
%372 = load i32, i32* %7
%373 = load i32, i32* %8
%374 = sub nsw i32 %373, 1
%375 = icmp eq i32 %372, %374
br i1 %375, label %376, label %377
376: ; preds = %371
store i32 0, i32* %9
br label %386
377: ; preds = %371, %364
%378 = load i32, i32* %7
%379 = sext i32 %378 to i64
%380 = getelementptr inbounds i8, i8* %29, i64 %379
%381 = load i8, i8* %380
%382 = sext i8 %381 to i32
%383 = icmp ne i32 %382, 42
br i1 %383, label %384, label %385
384: ; preds = %377
store i32 4, i32* %9
br label %385
385: ; preds = %384, %377
br label %386
386: ; preds = %385, %376
br label %387
387: ; preds = %386, %356
br label %437
388: ; preds = %205, %205
%389 = load i32, i32* %9
%390 = icmp eq i32 %389, 7
br i1 %390, label %391, label %398
391: ; preds = %388
%392 = load i32, i32* %7
%393 = sext i32 %392 to i64
%394 = getelementptr inbounds i8, i8* %29, i64 %393
%395 = load i8, i8* %394
%396 = sext i8 %395 to i32
%397 = icmp eq i32 %396, 34
br i1 %397, label %408, label %398
398: ; preds = %391, %388
%399 = load i32, i32* %9
%400 = icmp eq i32 %399, 8
br i1 %400, label %401, label %436
401: ; preds = %398
%402 = load i32, i32* %7
%403 = sext i32 %402 to i64
%404 = getelementptr inbounds i8, i8* %29, i64 %403
%405 = load i8, i8* %404
%406 = sext i8 %405 to i32
%407 = icmp eq i32 %406, 39
br i1 %407, label %408, label %436
408: ; preds = %401, %391
store i32 0, i32* %19
br label %409
409: ; preds = %422, %408
%410 = load i32, i32* %7
%411 = icmp ne i32 %410, 0
br i1 %411, label %412, label %420
412: ; preds = %409
%413 = load i32, i32* %7
%414 = sub nsw i32 %413, 1
%415 = sext i32 %414 to i64
%416 = getelementptr inbounds i8, i8* %29, i64 %415
%417 = load i8, i8* %416
%418 = sext i8 %417 to i32
%419 = icmp eq i32 %418, 92
br label %420
420: ; preds = %412, %409
%421 = phi i1 [ false, %409 ], [ %419, %412 ]
br i1 %421, label %422, label %427
422: ; preds = %420
%423 = load i32, i32* %19
%424 = add nsw i32 %423, 1
store i32 %424, i32* %19
%425 = load i32, i32* %7
%426 = add nsw i32 %425, -1
store i32 %426, i32* %7
br label %409
427: ; preds = %420
%428 = load i32, i32* %19
%429 = load i32, i32* %7
%430 = add nsw i32 %429, %428
store i32 %430, i32* %7
%431 = load i32, i32* %19
%432 = and i32 %431, 1
%433 = icmp ne i32 %432, 0
br i1 %433, label %434, label %435
434: ; preds = %427
br label %437
435: ; preds = %427
store i32 0, i32* %9
br label %436
436: ; preds = %435, %401, %398
br label %437
437: ; preds = %205, %436, %434, %387, %343, %318, %301, %286, %277, %251
br label %438
438: ; preds = %437
%439 = load i32, i32* %7
%440 = add nsw i32 %439, 1
store i32 %440, i32* %7
br label %201
441: ; preds = %201
%442 = load i32, i32* %8
%443 = sext i32 %442 to i64
%444 = getelementptr inbounds i8, i8* %29, i64 %443
store i8 10, i8* %444
%445 = load i32, i32* %8
%446 = add nsw i32 %445, 1
%447 = sext i32 %446 to i64
%448 = getelementptr inbounds i8, i8* %29, i64 %447
store i8 0, i8* %448
%449 = load i32*, i32** %12
%450 = call i32 @fputs(i8* %29, i32* %449)
%451 = load i32, i32* %10
%452 = add nsw i32 %451, 1
store i32 %452, i32* %10
br label %71
453: ; preds = %71
%454 = load i32, i32* %9
%455 = icmp ne i32 %454, 0
br i1 %455, label %456, label %458
456: ; preds = %453
%457 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i8* %26)
br label %458
458: ; preds = %456, %453
%459 = load i32*, i32** %12
%460 = call i32 @fclose(i32* %459)
%461 = load i32*, i32** %11
%462 = call i32 @fclose(i32* %461)
br label %463
463: ; preds = %458, %67, %61, %54
%464 = load i32, i32* %6
%465 = add nsw i32 %464, 1
store i32 %465, i32* %6
br label %35
466: ; preds = %35
store i32 0, i32* %3
store i32 1, i32* %17
br label %467
467: ; preds = %466, %32
%468 = load i8*, i8** %13
%469 = load i32, i32* %3
ret i32 %469
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [29 x i8] c"Error opening input file %s\0A\00"
@.str.4 = [6 x i8] c".orig\00"
@.str.5 = [25 x i8] c"Error renaming %s to %s\0A\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [30 x i8] c"Error opening output file %s\0A\00"
@.str.8 = [9 x i8] c"#include\00"
@stderr = global i32 0
@.str.9 = [51 x i8] c"File: %s, Malformed #include at line %d, aborting\0A\00"
@.str.10 = [35 x i8] c"Warning, file ends abnormally: %s\0A\00"
@str.12 = [26 x i8] c"Continuing with next file\00"
@str.13 = [29 x i8] c"Usage: fix [sourcefilenames]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @BUFSIZ
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = alloca i8, i64 %4
%7 = alloca i8, i64 %4
%8 = icmp slt i32 %0, 2
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = zext i32 %0 to i64
br label %13
11: ; preds = %2
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.13, i64 0, i64 0))
br label %270
13: ; preds = %9, %267
%14 = phi i64 [ 1, %9 ], [ %268, %267 ]
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @strcpy(i8* %6, i8* %16)
%18 = load i8*, i8** %15
%19 = call i32 @strcpy(i8* %5, i8* %18)
%20 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %25
22: ; preds = %13
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.12, i64 0, i64 0))
br label %267
25: ; preds = %13
%26 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%27 = call i32 @rename(i8* %6, i8* %5)
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %6, i8* %5)
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.12, i64 0, i64 0))
br label %267
32: ; preds = %25
%33 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%34 = icmp eq i32* %33, null
br i1 %34, label %39, label %35
35: ; preds = %32
%36 = load i32, i32* @BUFSIZ
%37 = call i32* @fgets(i8* %7, i32 %36, i32* %20)
%38 = icmp eq i32* %37, null
br i1 %38, label %264, label %42
39: ; preds = %32
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.12, i64 0, i64 0))
br label %267
42: ; preds = %35, %247
%43 = phi i32 [ %248, %247 ], [ 0, %35 ]
%44 = phi i32 [ %256, %247 ], [ 1, %35 ]
%45 = call i32 @strlen(i8* %7)
%46 = add nsw i32 %45, -1
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8, i8* %7, i64 %47
%49 = load i8, i8* %48
%50 = icmp eq i8 %49, 10
%51 = select i1 %50, i32 %46, i32 %45
%52 = icmp eq i32 %51, 0
br i1 %52, label %65, label %53
53: ; preds = %42
%54 = sext i32 %51 to i64
br label %55
55: ; preds = %53, %60
%56 = phi i64 [ %54, %53 ], [ %57, %60 ]
%57 = add nsw i64 %56, -1
%58 = getelementptr inbounds i8, i8* %7, i64 %57
%59 = load i8, i8* %58
switch i8 %59, label %63 [
i8 13, label %60
i8 26, label %60
]
60: ; preds = %55, %55
%61 = trunc i64 %57 to i32
%62 = icmp eq i32 %61, 0
br i1 %62, label %65, label %55
63: ; preds = %55
%64 = trunc i64 %56 to i32
br label %65
65: ; preds = %60, %63, %42
%66 = phi i32 [ 0, %42 ], [ %64, %63 ], [ 0, %60 ]
%67 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 8)
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %103
69: ; preds = %65
%70 = icmp sgt i32 %66, 8
br i1 %70, label %71, label %82
71: ; preds = %69
%72 = zext i32 %66 to i64
br label %73
73: ; preds = %71, %77
%74 = phi i64 [ 8, %71 ], [ %78, %77 ]
%75 = getelementptr inbounds i8, i8* %7, i64 %74
%76 = load i8, i8* %75
switch i8 %76, label %77 [
i8 60, label %80
i8 34, label %80
]
77: ; preds = %73
%78 = add nuw nsw i64 %74, 1
%79 = icmp eq i64 %78, %72
br i1 %79, label %82, label %73
80: ; preds = %73, %73
%81 = trunc i64 %74 to i32
br label %82
82: ; preds = %77, %80, %69
%83 = phi i32 [ 8, %69 ], [ %81, %80 ], [ %66, %77 ]
%84 = add i32 %83, 1
%85 = icmp slt i32 %84, %66
br i1 %85, label %86, label %99
86: ; preds = %82
%87 = zext i32 %84 to i64
br label %88
88: ; preds = %86, %94
%89 = phi i64 [ %87, %86 ], [ %96, %94 ]
%90 = getelementptr inbounds i8, i8* %7, i64 %89
%91 = load i8, i8* %90
switch i8 %91, label %92 [
i8 62, label %103
i8 34, label %103
i8 92, label %94
]
92: ; preds = %88
%93 = call signext i8 @tolower(i8 signext %91)
br label %94
94: ; preds = %88, %92
%95 = phi i8 [ %93, %92 ], [ 47, %88 ]
store i8 %95, i8* %90
%96 = add nuw nsw i64 %89, 1
%97 = trunc i64 %96 to i32
%98 = icmp sgt i32 %66, %97
br i1 %98, label %88, label %99
99: ; preds = %82, %94
%100 = load i32, i32* @stderr
%101 = call i32 @fprintf(i32 %100, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0), i8* %6, i32 %44)
%102 = call i32 @exit(i32 1)
unreachable
103: ; preds = %88, %88, %65
%104 = icmp sgt i32 %66, 0
br i1 %104, label %105, label %247
105: ; preds = %103, %241
%106 = phi i32 [ %245, %241 ], [ 0, %103 ]
%107 = phi i32 [ %243, %241 ], [ %66, %103 ]
%108 = phi i32 [ %242, %241 ], [ %43, %103 ]
switch i32 %108, label %241 [
i32 0, label %109
i32 1, label %142
i32 2, label %158
i32 3, label %164
i32 4, label %173
i32 5, label %181
i32 6, label %190
i32 7, label %208
i32 8, label %213
]
109: ; preds = %105
%110 = sext i32 %106 to i64
%111 = getelementptr inbounds i8, i8* %7, i64 %110
%112 = load i8, i8* %111
%113 = sext i8 %112 to i32
switch i32 %113, label %241 [
i32 47, label %114
i32 34, label %115
i32 39, label %115
]
114: ; preds = %109
br label %241
115: ; preds = %109, %109
%116 = icmp eq i32 %106, 0
br i1 %116, label %135, label %117
117: ; preds = %115, %124
%118 = phi i64 [ %120, %124 ], [ %110, %115 ]
%119 = phi i32 [ %125, %124 ], [ 0, %115 ]
%120 = add nsw i64 %118, -1
%121 = getelementptr inbounds i8, i8* %7, i64 %120
%122 = load i8, i8* %121
%123 = icmp eq i8 %122, 92
br i1 %123, label %124, label %127
124: ; preds = %117
%125 = add nuw i32 %119, 1
%126 = icmp eq i32 %125, %106
br i1 %126, label %129, label %117
127: ; preds = %117
%128 = trunc i64 %118 to i32
br label %129
129: ; preds = %124, %127
%130 = phi i32 [ %128, %127 ], [ 0, %124 ]
%131 = phi i32 [ %119, %127 ], [ %106, %124 ]
%132 = add nsw i32 %131, %130
%133 = and i32 %131, 1
%134 = icmp eq i32 %133, 0
br i1 %134, label %135, label %241
135: ; preds = %115, %129
%136 = phi i32 [ %132, %129 ], [ 0, %115 ]
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i8, i8* %7, i64 %137
%139 = load i8, i8* %138
%140 = icmp eq i8 %139, 34
%141 = select i1 %140, i32 7, i32 8
br label %241
142: ; preds = %105
%143 = sext i32 %106 to i64
%144 = getelementptr inbounds i8, i8* %7, i64 %143
%145 = load i8, i8* %144
%146 = sext i8 %145 to i32
switch i32 %146, label %157 [
i32 42, label %241
i32 47, label %147
]
147: ; preds = %142
store i8 42, i8* %144
%148 = sext i32 %107 to i64
%149 = getelementptr inbounds i8, i8* %7, i64 %148
store i8 32, i8* %149
%150 = add nsw i32 %107, 1
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds i8, i8* %7, i64 %151
store i8 42, i8* %152
%153 = add nsw i32 %107, 2
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds i8, i8* %7, i64 %154
store i8 47, i8* %155
%156 = add nsw i32 %107, 3
br label %241
157: ; preds = %142
br label %241
158: ; preds = %105
%159 = sext i32 %106 to i64
%160 = getelementptr inbounds i8, i8* %7, i64 %159
%161 = load i8, i8* %160
%162 = icmp eq i8 %161, 42
%163 = select i1 %162, i32 3, i32 2
br label %241
164: ; preds = %105
%165 = sext i32 %106 to i64
%166 = getelementptr inbounds i8, i8* %7, i64 %165
%167 = load i8, i8* %166
%168 = sext i8 %167 to i32
switch i32 %168, label %172 [
i32 47, label %169
i32 42, label %241
]
169: ; preds = %164
%170 = icmp sgt i32 %106, 0
%171 = select i1 %170, i32 0, i32 2
br label %241
172: ; preds = %164
br label %241
173: ; preds = %105
%174 = sext i32 %106 to i64
%175 = getelementptr inbounds i8, i8* %7, i64 %174
%176 = load i8, i8* %175
%177 = icmp eq i8 %176, 47
%178 = select i1 %177, i32 5, i32 4
%179 = icmp eq i8 %176, 42
%180 = select i1 %179, i32 6, i32 %178
br label %241
181: ; preds = %105
%182 = sext i32 %106 to i64
%183 = getelementptr inbounds i8, i8* %7, i64 %182
%184 = load i8, i8* %183
switch i8 %184, label %189 [
i8 42, label %185
i8 47, label %241
]
185: ; preds = %181
%186 = add nsw i32 %106, -1
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds i8, i8* %7, i64 %187
store i8 32, i8* %188
store i8 32, i8* %183
br label %241
189: ; preds = %181
br label %241
190: ; preds = %105
%191 = sext i32 %106 to i64
%192 = getelementptr inbounds i8, i8* %7, i64 %191
%193 = load i8, i8* %192
%194 = icmp eq i8 %193, 47
%195 = add nsw i32 %107, -1
%196 = icmp slt i32 %106, %195
%197 = select i1 %194, i1 %196, i1 false
br i1 %197, label %198, label %202
198: ; preds = %190
%199 = add nsw i32 %106, -1
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds i8, i8* %7, i64 %200
store i8 32, i8* %201
store i8 32, i8* %192
br label %241
202: ; preds = %190
%203 = icmp eq i32 %106, %195
%204 = select i1 %194, i1 %203, i1 false
br i1 %204, label %241, label %205
205: ; preds = %202
%206 = icmp eq i8 %193, 42
%207 = select i1 %206, i32 6, i32 4
br label %241
208: ; preds = %105
%209 = sext i32 %106 to i64
%210 = getelementptr inbounds i8, i8* %7, i64 %209
%211 = load i8, i8* %210
%212 = icmp eq i8 %211, 34
br i1 %212, label %218, label %241
213: ; preds = %105
%214 = sext i32 %106 to i64
%215 = getelementptr inbounds i8, i8* %7, i64 %214
%216 = load i8, i8* %215
%217 = icmp eq i8 %216, 39
br i1 %217, label %218, label %241
218: ; preds = %213, %208
%219 = icmp eq i32 %106, 0
br i1 %219, label %234, label %220
220: ; preds = %218
%221 = sext i32 %106 to i64
br label %222
222: ; preds = %220, %229
%223 = phi i64 [ %221, %220 ], [ %225, %229 ]
%224 = phi i32 [ 0, %220 ], [ %230, %229 ]
%225 = add nsw i64 %223, -1
%226 = getelementptr inbounds i8, i8* %7, i64 %225
%227 = load i8, i8* %226
%228 = icmp eq i8 %227, 92
br i1 %228, label %229, label %232
229: ; preds = %222
%230 = add nuw i32 %224, 1
%231 = icmp eq i32 %230, %106
br i1 %231, label %234, label %222
232: ; preds = %222
%233 = trunc i64 %223 to i32
br label %234
234: ; preds = %229, %232, %218
%235 = phi i32 [ 0, %218 ], [ %233, %232 ], [ 0, %229 ]
%236 = phi i32 [ 0, %218 ], [ %224, %232 ], [ %106, %229 ]
%237 = add nsw i32 %236, %235
%238 = and i32 %236, 1
%239 = icmp eq i32 %238, 0
%240 = select i1 %239, i32 0, i32 %108
br label %241
241: ; preds = %208, %173, %205, %158, %105, %202, %181, %169, %142, %135, %129, %234, %109, %114, %157, %147, %164, %172, %189, %185, %198, %213
%242 = phi i32 [ %108, %105 ], [ %240, %234 ], [ 8, %213 ], [ 4, %198 ], [ 4, %185 ], [ 4, %189 ], [ 2, %172 ], [ 3, %164 ], [ 0, %157 ], [ 4, %147 ], [ 0, %109 ], [ 1, %114 ], [ %141, %135 ], [ 0, %129 ], [ 2, %142 ], [ %163, %158 ], [ %171, %169 ], [ 5, %181 ], [ 0, %202 ], [ %207, %205 ], [ %180, %173 ], [ 7, %208 ]
%243 = phi i32 [ %107, %105 ], [ %107, %234 ], [ %107, %213 ], [ %107, %198 ], [ %107, %185 ], [ %107, %189 ], [ %107, %172 ], [ %107, %164 ], [ %107, %157 ], [ %156, %147 ], [ %107, %109 ], [ %107, %114 ], [ %107, %135 ], [ %107, %129 ], [ %107, %142 ], [ %107, %158 ], [ %107, %169 ], [ %107, %181 ], [ %107, %202 ], [ %107, %205 ], [ %107, %173 ], [ %107, %208 ]
%244 = phi i32 [ %106, %105 ], [ %237, %234 ], [ %106, %213 ], [ %106, %198 ], [ %106, %185 ], [ %106, %189 ], [ %106, %172 ], [ %106, %164 ], [ %106, %157 ], [ %106, %147 ], [ %106, %109 ], [ %106, %114 ], [ %136, %135 ], [ %132, %129 ], [ %106, %142 ], [ %106, %158 ], [ %106, %169 ], [ %106, %181 ], [ %106, %202 ], [ %106, %205 ], [ %106, %173 ], [ %106, %208 ]
%245 = add nsw i32 %244, 1
%246 = icmp slt i32 %245, %243
br i1 %246, label %105, label %247
247: ; preds = %241, %103
%248 = phi i32 [ %43, %103 ], [ %242, %241 ]
%249 = phi i32 [ %66, %103 ], [ %243, %241 ]
%250 = sext i32 %249 to i64
%251 = getelementptr inbounds i8, i8* %7, i64 %250
store i8 10, i8* %251
%252 = add nsw i32 %249, 1
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds i8, i8* %7, i64 %253
store i8 0, i8* %254
%255 = call i32 @fputs(i8* %7, i32* %33)
%256 = add nuw nsw i32 %44, 1
%257 = load i32, i32* @BUFSIZ
%258 = call i32* @fgets(i8* %7, i32 %257, i32* %20)
%259 = icmp eq i32* %258, null
br i1 %259, label %260, label %42
260: ; preds = %247
%261 = icmp eq i32 %248, 0
br i1 %261, label %264, label %262
262: ; preds = %260
%263 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i8* %6)
br label %264
264: ; preds = %35, %262, %260
%265 = call i32 @fclose(i32* %33)
%266 = call i32 @fclose(i32* %20)
br label %267
267: ; preds = %264, %39, %29, %22
%268 = add nuw nsw i64 %14, 1
%269 = icmp eq i64 %268, %10
br i1 %269, label %270, label %13
270: ; preds = %267, %11
%271 = phi i32 [ 1, %11 ], [ 0, %267 ]
ret i32 %271
}