#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int ssize_t;
struct TYPE_3__ {
  int rm_so;
  int rm_eo;
};
typedef TYPE_1__ regmatch_t;
typedef int /*<<< orphan*/ regex_t;
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int REG_EXTENDED;
int REG_ICASE;
int REG_NEWLINE;
int REG_NOTBOL;
int REG_NOTEOL;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ frob_escapes(char *, int);
int getline(char **, size_t *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int regcomp(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ regerror(int, int /*<<< orphan*/ *, char *, int);
scalar_t__ regexec(int /*<<< orphan*/ *, char *, int, TYPE_1__ *, int);
int /*<<< orphan*/ regfree(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
char *strchr(char *, char);
int strcspn(char *, char *);
int strspn(char *, char *);
scalar_t__ strstr(char *, char *);
int strtol(char *, char **, int);
int main(int argc, char **argv) {
  int ret = 0, n;
  char *line = NULL;
  size_t line_len = 0;
  ssize_t len;
  FILE *f;
  char *pattern, *string;
  int flags = REG_EXTENDED;
  int eflags = 0;
  regex_t re;
  regmatch_t rm[20];
  if (argc < 2) {
    fprintf(stderr, "Missing test filename\n");
    return 1;
  }
  f = fopen(argv[1], "r");
  if (f == NULL) {
    fprintf(stderr, "Couldn't open %s\n", argv[1]);
    return 1;
  }
  while ((len = getline(&line, &line_len, f)) > 0) {
    char *p, *q;
    int i;
    if (line[len - 1] == '\n')
      line[--len] = '\0';
    puts(line);
    if (line[0] == ';')
      continue;
    if (line[0] == '\0')
      continue;
    if (line[0] == '-') {
      if (strstr(line, "REG_BASIC"))
        flags = 0;
      else
        flags = REG_EXTENDED;
      if (strstr(line, "REG_ICASE"))
        flags |= REG_ICASE;
      if (strstr(line, "REG_NEWLINE"))
        flags |= REG_NEWLINE;
      eflags = 0;
      if (strstr(line, "REG_NOTBOL"))
        eflags |= REG_NOTBOL;
      if (strstr(line, "REG_NOTEOL"))
        eflags |= REG_NOTEOL;
      continue;
    }
    pattern = line + strspn(line, " \t");
    if (*pattern == '\0')
      continue;
    p = pattern + strcspn(pattern, " \t");
    if (*p == '\0')
      continue;
    *p++ = '\0';
    string = p + strspn(p, " \t");
    if (*string == '\0')
      continue;
    if (*string == '"') {
      string++;
      p = strchr(string, '"');
      if (p == NULL)
        continue;
      *p++ = '\0';
    } else {
      p = string + strcspn(string, " \t");
      if (*string == '!')
        string = NULL;
      else if (*p == '\0')
        continue;
      else
        *p++ = '\0';
    }
    frob_escapes(pattern, 1);
    if (string != NULL)
      frob_escapes(string, 0);
    n = regcomp(&re, pattern, flags);
    if (n != 0) {
      if (string != NULL) {
        char buf[500];
        regerror(n, &re, buf, sizeof(buf));
        printf("FAIL regcomp unexpectedly failed: %s\n", buf);
        ret = 1;
      }
      continue;
    } else if (string == NULL) {
      regfree(&re);
      puts("FAIL regcomp unpexpectedly succeeded");
      ret = 1;
      continue;
    }
    if (regexec(&re, string, 20, rm, eflags)) {
      for (i = 0; i < 20; ++i) {
        rm[i].rm_so = -1;
        rm[i].rm_eo = -1;
      }
    }
    regfree(&re);
    for (i = 0; i < 20 && *p != '\0'; ++i) {
      int rm_so, rm_eo;
      rm_so = strtol(p, &q, 10);
      if (p == q)
        break;
      p = q;
      rm_eo = strtol(p, &q, 10);
      if (p == q)
        break;
      p = q;
      if (rm[i].rm_so != rm_so || rm[i].rm_eo != rm_eo) {
        printf("FAIL rm[%d] %d..%d != expected %d..%d\n", i, rm[i].rm_so,
               rm[i].rm_eo, rm_so, rm_eo);
        ret = 1;
        break;
      }
    }
  }
  free(line);
  fclose(f);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    0x2d71(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1280 <main+0x70>
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
lea    0xd93(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    18d9 <main+0x6c9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd88(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    12ce <main+0xbe>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd5e(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    18d9 <main+0x6c9>
jmp    12d3 <main+0xc3>
mov    -0x38(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1120 <getline@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jle    18c1 <main+0x6b1>
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    131e <main+0x10e>
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x2c(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
jne    133c <main+0x12c>
jmp    12d3 <main+0xc3>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1351 <main+0x141>
jmp    12d3 <main+0xc3>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1443 <main+0x233>
mov    -0x20(%rbp),%rdi
lea    0xcbf(%rip),%rsi
call   1130 <strstr@plt>
cmp    $0x0,%rax
je     1387 <main+0x177>
movl   $0x0,-0x4c(%rbp)
jmp    1393 <main+0x183>
mov    0x2c2a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc97(%rip),%rsi
call   1130 <strstr@plt>
cmp    $0x0,%rax
je     13bc <main+0x1ac>
mov    0x2c34(%rip),%rax
mov    (%rax),%eax
or     -0x4c(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc78(%rip),%rsi
call   1130 <strstr@plt>
cmp    $0x0,%rax
je     13e5 <main+0x1d5>
mov    0x2bf3(%rip),%rax
mov    (%rax),%eax
or     -0x4c(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc54(%rip),%rsi
call   1130 <strstr@plt>
cmp    $0x0,%rax
je     1415 <main+0x205>
mov    0x2bd3(%rip),%rax
mov    (%rax),%eax
or     -0x50(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc36(%rip),%rsi
call   1130 <strstr@plt>
cmp    $0x0,%rax
je     143e <main+0x22e>
mov    0x2ba2(%rip),%rax
mov    (%rax),%eax
or     -0x50(%rbp),%eax
mov    %eax,-0x50(%rbp)
jmp    12d3 <main+0xc3>
mov    -0x20(%rbp),%rax
mov    %rax,-0x320(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc08(%rip),%rsi
call   10a0 <strspn@plt>
mov    %eax,%ecx
mov    -0x320(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1486 <main+0x276>
jmp    12d3 <main+0xc3>
mov    -0x40(%rbp),%rax
mov    %rax,-0x328(%rbp)
mov    -0x40(%rbp),%rdi
lea    0xbc5(%rip),%rsi
call   10c0 <strcspn@plt>
mov    %eax,%ecx
mov    -0x328(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    14cf <main+0x2bf>
jmp    12d3 <main+0xc3>
mov    -0x108(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x108(%rbp)
movb   $0x0,(%rax)
mov    -0x108(%rbp),%rax
mov    %rax,-0x330(%rbp)
mov    -0x108(%rbp),%rdi
lea    0xb5e(%rip),%rsi
call   10a0 <strspn@plt>
mov    %eax,%ecx
mov    -0x330(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1530 <main+0x320>
jmp    12d3 <main+0xc3>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1591 <main+0x381>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    $0x22,%esi
call   1080 <strchr@plt>
mov    %rax,-0x108(%rbp)
cmpq   $0x0,-0x108(%rbp)
jne    1574 <main+0x364>
jmp    12d3 <main+0xc3>
mov    -0x108(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x108(%rbp)
movb   $0x0,(%rax)
jmp    1619 <main+0x409>
mov    -0x48(%rbp),%rax
mov    %rax,-0x338(%rbp)
mov    -0x48(%rbp),%rdi
lea    0xaba(%rip),%rsi
call   10c0 <strcspn@plt>
mov    %eax,%ecx
mov    -0x338(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x108(%rbp)
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x21,%eax
jne    15df <main+0x3cf>
movq   $0x0,-0x48(%rbp)
jmp    1614 <main+0x404>
mov    -0x108(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    15f7 <main+0x3e7>
jmp    12d3 <main+0xc3>
mov    -0x108(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x108(%rbp)
movb   $0x0,(%rax)
jmp    1614 <main+0x404>
jmp    1619 <main+0x409>
mov    -0x40(%rbp),%rdi
mov    $0x1,%esi
call   1050 <frob_escapes@plt>
cmpq   $0x0,-0x48(%rbp)
je     163d <main+0x42d>
mov    -0x48(%rbp),%rdi
xor    %esi,%esi
call   1050 <frob_escapes@plt>
mov    -0x40(%rbp),%rsi
mov    -0x4c(%rbp),%edx
lea    -0x54(%rbp),%rdi
call   10b0 <regcomp@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     169e <main+0x48e>
cmpq   $0x0,-0x48(%rbp)
je     1699 <main+0x489>
mov    -0x18(%rbp),%edi
lea    -0x310(%rbp),%rdx
lea    -0x54(%rbp),%rsi
mov    $0x1f4,%ecx
call   10f0 <regerror@plt>
lea    -0x310(%rbp),%rsi
lea    0x9d9(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    12d3 <main+0xc3>
cmpq   $0x0,-0x48(%rbp)
jne    16ca <main+0x4ba>
lea    -0x54(%rbp),%rdi
call   1070 <regfree@plt>
lea    0x9d1(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x14(%rbp)
jmp    12d3 <main+0xc3>
jmp    16cf <main+0x4bf>
mov    -0x48(%rbp),%rsi
lea    -0x100(%rbp),%rcx
mov    -0x50(%rbp),%r8d
lea    -0x54(%rbp),%rdi
mov    $0x14,%edx
call   1100 <regexec@plt>
cmp    $0x0,%rax
je     174a <main+0x53a>
movl   $0x0,-0x114(%rbp)
cmpl   $0x14,-0x114(%rbp)
jge    1745 <main+0x535>
movslq -0x114(%rbp),%rax
movl   $0xffffffff,-0x100(%rbp,%rax,8)
ff ff ff ff
movslq -0x114(%rbp),%rax
movl   $0xffffffff,-0xfc(%rbp,%rax,8)
ff ff ff ff
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    1700 <main+0x4f0>
jmp    174a <main+0x53a>
lea    -0x54(%rbp),%rdi
call   1070 <regfree@plt>
movl   $0x0,-0x114(%rbp)
xor    %eax,%eax
cmpl   $0x14,-0x114(%rbp)
mov    %al,-0x339(%rbp)
jge    1788 <main+0x578>
mov    -0x108(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x339(%rbp)
mov    -0x339(%rbp),%al
test   $0x1,%al
jne    179b <main+0x58b>
jmp    18bc <main+0x6ac>
mov    -0x108(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0xa,%edx
call   10e0 <strtol@plt>
mov    %eax,-0x314(%rbp)
mov    -0x108(%rbp),%rax
cmp    -0x110(%rbp),%rax
jne    17d2 <main+0x5c2>
jmp    18bc <main+0x6ac>
mov    -0x110(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0xa,%edx
call   10e0 <strtol@plt>
mov    %eax,-0x318(%rbp)
mov    -0x108(%rbp),%rax
cmp    -0x110(%rbp),%rax
jne    1817 <main+0x607>
jmp    18bc <main+0x6ac>
mov    -0x110(%rbp),%rax
mov    %rax,-0x108(%rbp)
movslq -0x114(%rbp),%rax
mov    -0x100(%rbp,%rax,8),%eax
cmp    -0x314(%rbp),%eax
jne    1859 <main+0x649>
movslq -0x114(%rbp),%rax
mov    -0xfc(%rbp,%rax,8),%eax
cmp    -0x318(%rbp),%eax
je     18a3 <main+0x693>
mov    -0x114(%rbp),%esi
movslq -0x114(%rbp),%rax
mov    -0x100(%rbp,%rax,8),%edx
movslq -0x114(%rbp),%rax
mov    -0xfc(%rbp,%rax,8),%ecx
mov    -0x314(%rbp),%r8d
mov    -0x318(%rbp),%r9d
lea    0x81f(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    18bc <main+0x6ac>
jmp    18a8 <main+0x698>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    175d <main+0x54d>
jmp    12d3 <main+0xc3>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2c8,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
cmp    $0x1,%edi
jg     1259 <main+0x49>
mov    0x2d81(%rip),%rax
mov    (%rax),%edi
lea    0xdb8(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    $0x1,%eax
jmp    16ef <main+0x4df>
mov    %rsi,%rbx
mov    0x2d55(%rip),%rax
mov    (%rax),%r12d
mov    0x8(%rsi),%rdi
lea    0xda6(%rip),%rsi
call   1110 <fopen@plt>
test   %rax,%rax
je     16af <main+0x49f>
mov    %rax,%r15
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    %rax,%rdx
call   1120 <getline@plt>
test   %eax,%eax
jle    16d1 <main+0x4c1>
lea    0x8(%rsp),%r14
lea    0x10(%rsp),%rbp
lea    0xdb4(%rip),%rbx
movl   $0x0,0x1c(%rsp)
movl   $0x0,0x2c(%rsp)
mov    %r15,0x20(%rsp)
jmp    12e6 <main+0xd6>
mov    %rsi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
call   1120 <getline@plt>
test   %eax,%eax
jle    16d9 <main+0x4c9>
mov    0x8(%rsp),%rdi
add    $0xffffffff,%eax
cmpb   $0xa,(%rdi,%rax,1)
jne    12fd <main+0xed>
movb   $0x0,(%rdi,%rax,1)
mov    0x8(%rsp),%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%r13
mov    0x0(%r13),%al
test   %al,%al
je     12d0 <main+0xc0>
cmp    $0x3b,%al
je     12d0 <main+0xc0>
cmp    $0x2d,%al
jne    1400 <main+0x1f0>
mov    %r13,%rdi
lea    0xd06(%rip),%rsi
call   1130 <strstr@plt>
mov    $0x0,%r14d
test   %rax,%rax
jne    133f <main+0x12f>
mov    0x2c7c(%rip),%rax
mov    (%rax),%r14d
mov    0x8(%rsp),%rdi
lea    0xcea(%rip),%rsi
call   1130 <strstr@plt>
mov    $0x0,%r12d
test   %rax,%rax
je     1365 <main+0x155>
mov    0x2c86(%rip),%rax
mov    (%rax),%r12d
mov    0x8(%rsp),%rdi
lea    0xcce(%rip),%rsi
call   1130 <strstr@plt>
mov    $0x0,%ebp
test   %rax,%rax
je     1389 <main+0x179>
mov    0x2c49(%rip),%rax
mov    (%rax),%ebp
mov    0x8(%rsp),%rdi
lea    0xcb6(%rip),%rsi
call   1130 <strstr@plt>
mov    $0x0,%ebx
test   %rax,%rax
je     13ad <main+0x19d>
mov    0x2c35(%rip),%rax
mov    (%rax),%ebx
or     %r14d,%r12d
mov    0x8(%rsp),%rdi
lea    0xc9a(%rip),%rsi
call   1130 <strstr@plt>
test   %rax,%rax
mov    $0x0,%eax
je     13d4 <main+0x1c4>
mov    0x2c06(%rip),%rax
mov    (%rax),%eax
or     %ebx,%eax
mov    %eax,0x2c(%rsp)
or     %ebp,%r12d
lea    0x8(%rsp),%r14
lea    0x10(%rsp),%rbp
lea    0xc73(%rip),%rbx
jmp    12d0 <main+0xc0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rdi
mov    %rbx,%rsi
call   10a0 <strspn@plt>
cltq
cmpb   $0x0,0x0(%r13,%rax,1)
je     12d0 <main+0xc0>
add    %rax,%r13
mov    %r13,%rdi
mov    %rbx,%rsi
call   10c0 <strcspn@plt>
mov    %rbx,%rsi
movslq %eax,%rbx
cmpb   $0x0,0x0(%r13,%rbx,1)
je     12c4 <main+0xb4>
add    %r13,%rbx
lea    0x1(%rbx),%rdi
movb   $0x0,(%rbx)
call   10a0 <strspn@plt>
cltq
mov    0x1(%rbx,%rax,1),%bpl
test   %bpl,%bpl
je     13e2 <main+0x1d2>
lea    (%rbx,%rax,1),%r15
add    $0x1,%r15
cmp    $0x22,%bpl
jne    1490 <main+0x280>
add    $0x1,%r15
mov    %r15,%rdi
mov    $0x22,%esi
call   1080 <strchr@plt>
mov    %rax,%r14
test   %rax,%rax
lea    0x10(%rsp),%rbp
lea    0xbdc(%rip),%rbx
jne    150b <main+0x2fb>
jmp    156f <main+0x35f>
mov    %r15,%rdi
lea    0xbc7(%rip),%rbx
mov    %rbx,%rsi
call   10c0 <strcspn@plt>
cmp    $0x21,%bpl
jne    14fa <main+0x2ea>
mov    %r13,%rdi
mov    $0x1,%esi
call   1050 <frob_escapes@plt>
lea    0x28(%rsp),%rdi
mov    %r13,%rsi
mov    %r12d,%edx
call   10b0 <regcomp@plt>
test   %eax,%eax
mov    0x20(%rsp),%r15
lea    0x10(%rsp),%rbp
jne    12d0 <main+0xc0>
lea    0x28(%rsp),%rdi
call   1070 <regfree@plt>
lea    0xba2(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,0x1c(%rsp)
jmp    12d0 <main+0xc0>
movslq %eax,%r14
add    %r15,%r14
cmpb   $0x0,(%r14)
lea    0x10(%rsp),%rbp
je     156f <main+0x35f>
movb   $0x0,(%r14)
mov    %r13,%rdi
mov    $0x1,%esi
call   1050 <frob_escapes@plt>
mov    %r15,%rdi
xor    %esi,%esi
call   1050 <frob_escapes@plt>
lea    0x28(%rsp),%rdi
mov    %r13,%rsi
mov    %r12d,%edx
call   10b0 <regcomp@plt>
test   %eax,%eax
je     157e <main+0x36e>
mov    %eax,%edi
lea    0x28(%rsp),%rsi
lea    0xd0(%rsp),%r14
mov    %r14,%rdx
mov    $0x1f4,%ecx
call   10f0 <regerror@plt>
lea    0xb07(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
movl   $0x1,0x1c(%rsp)
mov    0x20(%rsp),%r15
lea    0x8(%rsp),%r14
jmp    12d0 <main+0xc0>
lea    0x28(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x14,%edx
lea    0x30(%rsp),%rcx
mov    0x2c(%rsp),%r8d
call   1100 <regexec@plt>
test   %rax,%rax
lea    0xd0(%rsp),%r13
je     15f9 <main+0x3e9>
pcmpeqd %xmm0,%xmm0
movdqa %xmm0,0xc0(%rsp)
movdqa %xmm0,0xb0(%rsp)
movdqa %xmm0,0xa0(%rsp)
movdqa %xmm0,0x90(%rsp)
movdqa %xmm0,0x80(%rsp)
movdqa %xmm0,0x70(%rsp)
movdqa %xmm0,0x60(%rsp)
movdqa %xmm0,0x50(%rsp)
movdqa %xmm0,0x40(%rsp)
movdqa %xmm0,0x30(%rsp)
add    $0x1,%r14
mov    %rbx,%rdi
call   1070 <regfree@plt>
xor    %ebx,%ebx
mov    0x20(%rsp),%r15
nopl   0x0(%rax)
cmpb   $0x0,(%r14)
je     1676 <main+0x466>
mov    %r14,%rdi
mov    %r13,%rsi
mov    $0xa,%edx
call   10e0 <strtol@plt>
mov    0xd0(%rsp),%rbp
cmp    %rbp,%r14
je     16a5 <main+0x495>
mov    %eax,%r15d
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0xa,%edx
call   10e0 <strtol@plt>
mov    0xd0(%rsp),%r14
cmp    %r14,%rbp
je     16a5 <main+0x495>
mov    0x30(%rsp,%rbx,8),%edx
cmp    %r15d,%edx
jne    1683 <main+0x473>
cmp    %eax,0x34(%rsp,%rbx,8)
jne    1680 <main+0x470>
add    $0x1,%rbx
cmp    $0x14,%rbx
mov    0x20(%rsp),%r15
lea    0x10(%rsp),%rbp
jne    1610 <main+0x400>
lea    0x8(%rsp),%r14
jmp    13e7 <main+0x1d7>
mov    %r15d,%edx
mov    0x34(%rsp,%rbx,8),%ecx
lea    0xa21(%rip),%rdi
mov    %ebx,%esi
mov    %r15d,%r8d
mov    %eax,%r9d
xor    %eax,%eax
call   1090 <printf@plt>
movl   $0x1,0x1c(%rsp)
mov    0x20(%rsp),%r15
jmp    13dd <main+0x1cd>
mov    0x290a(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0x956(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    $0x1,%eax
jmp    16ef <main+0x4df>
movl   $0x0,0x1c(%rsp)
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
mov    0x1c(%rsp),%eax
add    $0x2c8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
@REG_EXTENDED = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"Missing test filename\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [18 x i8] c"Couldn't open %s\0A\00"
@.str.3 = [10 x i8] c"REG_BASIC\00"
@.str.4 = [10 x i8] c"REG_ICASE\00"
@REG_ICASE = global i32 0
@.str.5 = [12 x i8] c"REG_NEWLINE\00"
@REG_NEWLINE = global i32 0
@.str.6 = [11 x i8] c"REG_NOTBOL\00"
@REG_NOTBOL = global i32 0
@.str.7 = [11 x i8] c"REG_NOTEOL\00"
@REG_NOTEOL = global i32 0
@.str.8 = [3 x i8] c" \09\00"
@.str.9 = [38 x i8] c"FAIL regcomp unexpectedly failed: %s\0A\00"
@.str.10 = [37 x i8] c"FAIL regcomp unpexpectedly succeeded\00"
@.str.11 = [39 x i8] c"FAIL rm[%d] %d..%d != expected %d..%d\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 i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [20 x %struct.TYPE_3__]
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i32
%21 = alloca [500 x i8]
%22 = alloca i32
%23 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* null, i8** %8
store i64 0, i64* %9
%24 = load i32, i32* @REG_EXTENDED
store i32 %24, i32* %14
store i32 0, i32* %15
%25 = load i32, i32* %4
%26 = icmp slt i32 %25, 2
br i1 %26, label %27, label %30
27: ; preds = %2
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %322
30: ; preds = %2
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i32* @fopen(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %34, i32** %11
%35 = load i32*, i32** %11
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %43
37: ; preds = %30
%38 = load i32, i32* @stderr
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %41)
store i32 1, i32* %3
br label %322
43: ; preds = %30
br label %44
44: ; preds = %315, %225, %221, %192, %172, %159, %146, %135, %124, %78, %71, %43
%45 = load i32*, i32** %11
%46 = call i32 @getline(i8** %8, i64* %9, i32* %45)
store i32 %46, i32* %10
%47 = icmp sgt i32 %46, 0
br i1 %47, label %48, label %316
48: ; preds = %44
%49 = load i8*, i8** %8
%50 = load i32, i32* %10
%51 = sub nsw i32 %50, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %49, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 10
br i1 %56, label %57, label %63
57: ; preds = %48
%58 = load i8*, i8** %8
%59 = load i32, i32* %10
%60 = add nsw i32 %59, -1
store i32 %60, i32* %10
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8, i8* %58, i64 %61
store i8 0, i8* %62
br label %63
63: ; preds = %57, %48
%64 = load i8*, i8** %8
%65 = call i32 @puts(i8* %64)
%66 = load i8*, i8** %8
%67 = getelementptr inbounds i8, i8* %66, i64 0
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 59
br i1 %70, label %71, label %72
71: ; preds = %63
br label %44
72: ; preds = %63
%73 = load i8*, i8** %8
%74 = getelementptr inbounds i8, i8* %73, i64 0
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp eq i32 %76, 0
br i1 %77, label %78, label %79
78: ; preds = %72
br label %44
79: ; preds = %72
%80 = load i8*, i8** %8
%81 = getelementptr inbounds i8, i8* %80, i64 0
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 45
br i1 %84, label %85, label %125
85: ; preds = %79
%86 = load i8*, i8** %8
%87 = call i64 @strstr(i8* %86, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%88 = icmp ne i64 %87, 0
br i1 %88, label %89, label %90
89: ; preds = %85
store i32 0, i32* %14
br label %92
90: ; preds = %85
%91 = load i32, i32* @REG_EXTENDED
store i32 %91, i32* %14
br label %92
92: ; preds = %90, %89
%93 = load i8*, i8** %8
%94 = call i64 @strstr(i8* %93, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %100
96: ; preds = %92
%97 = load i32, i32* @REG_ICASE
%98 = load i32, i32* %14
%99 = or i32 %98, %97
store i32 %99, i32* %14
br label %100
100: ; preds = %96, %92
%101 = load i8*, i8** %8
%102 = call i64 @strstr(i8* %101, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%103 = icmp ne i64 %102, 0
br i1 %103, label %104, label %108
104: ; preds = %100
%105 = load i32, i32* @REG_NEWLINE
%106 = load i32, i32* %14
%107 = or i32 %106, %105
store i32 %107, i32* %14
br label %108
108: ; preds = %104, %100
store i32 0, i32* %15
%109 = load i8*, i8** %8
%110 = call i64 @strstr(i8* %109, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%111 = icmp ne i64 %110, 0
br i1 %111, label %112, label %116
112: ; preds = %108
%113 = load i32, i32* @REG_NOTBOL
%114 = load i32, i32* %15
%115 = or i32 %114, %113
store i32 %115, i32* %15
br label %116
116: ; preds = %112, %108
%117 = load i8*, i8** %8
%118 = call i64 @strstr(i8* %117, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%119 = icmp ne i64 %118, 0
br i1 %119, label %120, label %124
120: ; preds = %116
%121 = load i32, i32* @REG_NOTEOL
%122 = load i32, i32* %15
%123 = or i32 %122, %121
store i32 %123, i32* %15
br label %124
124: ; preds = %120, %116
br label %44
125: ; preds = %79
%126 = load i8*, i8** %8
%127 = load i8*, i8** %8
%128 = call i32 @strspn(i8* %127, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds i8, i8* %126, i64 %129
store i8* %130, i8** %12
%131 = load i8*, i8** %12
%132 = load i8, i8* %131
%133 = sext i8 %132 to i32
%134 = icmp eq i32 %133, 0
br i1 %134, label %135, label %136
135: ; preds = %125
br label %44
136: ; preds = %125
%137 = load i8*, i8** %12
%138 = load i8*, i8** %12
%139 = call i32 @strcspn(i8* %138, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i8, i8* %137, i64 %140
store i8* %141, i8** %18
%142 = load i8*, i8** %18
%143 = load i8, i8* %142
%144 = sext i8 %143 to i32
%145 = icmp eq i32 %144, 0
br i1 %145, label %146, label %147
146: ; preds = %136
br label %44
147: ; preds = %136
%148 = load i8*, i8** %18
%149 = getelementptr inbounds i8, i8* %148, i32 1
store i8* %149, i8** %18
store i8 0, i8* %148
%150 = load i8*, i8** %18
%151 = load i8*, i8** %18
%152 = call i32 @strspn(i8* %151, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds i8, i8* %150, i64 %153
store i8* %154, i8** %13
%155 = load i8*, i8** %13
%156 = load i8, i8* %155
%157 = sext i8 %156 to i32
%158 = icmp eq i32 %157, 0
br i1 %158, label %159, label %160
159: ; preds = %147
br label %44
160: ; preds = %147
%161 = load i8*, i8** %13
%162 = load i8, i8* %161
%163 = sext i8 %162 to i32
%164 = icmp eq i32 %163, 34
br i1 %164, label %165, label %176
165: ; preds = %160
%166 = load i8*, i8** %13
%167 = getelementptr inbounds i8, i8* %166, i32 1
store i8* %167, i8** %13
%168 = load i8*, i8** %13
%169 = call i8* @strchr(i8* %168, i8 signext 34)
store i8* %169, i8** %18
%170 = load i8*, i8** %18
%171 = icmp eq i8* %170, null
br i1 %171, label %172, label %173
172: ; preds = %165
br label %44
173: ; preds = %165
%174 = load i8*, i8** %18
%175 = getelementptr inbounds i8, i8* %174, i32 1
store i8* %175, i8** %18
store i8 0, i8* %174
br label %198
176: ; preds = %160
%177 = load i8*, i8** %13
%178 = load i8*, i8** %13
%179 = call i32 @strcspn(i8* %178, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds i8, i8* %177, i64 %180
store i8* %181, i8** %18
%182 = load i8*, i8** %13
%183 = load i8, i8* %182
%184 = sext i8 %183 to i32
%185 = icmp eq i32 %184, 33
br i1 %185, label %186, label %187
186: ; preds = %176
store i8* null, i8** %13
br label %197
187: ; preds = %176
%188 = load i8*, i8** %18
%189 = load i8, i8* %188
%190 = sext i8 %189 to i32
%191 = icmp eq i32 %190, 0
br i1 %191, label %192, label %193
192: ; preds = %187
br label %44
193: ; preds = %187
%194 = load i8*, i8** %18
%195 = getelementptr inbounds i8, i8* %194, i32 1
store i8* %195, i8** %18
store i8 0, i8* %194
br label %196
196: ; preds = %193
br label %197
197: ; preds = %196, %186
br label %198
198: ; preds = %197, %173
%199 = load i8*, i8** %12
%200 = call i32 @frob_escapes(i8* %199, i32 1)
%201 = load i8*, i8** %13
%202 = icmp ne i8* %201, null
br i1 %202, label %203, label %206
203: ; preds = %198
%204 = load i8*, i8** %13
%205 = call i32 @frob_escapes(i8* %204, i32 0)
br label %206
206: ; preds = %203, %198
%207 = load i8*, i8** %12
%208 = load i32, i32* %14
%209 = call i32 @regcomp(i32* %16, i8* %207, i32 %208)
store i32 %209, i32* %7
%210 = load i32, i32* %7
%211 = icmp ne i32 %210, 0
br i1 %211, label %212, label %222
212: ; preds = %206
%213 = load i8*, i8** %13
%214 = icmp ne i8* %213, null
br i1 %214, label %215, label %221
215: ; preds = %212
%216 = load i32, i32* %7
%217 = getelementptr inbounds [500 x i8], [500 x i8]* %21, i64 0, i64 0
%218 = call i32 @regerror(i32 %216, i32* %16, i8* %217, i32 500)
%219 = getelementptr inbounds [500 x i8], [500 x i8]* %21, i64 0, i64 0
%220 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i8* %219)
store i32 1, i32* %6
br label %221
221: ; preds = %215, %212
br label %44
222: ; preds = %206
%223 = load i8*, i8** %13
%224 = icmp eq i8* %223, null
br i1 %224, label %225, label %228
225: ; preds = %222
%226 = call i32 @regfree(i32* %16)
%227 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
store i32 1, i32* %6
br label %44
228: ; preds = %222
br label %229
229: ; preds = %228
%230 = load i8*, i8** %13
%231 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %17, i64 0, i64 0
%232 = load i32, i32* %15
%233 = call i64 @regexec(i32* %16, i8* %230, i32 20, %struct.TYPE_3__* %231, i32 %232)
%234 = icmp ne i64 %233, 0
br i1 %234, label %235, label %252
235: ; preds = %229
store i32 0, i32* %20
br label %236
236: ; preds = %248, %235
%237 = load i32, i32* %20
%238 = icmp slt i32 %237, 20
br i1 %238, label %239, label %251
239: ; preds = %236
%240 = load i32, i32* %20
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %17, i64 0, i64 %241
%243 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %242, i32 0, i32 0
store i32 -1, i32* %243
%244 = load i32, i32* %20
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %17, i64 0, i64 %245
%247 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %246, i32 0, i32 1
store i32 -1, i32* %247
br label %248
248: ; preds = %239
%249 = load i32, i32* %20
%250 = add nsw i32 %249, 1
store i32 %250, i32* %20
br label %236
251: ; preds = %236
br label %252
252: ; preds = %251, %229
%253 = call i32 @regfree(i32* %16)
store i32 0, i32* %20
br label %254
254: ; preds = %312, %252
%255 = load i32, i32* %20
%256 = icmp slt i32 %255, 20
br i1 %256, label %257, label %262
257: ; preds = %254
%258 = load i8*, i8** %18
%259 = load i8, i8* %258
%260 = sext i8 %259 to i32
%261 = icmp ne i32 %260, 0
br label %262
262: ; preds = %257, %254
%263 = phi i1 [ false, %254 ], [ %261, %257 ]
br i1 %263, label %264, label %315
264: ; preds = %262
%265 = load i8*, i8** %18
%266 = call i32 @strtol(i8* %265, i8** %19, i32 10)
store i32 %266, i32* %22
%267 = load i8*, i8** %18
%268 = load i8*, i8** %19
%269 = icmp eq i8* %267, %268
br i1 %269, label %270, label %271
270: ; preds = %264
br label %315
271: ; preds = %264
%272 = load i8*, i8** %19
store i8* %272, i8** %18
%273 = load i8*, i8** %18
%274 = call i32 @strtol(i8* %273, i8** %19, i32 10)
store i32 %274, i32* %23
%275 = load i8*, i8** %18
%276 = load i8*, i8** %19
%277 = icmp eq i8* %275, %276
br i1 %277, label %278, label %279
278: ; preds = %271
br label %315
279: ; preds = %271
%280 = load i8*, i8** %19
store i8* %280, i8** %18
%281 = load i32, i32* %20
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %17, i64 0, i64 %282
%284 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %283, i32 0, i32 0
%285 = load i32, i32* %284
%286 = load i32, i32* %22
%287 = icmp ne i32 %285, %286
br i1 %287, label %296, label %288
288: ; preds = %279
%289 = load i32, i32* %20
%290 = sext i32 %289 to i64
%291 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %17, i64 0, i64 %290
%292 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %291, i32 0, i32 1
%293 = load i32, i32* %292
%294 = load i32, i32* %23
%295 = icmp ne i32 %293, %294
br i1 %295, label %296, label %311
296: ; preds = %288, %279
%297 = load i32, i32* %20
%298 = load i32, i32* %20
%299 = sext i32 %298 to i64
%300 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %17, i64 0, i64 %299
%301 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %300, i32 0, i32 0
%302 = load i32, i32* %301
%303 = load i32, i32* %20
%304 = sext i32 %303 to i64
%305 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %17, i64 0, i64 %304
%306 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %305, i32 0, i32 1
%307 = load i32, i32* %306
%308 = load i32, i32* %22
%309 = load i32, i32* %23
%310 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i32 %297, i32 %302, i32 %307, i32 %308, i32 %309)
store i32 1, i32* %6
br label %315
311: ; preds = %288
br label %312
312: ; preds = %311
%313 = load i32, i32* %20
%314 = add nsw i32 %313, 1
store i32 %314, i32* %20
br label %254
315: ; preds = %296, %278, %270, %262
br label %44
316: ; preds = %44
%317 = load i8*, i8** %8
%318 = call i32 @free(i8* %317)
%319 = load i32*, i32** %11
%320 = call i32 @fclose(i32* %319)
%321 = load i32, i32* %6
store i32 %321, i32* %3
br label %322
322: ; preds = %316, %37, %27
%323 = load i32, i32* %3
ret i32 %323
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32 }
@REG_EXTENDED = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"Missing test filename\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [18 x i8] c"Couldn't open %s\0A\00"
@.str.3 = [10 x i8] c"REG_BASIC\00"
@.str.4 = [10 x i8] c"REG_ICASE\00"
@REG_ICASE = global i32 0
@.str.5 = [12 x i8] c"REG_NEWLINE\00"
@REG_NEWLINE = global i32 0
@.str.6 = [11 x i8] c"REG_NOTBOL\00"
@REG_NOTBOL = global i32 0
@.str.7 = [11 x i8] c"REG_NOTEOL\00"
@REG_NOTEOL = global i32 0
@.str.8 = [3 x i8] c" \09\00"
@.str.9 = [38 x i8] c"FAIL regcomp unexpectedly failed: %s\0A\00"
@.str.10 = [37 x i8] c"FAIL regcomp unpexpectedly succeeded\00"
@.str.11 = [39 x i8] c"FAIL rm[%d] %d..%d != expected %d..%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca [20 x %struct.TYPE_3__]
%7 = bitcast [20 x %struct.TYPE_3__]* %6 to i8*
%8 = alloca i8*
%9 = alloca [500 x i8]
%10 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%11 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%12 = load i32, i32* @REG_EXTENDED
%13 = bitcast i32* %5 to i8*
%14 = icmp slt i32 %0, 2
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %176
18: ; preds = %2
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = tail call i32* @fopen(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %30, label %23
23: ; preds = %18
%24 = call i32 @getline(i8** %3, i64* %4, i32* %21)
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %171
26: ; preds = %23
%27 = bitcast i8** %8 to i8*
%28 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 0
%29 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %6, i64 0, i64 0
br label %34
30: ; preds = %18
%31 = load i32, i32* @stderr
%32 = load i8*, i8** %19
%33 = tail call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %32)
br label %176
34: ; preds = %26, %165
%35 = phi i32 [ %24, %26 ], [ %169, %165 ]
%36 = phi i32 [ 0, %26 ], [ %168, %165 ]
%37 = phi i32 [ 0, %26 ], [ %167, %165 ]
%38 = phi i32 [ %12, %26 ], [ %166, %165 ]
%39 = load i8*, i8** %3
%40 = add nsw i32 %35, -1
%41 = zext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %39, i64 %41
%43 = load i8, i8* %42
%44 = icmp eq i8 %43, 10
br i1 %44, label %45, label %47
45: ; preds = %34
store i8 0, i8* %42
%46 = load i8*, i8** %3
br label %47
47: ; preds = %45, %34
%48 = phi i8* [ %46, %45 ], [ %39, %34 ]
%49 = call i32 @puts(i8* dereferenceable(1) %48)
%50 = load i8*, i8** %3
%51 = load i8, i8* %50
switch i8 %51, label %80 [
i8 59, label %165
i8 0, label %165
i8 45, label %52
]
52: ; preds = %47
%53 = call i64 @strstr(i8* %50, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
%55 = load i32, i32* @REG_EXTENDED
%56 = select i1 %54, i32 %55, i32 0
%57 = load i8*, i8** %3
%58 = call i64 @strstr(i8* %57, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
%60 = load i32, i32* @REG_ICASE
%61 = select i1 %59, i32 0, i32 %60
%62 = or i32 %61, %56
%63 = load i8*, i8** %3
%64 = call i64 @strstr(i8* %63, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
%66 = load i32, i32* @REG_NEWLINE
%67 = select i1 %65, i32 0, i32 %66
%68 = or i32 %62, %67
%69 = load i8*, i8** %3
%70 = call i64 @strstr(i8* %69, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
%72 = load i32, i32* @REG_NOTBOL
%73 = select i1 %71, i32 0, i32 %72
%74 = load i8*, i8** %3
%75 = call i64 @strstr(i8* %74, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
%77 = load i32, i32* @REG_NOTEOL
%78 = select i1 %76, i32 0, i32 %77
%79 = or i32 %78, %73
br label %165
80: ; preds = %47
%81 = call i32 @strspn(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8, i8* %50, i64 %82
%84 = load i8, i8* %83
%85 = icmp eq i8 %84, 0
br i1 %85, label %165, label %86
86: ; preds = %80
%87 = call i32 @strcspn(i8* %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8, i8* %83, i64 %88
%90 = load i8, i8* %89
%91 = icmp eq i8 %90, 0
br i1 %91, label %165, label %92
92: ; preds = %86
%93 = getelementptr inbounds i8, i8* %89, i64 1
store i8 0, i8* %89
%94 = call i32 @strspn(i8* %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8, i8* %93, i64 %95
%97 = load i8, i8* %96
switch i8 %97, label %102 [
i8 0, label %165
i8 34, label %98
]
98: ; preds = %92
%99 = getelementptr inbounds i8, i8* %96, i64 1
%100 = call i8* @strchr(i8* %99, i8 signext 34)
%101 = icmp eq i8* %100, null
br i1 %101, label %165, label %114
102: ; preds = %92
%103 = call i32 @strcspn(i8* %96, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i8, i8* %96, i64 %104
%106 = icmp eq i8 %97, 33
br i1 %106, label %110, label %107
107: ; preds = %102
%108 = load i8, i8* %105
%109 = icmp eq i8 %108, 0
br i1 %109, label %165, label %114
110: ; preds = %102
%111 = call i32 @frob_escapes(i8* %83, i32 1)
%112 = call i32 @regcomp(i32* %5, i8* %83, i32 %38)
%113 = icmp eq i32 %112, 0
br i1 %113, label %125, label %165
114: ; preds = %107, %98
%115 = phi i8* [ %100, %98 ], [ %105, %107 ]
%116 = phi i8* [ %99, %98 ], [ %96, %107 ]
store i8 0, i8* %115
%117 = getelementptr inbounds i8, i8* %115, i64 1
%118 = call i32 @frob_escapes(i8* %83, i32 1)
%119 = call i32 @frob_escapes(i8* %116, i32 0)
%120 = call i32 @regcomp(i32* %5, i8* %83, i32 %38)
%121 = icmp eq i32 %120, 0
br i1 %121, label %128, label %122
122: ; preds = %114
%123 = call i32 @regerror(i32 %120, i32* %5, i8* %28, i32 500)
%124 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i8* %28)
br label %165
125: ; preds = %110
%126 = call i32 @regfree(i32* %5)
%127 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
br label %165
128: ; preds = %114
%129 = call i64 @regexec(i32* %5, i8* %116, i32 20, %struct.TYPE_3__* %29, i32 %37)
%130 = icmp eq i64 %129, 0
br i1 %130, label %132, label %131
131: ; preds = %128
br label %132
132: ; preds = %131, %128
%133 = call i32 @regfree(i32* %5)
br label %134
134: ; preds = %132, %162
%135 = phi i64 [ 0, %132 ], [ %163, %162 ]
%136 = phi i8* [ %117, %132 ], [ %145, %162 ]
%137 = load i8, i8* %136
%138 = icmp eq i8 %137, 0
br i1 %138, label %165, label %139
139: ; preds = %134
%140 = call i32 @strtol(i8* %136, i8** %8, i32 10)
%141 = load i8*, i8** %8
%142 = icmp eq i8* %136, %141
br i1 %142, label %165, label %143
143: ; preds = %139
%144 = call i32 @strtol(i8* %141, i8** %8, i32 10)
%145 = load i8*, i8** %8
%146 = icmp eq i8* %141, %145
br i1 %146, label %165, label %147
147: ; preds = %143
%148 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %6, i64 0, i64 %135, i32 0
%149 = load i32, i32* %148
%150 = icmp eq i32 %149, %140
br i1 %150, label %151, label %155
151: ; preds = %147
%152 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %6, i64 0, i64 %135, i32 1
%153 = load i32, i32* %152
%154 = icmp eq i32 %153, %144
br i1 %154, label %162, label %155
155: ; preds = %151, %147
%156 = phi i32 [ %140, %151 ], [ %149, %147 ]
%157 = trunc i64 %135 to i32
%158 = and i64 %135, 4294967295
%159 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %6, i64 0, i64 %158, i32 1
%160 = load i32, i32* %159
%161 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i32 %157, i32 %156, i32 %160, i32 %140, i32 %144)
br label %165
162: ; preds = %151
%163 = add nuw nsw i64 %135, 1
%164 = icmp eq i64 %163, 20
br i1 %164, label %165, label %134
165: ; preds = %143, %139, %134, %162, %155, %110, %122, %107, %98, %92, %86, %80, %47, %47, %125, %52
%166 = phi i32 [ %68, %52 ], [ %38, %125 ], [ %38, %47 ], [ %38, %47 ], [ %38, %80 ], [ %38, %86 ], [ %38, %92 ], [ %38, %98 ], [ %38, %107 ], [ %38, %122 ], [ %38, %110 ], [ %38, %155 ], [ %38, %162 ], [ %38, %134 ], [ %38, %139 ], [ %38, %143 ]
%167 = phi i32 [ %79, %52 ], [ %37, %125 ], [ %37, %47 ], [ %37, %47 ], [ %37, %80 ], [ %37, %86 ], [ %37, %92 ], [ %37, %98 ], [ %37, %107 ], [ %37, %122 ], [ %37, %110 ], [ %37, %155 ], [ %37, %162 ], [ %37, %134 ], [ %37, %139 ], [ %37, %143 ]
%168 = phi i32 [ %36, %52 ], [ 1, %125 ], [ %36, %47 ], [ %36, %47 ], [ %36, %80 ], [ %36, %86 ], [ %36, %92 ], [ %36, %98 ], [ %36, %107 ], [ 1, %122 ], [ %36, %110 ], [ 1, %155 ], [ %36, %162 ], [ %36, %134 ], [ %36, %139 ], [ %36, %143 ]
%169 = call i32 @getline(i8** %3, i64* %4, i32* %21)
%170 = icmp sgt i32 %169, 0
br i1 %170, label %34, label %171
171: ; preds = %165, %23
%172 = phi i32 [ 0, %23 ], [ %168, %165 ]
%173 = load i8*, i8** %3
%174 = call i32 @free(i8* %173)
%175 = call i32 @fclose(i32* %21)
br label %176
176: ; preds = %171, %30, %15
%177 = phi i32 [ 1, %15 ], [ 1, %30 ], [ %172, %171 ]
ret i32 %177
}