#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 /*<<< 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*/ mtrace();
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 = 1;
  int eflags = 0;
  regex_t re;
  regmatch_t rm[20];
  mtrace();
  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 = 1;
      if (strstr(line, "REG_ICASE"))
        flags |= (1 << 1);
      if (strstr(line, "REG_NEWLINE"))
        flags |= ((1 << 1) << 1);
      eflags = 0;
      if (strstr(line, "REG_NOTBOL"))
        eflags |= 1;
      if (strstr(line, "REG_NOTEOL"))
        eflags |= (1 << 1);
      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)
movl   $0x1,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
mov    $0x0,%al
call   1130 <mtrace@plt>
cmpl   $0x2,-0x8(%rbp)
jge    1292 <main+0x72>
mov    0x2d6a(%rip),%rax
mov    (%rax),%edi
lea    0xd81(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    18ce <main+0x6ae>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd76(%rip),%rsi
call   1110 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    12e0 <main+0xc0>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd4c(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    18ce <main+0x6ae>
jmp    12e5 <main+0xc5>
mov    -0x38(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1120 <getline@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jle    18b6 <main+0x696>
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1330 <main+0x110>
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    134e <main+0x12e>
jmp    12e5 <main+0xc5>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1363 <main+0x143>
jmp    12e5 <main+0xc5>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1438 <main+0x218>
mov    -0x20(%rbp),%rdi
lea    0xcad(%rip),%rsi
call   1140 <strstr@plt>
cmp    $0x0,%rax
je     1399 <main+0x179>
movl   $0x0,-0x4c(%rbp)
jmp    13a0 <main+0x180>
movl   $0x1,-0x4c(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc8a(%rip),%rsi
call   1140 <strstr@plt>
cmp    $0x0,%rax
je     13c3 <main+0x1a3>
mov    -0x4c(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc71(%rip),%rsi
call   1140 <strstr@plt>
cmp    $0x0,%rax
je     13e6 <main+0x1c6>
mov    -0x4c(%rbp),%eax
or     $0x4,%eax
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc53(%rip),%rsi
call   1140 <strstr@plt>
cmp    $0x0,%rax
je     1410 <main+0x1f0>
mov    -0x50(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x50(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc3b(%rip),%rsi
call   1140 <strstr@plt>
cmp    $0x0,%rax
je     1433 <main+0x213>
mov    -0x50(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x50(%rbp)
jmp    12e5 <main+0xc5>
mov    -0x20(%rbp),%rax
mov    %rax,-0x320(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc13(%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    147b <main+0x25b>
jmp    12e5 <main+0xc5>
mov    -0x40(%rbp),%rax
mov    %rax,-0x328(%rbp)
mov    -0x40(%rbp),%rdi
lea    0xbd0(%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    14c4 <main+0x2a4>
jmp    12e5 <main+0xc5>
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    0xb69(%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    1525 <main+0x305>
jmp    12e5 <main+0xc5>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1586 <main+0x366>
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    1569 <main+0x349>
jmp    12e5 <main+0xc5>
mov    -0x108(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x108(%rbp)
movb   $0x0,(%rax)
jmp    160e <main+0x3ee>
mov    -0x48(%rbp),%rax
mov    %rax,-0x338(%rbp)
mov    -0x48(%rbp),%rdi
lea    0xac5(%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    15d4 <main+0x3b4>
movq   $0x0,-0x48(%rbp)
jmp    1609 <main+0x3e9>
mov    -0x108(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    15ec <main+0x3cc>
jmp    12e5 <main+0xc5>
mov    -0x108(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x108(%rbp)
movb   $0x0,(%rax)
jmp    1609 <main+0x3e9>
jmp    160e <main+0x3ee>
mov    -0x40(%rbp),%rdi
mov    $0x1,%esi
call   1050 <frob_escapes@plt>
cmpq   $0x0,-0x48(%rbp)
je     1632 <main+0x412>
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     1693 <main+0x473>
cmpq   $0x0,-0x48(%rbp)
je     168e <main+0x46e>
mov    -0x18(%rbp),%edi
lea    -0x310(%rbp),%rdx
lea    -0x54(%rbp),%rsi
mov    $0x1f4,%ecx
call   10f0 <regerror@plt>
lea    -0x310(%rbp),%rsi
lea    0x9e4(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    12e5 <main+0xc5>
cmpq   $0x0,-0x48(%rbp)
jne    16bf <main+0x49f>
lea    -0x54(%rbp),%rdi
call   1070 <regfree@plt>
lea    0x9dc(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x14(%rbp)
jmp    12e5 <main+0xc5>
jmp    16c4 <main+0x4a4>
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     173f <main+0x51f>
movl   $0x0,-0x114(%rbp)
cmpl   $0x14,-0x114(%rbp)
jge    173a <main+0x51a>
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    16f5 <main+0x4d5>
jmp    173f <main+0x51f>
lea    -0x54(%rbp),%rdi
call   1070 <regfree@plt>
movl   $0x0,-0x114(%rbp)
xor    %eax,%eax
cmpl   $0x14,-0x114(%rbp)
mov    %al,-0x339(%rbp)
jge    177d <main+0x55d>
mov    -0x108(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x339(%rbp)
mov    -0x339(%rbp),%al
test   $0x1,%al
jne    1790 <main+0x570>
jmp    18b1 <main+0x691>
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    17c7 <main+0x5a7>
jmp    18b1 <main+0x691>
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    180c <main+0x5ec>
jmp    18b1 <main+0x691>
mov    -0x110(%rbp),%rax
mov    %rax,-0x108(%rbp)
movslq -0x114(%rbp),%rax
mov    -0x100(%rbp,%rax,8),%eax
cmp    -0x314(%rbp),%eax
jne    184e <main+0x62e>
movslq -0x114(%rbp),%rax
mov    -0xfc(%rbp,%rax,8),%eax
cmp    -0x318(%rbp),%eax
je     1898 <main+0x678>
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    0x82a(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    18b1 <main+0x691>
jmp    189d <main+0x67d>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    1752 <main+0x532>
jmp    12e5 <main+0xc5>
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    $0x2b8,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
xor    %eax,%eax
call   1130 <mtrace@plt>
cmp    $0x1,%ebp
jg     1274 <main+0x54>
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
lea    0xd9d(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    $0x1,%eax
jmp    167a <main+0x45a>
mov    0x8(%rbx),%rdi
lea    0xd98(%rip),%rsi
call   1110 <fopen@plt>
test   %rax,%rax
je     163b <main+0x41b>
mov    %rax,%r12
mov    %rsp,%rdi
lea    0x8(%rsp),%rsi
mov    %rax,%rdx
call   1120 <getline@plt>
test   %eax,%eax
jle    165d <main+0x43d>
movl   $0x1,0x14(%rsp)
mov    %rsp,%r14
lea    0x8(%rsp),%r15
lea    0xda2(%rip),%rbp
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
jmp    137f <main+0x15f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r13,%rdi
lea    0xd41(%rip),%rsi
call   1140 <strstr@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    (%rsp),%rdi
lea    0xd33(%rip),%rsi
call   1140 <strstr@plt>
lea    0x2(%rbx),%ebp
test   %rax,%rax
cmove  %ebx,%ebp
mov    (%rsp),%rdi
lea    0xd24(%rip),%rsi
call   1140 <strstr@plt>
lea    0x4(%rbp),%ecx
test   %rax,%rax
cmove  %ebp,%ecx
mov    %ecx,0x14(%rsp)
lea    0xd2d(%rip),%rbp
mov    (%rsp),%rdi
lea    0xd0c(%rip),%rsi
call   1140 <strstr@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    (%rsp),%rdi
lea    0xcff(%rip),%rsi
call   1140 <strstr@plt>
lea    0x2(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,0x18(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1120 <getline@plt>
test   %eax,%eax
jle    1665 <main+0x445>
mov    (%rsp),%rdi
add    $0xffffffff,%eax
cmpb   $0xa,(%rdi,%rax,1)
jne    1394 <main+0x174>
movb   $0x0,(%rdi,%rax,1)
mov    (%rsp),%rdi
call   1040 <puts@plt>
mov    (%rsp),%r13
mov    0x0(%r13),%al
test   %al,%al
je     1369 <main+0x149>
cmp    $0x3b,%al
je     1369 <main+0x149>
cmp    $0x2d,%al
je     12e0 <main+0xc0>
mov    %r13,%rdi
mov    %rbp,%rsi
call   10a0 <strspn@plt>
cltq
cmpb   $0x0,0x0(%r13,%rax,1)
je     1369 <main+0x149>
add    %rax,%r13
mov    %r13,%rdi
mov    %rbp,%rsi
call   10c0 <strcspn@plt>
movslq %eax,%rbx
cmpb   $0x0,0x0(%r13,%rbx,1)
je     1369 <main+0x149>
add    %r13,%rbx
lea    0x1(%rbx),%rdi
movb   $0x0,(%rbx)
mov    %rbp,%rsi
call   10a0 <strspn@plt>
cltq
mov    0x1(%rbx,%rax,1),%bpl
test   %bpl,%bpl
je     1508 <main+0x2e8>
lea    (%rbx,%rax,1),%r15
add    $0x1,%r15
cmp    $0x22,%bpl
jne    142d <main+0x20d>
add    $0x1,%r15
mov    %r15,%rdi
mov    $0x22,%esi
call   1080 <strchr@plt>
mov    %rax,%r14
test   %rax,%rax
jne    149a <main+0x27a>
jmp    1500 <main+0x2e0>
mov    %r15,%rdi
lea    0xc2a(%rip),%rsi
call   10c0 <strcspn@plt>
cmp    $0x21,%bpl
jne    148e <main+0x26e>
mov    %r13,%rdi
mov    $0x1,%esi
call   1050 <frob_escapes@plt>
lea    0x1c(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
mov    0x14(%rsp),%edx
call   10b0 <regcomp@plt>
test   %eax,%eax
lea    0x8(%rsp),%r15
jne    1508 <main+0x2e8>
mov    %rbx,%rdi
call   1070 <regfree@plt>
lea    0xc0b(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,0x10(%rsp)
jmp    1508 <main+0x2e8>
movslq %eax,%r14
add    %r15,%r14
cmpb   $0x0,(%r14)
je     1500 <main+0x2e0>
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    0x1c(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
mov    0x14(%rsp),%edx
call   10b0 <regcomp@plt>
test   %eax,%eax
je     1514 <main+0x2f4>
mov    %eax,%edi
mov    %rbx,%rsi
lea    0xc0(%rsp),%rbx
mov    %rbx,%rdx
mov    $0x1f4,%ecx
call   10f0 <regerror@plt>
lea    0xb76(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
movl   $0x1,0x10(%rsp)
mov    %rsp,%r14
lea    0x8(%rsp),%r15
lea    0xb52(%rip),%rbp
jmp    1369 <main+0x149>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x14,%edx
lea    0x20(%rsp),%rcx
mov    0x18(%rsp),%r8d
call   1100 <regexec@plt>
test   %rax,%rax
je     157f <main+0x35f>
pcmpeqd %xmm0,%xmm0
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)
movdqa %xmm0,0x20(%rsp)
add    $0x1,%r14
mov    %rbx,%rdi
call   1070 <regfree@plt>
xor    %ebp,%ebp
lea    0x8(%rsp),%r15
lea    0xc0(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%r14)
je     1611 <main+0x3f1>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
call   10e0 <strtol@plt>
mov    %rbx,%rsi
mov    0xc0(%rsp),%rbx
cmp    %rbx,%r14
je     1500 <main+0x2e0>
mov    %eax,%r15d
mov    %rbx,%rdi
mov    $0xa,%edx
call   10e0 <strtol@plt>
mov    0xc0(%rsp),%r14
cmp    %r14,%rbx
je     1500 <main+0x2e0>
mov    0x20(%rsp,%rbp,8),%edx
cmp    %r15d,%edx
jne    161c <main+0x3fc>
cmp    %eax,0x24(%rsp,%rbp,8)
jne    1619 <main+0x3f9>
add    $0x1,%rbp
cmp    $0x14,%rbp
lea    0x8(%rsp),%r15
lea    0xc0(%rsp),%rbx
jne    15a0 <main+0x380>
mov    %rsp,%r14
jmp    1508 <main+0x2e8>
mov    %r15d,%edx
mov    0x24(%rsp,%rbp,8),%ecx
lea    0xa88(%rip),%rdi
mov    %ebp,%esi
mov    %r15d,%r8d
mov    %eax,%r9d
xor    %eax,%eax
call   1090 <printf@plt>
jmp    14f8 <main+0x2d8>
mov    0x299e(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0x9ca(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    $0x1,%eax
jmp    167a <main+0x45a>
movl   $0x0,0x10(%rsp)
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1060 <fclose@plt>
mov    0x10(%rsp),%eax
add    $0x2b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
@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"
@.str.5 = [12 x i8] c"REG_NEWLINE\00"
@.str.6 = [11 x i8] c"REG_NOTBOL\00"
@.str.7 = [11 x i8] c"REG_NOTEOL\00"
@.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
store i32 1, i32* %14
store i32 0, i32* %15
%24 = call i32 (...) @mtrace()
%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 %317
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 %317
43: ; preds = %30
br label %44
44: ; preds = %310, %220, %216, %187, %167, %154, %141, %130, %119, %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 %311
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 %120
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 %91
90: ; preds = %85
store i32 1, i32* %14
br label %91
91: ; preds = %90, %89
%92 = load i8*, i8** %8
%93 = call i64 @strstr(i8* %92, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%94 = icmp ne i64 %93, 0
br i1 %94, label %95, label %98
95: ; preds = %91
%96 = load i32, i32* %14
%97 = or i32 %96, 2
store i32 %97, i32* %14
br label %98
98: ; preds = %95, %91
%99 = load i8*, i8** %8
%100 = call i64 @strstr(i8* %99, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%101 = icmp ne i64 %100, 0
br i1 %101, label %102, label %105
102: ; preds = %98
%103 = load i32, i32* %14
%104 = or i32 %103, 4
store i32 %104, i32* %14
br label %105
105: ; preds = %102, %98
store i32 0, i32* %15
%106 = load i8*, i8** %8
%107 = call i64 @strstr(i8* %106, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%108 = icmp ne i64 %107, 0
br i1 %108, label %109, label %112
109: ; preds = %105
%110 = load i32, i32* %15
%111 = or i32 %110, 1
store i32 %111, i32* %15
br label %112
112: ; preds = %109, %105
%113 = load i8*, i8** %8
%114 = call i64 @strstr(i8* %113, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%115 = icmp ne i64 %114, 0
br i1 %115, label %116, label %119
116: ; preds = %112
%117 = load i32, i32* %15
%118 = or i32 %117, 2
store i32 %118, i32* %15
br label %119
119: ; preds = %116, %112
br label %44
120: ; preds = %79
%121 = load i8*, i8** %8
%122 = load i8*, i8** %8
%123 = call i32 @strspn(i8* %122, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i8, i8* %121, i64 %124
store i8* %125, i8** %12
%126 = load i8*, i8** %12
%127 = load i8, i8* %126
%128 = sext i8 %127 to i32
%129 = icmp eq i32 %128, 0
br i1 %129, label %130, label %131
130: ; preds = %120
br label %44
131: ; preds = %120
%132 = load i8*, i8** %12
%133 = load i8*, i8** %12
%134 = call i32 @strcspn(i8* %133, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i8, i8* %132, i64 %135
store i8* %136, i8** %18
%137 = load i8*, i8** %18
%138 = load i8, i8* %137
%139 = sext i8 %138 to i32
%140 = icmp eq i32 %139, 0
br i1 %140, label %141, label %142
141: ; preds = %131
br label %44
142: ; preds = %131
%143 = load i8*, i8** %18
%144 = getelementptr inbounds i8, i8* %143, i32 1
store i8* %144, i8** %18
store i8 0, i8* %143
%145 = load i8*, i8** %18
%146 = load i8*, i8** %18
%147 = call i32 @strspn(i8* %146, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds i8, i8* %145, i64 %148
store i8* %149, i8** %13
%150 = load i8*, i8** %13
%151 = load i8, i8* %150
%152 = sext i8 %151 to i32
%153 = icmp eq i32 %152, 0
br i1 %153, label %154, label %155
154: ; preds = %142
br label %44
155: ; preds = %142
%156 = load i8*, i8** %13
%157 = load i8, i8* %156
%158 = sext i8 %157 to i32
%159 = icmp eq i32 %158, 34
br i1 %159, label %160, label %171
160: ; preds = %155
%161 = load i8*, i8** %13
%162 = getelementptr inbounds i8, i8* %161, i32 1
store i8* %162, i8** %13
%163 = load i8*, i8** %13
%164 = call i8* @strchr(i8* %163, i8 signext 34)
store i8* %164, i8** %18
%165 = load i8*, i8** %18
%166 = icmp eq i8* %165, null
br i1 %166, label %167, label %168
167: ; preds = %160
br label %44
168: ; preds = %160
%169 = load i8*, i8** %18
%170 = getelementptr inbounds i8, i8* %169, i32 1
store i8* %170, i8** %18
store i8 0, i8* %169
br label %193
171: ; preds = %155
%172 = load i8*, i8** %13
%173 = load i8*, i8** %13
%174 = call i32 @strcspn(i8* %173, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds i8, i8* %172, i64 %175
store i8* %176, i8** %18
%177 = load i8*, i8** %13
%178 = load i8, i8* %177
%179 = sext i8 %178 to i32
%180 = icmp eq i32 %179, 33
br i1 %180, label %181, label %182
181: ; preds = %171
store i8* null, i8** %13
br label %192
182: ; preds = %171
%183 = load i8*, i8** %18
%184 = load i8, i8* %183
%185 = sext i8 %184 to i32
%186 = icmp eq i32 %185, 0
br i1 %186, label %187, label %188
187: ; preds = %182
br label %44
188: ; preds = %182
%189 = load i8*, i8** %18
%190 = getelementptr inbounds i8, i8* %189, i32 1
store i8* %190, i8** %18
store i8 0, i8* %189
br label %191
191: ; preds = %188
br label %192
192: ; preds = %191, %181
br label %193
193: ; preds = %192, %168
%194 = load i8*, i8** %12
%195 = call i32 @frob_escapes(i8* %194, i32 1)
%196 = load i8*, i8** %13
%197 = icmp ne i8* %196, null
br i1 %197, label %198, label %201
198: ; preds = %193
%199 = load i8*, i8** %13
%200 = call i32 @frob_escapes(i8* %199, i32 0)
br label %201
201: ; preds = %198, %193
%202 = load i8*, i8** %12
%203 = load i32, i32* %14
%204 = call i32 @regcomp(i32* %16, i8* %202, i32 %203)
store i32 %204, i32* %7
%205 = load i32, i32* %7
%206 = icmp ne i32 %205, 0
br i1 %206, label %207, label %217
207: ; preds = %201
%208 = load i8*, i8** %13
%209 = icmp ne i8* %208, null
br i1 %209, label %210, label %216
210: ; preds = %207
%211 = load i32, i32* %7
%212 = getelementptr inbounds [500 x i8], [500 x i8]* %21, i64 0, i64 0
%213 = call i32 @regerror(i32 %211, i32* %16, i8* %212, i32 500)
%214 = getelementptr inbounds [500 x i8], [500 x i8]* %21, i64 0, i64 0
%215 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i8* %214)
store i32 1, i32* %6
br label %216
216: ; preds = %210, %207
br label %44
217: ; preds = %201
%218 = load i8*, i8** %13
%219 = icmp eq i8* %218, null
br i1 %219, label %220, label %223
220: ; preds = %217
%221 = call i32 @regfree(i32* %16)
%222 = 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
223: ; preds = %217
br label %224
224: ; preds = %223
%225 = load i8*, i8** %13
%226 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %17, i64 0, i64 0
%227 = load i32, i32* %15
%228 = call i64 @regexec(i32* %16, i8* %225, i32 20, %struct.TYPE_3__* %226, i32 %227)
%229 = icmp ne i64 %228, 0
br i1 %229, label %230, label %247
230: ; preds = %224
store i32 0, i32* %20
br label %231
231: ; preds = %243, %230
%232 = load i32, i32* %20
%233 = icmp slt i32 %232, 20
br i1 %233, label %234, label %246
234: ; preds = %231
%235 = load i32, i32* %20
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %17, i64 0, i64 %236
%238 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %237, i32 0, i32 0
store i32 -1, i32* %238
%239 = load i32, i32* %20
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %17, i64 0, i64 %240
%242 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %241, i32 0, i32 1
store i32 -1, i32* %242
br label %243
243: ; preds = %234
%244 = load i32, i32* %20
%245 = add nsw i32 %244, 1
store i32 %245, i32* %20
br label %231
246: ; preds = %231
br label %247
247: ; preds = %246, %224
%248 = call i32 @regfree(i32* %16)
store i32 0, i32* %20
br label %249
249: ; preds = %307, %247
%250 = load i32, i32* %20
%251 = icmp slt i32 %250, 20
br i1 %251, label %252, label %257
252: ; preds = %249
%253 = load i8*, i8** %18
%254 = load i8, i8* %253
%255 = sext i8 %254 to i32
%256 = icmp ne i32 %255, 0
br label %257
257: ; preds = %252, %249
%258 = phi i1 [ false, %249 ], [ %256, %252 ]
br i1 %258, label %259, label %310
259: ; preds = %257
%260 = load i8*, i8** %18
%261 = call i32 @strtol(i8* %260, i8** %19, i32 10)
store i32 %261, i32* %22
%262 = load i8*, i8** %18
%263 = load i8*, i8** %19
%264 = icmp eq i8* %262, %263
br i1 %264, label %265, label %266
265: ; preds = %259
br label %310
266: ; preds = %259
%267 = load i8*, i8** %19
store i8* %267, i8** %18
%268 = load i8*, i8** %18
%269 = call i32 @strtol(i8* %268, i8** %19, i32 10)
store i32 %269, i32* %23
%270 = load i8*, i8** %18
%271 = load i8*, i8** %19
%272 = icmp eq i8* %270, %271
br i1 %272, label %273, label %274
273: ; preds = %266
br label %310
274: ; preds = %266
%275 = load i8*, i8** %19
store i8* %275, i8** %18
%276 = load i32, i32* %20
%277 = sext i32 %276 to i64
%278 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %17, i64 0, i64 %277
%279 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %278, i32 0, i32 0
%280 = load i32, i32* %279
%281 = load i32, i32* %22
%282 = icmp ne i32 %280, %281
br i1 %282, label %291, label %283
283: ; preds = %274
%284 = load i32, i32* %20
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %17, i64 0, i64 %285
%287 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %286, i32 0, i32 1
%288 = load i32, i32* %287
%289 = load i32, i32* %23
%290 = icmp ne i32 %288, %289
br i1 %290, label %291, label %306
291: ; preds = %283, %274
%292 = load i32, i32* %20
%293 = load i32, i32* %20
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %17, i64 0, i64 %294
%296 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %295, i32 0, i32 0
%297 = load i32, i32* %296
%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 1
%302 = load i32, i32* %301
%303 = load i32, i32* %22
%304 = load i32, i32* %23
%305 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i32 %292, i32 %297, i32 %302, i32 %303, i32 %304)
store i32 1, i32* %6
br label %310
306: ; preds = %283
br label %307
307: ; preds = %306
%308 = load i32, i32* %20
%309 = add nsw i32 %308, 1
store i32 %309, i32* %20
br label %249
310: ; preds = %291, %273, %265, %257
br label %44
311: ; preds = %44
%312 = load i8*, i8** %8
%313 = call i32 @free(i8* %312)
%314 = load i32*, i32** %11
%315 = call i32 @fclose(i32* %314)
%316 = load i32, i32* %6
store i32 %316, i32* %3
br label %317
317: ; preds = %311, %37, %27
%318 = load i32, i32* %3
ret i32 %318
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32 }
@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"
@.str.5 = [12 x i8] c"REG_NEWLINE\00"
@.str.6 = [11 x i8] c"REG_NOTBOL\00"
@.str.7 = [11 x i8] c"REG_NOTEOL\00"
@.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 = bitcast i32* %5 to i8*
%13 = tail call i32 (...) @mtrace()
%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 %171
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 %166
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 %171
34: ; preds = %26, %160
%35 = phi i32 [ %24, %26 ], [ %164, %160 ]
%36 = phi i32 [ 0, %26 ], [ %163, %160 ]
%37 = phi i32 [ 0, %26 ], [ %162, %160 ]
%38 = phi i32 [ 1, %26 ], [ %161, %160 ]
%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 %75 [
i8 59, label %160
i8 0, label %160
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 = zext i1 %54 to i32
%56 = load i8*, i8** %3
%57 = call i64 @strstr(i8* %56, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
%59 = or i32 %55, 2
%60 = select i1 %58, i32 %55, i32 %59
%61 = load i8*, i8** %3
%62 = call i64 @strstr(i8* %61, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
%64 = or i32 %60, 4
%65 = select i1 %63, i32 %60, i32 %64
%66 = load i8*, i8** %3
%67 = call i64 @strstr(i8* %66, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%68 = icmp ne i64 %67, 0
%69 = zext i1 %68 to i32
%70 = load i8*, i8** %3
%71 = call i64 @strstr(i8* %70, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%72 = icmp eq i64 %71, 0
%73 = or i32 %69, 2
%74 = select i1 %72, i32 %69, i32 %73
br label %160
75: ; preds = %47
%76 = call i32 @strspn(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %50, i64 %77
%79 = load i8, i8* %78
%80 = icmp eq i8 %79, 0
br i1 %80, label %160, label %81
81: ; preds = %75
%82 = call i32 @strcspn(i8* %78, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8, i8* %78, i64 %83
%85 = load i8, i8* %84
%86 = icmp eq i8 %85, 0
br i1 %86, label %160, label %87
87: ; preds = %81
%88 = getelementptr inbounds i8, i8* %84, i64 1
store i8 0, i8* %84
%89 = call i32 @strspn(i8* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8, i8* %88, i64 %90
%92 = load i8, i8* %91
switch i8 %92, label %97 [
i8 0, label %160
i8 34, label %93
]
93: ; preds = %87
%94 = getelementptr inbounds i8, i8* %91, i64 1
%95 = call i8* @strchr(i8* %94, i8 signext 34)
%96 = icmp eq i8* %95, null
br i1 %96, label %160, label %109
97: ; preds = %87
%98 = call i32 @strcspn(i8* %91, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i8, i8* %91, i64 %99
%101 = icmp eq i8 %92, 33
br i1 %101, label %105, label %102
102: ; preds = %97
%103 = load i8, i8* %100
%104 = icmp eq i8 %103, 0
br i1 %104, label %160, label %109
105: ; preds = %97
%106 = call i32 @frob_escapes(i8* %78, i32 1)
%107 = call i32 @regcomp(i32* %5, i8* %78, i32 %38)
%108 = icmp eq i32 %107, 0
br i1 %108, label %120, label %160
109: ; preds = %102, %93
%110 = phi i8* [ %95, %93 ], [ %100, %102 ]
%111 = phi i8* [ %94, %93 ], [ %91, %102 ]
store i8 0, i8* %110
%112 = getelementptr inbounds i8, i8* %110, i64 1
%113 = call i32 @frob_escapes(i8* %78, i32 1)
%114 = call i32 @frob_escapes(i8* %111, i32 0)
%115 = call i32 @regcomp(i32* %5, i8* %78, i32 %38)
%116 = icmp eq i32 %115, 0
br i1 %116, label %123, label %117
117: ; preds = %109
%118 = call i32 @regerror(i32 %115, i32* %5, i8* %28, i32 500)
%119 = 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 %160
120: ; preds = %105
%121 = call i32 @regfree(i32* %5)
%122 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
br label %160
123: ; preds = %109
%124 = call i64 @regexec(i32* %5, i8* %111, i32 20, %struct.TYPE_3__* %29, i32 %37)
%125 = icmp eq i64 %124, 0
br i1 %125, label %127, label %126
126: ; preds = %123
br label %127
127: ; preds = %126, %123
%128 = call i32 @regfree(i32* %5)
br label %129
129: ; preds = %127, %157
%130 = phi i64 [ 0, %127 ], [ %158, %157 ]
%131 = phi i8* [ %112, %127 ], [ %140, %157 ]
%132 = load i8, i8* %131
%133 = icmp eq i8 %132, 0
br i1 %133, label %160, label %134
134: ; preds = %129
%135 = call i32 @strtol(i8* %131, i8** %8, i32 10)
%136 = load i8*, i8** %8
%137 = icmp eq i8* %131, %136
br i1 %137, label %160, label %138
138: ; preds = %134
%139 = call i32 @strtol(i8* %136, i8** %8, i32 10)
%140 = load i8*, i8** %8
%141 = icmp eq i8* %136, %140
br i1 %141, label %160, label %142
142: ; preds = %138
%143 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %6, i64 0, i64 %130, i32 0
%144 = load i32, i32* %143
%145 = icmp eq i32 %144, %135
br i1 %145, label %146, label %150
146: ; preds = %142
%147 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %6, i64 0, i64 %130, i32 1
%148 = load i32, i32* %147
%149 = icmp eq i32 %148, %139
br i1 %149, label %157, label %150
150: ; preds = %146, %142
%151 = phi i32 [ %135, %146 ], [ %144, %142 ]
%152 = trunc i64 %130 to i32
%153 = and i64 %130, 4294967295
%154 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %6, i64 0, i64 %153, i32 1
%155 = load i32, i32* %154
%156 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i32 %152, i32 %151, i32 %155, i32 %135, i32 %139)
br label %160
157: ; preds = %146
%158 = add nuw nsw i64 %130, 1
%159 = icmp eq i64 %158, 20
br i1 %159, label %160, label %129
160: ; preds = %138, %134, %129, %157, %150, %105, %117, %102, %93, %87, %81, %75, %47, %47, %120, %52
%161 = phi i32 [ %65, %52 ], [ %38, %120 ], [ %38, %47 ], [ %38, %47 ], [ %38, %75 ], [ %38, %81 ], [ %38, %87 ], [ %38, %93 ], [ %38, %102 ], [ %38, %117 ], [ %38, %105 ], [ %38, %150 ], [ %38, %157 ], [ %38, %129 ], [ %38, %134 ], [ %38, %138 ]
%162 = phi i32 [ %74, %52 ], [ %37, %120 ], [ %37, %47 ], [ %37, %47 ], [ %37, %75 ], [ %37, %81 ], [ %37, %87 ], [ %37, %93 ], [ %37, %102 ], [ %37, %117 ], [ %37, %105 ], [ %37, %150 ], [ %37, %157 ], [ %37, %129 ], [ %37, %134 ], [ %37, %138 ]
%163 = phi i32 [ %36, %52 ], [ 1, %120 ], [ %36, %47 ], [ %36, %47 ], [ %36, %75 ], [ %36, %81 ], [ %36, %87 ], [ %36, %93 ], [ %36, %102 ], [ 1, %117 ], [ %36, %105 ], [ 1, %150 ], [ %36, %157 ], [ %36, %129 ], [ %36, %134 ], [ %36, %138 ]
%164 = call i32 @getline(i8** %3, i64* %4, i32* %21)
%165 = icmp sgt i32 %164, 0
br i1 %165, label %34, label %166
166: ; preds = %160, %23
%167 = phi i32 [ 0, %23 ], [ %163, %160 ]
%168 = load i8*, i8** %3
%169 = call i32 @free(i8* %168)
%170 = call i32 @fclose(i32* %21)
br label %171
171: ; preds = %166, %30, %15
%172 = phi i32 [ 1, %15 ], [ 1, %30 ], [ %167, %166 ]
ret i32 %172
}