#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 /*<<< 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*/ mtrace();
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;
  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;
  }
  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("%zd: 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("%zd: 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("%zd: 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("%zd: 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("%zd: Cannot record search string: %m\n", linenum);
          ret = 1;
          break;
        }
        string_alloced = len - 3;
      }
      memcpy(string, line + 4, len - 3);
      n = regcomp(&re, pattern, 1 | (ignorecase ? (1 << 1) : 0));
      if (n != 0) {
        char buf[500];
        regerror(n, &re, buf, sizeof(buf));
        printf("%zd: 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("%zd: 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("%zd: /%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("%zd: 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("%zd: /%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("%zd: /%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    $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)
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)
mov    $0x0,%al
call   1130 <mtrace@plt>
cmpl   $0x2,-0x8(%rbp)
jge    12b8 <main+0xa8>
mov    0x2d44(%rip),%rax
mov    (%rax),%edi
lea    0xd5b(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1a99 <main+0x889>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd50(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1306 <main+0xf6>
mov    0x2cfe(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd26(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1a99 <main+0x889>
mov    -0x38(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1120 <getline@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jbe    1344 <main+0x134>
mov    -0x20(%rbp),%rdi
lea    0xcfb(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     1379 <main+0x169>
mov    0x2c95(%rip),%rax
mov    (%rax),%edi
lea    0xcde(%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    1a99 <main+0x889>
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    1a6f <main+0x85f>
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    13e6 <main+0x1d6>
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    13fb <main+0x1eb>
jmp    1384 <main+0x174>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    142e <main+0x21e>
movl   $0x0,-0x104(%rbp)
movl   $0x0,-0x108(%rbp)
movl   $0x0,-0x10c(%rbp)
jmp    1384 <main+0x174>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    15d9 <main+0x3c9>
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    149e <main+0x28e>
mov    -0x118(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xbbd(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1384 <main+0x174>
mov    -0x120(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x69,%eax
jne    14d5 <main+0x2c5>
mov    -0x120(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    14d5 <main+0x2c5>
movl   $0x1,-0x104(%rbp)
jmp    1513 <main+0x303>
mov    -0x120(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     150e <main+0x2fe>
mov    -0x118(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xb4d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1384 <main+0x174>
jmp    1513 <main+0x303>
mov    -0xf8(%rbp),%rax
mov    -0x120(%rbp),%rcx
mov    -0x20(%rbp),%rdx
sub    %rdx,%rcx
cmp    %rcx,%rax
jae    158d <main+0x37d>
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    1578 <main+0x368>
mov    -0x118(%rbp),%rsi
lea    0xb02(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1a6f <main+0x85f>
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    1384 <main+0x174>
mov    -0x20(%rbp),%rdi
lea    0xaa3(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    177f <main+0x56f>
cmpl   $0x0,-0x108(%rbp)
jne    1623 <main+0x413>
mov    -0x118(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xa75(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1384 <main+0x174>
mov    -0x100(%rbp),%rax
mov    -0x30(%rbp),%rcx
sub    $0x3,%rcx
cmp    %rcx,%rax
jae    168b <main+0x47b>
mov    -0x48(%rbp),%rdi
mov    -0x30(%rbp),%rsi
sub    $0x3,%rsi
call   10f0 <realloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    167c <main+0x46c>
mov    -0x118(%rbp),%rsi
lea    0xa46(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1a6f <main+0x85f>
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),%rsi
mov    -0x104(%rbp),%ecx
xor    %edx,%edx
mov    $0x2,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
or     $0x1,%edx
lea    -0x12c(%rbp),%rdi
call   1090 <regcomp@plt>
mov    %eax,-0x130(%rbp)
cmpl   $0x0,-0x130(%rbp)
je     1727 <main+0x517>
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    0x9c1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1384 <main+0x174>
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     1764 <main+0x554>
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    1384 <main+0x174>
cmpl   $0x0,-0x10c(%rbp)
jne    17ad <main+0x59d>
mov    -0x118(%rbp),%rsi
lea    0x95b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1384 <main+0x174>
mov    -0x20(%rbp),%rdi
lea    0x96a(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1818 <main+0x608>
cmpl   $0xffffffff,-0xf0(%rbp)
jne    17e1 <main+0x5d1>
cmpl   $0xffffffff,-0xec(%rbp)
je     1813 <main+0x603>
mov    -0x118(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0xf0(%rbp),%r8d
mov    -0xec(%rbp),%r9d
lea    0x926(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1384 <main+0x174>
mov    -0x20(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    -0x120(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1848 <main+0x638>
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    189c <main+0x68c>
mov    -0x120(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    189c <main+0x68c>
mov    -0x120(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x20,%eax
je     18c1 <main+0x6b1>
mov    -0x118(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0x8aa(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1384 <main+0x174>
mov    -0x128(%rbp),%rax
cmpl   $0xffffffff,-0xf0(%rbp,%rax,8)
ff
je     18eb <main+0x6db>
mov    -0x128(%rbp),%rax
cmpl   $0xffffffff,-0xec(%rbp,%rax,8)
ff
jne    195c <main+0x74c>
mov    -0x120(%rbp),%rdi
add    $0x2,%rdi
lea    0x871(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     1957 <main+0x747>
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    0x830(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1384 <main+0x174>
mov    -0x128(%rbp),%rax
mov    -0xec(%rbp,%rax,8),%eax
mov    -0x128(%rbp),%rcx
cmp    -0xf0(%rbp,%rcx,8),%eax
jl     1a0a <main+0x7fa>
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    1a0a <main+0x7fa>
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     1a6a <main+0x85a>
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    0x769(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1384 <main+0x174>
jmp    1384 <main+0x174>
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    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2f8,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movq   $0x0,0x8(%rsp)
movq   $0x0,0x58(%rsp)
xor    %eax,%eax
call   1130 <mtrace@plt>
cmp    $0x1,%ebp
jg     1266 <main+0x56>
mov    0x2d95(%rip),%rax
mov    (%rax),%edi
lea    0xdac(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x1,%r14d
jmp    1899 <main+0x689>
mov    0x8(%rbx),%rdi
lea    0xda6(%rip),%rsi
call   1100 <fopen@plt>
test   %rax,%rax
je     12e4 <main+0xd4>
mov    %rax,%rbp
lea    0x8(%rsp),%rdi
lea    0x58(%rsp),%rsi
mov    %rax,%rdx
call   1120 <getline@plt>
test   %rax,%rax
je     12b0 <main+0xa0>
mov    0x8(%rsp),%rdi
lea    0xd8a(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     130a <main+0xfa>
mov    0x2d29(%rip),%rax
mov    (%rax),%edi
lea    0xd72(%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    1899 <main+0x689>
mov    0x2cf5(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xd21(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x1,%r14d
jmp    1899 <main+0x689>
mov    $0x2,%ebx
xor    %eax,%eax
mov    %rax,0x20(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x50(%rsp)
xor    %r13d,%r13d
movl   $0x0,0x34(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
xor    %r14d,%r14d
mov    %rbp,0x28(%rsp)
jmp    1392 <main+0x182>
movl   $0x0,0x14(%rsp)
lea    0xcf0(%rip),%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
movl   $0x0,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x2,%ecx
add    $0x1,%rbx
cmp    $0x3,%ecx
je     1873 <main+0x663>
lea    0x8(%rsp),%rdi
lea    0x58(%rsp),%rsi
mov    %rbp,%rdx
call   1120 <getline@plt>
test   %rax,%rax
je     1873 <main+0x663>
mov    %rax,%r15
mov    0x8(%rsp),%r12
cmpb   $0xa,-0x1(%r12,%rax,1)
jne    13cb <main+0x1bb>
add    $0xffffffffffffffff,%r15
movb   $0x0,(%r12,%r15,1)
mov    0x8(%rsp),%r12
movzbl (%r12),%eax
mov    $0x2,%ecx
cmp    $0x2f,%al
je     1400 <main+0x1f0>
cmp    $0x23,%al
je     1385 <main+0x175>
test   %al,%al
jne    1470 <main+0x260>
movl   $0x0,0x34(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
jmp    1385 <main+0x175>
nop
lea    0x1(%r12),%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
mov    %rax,0x38(%rsp)
test   %rax,%rax
je     1349 <main+0x139>
mov    %rax,%rbp
movzbl 0x1(%rax),%ecx
test   %cl,%cl
je     16c8 <main+0x4b8>
cmp    $0x69,%cl
jne    143b <main+0x22b>
cmpb   $0x0,0x2(%rbp)
je     16c0 <main+0x4b0>
movl   $0x0,0x14(%rsp)
lea    0xbfe(%rip),%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
movl   $0x0,0x10(%rsp)
jmp    1744 <main+0x534>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
lea    0xc0d(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1532 <main+0x322>
cmpl   $0x0,0x10(%rsp)
je     158e <main+0x37e>
mov    0x8(%rsp),%rdi
lea    0xc7e(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     15d3 <main+0x3c3>
mov    0x8(%rsp),%rdi
mov    %rdi,0x38(%rsp)
cmpb   $0x20,(%rdi)
jne    14ca <main+0x2ba>
add    $0x1,%rdi
mov    %rdi,0x38(%rsp)
lea    0x38(%rsp),%rsi
mov    $0xa,%edx
call   1110 <strtoul@plt>
cmp    $0x13,%rax
ja     15b2 <main+0x3a2>
mov    0x38(%rsp),%r8
cmpb   $0x3a,(%r8)
jne    15b2 <main+0x3a2>
cmpb   $0x20,0x1(%r8)
jne    15b2 <main+0x3a2>
mov    %rax,%r12
movslq 0x60(%rsp,%rax,8),%r10
cmp    $0xffffffffffffffff,%r10
je     1790 <main+0x580>
mov    0x64(%rsp,%r12,8),%ebp
cmp    $0xffffffff,%ebp
je     1790 <main+0x580>
mov    %ebp,%edx
sub    %r10d,%edx
jge    17d7 <main+0x5c7>
mov    0x18(%rsp),%rcx
jmp    1815 <main+0x605>
cmpl   $0x0,0x14(%rsp)
je     1613 <main+0x403>
add    $0xfffffffffffffffd,%r15
cmp    %r15,%r13
jae    162e <main+0x41e>
mov    0x18(%rsp),%rdi
mov    %r15,%rsi
call   10f0 <realloc@plt>
mov    %rax,%rdi
mov    %r15,%rax
test   %rdi,%rdi
jne    1636 <main+0x426>
lea    0xb42(%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    1385 <main+0x175>
movl   $0x0,0x10(%rsp)
lea    0xb58(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
jmp    1380 <main+0x170>
mov    0x8(%rsp),%rdx
lea    0xb9a(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
jmp    1380 <main+0x170>
mov    0x60(%rsp),%r8d
mov    0x64(%rsp),%r9d
cmp    $0xffffffff,%r8d
jne    15ed <main+0x3dd>
cmp    $0xffffffff,%r9d
je     1380 <main+0x170>
lea    0xb37(%rip),%rdi
mov    %rbx,%rsi
mov    0x20(%rsp),%rdx
mov    0x18(%rsp),%rcx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
jmp    1380 <main+0x170>
mov    0x8(%rsp),%rdx
lea    0xa6d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1380 <main+0x170>
mov    %r13,%rax
mov    0x18(%rsp),%rdi
mov    %rax,0x48(%rsp)
mov    0x8(%rsp),%rsi
add    $0x4,%rsi
mov    %r15,%rdx
mov    %rdi,%r13
call   10c0 <memcpy@plt>
xor    %eax,%eax
cmpl   $0x0,0x34(%rsp)
setne  %al
lea    0x1(%rax,%rax,1),%edx
lea    0x44(%rsp),%r12
mov    %r12,%rdi
mov    0x20(%rsp),%r15
mov    %r15,%rsi
call   1090 <regcomp@plt>
test   %eax,%eax
mov    %r13,0x18(%rsp)
je     174e <main+0x53e>
mov    %eax,%edi
mov    %r12,%rsi
lea    0x100(%rsp),%r14
mov    %r14,%rdx
mov    $0x1f4,%ecx
call   10d0 <regerror@plt>
lea    0xa35(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
mov    0x48(%rsp),%r13
jmp    1380 <main+0x170>
movl   $0x1,0x34(%rsp)
sub    %r12,%rax
cmp    %rax,0x50(%rsp)
jae    1707 <main+0x4f7>
mov    0x20(%rsp),%rdi
mov    %rax,%rsi
call   10f0 <realloc@plt>
test   %rax,%rax
je     1850 <main+0x640>
mov    %rax,0x20(%rsp)
mov    0x38(%rsp),%rbp
mov    0x8(%rsp),%rdx
mov    %rbp,%rax
sub    %rdx,%rax
mov    %rax,0x50(%rsp)
mov    %rdx,%r12
jmp    170a <main+0x4fa>
mov    %r12,%rdx
add    $0x1,%r12
not    %rdx
add    %rbp,%rdx
mov    0x20(%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,0x10(%rsp)
movl   $0x1,0x14(%rsp)
mov    0x28(%rsp),%rbp
jmp    1380 <main+0x170>
mov    %r12,%rdi
mov    %r13,%rsi
mov    $0x14,%edx
lea    0x60(%rsp),%rcx
xor    %r8d,%r8d
call   10e0 <regexec@plt>
test   %rax,%rax
je     1774 <main+0x564>
movq   $0xffffffffffffffff,0x60(%rsp)
ff ff
lea    0x44(%rsp),%rdi
call   1060 <regfree@plt>
movl   $0x1,0x10(%rsp)
mov    0x48(%rsp),%r13
jmp    1380 <main+0x170>
add    $0x2,%r8
mov    %r8,%rdi
lea    0x9d0(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1744 <main+0x534>
mov    0x60(%rsp,%r12,8),%r9d
mov    0x64(%rsp,%r12,8),%ebp
sub    $0x8,%rsp
lea    0x9b9(%rip),%rdi
mov    %rbx,%rsi
mov    0x28(%rsp),%rdx
mov    0x20(%rsp),%rcx
mov    %r12,%r8
xor    %eax,%eax
push   %rbp
call   1070 <printf@plt>
jmp    1835 <main+0x625>
movslq %edx,%rax
lea    0x2(%r8),%rdi
sub    %rdi,%r15
add    0x8(%rsp),%r15
cmp    %rax,%r15
mov    0x18(%rsp),%rcx
jne    1815 <main+0x605>
mov    %r8,%r15
add    %rcx,%r10
mov    %r10,%rsi
call   1040 <strncmp@plt>
test   %rax,%rax
je     1844 <main+0x634>
mov    0x60(%rsp,%r12,8),%r10d
mov    0x64(%rsp,%r12,8),%ebp
mov    0x18(%rsp),%rcx
mov    %r15,%r8
add    $0x2,%r8
lea    0x998(%rip),%rdi
mov    %rbx,%rsi
mov    0x20(%rsp),%rdx
mov    %r12,%r9
xor    %eax,%eax
push   %rbp
push   %r10
call   1070 <printf@plt>
add    $0x10,%rsp
mov    $0x1,%r14d
jmp    1744 <main+0x534>
xor    %ecx,%ecx
mov    0x28(%rsp),%rbp
jmp    1385 <main+0x175>
lea    0x810(%rip),%rdi
xor    %eax,%eax
mov    %rax,0x20(%rsp)
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
mov    0x28(%rsp),%rbp
mov    0x20(%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"%zd: Invalid pattern line: %s\0A\00"
@.str.6 = [32 x i8] c"%zd: Cannot record pattern: %m\0A\00"
@.str.7 = [5 x i8] c" \00"
@.str.8 = [35 x i8] c"%zd: No previous valid pattern %s\0A\00"
@.str.9 = [38 x i8] c"%zd: Cannot record search string: %m\0A\00"
@.str.10 = [32 x i8] c"%zd: regcomp failed for %s: %s\0A\00"
@.str.11 = [45 x i8] c"%zd: No preceeding pattern or search string\0A\00"
@.str.12 = [9 x i8] c"No match\00"
@.str.13 = [45 x i8] c"%zd: /%s/ on %s unexpectedly matched %d..%d\0A\00"
@.str.14 = [22 x i8] c"%zd: Invalid line %s\0A\00"
@.str.15 = [8 x i8] c"<unset>\00"
@.str.16 = [66 x i8] c"%zd: /%s/ on %s unexpectedly failed to match register %ld %d..%d\0A\00"
@.str.17 = [73 x i8] c"%zd: /%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 = call i32 (...) @mtrace()
%26 = load i32, i32* %4
%27 = icmp slt i32 %26, 2
br i1 %27, label %28, label %31
28: ; preds = %2
%29 = load i32, i32* @stderr
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %415
31: ; preds = %2
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32* @fopen(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %35, i32** %10
%36 = load i32*, i32** %10
%37 = icmp eq i32* %36, null
br i1 %37, label %38, label %44
38: ; preds = %31
%39 = load i32, i32* @stderr
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %42)
store i32 1, i32* %3
br label %415
44: ; preds = %31
%45 = load i32*, i32** %10
%46 = call i64 @getline(i8** %7, i64* %8, i32* %45)
store i64 %46, i64* %9
%47 = icmp ule i64 %46, 0
br i1 %47, label %52, label %48
48: ; preds = %44
%49 = load i8*, i8** %7
%50 = call i64 @strncmp(i8* %49, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 6)
%51 = icmp ne i64 %50, 0
br i1 %51, label %52, label %59
52: ; preds = %48, %44
%53 = load i32, i32* @stderr
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%55 = load i32*, i32** %10
%56 = call i32 @fclose(i32* %55)
%57 = load i8*, i8** %7
%58 = call i32 @free(i8* %57)
store i32 1, i32* %3
br label %415
59: ; preds = %48
store i64 1, i64* %19
br label %60
60: ; preds = %404, %388, %336, %301, %275, %247, %242, %224, %186, %160, %128, %105, %92, %85, %59
%61 = load i32*, i32** %10
%62 = call i64 @getline(i8** %7, i64* %8, i32* %61)
store i64 %62, i64* %9
%63 = icmp ugt i64 %62, 0
br i1 %63, label %64, label %405
64: ; preds = %60
%65 = load i64, i64* %19
%66 = add i64 %65, 1
store i64 %66, i64* %19
%67 = load i8*, i8** %7
%68 = load i64, i64* %9
%69 = sub i64 %68, 1
%70 = getelementptr inbounds i8, i8* %67, i64 %69
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = icmp eq i32 %72, 10
br i1 %73, label %74, label %79
74: ; preds = %64
%75 = load i8*, i8** %7
%76 = load i64, i64* %9
%77 = add i64 %76, -1
store i64 %77, i64* %9
%78 = getelementptr inbounds i8, i8* %75, i64 %77
store i8 0, i8* %78
br label %79
79: ; preds = %74, %64
%80 = load i8*, i8** %7
%81 = getelementptr inbounds i8, i8* %80, i64 0
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 35
br i1 %84, label %85, label %86
85: ; preds = %79
br label %60
86: ; preds = %79
%87 = load i8*, i8** %7
%88 = getelementptr inbounds i8, i8* %87, i64 0
%89 = load i8, i8* %88
%90 = sext i8 %89 to i32
%91 = icmp eq i32 %90, 0
br i1 %91, label %92, label %93
92: ; preds = %86
store i32 0, i32* %16
store i32 0, i32* %17
store i32 0, i32* %18
br label %60
93: ; preds = %86
%94 = load i8*, i8** %7
%95 = getelementptr inbounds i8, i8* %94, i64 0
%96 = load i8, i8* %95
%97 = sext i8 %96 to i32
%98 = icmp eq i32 %97, 47
br i1 %98, label %99, label %179
99: ; preds = %93
%100 = load i8*, i8** %7
%101 = getelementptr inbounds i8, i8* %100, i64 1
%102 = call i8* @strrchr(i8* %101, i8 signext 47)
store i8* %102, i8** %20
store i32 0, i32* %17
store i32 0, i32* %18
%103 = load i8*, i8** %20
%104 = icmp eq i8* %103, null
br i1 %104, label %105, label %109
105: ; preds = %99
%106 = load i64, i64* %19
%107 = load i8*, i8** %7
%108 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i64 %106, i8* %107)
store i32 1, i32* %6
br label %60
109: ; preds = %99
%110 = load i8*, i8** %20
%111 = getelementptr inbounds i8, i8* %110, i64 1
%112 = load i8, i8* %111
%113 = sext i8 %112 to i32
%114 = icmp eq i32 %113, 105
br i1 %114, label %115, label %122
115: ; preds = %109
%116 = load i8*, i8** %20
%117 = getelementptr inbounds i8, i8* %116, i64 2
%118 = load i8, i8* %117
%119 = sext i8 %118 to i32
%120 = icmp eq i32 %119, 0
br i1 %120, label %121, label %122
121: ; preds = %115
store i32 1, i32* %16
br label %133
122: ; preds = %115, %109
%123 = load i8*, i8** %20
%124 = getelementptr inbounds i8, i8* %123, i64 1
%125 = load i8, i8* %124
%126 = sext i8 %125 to i32
%127 = icmp ne i32 %126, 0
br i1 %127, label %128, label %132
128: ; preds = %122
%129 = load i64, i64* %19
%130 = load i8*, i8** %7
%131 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i64 %129, i8* %130)
store i32 1, i32* %6
br label %60
132: ; preds = %122
br label %133
133: ; preds = %132, %121
%134 = load i64, i64* %14
%135 = load i8*, i8** %20
%136 = load i8*, i8** %7
%137 = ptrtoint i8* %135 to i64
%138 = ptrtoint i8* %136 to i64
%139 = sub i64 %137, %138
%140 = icmp ult i64 %134, %139
br i1 %140, label %141, label %160
141: ; preds = %133
%142 = load i8*, i8** %11
%143 = load i8*, i8** %20
%144 = load i8*, i8** %7
%145 = ptrtoint i8* %143 to i64
%146 = ptrtoint i8* %144 to i64
%147 = sub i64 %145, %146
%148 = call i8* @realloc(i8* %142, i64 %147)
store i8* %148, i8** %11
%149 = load i8*, i8** %11
%150 = icmp eq i8* %149, null
br i1 %150, label %151, label %154
151: ; preds = %141
%152 = load i64, i64* %19
%153 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i64 %152)
store i32 1, i32* %6
br label %405
154: ; preds = %141
%155 = load i8*, i8** %20
%156 = load i8*, i8** %7
%157 = ptrtoint i8* %155 to i64
%158 = ptrtoint i8* %156 to i64
%159 = sub i64 %157, %158
store i64 %159, i64* %14
br label %160
160: ; preds = %154, %133
%161 = load i8*, i8** %11
%162 = load i8*, i8** %7
%163 = getelementptr inbounds i8, i8* %162, i64 1
%164 = load i8*, i8** %20
%165 = load i8*, i8** %7
%166 = ptrtoint i8* %164 to i64
%167 = ptrtoint i8* %165 to i64
%168 = sub i64 %166, %167
%169 = sub nsw i64 %168, 1
%170 = call i32 @memcpy(i8* %161, i8* %163, i64 %169)
%171 = load i8*, i8** %11
%172 = load i8*, i8** %20
%173 = load i8*, i8** %7
%174 = ptrtoint i8* %172 to i64
%175 = ptrtoint i8* %173 to i64
%176 = sub i64 %174, %175
%177 = sub nsw i64 %176, 1
%178 = getelementptr inbounds i8, i8* %171, i64 %177
store i8 0, i8* %178
store i32 1, i32* %17
br label %60
179: ; preds = %93
%180 = load i8*, i8** %7
%181 = call i64 @strncmp(i8* %180, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%182 = icmp eq i64 %181, 0
br i1 %182, label %183, label %244
183: ; preds = %179
%184 = load i32, i32* %17
%185 = icmp ne i32 %184, 0
br i1 %185, label %190, label %186
186: ; preds = %183
%187 = load i64, i64* %19
%188 = load i8*, i8** %7
%189 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), i64 %187, i8* %188)
br label %60
190: ; preds = %183
%191 = load i64, i64* %15
%192 = load i64, i64* %9
%193 = sub i64 %192, 3
%194 = icmp ult i64 %191, %193
br i1 %194, label %195, label %208
195: ; preds = %190
%196 = load i8*, i8** %12
%197 = load i64, i64* %9
%198 = sub i64 %197, 3
%199 = call i8* @realloc(i8* %196, i64 %198)
store i8* %199, i8** %12
%200 = load i8*, i8** %12
%201 = icmp eq i8* %200, null
br i1 %201, label %202, label %205
202: ; preds = %195
%203 = load i64, i64* %19
%204 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i64 %203)
store i32 1, i32* %6
br label %405
205: ; preds = %195
%206 = load i64, i64* %9
%207 = sub i64 %206, 3
store i64 %207, i64* %15
br label %208
208: ; preds = %205, %190
%209 = load i8*, i8** %12
%210 = load i8*, i8** %7
%211 = getelementptr inbounds i8, i8* %210, i64 4
%212 = load i64, i64* %9
%213 = sub i64 %212, 3
%214 = call i32 @memcpy(i8* %209, i8* %211, i64 %213)
%215 = load i8*, i8** %11
%216 = load i32, i32* %16
%217 = icmp ne i32 %216, 0
%218 = zext i1 %217 to i64
%219 = select i1 %217, i32 2, i32 0
%220 = or i32 1, %219
%221 = call i32 @regcomp(i32* %22, i8* %215, i32 %220)
store i32 %221, i32* %23
%222 = load i32, i32* %23
%223 = icmp ne i32 %222, 0
br i1 %223, label %224, label %232
224: ; preds = %208
%225 = load i32, i32* %23
%226 = getelementptr inbounds [500 x i8], [500 x i8]* %24, i64 0, i64 0
%227 = call i32 @regerror(i32 %225, i32* %22, i8* %226, i32 500)
%228 = load i64, i64* %19
%229 = load i8*, i8** %11
%230 = getelementptr inbounds [500 x i8], [500 x i8]* %24, i64 0, i64 0
%231 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i64 %228, i8* %229, i8* %230)
store i32 1, i32* %6
br label %60
232: ; preds = %208
%233 = load i8*, i8** %12
%234 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%235 = call i64 @regexec(i32* %22, i8* %233, i32 20, %struct.TYPE_3__* %234, i32 0)
%236 = icmp ne i64 %235, 0
br i1 %236, label %237, label %242
237: ; preds = %232
%238 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%239 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %238, i32 0, i32 0
store i32 -1, i32* %239
%240 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%241 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %240, i32 0, i32 1
store i32 -1, i32* %241
br label %242
242: ; preds = %237, %232
%243 = call i32 @regfree(i32* %22)
store i32 1, i32* %18
br label %60
244: ; preds = %179
%245 = load i32, i32* %18
%246 = icmp ne i32 %245, 0
br i1 %246, label %250, label %247
247: ; preds = %244
%248 = load i64, i64* %19
%249 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0), i64 %248)
store i32 1, i32* %6
br label %60
250: ; preds = %244
%251 = load i8*, i8** %7
%252 = call i64 @strcmp(i8* %251, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%253 = icmp eq i64 %252, 0
br i1 %253, label %254, label %276
254: ; preds = %250
%255 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%256 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %255, i32 0, i32 0
%257 = load i32, i32* %256
%258 = icmp ne i32 %257, -1
br i1 %258, label %264, label %259
259: ; preds = %254
%260 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%261 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %260, i32 0, i32 1
%262 = load i32, i32* %261
%263 = icmp ne i32 %262, -1
br i1 %263, label %264, label %275
264: ; preds = %259, %254
%265 = load i64, i64* %19
%266 = load i8*, i8** %11
%267 = load i8*, i8** %12
%268 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%269 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %268, i32 0, i32 0
%270 = load i32, i32* %269
%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 1
%273 = load i32, i32* %272
%274 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), i64 %265, i8* %266, i8* %267, i32 %270, i32 %273)
store i32 1, i32* %6
br label %275
275: ; preds = %264, %259
br label %60
276: ; preds = %250
%277 = load i8*, i8** %7
store i8* %277, i8** %20
%278 = load i8*, i8** %20
%279 = load i8, i8* %278
%280 = sext i8 %279 to i32
%281 = icmp eq i32 %280, 32
br i1 %281, label %282, label %285
282: ; preds = %276
%283 = load i8*, i8** %20
%284 = getelementptr inbounds i8, i8* %283, i32 1
store i8* %284, i8** %20
br label %285
285: ; preds = %282, %276
%286 = load i8*, i8** %20
%287 = call i64 @strtoul(i8* %286, i8** %20, i32 10)
store i64 %287, i64* %21
%288 = load i64, i64* %21
%289 = icmp uge i64 %288, 20
br i1 %289, label %301, label %290
290: ; preds = %285
%291 = load i8*, i8** %20
%292 = load i8, i8* %291
%293 = sext i8 %292 to i32
%294 = icmp ne i32 %293, 58
br i1 %294, label %301, label %295
295: ; preds = %290
%296 = load i8*, i8** %20
%297 = getelementptr inbounds i8, i8* %296, i64 1
%298 = load i8, i8* %297
%299 = sext i8 %298 to i32
%300 = icmp ne i32 %299, 32
br i1 %300, label %301, label %305
301: ; preds = %295, %290, %285
%302 = load i64, i64* %19
%303 = load i8*, i8** %7
%304 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i64 %302, i8* %303)
store i32 1, i32* %6
br label %60
305: ; preds = %295
%306 = load i64, i64* %21
%307 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %306
%308 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %307, i32 0, i32 0
%309 = load i32, i32* %308
%310 = icmp eq i32 %309, -1
br i1 %310, label %317, label %311
311: ; preds = %305
%312 = load i64, i64* %21
%313 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %312
%314 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %313, i32 0, i32 1
%315 = load i32, i32* %314
%316 = icmp eq i32 %315, -1
br i1 %316, label %317, label %337
317: ; preds = %311, %305
%318 = load i8*, i8** %20
%319 = getelementptr inbounds i8, i8* %318, i64 2
%320 = call i64 @strcmp(i8* %319, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%321 = icmp ne i64 %320, 0
br i1 %321, label %322, label %336
322: ; preds = %317
%323 = load i64, i64* %19
%324 = load i8*, i8** %11
%325 = load i8*, i8** %12
%326 = load i64, i64* %21
%327 = load i64, i64* %21
%328 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %327
%329 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %328, i32 0, i32 0
%330 = load i32, i32* %329
%331 = load i64, i64* %21
%332 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %331
%333 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %332, i32 0, i32 1
%334 = load i32, i32* %333
%335 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.16, i64 0, i64 0), i64 %323, i8* %324, i8* %325, i64 %326, i32 %330, i32 %334)
store i32 1, i32* %6
br label %336
336: ; preds = %322, %317
br label %60
337: ; preds = %311
%338 = load i64, i64* %21
%339 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %338
%340 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %339, i32 0, i32 1
%341 = load i32, i32* %340
%342 = load i64, i64* %21
%343 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %342
%344 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %343, i32 0, i32 0
%345 = load i32, i32* %344
%346 = icmp slt i32 %341, %345
br i1 %346, label %388, label %347
347: ; preds = %337
%348 = load i64, i64* %21
%349 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %348
%350 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %349, i32 0, i32 1
%351 = load i32, i32* %350
%352 = load i64, i64* %21
%353 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %352
%354 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %353, i32 0, i32 0
%355 = load i32, i32* %354
%356 = sub nsw i32 %351, %355
%357 = sext i32 %356 to i64
%358 = load i64, i64* %9
%359 = load i8*, i8** %20
%360 = getelementptr inbounds i8, i8* %359, i64 2
%361 = load i8*, i8** %7
%362 = ptrtoint i8* %360 to i64
%363 = ptrtoint i8* %361 to i64
%364 = sub i64 %362, %363
%365 = sub i64 %358, %364
%366 = icmp ne i64 %357, %365
br i1 %366, label %388, label %367
367: ; preds = %347
%368 = load i8*, i8** %20
%369 = getelementptr inbounds i8, i8* %368, i64 2
%370 = load i8*, i8** %12
%371 = load i64, i64* %21
%372 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %371
%373 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %372, i32 0, i32 0
%374 = load i32, i32* %373
%375 = sext i32 %374 to i64
%376 = getelementptr inbounds i8, i8* %370, i64 %375
%377 = load i64, i64* %21
%378 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %377
%379 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %378, i32 0, i32 1
%380 = load i32, i32* %379
%381 = load i64, i64* %21
%382 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %381
%383 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %382, i32 0, i32 0
%384 = load i32, i32* %383
%385 = sub nsw i32 %380, %384
%386 = call i64 @strncmp(i8* %369, i8* %376, i32 %385)
%387 = icmp ne i64 %386, 0
br i1 %387, label %388, label %404
388: ; preds = %367, %347, %337
%389 = load i64, i64* %19
%390 = load i8*, i8** %11
%391 = load i8*, i8** %12
%392 = load i8*, i8** %20
%393 = getelementptr inbounds i8, i8* %392, i64 2
%394 = load i64, i64* %21
%395 = load i64, i64* %21
%396 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %395
%397 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %396, i32 0, i32 0
%398 = load i32, i32* %397
%399 = load i64, i64* %21
%400 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %399
%401 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %400, i32 0, i32 1
%402 = load i32, i32* %401
%403 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.17, i64 0, i64 0), i64 %389, i8* %390, i8* %391, i8* %393, i64 %394, i32 %398, i32 %402)
store i32 1, i32* %6
br label %60
404: ; preds = %367
br label %60
405: ; preds = %202, %151, %60
%406 = load i8*, i8** %11
%407 = call i32 @free(i8* %406)
%408 = load i8*, i8** %12
%409 = call i32 @free(i8* %408)
%410 = load i8*, i8** %7
%411 = call i32 @free(i8* %410)
%412 = load i32*, i32** %10
%413 = call i32 @fclose(i32* %412)
%414 = load i32, i32* %6
store i32 %414, i32* %3
br label %415
415: ; preds = %405, %52, %38, %28
%416 = load i32, i32* %3
ret i32 %416
}

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