#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 size_t 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 /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
size_t getline(char **, size_t *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
int /*<<< orphan*/ printf(char *, size_t, ...);
char *realloc(char *, size_t);
int regcomp(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ regerror(int, int /*<<< orphan*/ *, char *, int);
scalar_t__ regexec(int /*<<< orphan*/ *, char *, int, TYPE_1__ *,
                   int /*<<< orphan*/);
int /*<<< orphan*/ regfree(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
scalar_t__ strncmp(char *, char *, int);
char *strrchr(char *, char);
unsigned long strtoul(char *, char **, int);
int main(int argc, char **argv) {
  int ret = 0;
  char *line = NULL;
  size_t line_len = 0;
  ssize_t len;
  FILE *f;
  char *pattern = NULL, *string = NULL;
  regmatch_t rm[20];
  size_t pattern_alloced = 0, string_alloced = 0;
  int ignorecase = 0;
  int pattern_valid = 0, rm_valid = 0;
  size_t linenum;
  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;
  }
  if ((len = getline(&line, &line_len, f)) <= 0 ||
      strncmp(line, "# PCRE", 6) != 0) {
    fprintf(stderr, "Not a PCRE test file\n");
    fclose(f);
    free(line);
    return 1;
  }
  linenum = 1;
  while ((len = getline(&line, &line_len, f)) > 0) {
    char *p;
    unsigned long num;
    ++linenum;
    if (line[len - 1] == '\n')
      line[--len] = '\0';
    if (line[0] == '#')
      continue;
    if (line[0] == '\0') {
      ignorecase = 0;
      pattern_valid = 0;
      rm_valid = 0;
      continue;
    }
    if (line[0] == '/') {
      p = strrchr(line + 1, '/');
      pattern_valid = 0;
      rm_valid = 0;
      if (p == NULL) {
        printf("%lu: Invalid pattern line: %s\n", linenum, line);
        ret = 1;
        continue;
      }
      if (p[1] == 'i' && p[2] == '\0')
        ignorecase = 1;
      else if (p[1] != '\0') {
        printf("%lu: Invalid pattern line: %s\n", linenum, line);
        ret = 1;
        continue;
      }
      if (pattern_alloced < (size_t)(p - line)) {
        pattern = realloc(pattern, p - line);
        if (pattern == NULL) {
          printf("%lu: Cannot record pattern: %m\n", linenum);
          ret = 1;
          break;
        }
        pattern_alloced = p - line;
      }
      memcpy(pattern, line + 1, p - line - 1);
      pattern[p - line - 1] = '\0';
      pattern_valid = 1;
      continue;
    }
    if (strncmp(line, "    ", 4) == 0) {
      regex_t re;
      int n;
      if (!pattern_valid) {
        printf("%lu: No previous valid pattern %s\n", linenum, line);
        continue;
      }
      if (string_alloced < (size_t)(len - 3)) {
        string = realloc(string, len - 3);
        if (string == NULL) {
          printf("%lu: Cannot record search string: %m\n", linenum);
          ret = 1;
          break;
        }
        string_alloced = len - 3;
      }
      memcpy(string, line + 4, len - 3);
      n = regcomp(&re, pattern, REG_EXTENDED | (ignorecase ? REG_ICASE : 0));
      if (n != 0) {
        char buf[500];
        regerror(n, &re, buf, sizeof(buf));
        printf("%lu: regcomp failed for %s: %s\n", linenum, pattern, buf);
        ret = 1;
        continue;
      }
      if (regexec(&re, string, 20, rm, 0)) {
        rm[0].rm_so = -1;
        rm[0].rm_eo = -1;
      }
      regfree(&re);
      rm_valid = 1;
      continue;
    }
    if (!rm_valid) {
      printf("%lu: No preceeding pattern or search string\n", linenum);
      ret = 1;
      continue;
    }
    if (strcmp(line, "No match") == 0) {
      if (rm[0].rm_so != -1 || rm[0].rm_eo != -1) {
        printf("%lu: /%s/ on %s unexpectedly matched %d..%d\n", linenum,
               pattern, string, rm[0].rm_so, rm[0].rm_eo);
        ret = 1;
      }
      continue;
    }
    p = line;
    if (*p == ' ')
      ++p;
    num = strtoul(p, &p, 10);
    if (num >= 20 || *p != ':' || p[1] != ' ') {
      printf("%lu: Invalid line %s\n", linenum, line);
      ret = 1;
      continue;
    }
    if (rm[num].rm_so == -1 || rm[num].rm_eo == -1) {
      if (strcmp(p + 2, "<unset>") != 0) {
        printf("%lu: /%s/ on %s unexpectedly failed to match register %ld "
               "%d..%d\n",
               linenum, pattern, string, num, rm[num].rm_so, rm[num].rm_eo);
        ret = 1;
      }
      continue;
    }
    if (rm[num].rm_eo < rm[num].rm_so ||
        rm[num].rm_eo - rm[num].rm_so != len - (p + 2 - line) ||
        strncmp(p + 2, string + rm[num].rm_so, rm[num].rm_eo - rm[num].rm_so) !=
            0) {
      printf("%lu: /%s/ on %s unexpectedly failed to match %s for register %ld "
             "%d..%d\n",
             linenum, pattern, string, p + 2, num, rm[num].rm_so,
             rm[num].rm_eo);
      ret = 1;
      continue;
    }
  }
  free(pattern);
  free(string);
  free(line);
  fclose(f);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x360,%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)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0xf8(%rbp)
movq   $0x0,-0x100(%rbp)
movl   $0x0,-0x104(%rbp)
movl   $0x0,-0x108(%rbp)
movl   $0x0,-0x10c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    12a1 <main+0xa1>
mov    0x2d53(%rip),%rax
mov    (%rax),%edi
lea    0xd72(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1ac5 <main+0x8c5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd67(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    12ef <main+0xef>
mov    0x2d0d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd3d(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1ac5 <main+0x8c5>
mov    -0x38(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1120 <getline@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jbe    132d <main+0x12d>
mov    -0x20(%rbp),%rdi
lea    0xd12(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     1362 <main+0x162>
mov    0x2ca4(%rip),%rax
mov    (%rax),%edi
lea    0xcf5(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    1ac5 <main+0x8c5>
movq   $0x1,-0x118(%rbp)
mov    -0x38(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1120 <getline@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jbe    1a9b <main+0x89b>
mov    -0x118(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x118(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    13cf <main+0x1cf>
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x30(%rbp)
movb   $0x0,-0x1(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    13e4 <main+0x1e4>
jmp    136d <main+0x16d>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1417 <main+0x217>
movl   $0x0,-0x104(%rbp)
movl   $0x0,-0x108(%rbp)
movl   $0x0,-0x10c(%rbp)
jmp    136d <main+0x16d>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    15c2 <main+0x3c2>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
mov    %rax,-0x120(%rbp)
movl   $0x0,-0x108(%rbp)
movl   $0x0,-0x10c(%rbp)
cmpq   $0x0,-0x120(%rbp)
jne    1487 <main+0x287>
mov    -0x118(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xbd4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    136d <main+0x16d>
mov    -0x120(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x69,%eax
jne    14be <main+0x2be>
mov    -0x120(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    14be <main+0x2be>
movl   $0x1,-0x104(%rbp)
jmp    14fc <main+0x2fc>
mov    -0x120(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     14f7 <main+0x2f7>
mov    -0x118(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xb64(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    136d <main+0x16d>
jmp    14fc <main+0x2fc>
mov    -0xf8(%rbp),%rax
mov    -0x120(%rbp),%rcx
mov    -0x20(%rbp),%rdx
sub    %rdx,%rcx
cmp    %rcx,%rax
jae    1576 <main+0x376>
mov    -0x40(%rbp),%rdi
mov    -0x120(%rbp),%rsi
mov    -0x20(%rbp),%rax
sub    %rax,%rsi
call   10f0 <realloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1561 <main+0x361>
mov    -0x118(%rbp),%rsi
lea    0xb19(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1a9b <main+0x89b>
mov    -0x120(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0xf8(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
mov    -0x120(%rbp),%rdx
mov    -0x20(%rbp),%rax
sub    %rax,%rdx
sub    $0x1,%rdx
call   10c0 <memcpy@plt>
mov    -0x40(%rbp),%rax
mov    -0x120(%rbp),%rcx
mov    -0x20(%rbp),%rdx
sub    %rdx,%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x1,-0x108(%rbp)
jmp    136d <main+0x16d>
mov    -0x20(%rbp),%rdi
lea    0xaba(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    17ab <main+0x5ab>
cmpl   $0x0,-0x108(%rbp)
jne    160c <main+0x40c>
mov    -0x118(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xa8c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    136d <main+0x16d>
mov    -0x100(%rbp),%rax
mov    -0x30(%rbp),%rcx
sub    $0x3,%rcx
cmp    %rcx,%rax
jae    1674 <main+0x474>
mov    -0x48(%rbp),%rdi
mov    -0x30(%rbp),%rsi
sub    $0x3,%rsi
call   10f0 <realloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1665 <main+0x465>
mov    -0x118(%rbp),%rsi
lea    0xa5d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1a9b <main+0x89b>
mov    -0x30(%rbp),%rax
sub    $0x3,%rax
mov    %rax,-0x100(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x4,%rsi
mov    -0x30(%rbp),%rdx
sub    $0x3,%rdx
call   10c0 <memcpy@plt>
mov    -0x40(%rbp),%rax
mov    %rax,-0x340(%rbp)
mov    0x2931(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x334(%rbp)
cmpl   $0x0,-0x104(%rbp)
je     16c8 <main+0x4c8>
mov    0x292d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x344(%rbp)
jmp    16d5 <main+0x4d5>
xor    %eax,%eax
mov    %eax,-0x344(%rbp)
jmp    16d5 <main+0x4d5>
mov    -0x340(%rbp),%rsi
mov    -0x334(%rbp),%edx
mov    -0x344(%rbp),%eax
or     %eax,%edx
lea    -0x12c(%rbp),%rdi
call   1090 <regcomp@plt>
mov    %eax,-0x130(%rbp)
cmpl   $0x0,-0x130(%rbp)
je     1753 <main+0x553>
mov    -0x130(%rbp),%edi
lea    -0x330(%rbp),%rdx
lea    -0x12c(%rbp),%rsi
mov    $0x1f4,%ecx
call   10d0 <regerror@plt>
mov    -0x118(%rbp),%rsi
mov    -0x40(%rbp),%rdx
lea    -0x330(%rbp),%rcx
lea    0x995(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    136d <main+0x16d>
mov    -0x48(%rbp),%rsi
lea    -0xf0(%rbp),%rcx
lea    -0x12c(%rbp),%rdi
mov    $0x14,%edx
xor    %r8d,%r8d
call   10e0 <regexec@plt>
cmp    $0x0,%rax
je     1790 <main+0x590>
movl   $0xffffffff,-0xf0(%rbp)
ff ff ff
movl   $0xffffffff,-0xec(%rbp)
ff ff ff
lea    -0x12c(%rbp),%rdi
call   1060 <regfree@plt>
movl   $0x1,-0x10c(%rbp)
jmp    136d <main+0x16d>
cmpl   $0x0,-0x10c(%rbp)
jne    17d9 <main+0x5d9>
mov    -0x118(%rbp),%rsi
lea    0x92f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    136d <main+0x16d>
mov    -0x20(%rbp),%rdi
lea    0x93e(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1844 <main+0x644>
cmpl   $0xffffffff,-0xf0(%rbp)
jne    180d <main+0x60d>
cmpl   $0xffffffff,-0xec(%rbp)
je     183f <main+0x63f>
mov    -0x118(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0xf0(%rbp),%r8d
mov    -0xec(%rbp),%r9d
lea    0x8fa(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    136d <main+0x16d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    -0x120(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1874 <main+0x674>
mov    -0x120(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x120(%rbp)
mov    -0x120(%rbp),%rdi
lea    -0x120(%rbp),%rsi
mov    $0xa,%edx
call   1110 <strtoul@plt>
mov    %rax,-0x128(%rbp)
cmpq   $0x14,-0x128(%rbp)
14
jae    18c8 <main+0x6c8>
mov    -0x120(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    18c8 <main+0x6c8>
mov    -0x120(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x20,%eax
je     18ed <main+0x6ed>
mov    -0x118(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0x87e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    136d <main+0x16d>
mov    -0x128(%rbp),%rax
cmpl   $0xffffffff,-0xf0(%rbp,%rax,8)
ff
je     1917 <main+0x717>
mov    -0x128(%rbp),%rax
cmpl   $0xffffffff,-0xec(%rbp,%rax,8)
ff
jne    1988 <main+0x788>
mov    -0x120(%rbp),%rdi
add    $0x2,%rdi
lea    0x845(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     1983 <main+0x783>
mov    -0x118(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x128(%rbp),%r8
mov    -0x128(%rbp),%rax
mov    -0xf0(%rbp,%rax,8),%r9d
ff
mov    -0x128(%rbp),%rax
mov    -0xec(%rbp,%rax,8),%eax
lea    0x804(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    136d <main+0x16d>
mov    -0x128(%rbp),%rax
mov    -0xec(%rbp,%rax,8),%eax
mov    -0x128(%rbp),%rcx
cmp    -0xf0(%rbp,%rcx,8),%eax
jl     1a36 <main+0x836>
mov    -0x128(%rbp),%rax
mov    -0xec(%rbp,%rax,8),%eax
mov    -0x128(%rbp),%rcx
sub    -0xf0(%rbp,%rcx,8),%eax
cltq
mov    -0x30(%rbp),%rcx
mov    -0x120(%rbp),%rdx
add    $0x2,%rdx
mov    -0x20(%rbp),%rsi
sub    %rsi,%rdx
sub    %rdx,%rcx
cmp    %rcx,%rax
jne    1a36 <main+0x836>
mov    -0x120(%rbp),%rdi
add    $0x2,%rdi
mov    -0x48(%rbp),%rsi
mov    -0x128(%rbp),%rax
movslq -0xf0(%rbp,%rax,8),%rax
ff
add    %rax,%rsi
mov    -0x128(%rbp),%rax
mov    -0xec(%rbp,%rax,8),%edx
mov    -0x128(%rbp),%rax
sub    -0xf0(%rbp,%rax,8),%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     1a96 <main+0x896>
mov    -0x118(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x120(%rbp),%r8
add    $0x2,%r8
mov    -0x128(%rbp),%r9
mov    -0x128(%rbp),%rax
mov    -0xf0(%rbp,%rax,8),%r10d
ff
mov    -0x128(%rbp),%rax
mov    -0xec(%rbp,%rax,8),%eax
lea    0x73d(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    136d <main+0x16d>
jmp    136d <main+0x16d>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x360,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2f8,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,0x58(%rsp)
cmp    $0x1,%edi
jg     124a <main+0x4a>
mov    0x2da9(%rip),%rax
mov    (%rax),%edi
lea    0xdc8(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x1,%r14d
jmp    187a <main+0x67a>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xdbf(%rip),%rsi
call   1100 <fopen@plt>
test   %rax,%rax
je     12cb <main+0xcb>
mov    %rax,%rbp
lea    0x8(%rsp),%rdi
lea    0x58(%rsp),%rsi
mov    %rax,%rdx
call   1120 <getline@plt>
test   %rax,%rax
je     1297 <main+0x97>
mov    0x8(%rsp),%rdi
lea    0xda3(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     12f1 <main+0xf1>
mov    0x2d3a(%rip),%rax
mov    (%rax),%edi
lea    0xd8b(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    $0x1,%r14d
jmp    187a <main+0x67a>
mov    0x2d06(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xd3a(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x1,%r14d
jmp    187a <main+0x67a>
mov    $0x2,%ebx
xor    %eax,%eax
mov    %rax,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x50(%rsp)
xor    %r13d,%r13d
movl   $0x0,0x3c(%rsp)
movl   $0x0,0x24(%rsp)
movl   $0x0,0x14(%rsp)
xor    %r14d,%r14d
mov    %rbp,0x30(%rsp)
jmp    1372 <main+0x172>
movl   $0x0,0x24(%rsp)
lea    0xd09(%rip),%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
movl   $0x0,0x14(%rsp)
nopw   0x0(%rax,%rax,1)
mov    $0x2,%ecx
add    $0x1,%rbx
cmp    $0x3,%ecx
je     1854 <main+0x654>
lea    0x8(%rsp),%rdi
lea    0x58(%rsp),%rsi
mov    %rbp,%rdx
call   1120 <getline@plt>
test   %rax,%rax
je     1854 <main+0x654>
mov    %rax,%r15
mov    0x8(%rsp),%r12
cmpb   $0xa,-0x1(%r12,%rax,1)
jne    13ab <main+0x1ab>
add    $0xffffffffffffffff,%r15
movb   $0x0,(%r12,%r15,1)
mov    0x8(%rsp),%r12
movzbl (%r12),%eax
mov    $0x2,%ecx
cmp    $0x2f,%al
je     13e0 <main+0x1e0>
cmp    $0x23,%al
je     1365 <main+0x165>
test   %al,%al
jne    1450 <main+0x250>
movl   $0x0,0x3c(%rsp)
movl   $0x0,0x24(%rsp)
movl   $0x0,0x14(%rsp)
jmp    1365 <main+0x165>
nop
lea    0x1(%r12),%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
mov    %rax,0x40(%rsp)
test   %rax,%rax
je     1330 <main+0x130>
mov    %rax,%rbp
movzbl 0x1(%rax),%ecx
test   %cl,%cl
je     16ac <main+0x4ac>
cmp    $0x69,%cl
jne    141b <main+0x21b>
cmpb   $0x0,0x2(%rbp)
je     16a4 <main+0x4a4>
movl   $0x0,0x24(%rsp)
lea    0xc1e(%rip),%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
movl   $0x0,0x14(%rsp)
jmp    1728 <main+0x528>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
lea    0xc2d(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1512 <main+0x312>
cmpl   $0x0,0x14(%rsp)
je     156e <main+0x36e>
mov    0x8(%rsp),%rdi
lea    0xc9e(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     15b3 <main+0x3b3>
mov    0x8(%rsp),%rdi
mov    %rdi,0x40(%rsp)
cmpb   $0x20,(%rdi)
jne    14aa <main+0x2aa>
add    $0x1,%rdi
mov    %rdi,0x40(%rsp)
lea    0x40(%rsp),%rsi
mov    $0xa,%edx
call   1110 <strtoul@plt>
cmp    $0x13,%rax
ja     1592 <main+0x392>
mov    0x40(%rsp),%r8
cmpb   $0x3a,(%r8)
jne    1592 <main+0x392>
cmpb   $0x20,0x1(%r8)
jne    1592 <main+0x392>
mov    %rax,%r12
movslq 0x60(%rsp,%rax,8),%r10
cmp    $0xffffffffffffffff,%r10
je     1771 <main+0x571>
mov    0x64(%rsp,%r12,8),%ebp
cmp    $0xffffffff,%ebp
je     1771 <main+0x571>
mov    %ebp,%edx
sub    %r10d,%edx
jge    17b8 <main+0x5b8>
mov    0x18(%rsp),%rcx
jmp    17f6 <main+0x5f6>
cmpl   $0x0,0x24(%rsp)
je     15f3 <main+0x3f3>
add    $0xfffffffffffffffd,%r15
cmp    %r15,%r13
jae    160e <main+0x40e>
mov    0x18(%rsp),%rdi
mov    %r15,%rsi
call   10f0 <realloc@plt>
mov    %rax,%rdi
mov    %r15,%rax
test   %rdi,%rdi
jne    1616 <main+0x416>
lea    0xb62(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
mov    $0x3,%ecx
xor    %eax,%eax
mov    %rax,0x18(%rsp)
jmp    1365 <main+0x165>
movl   $0x0,0x14(%rsp)
lea    0xb78(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
jmp    1360 <main+0x160>
mov    0x8(%rsp),%rdx
lea    0xbba(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
jmp    1360 <main+0x160>
mov    0x60(%rsp),%r8d
mov    0x64(%rsp),%r9d
cmp    $0xffffffff,%r8d
jne    15cd <main+0x3cd>
cmp    $0xffffffff,%r9d
je     1360 <main+0x160>
lea    0xb57(%rip),%rdi
mov    %rbx,%rsi
mov    0x28(%rsp),%rdx
mov    0x18(%rsp),%rcx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
jmp    1360 <main+0x160>
mov    0x8(%rsp),%rdx
lea    0xa8d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1360 <main+0x160>
mov    %r13,%rax
mov    0x18(%rsp),%rdi
mov    %rax,%r13
mov    0x8(%rsp),%rsi
add    $0x4,%rsi
mov    %rdi,0x18(%rsp)
mov    %r15,%rdx
call   10c0 <memcpy@plt>
mov    0x3c(%rsp),%eax
mov    %eax,%edx
test   %eax,%eax
je     1642 <main+0x442>
mov    0x29a8(%rip),%rax
mov    (%rax),%edx
mov    0x2987(%rip),%rax
or     (%rax),%edx
lea    0x4c(%rsp),%r12
mov    %r12,%rdi
mov    0x28(%rsp),%r15
mov    %r15,%rsi
call   1090 <regcomp@plt>
test   %eax,%eax
je     1732 <main+0x532>
mov    %eax,%edi
mov    %r12,%rsi
lea    0x100(%rsp),%r14
mov    %r14,%rdx
mov    $0x1f4,%ecx
call   10d0 <regerror@plt>
lea    0xa4c(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
jmp    1360 <main+0x160>
movl   $0x1,0x3c(%rsp)
sub    %r12,%rax
cmp    %rax,0x50(%rsp)
jae    16eb <main+0x4eb>
mov    0x28(%rsp),%rdi
mov    %rax,%rsi
call   10f0 <realloc@plt>
test   %rax,%rax
je     1831 <main+0x631>
mov    %rax,0x28(%rsp)
mov    0x40(%rsp),%rbp
mov    0x8(%rsp),%rdx
mov    %rbp,%rax
sub    %rdx,%rax
mov    %rax,0x50(%rsp)
mov    %rdx,%r12
jmp    16ee <main+0x4ee>
mov    %r12,%rdx
add    $0x1,%r12
not    %rdx
add    %rbp,%rdx
mov    0x28(%rsp),%r15
mov    %r15,%rdi
mov    %r12,%rsi
call   10c0 <memcpy@plt>
mov    0x8(%rsp),%rax
not    %rax
add    %rbp,%rax
movb   $0x0,(%r15,%rax,1)
movl   $0x0,0x14(%rsp)
movl   $0x1,0x24(%rsp)
mov    0x30(%rsp),%rbp
jmp    1360 <main+0x160>
mov    %r12,%rdi
mov    0x18(%rsp),%rsi
mov    $0x14,%edx
lea    0x60(%rsp),%rcx
xor    %r8d,%r8d
call   10e0 <regexec@plt>
test   %rax,%rax
je     175a <main+0x55a>
movq   $0xffffffffffffffff,0x60(%rsp)
ff ff
lea    0x4c(%rsp),%rdi
call   1060 <regfree@plt>
movl   $0x1,0x14(%rsp)
jmp    1360 <main+0x160>
add    $0x2,%r8
mov    %r8,%rdi
lea    0x9ef(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1728 <main+0x528>
mov    0x60(%rsp,%r12,8),%r9d
mov    0x64(%rsp,%r12,8),%ebp
sub    $0x8,%rsp
lea    0x9d8(%rip),%rdi
mov    %rbx,%rsi
mov    0x30(%rsp),%rdx
mov    0x20(%rsp),%rcx
mov    %r12,%r8
xor    %eax,%eax
push   %rbp
call   1070 <printf@plt>
jmp    1816 <main+0x616>
movslq %edx,%rax
lea    0x2(%r8),%rdi
sub    %rdi,%r15
add    0x8(%rsp),%r15
cmp    %rax,%r15
mov    0x18(%rsp),%rcx
jne    17f6 <main+0x5f6>
mov    %r8,%r15
add    %rcx,%r10
mov    %r10,%rsi
call   1040 <strncmp@plt>
test   %rax,%rax
je     1825 <main+0x625>
mov    0x60(%rsp,%r12,8),%r10d
mov    0x64(%rsp,%r12,8),%ebp
mov    0x18(%rsp),%rcx
mov    %r15,%r8
add    $0x2,%r8
lea    0x9b7(%rip),%rdi
mov    %rbx,%rsi
mov    0x28(%rsp),%rdx
mov    %r12,%r9
xor    %eax,%eax
push   %rbp
push   %r10
call   1070 <printf@plt>
add    $0x10,%rsp
mov    $0x1,%r14d
jmp    1728 <main+0x528>
xor    %ecx,%ecx
mov    0x30(%rsp),%rbp
jmp    1365 <main+0x165>
lea    0x82f(%rip),%rdi
xor    %eax,%eax
mov    %rax,0x28(%rsp)
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
mov    0x30(%rsp),%rbp
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    %r14d,%eax
add    $0x2f8,%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 = [7 x i8] c"# PCRE\00"
@.str.4 = [22 x i8] c"Not a PCRE test file\0A\00"
@.str.5 = [31 x i8] c"%lu: Invalid pattern line: %s\0A\00"
@.str.6 = [32 x i8] c"%lu: Cannot record pattern: %m\0A\00"
@.str.7 = [5 x i8] c" \00"
@.str.8 = [35 x i8] c"%lu: No previous valid pattern %s\0A\00"
@.str.9 = [38 x i8] c"%lu: Cannot record search string: %m\0A\00"
@REG_EXTENDED = global i32 0
@REG_ICASE = global i32 0
@.str.10 = [32 x i8] c"%lu: regcomp failed for %s: %s\0A\00"
@.str.11 = [45 x i8] c"%lu: No preceeding pattern or search string\0A\00"
@.str.12 = [9 x i8] c"No match\00"
@.str.13 = [45 x i8] c"%lu: /%s/ on %s unexpectedly matched %d..%d\0A\00"
@.str.14 = [22 x i8] c"%lu: Invalid line %s\0A\00"
@.str.15 = [8 x i8] c"<unset>\00"
@.str.16 = [66 x i8] c"%lu: /%s/ on %s unexpectedly failed to match register %ld %d..%d\0A\00"
@.str.17 = [73 x i8] c"%lu: /%s/ on %s unexpectedly failed to match %s for register %ld %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 i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca [20 x %struct.TYPE_3__]
%14 = alloca i64
%15 = alloca i64
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i64
%20 = alloca i8*
%21 = alloca i64
%22 = alloca i32
%23 = alloca i32
%24 = alloca [500 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* null, i8** %7
store i64 0, i64* %8
store i8* null, i8** %11
store i8* null, i8** %12
store i64 0, i64* %14
store i64 0, i64* %15
store i32 0, i32* %16
store i32 0, i32* %17
store i32 0, i32* %18
%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 %418
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** %10
%35 = load i32*, i32** %10
%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 %418
43: ; preds = %30
%44 = load i32*, i32** %10
%45 = call i64 @getline(i8** %7, i64* %8, i32* %44)
store i64 %45, i64* %9
%46 = icmp ule i64 %45, 0
br i1 %46, label %51, label %47
47: ; preds = %43
%48 = load i8*, i8** %7
%49 = call i64 @strncmp(i8* %48, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 6)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %58
51: ; preds = %47, %43
%52 = load i32, i32* @stderr
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%54 = load i32*, i32** %10
%55 = call i32 @fclose(i32* %54)
%56 = load i8*, i8** %7
%57 = call i32 @free(i8* %56)
store i32 1, i32* %3
br label %418
58: ; preds = %47
store i64 1, i64* %19
br label %59
59: ; preds = %407, %391, %339, %304, %278, %250, %245, %227, %185, %159, %127, %104, %91, %84, %58
%60 = load i32*, i32** %10
%61 = call i64 @getline(i8** %7, i64* %8, i32* %60)
store i64 %61, i64* %9
%62 = icmp ugt i64 %61, 0
br i1 %62, label %63, label %408
63: ; preds = %59
%64 = load i64, i64* %19
%65 = add i64 %64, 1
store i64 %65, i64* %19
%66 = load i8*, i8** %7
%67 = load i64, i64* %9
%68 = sub i64 %67, 1
%69 = getelementptr inbounds i8, i8* %66, i64 %68
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 10
br i1 %72, label %73, label %78
73: ; preds = %63
%74 = load i8*, i8** %7
%75 = load i64, i64* %9
%76 = add i64 %75, -1
store i64 %76, i64* %9
%77 = getelementptr inbounds i8, i8* %74, i64 %76
store i8 0, i8* %77
br label %78
78: ; preds = %73, %63
%79 = load i8*, i8** %7
%80 = getelementptr inbounds i8, i8* %79, i64 0
%81 = load i8, i8* %80
%82 = sext i8 %81 to i32
%83 = icmp eq i32 %82, 35
br i1 %83, label %84, label %85
84: ; preds = %78
br label %59
85: ; preds = %78
%86 = load i8*, i8** %7
%87 = getelementptr inbounds i8, i8* %86, i64 0
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = icmp eq i32 %89, 0
br i1 %90, label %91, label %92
91: ; preds = %85
store i32 0, i32* %16
store i32 0, i32* %17
store i32 0, i32* %18
br label %59
92: ; preds = %85
%93 = load i8*, i8** %7
%94 = getelementptr inbounds i8, i8* %93, i64 0
%95 = load i8, i8* %94
%96 = sext i8 %95 to i32
%97 = icmp eq i32 %96, 47
br i1 %97, label %98, label %178
98: ; preds = %92
%99 = load i8*, i8** %7
%100 = getelementptr inbounds i8, i8* %99, i64 1
%101 = call i8* @strrchr(i8* %100, i8 signext 47)
store i8* %101, i8** %20
store i32 0, i32* %17
store i32 0, i32* %18
%102 = load i8*, i8** %20
%103 = icmp eq i8* %102, null
br i1 %103, label %104, label %108
104: ; preds = %98
%105 = load i64, i64* %19
%106 = load i8*, i8** %7
%107 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i64 %105, i8* %106)
store i32 1, i32* %6
br label %59
108: ; preds = %98
%109 = load i8*, i8** %20
%110 = getelementptr inbounds i8, i8* %109, i64 1
%111 = load i8, i8* %110
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %112, 105
br i1 %113, label %114, label %121
114: ; preds = %108
%115 = load i8*, i8** %20
%116 = getelementptr inbounds i8, i8* %115, i64 2
%117 = load i8, i8* %116
%118 = sext i8 %117 to i32
%119 = icmp eq i32 %118, 0
br i1 %119, label %120, label %121
120: ; preds = %114
store i32 1, i32* %16
br label %132
121: ; preds = %114, %108
%122 = load i8*, i8** %20
%123 = getelementptr inbounds i8, i8* %122, i64 1
%124 = load i8, i8* %123
%125 = sext i8 %124 to i32
%126 = icmp ne i32 %125, 0
br i1 %126, label %127, label %131
127: ; preds = %121
%128 = load i64, i64* %19
%129 = load i8*, i8** %7
%130 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i64 %128, i8* %129)
store i32 1, i32* %6
br label %59
131: ; preds = %121
br label %132
132: ; preds = %131, %120
%133 = load i64, i64* %14
%134 = load i8*, i8** %20
%135 = load i8*, i8** %7
%136 = ptrtoint i8* %134 to i64
%137 = ptrtoint i8* %135 to i64
%138 = sub i64 %136, %137
%139 = icmp ult i64 %133, %138
br i1 %139, label %140, label %159
140: ; preds = %132
%141 = load i8*, i8** %11
%142 = load i8*, i8** %20
%143 = load i8*, i8** %7
%144 = ptrtoint i8* %142 to i64
%145 = ptrtoint i8* %143 to i64
%146 = sub i64 %144, %145
%147 = call i8* @realloc(i8* %141, i64 %146)
store i8* %147, i8** %11
%148 = load i8*, i8** %11
%149 = icmp eq i8* %148, null
br i1 %149, label %150, label %153
150: ; preds = %140
%151 = load i64, i64* %19
%152 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i64 %151)
store i32 1, i32* %6
br label %408
153: ; preds = %140
%154 = load i8*, i8** %20
%155 = load i8*, i8** %7
%156 = ptrtoint i8* %154 to i64
%157 = ptrtoint i8* %155 to i64
%158 = sub i64 %156, %157
store i64 %158, i64* %14
br label %159
159: ; preds = %153, %132
%160 = load i8*, i8** %11
%161 = load i8*, i8** %7
%162 = getelementptr inbounds i8, i8* %161, i64 1
%163 = load i8*, i8** %20
%164 = load i8*, i8** %7
%165 = ptrtoint i8* %163 to i64
%166 = ptrtoint i8* %164 to i64
%167 = sub i64 %165, %166
%168 = sub nsw i64 %167, 1
%169 = call i32 @memcpy(i8* %160, i8* %162, i64 %168)
%170 = load i8*, i8** %11
%171 = load i8*, i8** %20
%172 = load i8*, i8** %7
%173 = ptrtoint i8* %171 to i64
%174 = ptrtoint i8* %172 to i64
%175 = sub i64 %173, %174
%176 = sub nsw i64 %175, 1
%177 = getelementptr inbounds i8, i8* %170, i64 %176
store i8 0, i8* %177
store i32 1, i32* %17
br label %59
178: ; preds = %92
%179 = load i8*, i8** %7
%180 = call i64 @strncmp(i8* %179, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%181 = icmp eq i64 %180, 0
br i1 %181, label %182, label %247
182: ; preds = %178
%183 = load i32, i32* %17
%184 = icmp ne i32 %183, 0
br i1 %184, label %189, label %185
185: ; preds = %182
%186 = load i64, i64* %19
%187 = load i8*, i8** %7
%188 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i64 %186, i8* %187)
br label %59
189: ; preds = %182
%190 = load i64, i64* %15
%191 = load i64, i64* %9
%192 = sub i64 %191, 3
%193 = icmp ult i64 %190, %192
br i1 %193, label %194, label %207
194: ; preds = %189
%195 = load i8*, i8** %12
%196 = load i64, i64* %9
%197 = sub i64 %196, 3
%198 = call i8* @realloc(i8* %195, i64 %197)
store i8* %198, i8** %12
%199 = load i8*, i8** %12
%200 = icmp eq i8* %199, null
br i1 %200, label %201, label %204
201: ; preds = %194
%202 = load i64, i64* %19
%203 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i64 %202)
store i32 1, i32* %6
br label %408
204: ; preds = %194
%205 = load i64, i64* %9
%206 = sub i64 %205, 3
store i64 %206, i64* %15
br label %207
207: ; preds = %204, %189
%208 = load i8*, i8** %12
%209 = load i8*, i8** %7
%210 = getelementptr inbounds i8, i8* %209, i64 4
%211 = load i64, i64* %9
%212 = sub i64 %211, 3
%213 = call i32 @memcpy(i8* %208, i8* %210, i64 %212)
%214 = load i8*, i8** %11
%215 = load i32, i32* @REG_EXTENDED
%216 = load i32, i32* %16
%217 = icmp ne i32 %216, 0
br i1 %217, label %218, label %220
218: ; preds = %207
%219 = load i32, i32* @REG_ICASE
br label %221
220: ; preds = %207
br label %221
221: ; preds = %220, %218
%222 = phi i32 [ %219, %218 ], [ 0, %220 ]
%223 = or i32 %215, %222
%224 = call i32 @regcomp(i32* %22, i8* %214, i32 %223)
store i32 %224, i32* %23
%225 = load i32, i32* %23
%226 = icmp ne i32 %225, 0
br i1 %226, label %227, label %235
227: ; preds = %221
%228 = load i32, i32* %23
%229 = getelementptr inbounds [500 x i8], [500 x i8]* %24, i64 0, i64 0
%230 = call i32 @regerror(i32 %228, i32* %22, i8* %229, i32 500)
%231 = load i64, i64* %19
%232 = load i8*, i8** %11
%233 = getelementptr inbounds [500 x i8], [500 x i8]* %24, i64 0, i64 0
%234 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i64 %231, i8* %232, i8* %233)
store i32 1, i32* %6
br label %59
235: ; preds = %221
%236 = load i8*, i8** %12
%237 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%238 = call i64 @regexec(i32* %22, i8* %236, i32 20, %struct.TYPE_3__* %237, i32 0)
%239 = icmp ne i64 %238, 0
br i1 %239, label %240, label %245
240: ; preds = %235
%241 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%242 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %241, i32 0, i32 0
store i32 -1, i32* %242
%243 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%244 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %243, i32 0, i32 1
store i32 -1, i32* %244
br label %245
245: ; preds = %240, %235
%246 = call i32 @regfree(i32* %22)
store i32 1, i32* %18
br label %59
247: ; preds = %178
%248 = load i32, i32* %18
%249 = icmp ne i32 %248, 0
br i1 %249, label %253, label %250
250: ; preds = %247
%251 = load i64, i64* %19
%252 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0), i64 %251)
store i32 1, i32* %6
br label %59
253: ; preds = %247
%254 = load i8*, i8** %7
%255 = call i64 @strcmp(i8* %254, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%256 = icmp eq i64 %255, 0
br i1 %256, label %257, label %279
257: ; preds = %253
%258 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%259 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %258, i32 0, i32 0
%260 = load i32, i32* %259
%261 = icmp ne i32 %260, -1
br i1 %261, label %267, label %262
262: ; preds = %257
%263 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%264 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %263, i32 0, i32 1
%265 = load i32, i32* %264
%266 = icmp ne i32 %265, -1
br i1 %266, label %267, label %278
267: ; preds = %262, %257
%268 = load i64, i64* %19
%269 = load i8*, i8** %11
%270 = load i8*, i8** %12
%271 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%272 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %271, i32 0, i32 0
%273 = load i32, i32* %272
%274 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%275 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %274, i32 0, i32 1
%276 = load i32, i32* %275
%277 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), i64 %268, i8* %269, i8* %270, i32 %273, i32 %276)
store i32 1, i32* %6
br label %278
278: ; preds = %267, %262
br label %59
279: ; preds = %253
%280 = load i8*, i8** %7
store i8* %280, i8** %20
%281 = load i8*, i8** %20
%282 = load i8, i8* %281
%283 = sext i8 %282 to i32
%284 = icmp eq i32 %283, 32
br i1 %284, label %285, label %288
285: ; preds = %279
%286 = load i8*, i8** %20
%287 = getelementptr inbounds i8, i8* %286, i32 1
store i8* %287, i8** %20
br label %288
288: ; preds = %285, %279
%289 = load i8*, i8** %20
%290 = call i64 @strtoul(i8* %289, i8** %20, i32 10)
store i64 %290, i64* %21
%291 = load i64, i64* %21
%292 = icmp uge i64 %291, 20
br i1 %292, label %304, label %293
293: ; preds = %288
%294 = load i8*, i8** %20
%295 = load i8, i8* %294
%296 = sext i8 %295 to i32
%297 = icmp ne i32 %296, 58
br i1 %297, label %304, label %298
298: ; preds = %293
%299 = load i8*, i8** %20
%300 = getelementptr inbounds i8, i8* %299, i64 1
%301 = load i8, i8* %300
%302 = sext i8 %301 to i32
%303 = icmp ne i32 %302, 32
br i1 %303, label %304, label %308
304: ; preds = %298, %293, %288
%305 = load i64, i64* %19
%306 = load i8*, i8** %7
%307 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i64 %305, i8* %306)
store i32 1, i32* %6
br label %59
308: ; preds = %298
%309 = load i64, i64* %21
%310 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %309
%311 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %310, i32 0, i32 0
%312 = load i32, i32* %311
%313 = icmp eq i32 %312, -1
br i1 %313, label %320, label %314
314: ; preds = %308
%315 = load i64, i64* %21
%316 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %315
%317 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %316, i32 0, i32 1
%318 = load i32, i32* %317
%319 = icmp eq i32 %318, -1
br i1 %319, label %320, label %340
320: ; preds = %314, %308
%321 = load i8*, i8** %20
%322 = getelementptr inbounds i8, i8* %321, i64 2
%323 = call i64 @strcmp(i8* %322, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%324 = icmp ne i64 %323, 0
br i1 %324, label %325, label %339
325: ; preds = %320
%326 = load i64, i64* %19
%327 = load i8*, i8** %11
%328 = load i8*, i8** %12
%329 = load i64, i64* %21
%330 = load i64, i64* %21
%331 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %330
%332 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %331, i32 0, i32 0
%333 = load i32, i32* %332
%334 = load i64, i64* %21
%335 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %334
%336 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %335, i32 0, i32 1
%337 = load i32, i32* %336
%338 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.16, i64 0, i64 0), i64 %326, i8* %327, i8* %328, i64 %329, i32 %333, i32 %337)
store i32 1, i32* %6
br label %339
339: ; preds = %325, %320
br label %59
340: ; preds = %314
%341 = load i64, i64* %21
%342 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %341
%343 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %342, i32 0, i32 1
%344 = load i32, i32* %343
%345 = load i64, i64* %21
%346 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %345
%347 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %346, i32 0, i32 0
%348 = load i32, i32* %347
%349 = icmp slt i32 %344, %348
br i1 %349, label %391, label %350
350: ; preds = %340
%351 = load i64, i64* %21
%352 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %351
%353 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %352, i32 0, i32 1
%354 = load i32, i32* %353
%355 = load i64, i64* %21
%356 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %355
%357 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %356, i32 0, i32 0
%358 = load i32, i32* %357
%359 = sub nsw i32 %354, %358
%360 = sext i32 %359 to i64
%361 = load i64, i64* %9
%362 = load i8*, i8** %20
%363 = getelementptr inbounds i8, i8* %362, i64 2
%364 = load i8*, i8** %7
%365 = ptrtoint i8* %363 to i64
%366 = ptrtoint i8* %364 to i64
%367 = sub i64 %365, %366
%368 = sub i64 %361, %367
%369 = icmp ne i64 %360, %368
br i1 %369, label %391, label %370
370: ; preds = %350
%371 = load i8*, i8** %20
%372 = getelementptr inbounds i8, i8* %371, i64 2
%373 = load i8*, i8** %12
%374 = load i64, i64* %21
%375 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %374
%376 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %375, i32 0, i32 0
%377 = load i32, i32* %376
%378 = sext i32 %377 to i64
%379 = getelementptr inbounds i8, i8* %373, i64 %378
%380 = load i64, i64* %21
%381 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %380
%382 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %381, i32 0, i32 1
%383 = load i32, i32* %382
%384 = load i64, i64* %21
%385 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %384
%386 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %385, i32 0, i32 0
%387 = load i32, i32* %386
%388 = sub nsw i32 %383, %387
%389 = call i64 @strncmp(i8* %372, i8* %379, i32 %388)
%390 = icmp ne i64 %389, 0
br i1 %390, label %391, label %407
391: ; preds = %370, %350, %340
%392 = load i64, i64* %19
%393 = load i8*, i8** %11
%394 = load i8*, i8** %12
%395 = load i8*, i8** %20
%396 = getelementptr inbounds i8, i8* %395, i64 2
%397 = load i64, i64* %21
%398 = load i64, i64* %21
%399 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %398
%400 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %399, i32 0, i32 0
%401 = load i32, i32* %400
%402 = load i64, i64* %21
%403 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %402
%404 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %403, i32 0, i32 1
%405 = load i32, i32* %404
%406 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.17, i64 0, i64 0), i64 %392, i8* %393, i8* %394, i8* %396, i64 %397, i32 %401, i32 %405)
store i32 1, i32* %6
br label %59
407: ; preds = %370
br label %59
408: ; preds = %201, %150, %59
%409 = load i8*, i8** %11
%410 = call i32 @free(i8* %409)
%411 = load i8*, i8** %12
%412 = call i32 @free(i8* %411)
%413 = load i8*, i8** %7
%414 = call i32 @free(i8* %413)
%415 = load i32*, i32** %10
%416 = call i32 @fclose(i32* %415)
%417 = load i32, i32* %6
store i32 %417, i32* %3
br label %418
418: ; preds = %408, %51, %37, %27
%419 = load i32, i32* %3
ret i32 %419
}

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 = [7 x i8] c"# PCRE\00"
@.str.4 = [22 x i8] c"Not a PCRE test file\0A\00"
@.str.5 = [31 x i8] c"%lu: Invalid pattern line: %s\0A\00"
@.str.6 = [32 x i8] c"%lu: Cannot record pattern: %m\0A\00"
@.str.7 = [5 x i8] c" \00"
@.str.8 = [35 x i8] c"%lu: No previous valid pattern %s\0A\00"
@.str.9 = [38 x i8] c"%lu: Cannot record search string: %m\0A\00"
@REG_EXTENDED = global i32 0
@REG_ICASE = global i32 0
@.str.10 = [32 x i8] c"%lu: regcomp failed for %s: %s\0A\00"
@.str.11 = [45 x i8] c"%lu: No preceeding pattern or search string\0A\00"
@.str.12 = [9 x i8] c"No match\00"
@.str.13 = [45 x i8] c"%lu: /%s/ on %s unexpectedly matched %d..%d\0A\00"
@.str.14 = [22 x i8] c"%lu: Invalid line %s\0A\00"
@.str.15 = [8 x i8] c"<unset>\00"
@.str.16 = [66 x i8] c"%lu: /%s/ on %s unexpectedly failed to match register %ld %d..%d\0A\00"
@.str.17 = [73 x i8] c"%lu: /%s/ on %s unexpectedly failed to match %s for register %ld %d..%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [20 x %struct.TYPE_3__]
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [500 x i8]
%9 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%10 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%11 = bitcast [20 x %struct.TYPE_3__]* %5 to i8*
%12 = icmp slt i32 %0, 2
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %261
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = tail call i32* @fopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %25
21: ; preds = %16
%22 = load i32, i32* @stderr
%23 = load i8*, i8** %17
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %23)
br label %261
25: ; preds = %16
%26 = call i64 @getline(i8** %3, i64* %4, i32* %19)
%27 = icmp eq i64 %26, 0
br i1 %27, label %39, label %28
28: ; preds = %25
%29 = load i8*, i8** %3
%30 = call i64 @strncmp(i8* %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 6)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %39
32: ; preds = %28
%33 = bitcast i8** %6 to i8*
%34 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %5, i64 0, i64 0, i32 0
%35 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %5, i64 0, i64 0, i32 1
%36 = bitcast i32* %7 to i8*
%37 = getelementptr inbounds [500 x i8], [500 x i8]* %8, i64 0, i64 0
%38 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %5, i64 0, i64 0
br label %45
39: ; preds = %28, %25
%40 = load i32, i32* @stderr
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%42 = call i32 @fclose(i32* %19)
%43 = load i8*, i8** %3
%44 = call i32 @free(i8* %43)
br label %261
45: ; preds = %32, %241
%46 = phi i8* [ %242, %241 ], [ null, %32 ]
%47 = phi i8* [ %243, %241 ], [ null, %32 ]
%48 = phi i64 [ %244, %241 ], [ 0, %32 ]
%49 = phi i64 [ %245, %241 ], [ 0, %32 ]
%50 = phi i32 [ %246, %241 ], [ 0, %32 ]
%51 = phi i32 [ %247, %241 ], [ 0, %32 ]
%52 = phi i32 [ %248, %241 ], [ 0, %32 ]
%53 = phi i64 [ %58, %241 ], [ 1, %32 ]
%54 = phi i32 [ %250, %241 ], [ 0, %32 ]
%55 = call i64 @getline(i8** %3, i64* %4, i32* %19)
%56 = icmp eq i64 %55, 0
br i1 %56, label %252, label %57
57: ; preds = %45
%58 = add i64 %53, 1
%59 = load i8*, i8** %3
%60 = add i64 %55, -1
%61 = getelementptr inbounds i8, i8* %59, i64 %60
%62 = load i8, i8* %61
%63 = icmp eq i8 %62, 10
br i1 %63, label %64, label %66
64: ; preds = %57
store i8 0, i8* %61
%65 = load i8*, i8** %3
br label %66
66: ; preds = %64, %57
%67 = phi i8* [ %65, %64 ], [ %59, %57 ]
%68 = phi i64 [ %60, %64 ], [ %55, %57 ]
%69 = load i8, i8* %67
switch i8 %69, label %118 [
i8 35, label %241
i8 0, label %70
i8 47, label %71
]
70: ; preds = %66
br label %241
71: ; preds = %66
%72 = getelementptr inbounds i8, i8* %67, i64 1
%73 = call i8* @strrchr(i8* %72, i8 signext 47)
store i8* %73, i8** %6
%74 = icmp eq i8* %73, null
br i1 %74, label %75, label %77
75: ; preds = %71
%76 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i64 %58, i8* %67)
br label %241
77: ; preds = %71
%78 = getelementptr inbounds i8, i8* %73, i64 1
%79 = load i8, i8* %78
switch i8 %79, label %84 [
i8 105, label %80
i8 0, label %86
]
80: ; preds = %77
%81 = getelementptr inbounds i8, i8* %73, i64 2
%82 = load i8, i8* %81
%83 = icmp eq i8 %82, 0
br i1 %83, label %86, label %84
84: ; preds = %77, %80
%85 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i64 %58, i8* %67)
br label %241
86: ; preds = %77, %80
%87 = phi i32 [ 1, %80 ], [ %50, %77 ]
%88 = ptrtoint i8* %73 to i64
%89 = ptrtoint i8* %67 to i64
%90 = sub i64 %88, %89
%91 = icmp ult i64 %48, %90
br i1 %91, label %92, label %103
92: ; preds = %86
%93 = call i8* @realloc(i8* %46, i64 %90)
%94 = icmp eq i8* %93, null
br i1 %94, label %95, label %97
95: ; preds = %92
%96 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i64 %58)
br label %252
97: ; preds = %92
%98 = load i8*, i8** %6
%99 = load i8*, i8** %3
%100 = ptrtoint i8* %98 to i64
%101 = ptrtoint i8* %99 to i64
%102 = sub i64 %100, %101
br label %103
103: ; preds = %97, %86
%104 = phi i64 [ %101, %97 ], [ %89, %86 ]
%105 = phi i64 [ %100, %97 ], [ %88, %86 ]
%106 = phi i8* [ %99, %97 ], [ %67, %86 ]
%107 = phi i8* [ %93, %97 ], [ %46, %86 ]
%108 = phi i64 [ %102, %97 ], [ %48, %86 ]
%109 = getelementptr inbounds i8, i8* %106, i64 1
%110 = xor i64 %104, -1
%111 = add i64 %105, %110
%112 = call i32 @memcpy(i8* %107, i8* %109, i64 %111)
%113 = load i8*, i8** %3
%114 = ptrtoint i8* %113 to i64
%115 = xor i64 %114, -1
%116 = add i64 %105, %115
%117 = getelementptr inbounds i8, i8* %107, i64 %116
store i8 0, i8* %117
br label %241
118: ; preds = %66
%119 = call i64 @strncmp(i8* %67, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%120 = icmp eq i64 %119, 0
br i1 %120, label %121, label %162
121: ; preds = %118
%122 = icmp eq i32 %51, 0
br i1 %122, label %123, label %126
123: ; preds = %121
%124 = load i8*, i8** %3
%125 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i64 %58, i8* %124)
br label %156
126: ; preds = %121
%127 = add i64 %68, -3
%128 = icmp ult i64 %49, %127
br i1 %128, label %129, label %134
129: ; preds = %126
%130 = call i8* @realloc(i8* %47, i64 %127)
%131 = icmp eq i8* %130, null
br i1 %131, label %132, label %134
132: ; preds = %129
%133 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i64 %58)
br label %156
134: ; preds = %129, %126
%135 = phi i8* [ %47, %126 ], [ %130, %129 ]
%136 = phi i64 [ %49, %126 ], [ %127, %129 ]
%137 = load i8*, i8** %3
%138 = getelementptr inbounds i8, i8* %137, i64 4
%139 = call i32 @memcpy(i8* %135, i8* %138, i64 %127)
%140 = load i32, i32* @REG_EXTENDED
%141 = icmp eq i32 %50, 0
%142 = load i32, i32* @REG_ICASE
%143 = select i1 %141, i32 0, i32 %142
%144 = or i32 %143, %140
%145 = call i32 @regcomp(i32* %7, i8* %46, i32 %144)
%146 = icmp eq i32 %145, 0
br i1 %146, label %150, label %147
147: ; preds = %134
%148 = call i32 @regerror(i32 %145, i32* %7, i8* %37, i32 500)
%149 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i64 %58, i8* %46, i8* %37)
br label %156
150: ; preds = %134
%151 = call i64 @regexec(i32* %7, i8* %135, i32 20, %struct.TYPE_3__* %38, i32 0)
%152 = icmp eq i64 %151, 0
br i1 %152, label %154, label %153
153: ; preds = %150
store i32 -1, i32* %34
store i32 -1, i32* %35
br label %154
154: ; preds = %153, %150
%155 = call i32 @regfree(i32* %7)
br label %156
156: ; preds = %154, %147, %132, %123
%157 = phi i8* [ null, %132 ], [ %135, %147 ], [ %135, %154 ], [ %47, %123 ]
%158 = phi i64 [ %49, %132 ], [ %136, %147 ], [ %136, %154 ], [ %49, %123 ]
%159 = phi i32 [ %52, %132 ], [ %52, %147 ], [ 1, %154 ], [ %52, %123 ]
%160 = phi i32 [ 3, %132 ], [ 2, %147 ], [ 2, %154 ], [ 2, %123 ]
%161 = phi i32 [ 1, %132 ], [ 1, %147 ], [ %54, %154 ], [ %54, %123 ]
br label %241
162: ; preds = %118
%163 = icmp eq i32 %52, 0
br i1 %163, label %164, label %166
164: ; preds = %162
%165 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0), i64 %58)
br label %241
166: ; preds = %162
%167 = load i8*, i8** %3
%168 = call i64 @strcmp(i8* %167, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%169 = icmp eq i64 %168, 0
br i1 %169, label %170, label %178
170: ; preds = %166
%171 = load i32, i32* %34
%172 = icmp ne i32 %171, -1
%173 = load i32, i32* %35
%174 = icmp ne i32 %173, -1
%175 = select i1 %172, i1 true, i1 %174
br i1 %175, label %176, label %241
176: ; preds = %170
%177 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), i64 %58, i8* %46, i8* %47, i32 %171, i32 %173)
br label %241
178: ; preds = %166
%179 = load i8*, i8** %3
store i8* %179, i8** %6
%180 = load i8, i8* %179
%181 = icmp eq i8 %180, 32
br i1 %181, label %182, label %184
182: ; preds = %178
%183 = getelementptr inbounds i8, i8* %179, i64 1
store i8* %183, i8** %6
br label %184
184: ; preds = %182, %178
%185 = phi i8* [ %183, %182 ], [ %179, %178 ]
%186 = call i64 @strtoul(i8* %185, i8** %6, i32 10)
%187 = icmp ugt i64 %186, 19
br i1 %187, label %196, label %188
188: ; preds = %184
%189 = load i8*, i8** %6
%190 = load i8, i8* %189
%191 = icmp eq i8 %190, 58
br i1 %191, label %192, label %196
192: ; preds = %188
%193 = getelementptr inbounds i8, i8* %189, i64 1
%194 = load i8, i8* %193
%195 = icmp eq i8 %194, 32
br i1 %195, label %199, label %196
196: ; preds = %192, %188, %184
%197 = load i8*, i8** %3
%198 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i64 %58, i8* %197)
br label %241
199: ; preds = %192
%200 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %5, i64 0, i64 %186, i32 0
%201 = load i32, i32* %200
%202 = icmp eq i32 %201, -1
br i1 %202, label %207, label %203
203: ; preds = %199
%204 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %5, i64 0, i64 %186, i32 1
%205 = load i32, i32* %204
%206 = icmp eq i32 %205, -1
br i1 %206, label %207, label %216
207: ; preds = %203, %199
%208 = getelementptr inbounds i8, i8* %189, i64 2
%209 = call i64 @strcmp(i8* %208, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%210 = icmp eq i64 %209, 0
br i1 %210, label %241, label %211
211: ; preds = %207
%212 = load i32, i32* %200
%213 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %5, i64 0, i64 %186, i32 1
%214 = load i32, i32* %213
%215 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.16, i64 0, i64 0), i64 %58, i8* %46, i8* %47, i64 %186, i32 %212, i32 %214)
br label %241
216: ; preds = %203
%217 = icmp slt i32 %205, %201
br i1 %217, label %236, label %218
218: ; preds = %216
%219 = sub nsw i32 %205, %201
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds i8, i8* %189, i64 2
%222 = load i8*, i8** %3
%223 = ptrtoint i8* %221 to i64
%224 = ptrtoint i8* %222 to i64
%225 = sub i64 %68, %223
%226 = add i64 %225, %224
%227 = icmp eq i64 %226, %220
br i1 %227, label %228, label %236
228: ; preds = %218
%229 = sext i32 %201 to i64
%230 = getelementptr inbounds i8, i8* %47, i64 %229
%231 = call i64 @strncmp(i8* %221, i8* %230, i32 %219)
%232 = icmp eq i64 %231, 0
br i1 %232, label %241, label %233
233: ; preds = %228
%234 = load i32, i32* %200
%235 = load i32, i32* %204
br label %236
236: ; preds = %233, %218, %216
%237 = phi i32 [ %235, %233 ], [ %205, %218 ], [ %205, %216 ]
%238 = phi i32 [ %234, %233 ], [ %201, %218 ], [ %201, %216 ]
%239 = getelementptr inbounds i8, i8* %189, i64 2
%240 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.17, i64 0, i64 0), i64 %58, i8* %46, i8* %47, i8* %239, i64 %186, i32 %238, i32 %237)
br label %241
241: ; preds = %228, %207, %211, %176, %170, %66, %236, %196, %164, %156, %103, %84, %75, %70
%242 = phi i8* [ %46, %70 ], [ %46, %75 ], [ %107, %103 ], [ %46, %84 ], [ %46, %156 ], [ %46, %196 ], [ %46, %236 ], [ %46, %164 ], [ %46, %66 ], [ %46, %170 ], [ %46, %176 ], [ %46, %211 ], [ %46, %207 ], [ %46, %228 ]
%243 = phi i8* [ %47, %70 ], [ %47, %75 ], [ %47, %103 ], [ %47, %84 ], [ %157, %156 ], [ %47, %196 ], [ %47, %236 ], [ %47, %164 ], [ %47, %66 ], [ %47, %170 ], [ %47, %176 ], [ %47, %211 ], [ %47, %207 ], [ %47, %228 ]
%244 = phi i64 [ %48, %70 ], [ %48, %75 ], [ %108, %103 ], [ %48, %84 ], [ %48, %156 ], [ %48, %196 ], [ %48, %236 ], [ %48, %164 ], [ %48, %66 ], [ %48, %170 ], [ %48, %176 ], [ %48, %211 ], [ %48, %207 ], [ %48, %228 ]
%245 = phi i64 [ %49, %70 ], [ %49, %75 ], [ %49, %103 ], [ %49, %84 ], [ %158, %156 ], [ %49, %196 ], [ %49, %236 ], [ %49, %164 ], [ %49, %66 ], [ %49, %170 ], [ %49, %176 ], [ %49, %211 ], [ %49, %207 ], [ %49, %228 ]
%246 = phi i32 [ 0, %70 ], [ %50, %75 ], [ %87, %103 ], [ %50, %84 ], [ %50, %156 ], [ %50, %196 ], [ %50, %236 ], [ %50, %164 ], [ %50, %66 ], [ %50, %170 ], [ %50, %176 ], [ %50, %211 ], [ %50, %207 ], [ %50, %228 ]
%247 = phi i32 [ 0, %70 ], [ 0, %75 ], [ 1, %103 ], [ 0, %84 ], [ %51, %156 ], [ %51, %196 ], [ %51, %236 ], [ %51, %164 ], [ %51, %66 ], [ %51, %170 ], [ %51, %176 ], [ %51, %211 ], [ %51, %207 ], [ %51, %228 ]
%248 = phi i32 [ 0, %70 ], [ 0, %75 ], [ 0, %103 ], [ 0, %84 ], [ %159, %156 ], [ %52, %196 ], [ %52, %236 ], [ 0, %164 ], [ %52, %66 ], [ %52, %170 ], [ %52, %176 ], [ %52, %211 ], [ %52, %207 ], [ %52, %228 ]
%249 = phi i32 [ 2, %70 ], [ 2, %75 ], [ 2, %103 ], [ 2, %84 ], [ %160, %156 ], [ 2, %196 ], [ 2, %236 ], [ 2, %164 ], [ 2, %66 ], [ 2, %170 ], [ 2, %176 ], [ 2, %211 ], [ 2, %207 ], [ 0, %228 ]
%250 = phi i32 [ %54, %70 ], [ 1, %75 ], [ %54, %103 ], [ 1, %84 ], [ %161, %156 ], [ 1, %196 ], [ 1, %236 ], [ 1, %164 ], [ %54, %66 ], [ %54, %170 ], [ 1, %176 ], [ 1, %211 ], [ %54, %207 ], [ %54, %228 ]
%251 = icmp eq i32 %249, 3
br i1 %251, label %252, label %45
252: ; preds = %241, %45, %95
%253 = phi i8* [ null, %95 ], [ %46, %45 ], [ %242, %241 ]
%254 = phi i8* [ %47, %95 ], [ %47, %45 ], [ %243, %241 ]
%255 = phi i32 [ 1, %95 ], [ %54, %45 ], [ %250, %241 ]
%256 = call i32 @free(i8* %253)
%257 = call i32 @free(i8* %254)
%258 = load i8*, i8** %3
%259 = call i32 @free(i8* %258)
%260 = call i32 @fclose(i32* %19)
br label %261
261: ; preds = %252, %39, %21, %13
%262 = phi i32 [ 1, %13 ], [ 1, %21 ], [ 1, %39 ], [ %255, %252 ]
ret i32 %262
}