#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 /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fread(char *, int, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
size_t ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char const *, int, int /*<<< orphan*/,
                          int /*<<< orphan*/ *);
scalar_t__ isspace(char);
char *malloc(size_t);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcmp(char const *, char *);
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ strncmp(char *, char *, int);
char *strstr(char const *, char *);
int main(int argc, const char **argv) {
  const char *slang = NULL;
  const char *vs_asm = NULL;
  const char *ps_asm = NULL;
  const char *vs_out = NULL;
  const char *ps_out = NULL;
  for (int i = 1; i < argc - 1; i += 2) {
    if (!strcmp(argv[i], "--slang"))
      slang = argv[i + 1];
    else if (!strcmp(argv[i], "--vsource"))
      vs_asm = argv[i + 1];
    else if (!strcmp(argv[i], "--psource"))
      ps_asm = argv[i + 1];
    else if (!strcmp(argv[i], "--vsh"))
      vs_out = argv[i + 1];
    else if (!strcmp(argv[i], "--psh"))
      ps_out = argv[i + 1];
  }
  if (!slang || !vs_out || !ps_out || (!vs_asm && ps_asm) ||
      (vs_asm && !ps_asm)) {
    printf("Usage :\n");
    printf("%s --slang <slang input> --vsh <vsh output> --psh <psh output>\n",
           argv[0]);
    printf("%s --slang <slang input> --vsource <vsh asm input> --psource <psh "
           "asm input> --vsh <vsh output> --psh <psh output>\n",
           argv[0]);
  }
  char *slang_buffer;
  size_t slang_filesize;
  {
    FILE *slang_file = fopen(slang, "rb");
    fseek(slang_file, 0, SEEK_END);
    slang_filesize = ftell(slang_file);
    fseek(slang_file, 0, SEEK_SET);
    slang_buffer = malloc(slang_filesize + 1);
    fread(slang_buffer, 1, slang_filesize, slang_file);
    fclose(slang_file);
  }
  slang_buffer[slang_filesize] = '\0';
  FILE *vs_out_fp = fopen(vs_out, "wb");
  FILE *ps_out_fp = fopen(ps_out, "wb");
  const char *line = "#version 150\n";
  fwrite(line, 1, strlen(line), vs_out_fp);
  fwrite(line, 1, strlen(line), ps_out_fp);
  char *next = slang_buffer;
  bool vson = true;
  bool pson = true;
  while (*next) {
    const char *line = next;
    while (*next && *next != '\n' && *next != '\r')
      next++;
    if (*next == '\r')
      *next++ = '\0';
    *next++ = '\0';
    if (strstr(line, "#version"))
      continue;
    if (strstr(line, "#pragma")) {
      if (strstr(line, "#pragma stage vertex")) {
        vson = true;
        pson = false;
      } else if (strstr(line, "#pragma stage fragment")) {
        vson = false;
        pson = true;
      }
      continue;
    }
    char *layout = strstr(line, "layout(");
    if (layout) {
      while (*layout != ')')
        layout++;
      layout++;
      while (*layout && isspace(*layout))
        layout++;
      if (!strncmp(layout, "uniform", 7))
        line = layout;
    }
    if (vson) {
      fwrite(line, 1, strlen(line), vs_out_fp);
      fputc('\n', vs_out_fp);
    }
    if (pson) {
      fwrite(line, 1, strlen(line), ps_out_fp);
      fputc('\n', ps_out_fp);
    }
  }
  fclose(vs_out_fp);
  fclose(ps_out_fp);
  free(slang_buffer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1392 <main+0x1a2>
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xda4(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    1284 <main+0x94>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
jmp    137f <main+0x18f>
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd71(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    12bf <main+0xcf>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
jmp    137a <main+0x18a>
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd40(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    12fa <main+0x10a>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
jmp    1375 <main+0x185>
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd0f(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    1335 <main+0x145>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
jmp    1370 <main+0x180>
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcda(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    136b <main+0x17b>
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x38(%rbp)
jmp    1370 <main+0x180>
jmp    1375 <main+0x185>
jmp    137a <main+0x18a>
jmp    137f <main+0x18f>
jmp    1384 <main+0x194>
mov    -0x3c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x3c(%rbp)
jmp    1238 <main+0x48>
cmpq   $0x0,-0x18(%rbp)
je     13df <main+0x1ef>
cmpq   $0x0,-0x30(%rbp)
je     13df <main+0x1ef>
cmpq   $0x0,-0x38(%rbp)
je     13df <main+0x1ef>
cmpq   $0x0,-0x20(%rbp)
jne    13c9 <main+0x1d9>
cmpq   $0x0,-0x28(%rbp)
jne    13df <main+0x1ef>
cmpq   $0x0,-0x20(%rbp)
je     1417 <main+0x227>
cmpq   $0x0,-0x28(%rbp)
jne    1417 <main+0x227>
lea    0xc42(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xc36(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xc61(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xcc3(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
mov    0x2bb2(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10e0 <fseek@plt>
mov    -0x58(%rbp),%rdi
call   10c0 <ftell@plt>
mov    %rax,-0x50(%rbp)
mov    -0x58(%rbp),%rdi
mov    0x2b81(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10e0 <fseek@plt>
mov    -0x50(%rbp),%rdi
add    $0x1,%rdi
call   10d0 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fread@plt>
mov    -0x58(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x48(%rbp),%rax
mov    -0x50(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x30(%rbp),%rdi
lea    0xc41(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x60(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xc2d(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x68(%rbp)
lea    0xc20(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x70(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0xa0(%rbp),%rdi
mov    %eax,%edx
mov    -0x60(%rbp),%rcx
mov    $0x1,%esi
call   1100 <fwrite@plt>
mov    -0x70(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x70(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0x98(%rbp),%rdi
mov    %eax,%edx
mov    -0x68(%rbp),%rcx
mov    $0x1,%esi
call   1100 <fwrite@plt>
mov    -0x48(%rbp),%rax
mov    %rax,-0x78(%rbp)
movl   $0x1,-0x7c(%rbp)
movl   $0x1,-0x80(%rbp)
mov    -0x78(%rbp),%rax
cmpb   $0x0,(%rax)
je     1827 <main+0x637>
mov    -0x78(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x78(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa1(%rbp)
je     1596 <main+0x3a6>
mov    -0x78(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xa1(%rbp)
je     1596 <main+0x3a6>
mov    -0x78(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
setne  %al
mov    %al,-0xa1(%rbp)
mov    -0xa1(%rbp),%al
test   $0x1,%al
jne    15a9 <main+0x3b9>
jmp    15ba <main+0x3ca>
mov    -0x78(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
jmp    1553 <main+0x363>
mov    -0x78(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    15dc <main+0x3ec>
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movb   $0x0,(%rax)
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x78(%rbp)
movb   $0x0,(%rax)
mov    -0x88(%rbp),%rdi
lea    0xafd(%rip),%rsi
call   1110 <strstr@plt>
cmp    $0x0,%rax
je     1610 <main+0x420>
jmp    153b <main+0x34b>
mov    -0x88(%rbp),%rdi
lea    0xae4(%rip),%rsi
call   1110 <strstr@plt>
cmp    $0x0,%rax
je     1692 <main+0x4a2>
mov    -0x88(%rbp),%rdi
lea    0xacf(%rip),%rsi
call   1110 <strstr@plt>
cmp    $0x0,%rax
je     165d <main+0x46d>
movl   $0x1,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
jmp    168d <main+0x49d>
mov    -0x88(%rbp),%rdi
lea    0xab4(%rip),%rsi
call   1110 <strstr@plt>
cmp    $0x0,%rax
je     1688 <main+0x498>
movl   $0x0,-0x7c(%rbp)
movl   $0x1,-0x80(%rbp)
jmp    168d <main+0x49d>
jmp    153b <main+0x34b>
mov    -0x88(%rbp),%rdi
lea    0xa96(%rip),%rsi
call   1110 <strstr@plt>
mov    %rax,-0x90(%rbp)
cmpq   $0x0,-0x90(%rbp)
je     1790 <main+0x5a0>
jmp    16bf <main+0x4cf>
mov    -0x90(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x29,%eax
je     16e9 <main+0x4f9>
mov    -0x90(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x90(%rbp)
jmp    16bf <main+0x4cf>
mov    -0x90(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa2(%rbp)
je     1732 <main+0x542>
mov    -0x90(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xa2(%rbp)
mov    -0xa2(%rbp),%al
test   $0x1,%al
jne    1745 <main+0x555>
jmp    175c <main+0x56c>
mov    -0x90(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x90(%rbp)
jmp    16fb <main+0x50b>
mov    -0x90(%rbp),%rdi
lea    0x9d4(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    178b <main+0x59b>
mov    -0x90(%rbp),%rax
mov    %rax,-0x88(%rbp)
jmp    1790 <main+0x5a0>
cmpl   $0x0,-0x7c(%rbp)
je     17d9 <main+0x5e9>
mov    -0x88(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x88(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0xb0(%rbp),%rdi
mov    %eax,%edx
mov    -0x60(%rbp),%rcx
mov    $0x1,%esi
call   1100 <fwrite@plt>
mov    -0x60(%rbp),%rsi
mov    $0xa,%edi
call   10a0 <fputc@plt>
cmpl   $0x0,-0x80(%rbp)
je     1822 <main+0x632>
mov    -0x88(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x88(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0xb8(%rbp),%rdi
mov    %eax,%edx
mov    -0x68(%rbp),%rcx
mov    $0x1,%esi
call   1100 <fwrite@plt>
mov    -0x68(%rbp),%rsi
mov    $0xa,%edi
call   10a0 <fputc@plt>
jmp    153b <main+0x34b>
mov    -0x60(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x68(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0xc0,%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,%rbp
cmp    $0x3,%edi
jl     12fd <main+0xfd>
mov    %edi,%ebx
add    $0xffffffff,%ebx
mov    $0x1,%r14d
xor    %r15d,%r15d
lea    0xdd1(%rip),%r13
xor    %eax,%eax
mov    %rax,0x8(%rsp)
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
jmp    1262 <main+0x62>
nopl   (%rax)
mov    0x8(%rbp,%r14,8),%r15
add    $0x2,%r14
cmp    %rbx,%r14
jae    1307 <main+0x107>
mov    0x0(%rbp,%r14,8),%r12
mov    %r12,%rdi
mov    %r13,%rsi
call   10c0 <strcmp@plt>
test   %eax,%eax
je     1250 <main+0x50>
mov    %r12,%rdi
lea    0xd88(%rip),%rsi
call   10c0 <strcmp@plt>
test   %eax,%eax
je     12d0 <main+0xd0>
mov    %r12,%rdi
lea    0xd7f(%rip),%rsi
call   10c0 <strcmp@plt>
test   %eax,%eax
je     12df <main+0xdf>
mov    %r12,%rdi
lea    0xd76(%rip),%rsi
call   10c0 <strcmp@plt>
test   %eax,%eax
je     12ee <main+0xee>
mov    %r12,%rdi
lea    0xd69(%rip),%rsi
call   10c0 <strcmp@plt>
test   %eax,%eax
jne    1255 <main+0x55>
mov    0x8(%rbp,%r14,8),%rax
mov    %rax,0x20(%rsp)
jmp    1255 <main+0x55>
xchg   %ax,%ax
mov    0x8(%rbp,%r14,8),%rax
mov    %rax,0x8(%rsp)
jmp    1255 <main+0x55>
mov    0x8(%rbp,%r14,8),%rax
mov    %rax,0x10(%rsp)
jmp    1255 <main+0x55>
mov    0x8(%rbp,%r14,8),%rax
mov    %rax,0x18(%rsp)
jmp    1255 <main+0x55>
xor    %ebx,%ebx
xor    %r12d,%r12d
xor    %r15d,%r15d
jmp    1354 <main+0x154>
mov    %r15,%rbx
test   %r15,%r15
je     1343 <main+0x143>
mov    0x18(%rsp),%r12
test   %r12,%r12
je     134f <main+0x14f>
mov    0x20(%rsp),%r15
test   %r15,%r15
je     1354 <main+0x154>
mov    0x8(%rsp),%rcx
test   %rcx,%rcx
mov    0x10(%rsp),%rax
jne    1337 <main+0x137>
test   %rax,%rax
jne    1354 <main+0x154>
test   %rcx,%rcx
je     1384 <main+0x184>
test   %rax,%rax
je     1354 <main+0x154>
jmp    1384 <main+0x184>
mov    0x20(%rsp),%r15
mov    0x18(%rsp),%r12
jmp    1354 <main+0x154>
mov    0x20(%rsp),%r15
lea    0xde2(%rip),%rdi
call   1050 <puts@plt>
mov    0x0(%rbp),%rsi
lea    0xcbd(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x0(%rbp),%rsi
lea    0xceb(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xd51(%rip),%rsi
mov    %rbx,%rdi
call   1100 <fopen@plt>
mov    %rax,%rbx
mov    0x2c4b(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10f0 <fseek@plt>
mov    %rbx,%rdi
call   10d0 <ftell@plt>
mov    %rax,%rbp
mov    0x2c1d(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   10f0 <fseek@plt>
lea    0x1(%rbp),%rdi
call   10e0 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    $0x1,%esi
mov    %rbp,%rdx
mov    %rbx,%rcx
call   1060 <fread@plt>
mov    %rbx,%rdi
call   1070 <fclose@plt>
movb   $0x0,(%r14,%rbp,1)
lea    0xce5(%rip),%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1100 <fopen@plt>
mov    %rax,%r13
mov    %r15,%rdi
mov    %rbx,%rsi
call   1100 <fopen@plt>
mov    %rax,%r12
lea    0xcc5(%rip),%rbx
mov    %rbx,%rdi
call   1080 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r13,%rcx
call   1110 <fwrite@plt>
mov    %rbx,%rdi
call   1080 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r12,%rcx
call   1110 <fwrite@plt>
mov    %r14,0x18(%rsp)
mov    (%r14),%al
test   %al,%al
je     1653 <main+0x453>
lea    0xc88(%rip),%rbx
lea    0xc8a(%rip),%r14
movl   $0x1,0x8(%rsp)
movl   $0x1,0x10(%rsp)
mov    0x18(%rsp),%rbp
jmp    14cb <main+0x2cb>
mov    %r15,%rdi
lea    0xc86(%rip),%rsi
call   1120 <strstr@plt>
test   %rax,%rax
mov    $0x0,%eax
mov    0x10(%rsp),%ecx
cmovne %eax,%ecx
mov    %ecx,0x10(%rsp)
mov    $0x1,%eax
mov    0x8(%rsp),%ecx
cmovne %eax,%ecx
mov    %ecx,0x8(%rsp)
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp),%al
test   %al,%al
je     1653 <main+0x453>
mov    %rbp,%r15
add    $0x1,%rbp
test   %al,%al
je     14f4 <main+0x2f4>
cs nopw 0x0(%rax,%rax,1)
cmp    $0xa,%al
je     14f4 <main+0x2f4>
cmp    $0xd,%al
je     1500 <main+0x300>
movzbl 0x0(%rbp),%eax
add    $0x1,%rbp
test   %al,%al
jne    14e0 <main+0x2e0>
add    $0xffffffffffffffff,%rbp
jmp    1504 <main+0x304>
nopw   0x0(%rax,%rax,1)
movb   $0x0,-0x1(%rbp)
movb   $0x0,0x0(%rbp)
add    $0x1,%rbp
mov    %r15,%rdi
mov    %rbx,%rsi
call   1120 <strstr@plt>
test   %rax,%rax
jne    14c0 <main+0x2c0>
mov    %r15,%rdi
mov    %r14,%rsi
call   1120 <strstr@plt>
mov    %r15,%rdi
test   %rax,%rax
je     1559 <main+0x359>
lea    0xbcb(%rip),%rsi
call   1120 <strstr@plt>
test   %rax,%rax
je     1486 <main+0x286>
movl   $0x0,0x8(%rsp)
movl   $0x1,0x10(%rsp)
jmp    14c0 <main+0x2c0>
lea    0xbcd(%rip),%rsi
call   1120 <strstr@plt>
test   %rax,%rax
je     15e5 <main+0x3e5>
mov    %rbx,%r14
mov    %r12,%rbx
mov    %r13,%r12
lea    -0x1(%rax),%rdx
add    $0x1,%rax
nop
mov    %rax,%rcx
cmpb   $0x29,0x1(%rdx)
lea    0x1(%rdx),%rdx
lea    0x1(%rax),%rax
jne    1580 <main+0x380>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rcx,%r13
movzbl (%rcx),%eax
test   %al,%al
je     15bb <main+0x3bb>
movsbl %al,%edi
call   10a0 <isspace@plt>
lea    0x1(%r13),%rcx
test   %rax,%rax
jne    15a0 <main+0x3a0>
mov    %r13,%rdi
lea    0xb70(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
cmove  %r13,%r15
mov    %r12,%r13
mov    %rbx,%r12
mov    %r14,%rbx
lea    0xb14(%rip),%r14
cmpl   $0x0,0x10(%rsp)
je     1613 <main+0x413>
mov    %r15,%rdi
call   1080 <strlen@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r13,%rcx
call   1110 <fwrite@plt>
mov    $0xa,%edi
mov    %r13,%rsi
call   10b0 <fputc@plt>
cmpl   $0x0,0x8(%rsp)
je     1646 <main+0x446>
mov    %r15,%rdi
call   1080 <strlen@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r12,%rcx
call   1110 <fwrite@plt>
mov    $0xa,%edi
mov    %r12,%rsi
call   10b0 <fputc@plt>
jmp    14c0 <main+0x2c0>
movl   $0x0,0x8(%rsp)
jmp    14c0 <main+0x2c0>
mov    %r13,%rdi
call   1070 <fclose@plt>
mov    %r12,%rdi
call   1070 <fclose@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"--slang\00"
@.str.1 = [10 x i8] c"--vsource\00"
@.str.2 = [10 x i8] c"--psource\00"
@.str.3 = [6 x i8] c"--vsh\00"
@.str.4 = [6 x i8] c"--psh\00"
@.str.5 = [9 x i8] c"Usage :\0A\00"
@.str.6 = [64 x i8] c"%s --slang <slang input> --vsh <vsh output> --psh <psh output>\0A\00"
@.str.7 = [116 x i8] c"%s --slang <slang input> --vsource <vsh asm input> --psource <psh asm input> --vsh <vsh output> --psh <psh output>\0A\00"
@.str.8 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.9 = [3 x i8] c"wb\00"
@.str.10 = [14 x i8] c"#version 150\0A\00"
@.str.11 = [9 x i8] c"#version\00"
@.str.12 = [8 x i8] c"#pragma\00"
@.str.13 = [21 x i8] c"#pragma stage vertex\00"
@.str.14 = [23 x i8] c"#pragma stage fragment\00"
@.str.15 = [8 x i8] c"layout(\00"
@.str.16 = [8 x i8] c"uniform\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i8*
%22 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* null, i8** %7
store i8* null, i8** %8
store i8* null, i8** %9
store i8* null, i8** %10
store i32 1, i32* %11
br label %23
23: ; preds = %108, %2
%24 = load i32, i32* %11
%25 = load i32, i32* %4
%26 = sub nsw i32 %25, 1
%27 = icmp slt i32 %24, %26
br i1 %27, label %28, label %111
28: ; preds = %23
%29 = load i8**, i8*** %5
%30 = load i32, i32* %11
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call i32 @strcmp(i8* %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %43, label %36
36: ; preds = %28
%37 = load i8**, i8*** %5
%38 = load i32, i32* %11
%39 = add nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %37, i64 %40
%42 = load i8*, i8** %41
store i8* %42, i8** %6
br label %107
43: ; preds = %28
%44 = load i8**, i8*** %5
%45 = load i32, i32* %11
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8*, i8** %44, i64 %46
%48 = load i8*, i8** %47
%49 = call i32 @strcmp(i8* %48, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%50 = icmp ne i32 %49, 0
br i1 %50, label %58, label %51
51: ; preds = %43
%52 = load i8**, i8*** %5
%53 = load i32, i32* %11
%54 = add nsw i32 %53, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8*, i8** %52, i64 %55
%57 = load i8*, i8** %56
store i8* %57, i8** %7
br label %106
58: ; preds = %43
%59 = load i8**, i8*** %5
%60 = load i32, i32* %11
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8*, i8** %59, i64 %61
%63 = load i8*, i8** %62
%64 = call i32 @strcmp(i8* %63, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%65 = icmp ne i32 %64, 0
br i1 %65, label %73, label %66
66: ; preds = %58
%67 = load i8**, i8*** %5
%68 = load i32, i32* %11
%69 = add nsw i32 %68, 1
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8*, i8** %67, i64 %70
%72 = load i8*, i8** %71
store i8* %72, i8** %8
br label %105
73: ; preds = %58
%74 = load i8**, i8*** %5
%75 = load i32, i32* %11
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8*, i8** %74, i64 %76
%78 = load i8*, i8** %77
%79 = call i32 @strcmp(i8* %78, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%80 = icmp ne i32 %79, 0
br i1 %80, label %88, label %81
81: ; preds = %73
%82 = load i8**, i8*** %5
%83 = load i32, i32* %11
%84 = add nsw i32 %83, 1
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds i8*, i8** %82, i64 %85
%87 = load i8*, i8** %86
store i8* %87, i8** %9
br label %104
88: ; preds = %73
%89 = load i8**, i8*** %5
%90 = load i32, i32* %11
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i8*, i8** %89, i64 %91
%93 = load i8*, i8** %92
%94 = call i32 @strcmp(i8* %93, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%95 = icmp ne i32 %94, 0
br i1 %95, label %103, label %96
96: ; preds = %88
%97 = load i8**, i8*** %5
%98 = load i32, i32* %11
%99 = add nsw i32 %98, 1
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8*, i8** %97, i64 %100
%102 = load i8*, i8** %101
store i8* %102, i8** %10
br label %103
103: ; preds = %96, %88
br label %104
104: ; preds = %103, %81
br label %105
105: ; preds = %104, %66
br label %106
106: ; preds = %105, %51
br label %107
107: ; preds = %106, %36
br label %108
108: ; preds = %107
%109 = load i32, i32* %11
%110 = add nsw i32 %109, 2
store i32 %110, i32* %11
br label %23
111: ; preds = %23
%112 = load i8*, i8** %6
%113 = icmp ne i8* %112, null
br i1 %113, label %114, label %132
114: ; preds = %111
%115 = load i8*, i8** %9
%116 = icmp ne i8* %115, null
br i1 %116, label %117, label %132
117: ; preds = %114
%118 = load i8*, i8** %10
%119 = icmp ne i8* %118, null
br i1 %119, label %120, label %132
120: ; preds = %117
%121 = load i8*, i8** %7
%122 = icmp ne i8* %121, null
br i1 %122, label %126, label %123
123: ; preds = %120
%124 = load i8*, i8** %8
%125 = icmp ne i8* %124, null
br i1 %125, label %132, label %126
126: ; preds = %123, %120
%127 = load i8*, i8** %7
%128 = icmp ne i8* %127, null
br i1 %128, label %129, label %142
129: ; preds = %126
%130 = load i8*, i8** %8
%131 = icmp ne i8* %130, null
br i1 %131, label %142, label %132
132: ; preds = %129, %123, %117, %114, %111
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%134 = load i8**, i8*** %5
%135 = getelementptr inbounds i8*, i8** %134, i64 0
%136 = load i8*, i8** %135
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.6, i64 0, i64 0), i8* %136)
%138 = load i8**, i8*** %5
%139 = getelementptr inbounds i8*, i8** %138, i64 0
%140 = load i8*, i8** %139
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str.7, i64 0, i64 0), i8* %140)
br label %142
142: ; preds = %132, %129, %126
%143 = load i8*, i8** %6
%144 = call i32* @fopen(i8* %143, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i32* %144, i32** %14
%145 = load i32*, i32** %14
%146 = load i32, i32* @SEEK_END
%147 = call i32 @fseek(i32* %145, i32 0, i32 %146)
%148 = load i32*, i32** %14
%149 = call i64 @ftell(i32* %148)
store i64 %149, i64* %13
%150 = load i32*, i32** %14
%151 = load i32, i32* @SEEK_SET
%152 = call i32 @fseek(i32* %150, i32 0, i32 %151)
%153 = load i64, i64* %13
%154 = add i64 %153, 1
%155 = call i8* @malloc(i64 %154)
store i8* %155, i8** %12
%156 = load i8*, i8** %12
%157 = load i64, i64* %13
%158 = load i32*, i32** %14
%159 = call i32 @fread(i8* %156, i32 1, i64 %157, i32* %158)
%160 = load i32*, i32** %14
%161 = call i32 @fclose(i32* %160)
%162 = load i8*, i8** %12
%163 = load i64, i64* %13
%164 = getelementptr inbounds i8, i8* %162, i64 %163
store i8 0, i8* %164
%165 = load i8*, i8** %9
%166 = call i32* @fopen(i8* %165, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
store i32* %166, i32** %15
%167 = load i8*, i8** %10
%168 = call i32* @fopen(i8* %167, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
store i32* %168, i32** %16
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8** %17
%169 = load i8*, i8** %17
%170 = load i8*, i8** %17
%171 = call i32 @strlen(i8* %170)
%172 = load i32*, i32** %15
%173 = call i32 @fwrite(i8* %169, i32 1, i32 %171, i32* %172)
%174 = load i8*, i8** %17
%175 = load i8*, i8** %17
%176 = call i32 @strlen(i8* %175)
%177 = load i32*, i32** %16
%178 = call i32 @fwrite(i8* %174, i32 1, i32 %176, i32* %177)
%179 = load i8*, i8** %12
store i8* %179, i8** %18
store i32 1, i32* %19
store i32 1, i32* %20
br label %180
180: ; preds = %298, %236, %220, %142
%181 = load i8*, i8** %18
%182 = load i8, i8* %181
%183 = icmp ne i8 %182, 0
br i1 %183, label %184, label %299
184: ; preds = %180
%185 = load i8*, i8** %18
store i8* %185, i8** %21
br label %186
186: ; preds = %203, %184
%187 = load i8*, i8** %18
%188 = load i8, i8* %187
%189 = sext i8 %188 to i32
%190 = icmp ne i32 %189, 0
br i1 %190, label %191, label %201
191: ; preds = %186
%192 = load i8*, i8** %18
%193 = load i8, i8* %192
%194 = sext i8 %193 to i32
%195 = icmp ne i32 %194, 10
br i1 %195, label %196, label %201
196: ; preds = %191
%197 = load i8*, i8** %18
%198 = load i8, i8* %197
%199 = sext i8 %198 to i32
%200 = icmp ne i32 %199, 13
br label %201
201: ; preds = %196, %191, %186
%202 = phi i1 [ false, %191 ], [ false, %186 ], [ %200, %196 ]
br i1 %202, label %203, label %206
203: ; preds = %201
%204 = load i8*, i8** %18
%205 = getelementptr inbounds i8, i8* %204, i32 1
store i8* %205, i8** %18
br label %186
206: ; preds = %201
%207 = load i8*, i8** %18
%208 = load i8, i8* %207
%209 = sext i8 %208 to i32
%210 = icmp eq i32 %209, 13
br i1 %210, label %211, label %214
211: ; preds = %206
%212 = load i8*, i8** %18
%213 = getelementptr inbounds i8, i8* %212, i32 1
store i8* %213, i8** %18
store i8 0, i8* %212
br label %214
214: ; preds = %211, %206
%215 = load i8*, i8** %18
%216 = getelementptr inbounds i8, i8* %215, i32 1
store i8* %216, i8** %18
store i8 0, i8* %215
%217 = load i8*, i8** %21
%218 = call i8* @strstr(i8* %217, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%219 = icmp ne i8* %218, null
br i1 %219, label %220, label %221
220: ; preds = %214
br label %180
221: ; preds = %214
%222 = load i8*, i8** %21
%223 = call i8* @strstr(i8* %222, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0))
%224 = icmp ne i8* %223, null
br i1 %224, label %225, label %237
225: ; preds = %221
%226 = load i8*, i8** %21
%227 = call i8* @strstr(i8* %226, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0))
%228 = icmp ne i8* %227, null
br i1 %228, label %229, label %230
229: ; preds = %225
store i32 1, i32* %19
store i32 0, i32* %20
br label %236
230: ; preds = %225
%231 = load i8*, i8** %21
%232 = call i8* @strstr(i8* %231, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%233 = icmp ne i8* %232, null
br i1 %233, label %234, label %235
234: ; preds = %230
store i32 0, i32* %19
store i32 1, i32* %20
br label %235
235: ; preds = %234, %230
br label %236
236: ; preds = %235, %229
br label %180
237: ; preds = %221
%238 = load i8*, i8** %21
%239 = call i8* @strstr(i8* %238, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
store i8* %239, i8** %22
%240 = load i8*, i8** %22
%241 = icmp ne i8* %240, null
br i1 %241, label %242, label %276
242: ; preds = %237
br label %243
243: ; preds = %248, %242
%244 = load i8*, i8** %22
%245 = load i8, i8* %244
%246 = sext i8 %245 to i32
%247 = icmp ne i32 %246, 41
br i1 %247, label %248, label %251
248: ; preds = %243
%249 = load i8*, i8** %22
%250 = getelementptr inbounds i8, i8* %249, i32 1
store i8* %250, i8** %22
br label %243
251: ; preds = %243
%252 = load i8*, i8** %22
%253 = getelementptr inbounds i8, i8* %252, i32 1
store i8* %253, i8** %22
br label %254
254: ; preds = %266, %251
%255 = load i8*, i8** %22
%256 = load i8, i8* %255
%257 = sext i8 %256 to i32
%258 = icmp ne i32 %257, 0
br i1 %258, label %259, label %264
259: ; preds = %254
%260 = load i8*, i8** %22
%261 = load i8, i8* %260
%262 = call i64 @isspace(i8 signext %261)
%263 = icmp ne i64 %262, 0
br label %264
264: ; preds = %259, %254
%265 = phi i1 [ false, %254 ], [ %263, %259 ]
br i1 %265, label %266, label %269
266: ; preds = %264
%267 = load i8*, i8** %22
%268 = getelementptr inbounds i8, i8* %267, i32 1
store i8* %268, i8** %22
br label %254
269: ; preds = %264
%270 = load i8*, i8** %22
%271 = call i32 @strncmp(i8* %270, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i32 7)
%272 = icmp ne i32 %271, 0
br i1 %272, label %275, label %273
273: ; preds = %269
%274 = load i8*, i8** %22
store i8* %274, i8** %21
br label %275
275: ; preds = %273, %269
br label %276
276: ; preds = %275, %237
%277 = load i32, i32* %19
%278 = icmp ne i32 %277, 0
br i1 %278, label %279, label %287
279: ; preds = %276
%280 = load i8*, i8** %21
%281 = load i8*, i8** %21
%282 = call i32 @strlen(i8* %281)
%283 = load i32*, i32** %15
%284 = call i32 @fwrite(i8* %280, i32 1, i32 %282, i32* %283)
%285 = load i32*, i32** %15
%286 = call i32 @fputc(i8 signext 10, i32* %285)
br label %287
287: ; preds = %279, %276
%288 = load i32, i32* %20
%289 = icmp ne i32 %288, 0
br i1 %289, label %290, label %298
290: ; preds = %287
%291 = load i8*, i8** %21
%292 = load i8*, i8** %21
%293 = call i32 @strlen(i8* %292)
%294 = load i32*, i32** %16
%295 = call i32 @fwrite(i8* %291, i32 1, i32 %293, i32* %294)
%296 = load i32*, i32** %16
%297 = call i32 @fputc(i8 signext 10, i32* %296)
br label %298
298: ; preds = %290, %287
br label %180
299: ; preds = %180
%300 = load i32*, i32** %15
%301 = call i32 @fclose(i32* %300)
%302 = load i32*, i32** %16
%303 = call i32 @fclose(i32* %302)
%304 = load i8*, i8** %12
%305 = call i32 @free(i8* %304)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"--slang\00"
@.str.1 = [10 x i8] c"--vsource\00"
@.str.2 = [10 x i8] c"--psource\00"
@.str.3 = [6 x i8] c"--vsh\00"
@.str.4 = [6 x i8] c"--psh\00"
@.str.6 = [64 x i8] c"%s --slang <slang input> --vsh <vsh output> --psh <psh output>\0A\00"
@.str.7 = [116 x i8] c"%s --slang <slang input> --vsource <vsh asm input> --psource <psh asm input> --vsh <vsh output> --psh <psh output>\0A\00"
@.str.8 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.9 = [3 x i8] c"wb\00"
@.str.10 = [14 x i8] c"#version 150\0A\00"
@.str.11 = [9 x i8] c"#version\00"
@.str.12 = [8 x i8] c"#pragma\00"
@.str.13 = [21 x i8] c"#pragma stage vertex\00"
@.str.14 = [23 x i8] c"#pragma stage fragment\00"
@.str.15 = [8 x i8] c"layout(\00"
@.str.16 = [8 x i8] c"uniform\00"
@str = [8 x i8] c"Usage :\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %70
4: ; preds = %2
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i64
br label %13
7: ; preds = %56
%8 = icmp ne i8* %61, null
%9 = icmp ne i8* %58, null
%10 = select i1 %8, i1 %9, i1 false
%11 = icmp ne i8* %57, null
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %64, label %70
13: ; preds = %4, %56
%14 = phi i64 [ 1, %4 ], [ %62, %56 ]
%15 = phi i8* [ null, %4 ], [ %61, %56 ]
%16 = phi i8* [ null, %4 ], [ %60, %56 ]
%17 = phi i8* [ null, %4 ], [ %59, %56 ]
%18 = phi i8* [ null, %4 ], [ %58, %56 ]
%19 = phi i8* [ null, %4 ], [ %57, %56 ]
%20 = getelementptr inbounds i8*, i8** %1, i64 %14
%21 = load i8*, i8** %20
%22 = tail call i32 @strcmp(i8* dereferenceable(1) %21, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %13
%25 = add nuw nsw i64 %14, 1
%26 = getelementptr inbounds i8*, i8** %1, i64 %25
%27 = load i8*, i8** %26
br label %56
28: ; preds = %13
%29 = tail call i32 @strcmp(i8* dereferenceable(1) %21, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = add nuw nsw i64 %14, 1
%33 = getelementptr inbounds i8*, i8** %1, i64 %32
%34 = load i8*, i8** %33
br label %56
35: ; preds = %28
%36 = tail call i32 @strcmp(i8* dereferenceable(1) %21, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %42
38: ; preds = %35
%39 = add nuw nsw i64 %14, 1
%40 = getelementptr inbounds i8*, i8** %1, i64 %39
%41 = load i8*, i8** %40
br label %56
42: ; preds = %35
%43 = tail call i32 @strcmp(i8* dereferenceable(1) %21, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %42
%46 = add nuw nsw i64 %14, 1
%47 = getelementptr inbounds i8*, i8** %1, i64 %46
%48 = load i8*, i8** %47
br label %56
49: ; preds = %42
%50 = tail call i32 @strcmp(i8* dereferenceable(1) %21, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %49
%53 = add nuw nsw i64 %14, 1
%54 = getelementptr inbounds i8*, i8** %1, i64 %53
%55 = load i8*, i8** %54
br label %56
56: ; preds = %24, %38, %49, %52, %45, %31
%57 = phi i8* [ %19, %49 ], [ %55, %52 ], [ %19, %45 ], [ %19, %38 ], [ %19, %31 ], [ %19, %24 ]
%58 = phi i8* [ %18, %49 ], [ %18, %52 ], [ %48, %45 ], [ %18, %38 ], [ %18, %31 ], [ %18, %24 ]
%59 = phi i8* [ %17, %49 ], [ %17, %52 ], [ %17, %45 ], [ %41, %38 ], [ %17, %31 ], [ %17, %24 ]
%60 = phi i8* [ %16, %49 ], [ %16, %52 ], [ %16, %45 ], [ %16, %38 ], [ %34, %31 ], [ %16, %24 ]
%61 = phi i8* [ %15, %49 ], [ %15, %52 ], [ %15, %45 ], [ %15, %38 ], [ %15, %31 ], [ %27, %24 ]
%62 = add nuw nsw i64 %14, 2
%63 = icmp ult i64 %62, %6
br i1 %63, label %13, label %7
64: ; preds = %7
%65 = icmp eq i8* %60, null
%66 = icmp ne i8* %59, null
%67 = select i1 %65, i1 %66, i1 false
br i1 %67, label %70, label %68
68: ; preds = %64
%69 = select i1 %65, i1 true, i1 %66
br i1 %69, label %79, label %70
70: ; preds = %2, %68, %64, %7
%71 = phi i8* [ %61, %68 ], [ %61, %64 ], [ %61, %7 ], [ null, %2 ]
%72 = phi i8* [ %58, %68 ], [ %58, %64 ], [ %58, %7 ], [ null, %2 ]
%73 = phi i8* [ %57, %68 ], [ %57, %64 ], [ %57, %7 ], [ null, %2 ]
%74 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%75 = load i8*, i8** %1
%76 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.6, i64 0, i64 0), i8* %75)
%77 = load i8*, i8** %1
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([116 x i8], [116 x i8]* @.str.7, i64 0, i64 0), i8* %77)
br label %79
79: ; preds = %70, %68
%80 = phi i8* [ %71, %70 ], [ %61, %68 ]
%81 = phi i8* [ %72, %70 ], [ %58, %68 ]
%82 = phi i8* [ %73, %70 ], [ %57, %68 ]
%83 = tail call i32* @fopen(i8* %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%84 = load i32, i32* @SEEK_END
%85 = tail call i32 @fseek(i32* %83, i32 0, i32 %84)
%86 = tail call i64 @ftell(i32* %83)
%87 = load i32, i32* @SEEK_SET
%88 = tail call i32 @fseek(i32* %83, i32 0, i32 %87)
%89 = add i64 %86, 1
%90 = tail call i8* @malloc(i64 %89)
%91 = tail call i32 @fread(i8* %90, i32 1, i64 %86, i32* %83)
%92 = tail call i32 @fclose(i32* %83)
%93 = getelementptr inbounds i8, i8* %90, i64 %86
store i8 0, i8* %93
%94 = tail call i32* @fopen(i8* %81, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%95 = tail call i32* @fopen(i8* %82, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%96 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%97 = tail call i32 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i32 1, i32 %96, i32* %94)
%98 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%99 = tail call i32 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i32 1, i32 %98, i32* %95)
%100 = load i8, i8* %90
%101 = icmp eq i8 %100, 0
br i1 %101, label %169, label %102
102: ; preds = %79, %164
%103 = phi i8 [ %167, %164 ], [ %100, %79 ]
%104 = phi i32 [ %166, %164 ], [ 1, %79 ]
%105 = phi i32 [ %165, %164 ], [ 1, %79 ]
%106 = phi i8* [ %117, %164 ], [ %90, %79 ]
br label %107
107: ; preds = %102, %110
%108 = phi i8 [ %112, %110 ], [ %103, %102 ]
%109 = phi i8* [ %111, %110 ], [ %106, %102 ]
switch i8 %108, label %110 [
i8 13, label %113
i8 0, label %115
i8 10, label %115
]
110: ; preds = %107
%111 = getelementptr inbounds i8, i8* %109, i64 1
%112 = load i8, i8* %111
br label %107
113: ; preds = %107
%114 = getelementptr inbounds i8, i8* %109, i64 1
store i8 0, i8* %109
br label %115
115: ; preds = %107, %107, %113
%116 = phi i8* [ %114, %113 ], [ %109, %107 ], [ %109, %107 ]
%117 = getelementptr inbounds i8, i8* %116, i64 1
store i8 0, i8* %116
%118 = tail call i8* @strstr(i8* %106, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%119 = icmp eq i8* %118, null
br i1 %119, label %120, label %164
120: ; preds = %115
%121 = tail call i8* @strstr(i8* %106, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0))
%122 = icmp eq i8* %121, null
br i1 %122, label %131, label %123
123: ; preds = %120
%124 = tail call i8* @strstr(i8* %106, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0))
%125 = icmp eq i8* %124, null
br i1 %125, label %126, label %164
126: ; preds = %123
%127 = tail call i8* @strstr(i8* %106, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%128 = icmp eq i8* %127, null
%129 = select i1 %128, i32 %105, i32 0
%130 = select i1 %128, i32 %104, i32 1
br label %164
131: ; preds = %120
%132 = tail call i8* @strstr(i8* %106, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%133 = icmp eq i8* %132, null
br i1 %133, label %151, label %134
134: ; preds = %131, %134
%135 = phi i8* [ %138, %134 ], [ %132, %131 ]
%136 = load i8, i8* %135
%137 = icmp eq i8 %136, 41
%138 = getelementptr inbounds i8, i8* %135, i64 1
br i1 %137, label %139, label %134
139: ; preds = %134, %144
%140 = phi i8* [ %141, %144 ], [ %135, %134 ]
%141 = getelementptr inbounds i8, i8* %140, i64 1
%142 = load i8, i8* %141
%143 = icmp eq i8 %142, 0
br i1 %143, label %147, label %144
144: ; preds = %139
%145 = tail call i64 @isspace(i8 signext %142)
%146 = icmp eq i64 %145, 0
br i1 %146, label %147, label %139
147: ; preds = %139, %144
%148 = tail call i32 @strncmp(i8* %141, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i32 7)
%149 = icmp eq i32 %148, 0
%150 = select i1 %149, i8* %141, i8* %106
br label %151
151: ; preds = %147, %131
%152 = phi i8* [ %106, %131 ], [ %150, %147 ]
%153 = icmp eq i32 %105, 0
br i1 %153, label %158, label %154
154: ; preds = %151
%155 = tail call i32 @strlen(i8* %152)
%156 = tail call i32 @fwrite(i8* %152, i32 1, i32 %155, i32* %94)
%157 = tail call i32 @fputc(i8 signext 10, i32* %94)
br label %158
158: ; preds = %154, %151
%159 = icmp eq i32 %104, 0
br i1 %159, label %164, label %160
160: ; preds = %158
%161 = tail call i32 @strlen(i8* %152)
%162 = tail call i32 @fwrite(i8* %152, i32 1, i32 %161, i32* %95)
%163 = tail call i32 @fputc(i8 signext 10, i32* %95)
br label %164
164: ; preds = %126, %158, %160, %123, %115
%165 = phi i32 [ %105, %115 ], [ 1, %123 ], [ %129, %126 ], [ %105, %160 ], [ %105, %158 ]
%166 = phi i32 [ %104, %115 ], [ 0, %123 ], [ %130, %126 ], [ %104, %160 ], [ 0, %158 ]
%167 = load i8, i8* %117
%168 = icmp eq i8 %167, 0
br i1 %168, label %169, label %102
169: ; preds = %164, %79
%170 = tail call i32 @fclose(i32* %94)
%171 = tail call i32 @fclose(i32* %95)
%172 = tail call i32 @free(i8* %90)
ret i32 0
}