#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*/ 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, REG_EXTENDED | (ignorecase ? REG_ICASE : 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    $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)
mov    $0x0,%al
call   1130 <mtrace@plt>
cmpl   $0x2,-0x8(%rbp)
jge    12b8 <main+0xa8>
mov    0x2d3c(%rip),%rax
mov    (%rax),%edi
lea    0xd5b(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1adc <main+0x8cc>
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    0x2cf6(%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    1adc <main+0x8cc>
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    0x2c8d(%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    1adc <main+0x8cc>
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    1ab2 <main+0x8a2>
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    1ab2 <main+0x8a2>
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    17c2 <main+0x5b2>
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    1ab2 <main+0x8a2>
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    0x291a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x334(%rbp)
cmpl   $0x0,-0x104(%rbp)
je     16df <main+0x4cf>
mov    0x2916(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x344(%rbp)
jmp    16ec <main+0x4dc>
xor    %eax,%eax
mov    %eax,-0x344(%rbp)
jmp    16ec <main+0x4dc>
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     176a <main+0x55a>
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    0x97e(%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     17a7 <main+0x597>
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    17f0 <main+0x5e0>
mov    -0x118(%rbp),%rsi
lea    0x918(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1384 <main+0x174>
mov    -0x20(%rbp),%rdi
lea    0x927(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    185b <main+0x64b>
cmpl   $0xffffffff,-0xf0(%rbp)
jne    1824 <main+0x614>
cmpl   $0xffffffff,-0xec(%rbp)
je     1856 <main+0x646>
mov    -0x118(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0xf0(%rbp),%r8d
mov    -0xec(%rbp),%r9d
lea    0x8e3(%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    188b <main+0x67b>
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    18df <main+0x6cf>
mov    -0x120(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    18df <main+0x6cf>
mov    -0x120(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x20,%eax
je     1904 <main+0x6f4>
mov    -0x118(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0x867(%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     192e <main+0x71e>
mov    -0x128(%rbp),%rax
cmpl   $0xffffffff,-0xec(%rbp,%rax,8)
ff
jne    199f <main+0x78f>
mov    -0x120(%rbp),%rdi
add    $0x2,%rdi
lea    0x82e(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     199a <main+0x78a>
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    0x7ed(%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     1a4d <main+0x83d>
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    1a4d <main+0x83d>
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     1aad <main+0x89d>
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    0x726(%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    $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
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    0x2d8d(%rip),%rax
mov    (%rax),%edi
lea    0xdac(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x1,%r14d
jmp    189a <main+0x68a>
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    0x2d21(%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    189a <main+0x68a>
mov    0x2ced(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xd21(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x1,%r14d
jmp    189a <main+0x68a>
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    1392 <main+0x182>
movl   $0x0,0x24(%rsp)
lea    0xcf0(%rip),%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
movl   $0x0,0x14(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x2,%ecx
add    $0x1,%rbx
cmp    $0x3,%ecx
je     1874 <main+0x664>
lea    0x8(%rsp),%rdi
lea    0x58(%rsp),%rsi
mov    %rbp,%rdx
call   1120 <getline@plt>
test   %rax,%rax
je     1874 <main+0x664>
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,0x3c(%rsp)
movl   $0x0,0x24(%rsp)
movl   $0x0,0x14(%rsp)
jmp    1385 <main+0x175>
nop
lea    0x1(%r12),%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
mov    %rax,0x40(%rsp)
test   %rax,%rax
je     1349 <main+0x139>
mov    %rax,%rbp
movzbl 0x1(%rax),%ecx
test   %cl,%cl
je     16cc <main+0x4bc>
cmp    $0x69,%cl
jne    143b <main+0x22b>
cmpb   $0x0,0x2(%rbp)
je     16c4 <main+0x4b4>
movl   $0x0,0x24(%rsp)
lea    0xbfe(%rip),%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
movl   $0x0,0x14(%rsp)
jmp    1748 <main+0x538>
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,0x14(%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,0x40(%rsp)
cmpb   $0x20,(%rdi)
jne    14ca <main+0x2ba>
add    $0x1,%rdi
mov    %rdi,0x40(%rsp)
lea    0x40(%rsp),%rsi
mov    $0xa,%edx
call   1110 <strtoul@plt>
cmp    $0x13,%rax
ja     15b2 <main+0x3a2>
mov    0x40(%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     1791 <main+0x581>
mov    0x64(%rsp,%r12,8),%ebp
cmp    $0xffffffff,%ebp
je     1791 <main+0x581>
mov    %ebp,%edx
sub    %r10d,%edx
jge    17d8 <main+0x5c8>
mov    0x18(%rsp),%rcx
jmp    1816 <main+0x606>
cmpl   $0x0,0x24(%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,0x14(%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    0x28(%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,%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     1662 <main+0x452>
mov    0x2988(%rip),%rax
mov    (%rax),%edx
mov    0x2967(%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     1752 <main+0x542>
mov    %eax,%edi
mov    %r12,%rsi
lea    0x100(%rsp),%r14
mov    %r14,%rdx
mov    $0x1f4,%ecx
call   10d0 <regerror@plt>
lea    0xa2c(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r14d
jmp    1380 <main+0x170>
movl   $0x1,0x3c(%rsp)
sub    %r12,%rax
cmp    %rax,0x50(%rsp)
jae    170b <main+0x4fb>
mov    0x28(%rsp),%rdi
mov    %rax,%rsi
call   10f0 <realloc@plt>
test   %rax,%rax
je     1851 <main+0x641>
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    170e <main+0x4fe>
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    1380 <main+0x170>
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     177a <main+0x56a>
movq   $0xffffffffffffffff,0x60(%rsp)
ff ff
lea    0x4c(%rsp),%rdi
call   1060 <regfree@plt>
movl   $0x1,0x14(%rsp)
jmp    1380 <main+0x170>
add    $0x2,%r8
mov    %r8,%rdi
lea    0x9cf(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1748 <main+0x538>
mov    0x60(%rsp,%r12,8),%r9d
mov    0x64(%rsp,%r12,8),%ebp
sub    $0x8,%rsp
lea    0x9b8(%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    1836 <main+0x626>
movslq %edx,%rax
lea    0x2(%r8),%rdi
sub    %rdi,%r15
add    0x8(%rsp),%r15
cmp    %rax,%r15
mov    0x18(%rsp),%rcx
jne    1816 <main+0x606>
mov    %r8,%r15
add    %rcx,%r10
mov    %r10,%rsi
call   1040 <strncmp@plt>
test   %rax,%rax
je     1845 <main+0x635>
mov    0x60(%rsp,%r12,8),%r10d
mov    0x64(%rsp,%r12,8),%ebp
mov    0x18(%rsp),%rcx
mov    %r15,%r8
add    $0x2,%r8
lea    0x997(%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    1748 <main+0x538>
xor    %ecx,%ecx
mov    0x30(%rsp),%rbp
jmp    1385 <main+0x175>
lea    0x80f(%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"%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"
@REG_EXTENDED = global i32 0
@REG_ICASE = global i32 0
@.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 %419
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 %419
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 %419
59: ; preds = %48
store i64 1, i64* %19
br label %60
60: ; preds = %408, %392, %340, %305, %279, %251, %246, %228, %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 %409
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 %409
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 %248
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 %409
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* @REG_EXTENDED
%217 = load i32, i32* %16
%218 = icmp ne i32 %217, 0
br i1 %218, label %219, label %221
219: ; preds = %208
%220 = load i32, i32* @REG_ICASE
br label %222
221: ; preds = %208
br label %222
222: ; preds = %221, %219
%223 = phi i32 [ %220, %219 ], [ 0, %221 ]
%224 = or i32 %216, %223
%225 = call i32 @regcomp(i32* %22, i8* %215, i32 %224)
store i32 %225, i32* %23
%226 = load i32, i32* %23
%227 = icmp ne i32 %226, 0
br i1 %227, label %228, label %236
228: ; preds = %222
%229 = load i32, i32* %23
%230 = getelementptr inbounds [500 x i8], [500 x i8]* %24, i64 0, i64 0
%231 = call i32 @regerror(i32 %229, i32* %22, i8* %230, i32 500)
%232 = load i64, i64* %19
%233 = load i8*, i8** %11
%234 = getelementptr inbounds [500 x i8], [500 x i8]* %24, i64 0, i64 0
%235 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i64 %232, i8* %233, i8* %234)
store i32 1, i32* %6
br label %60
236: ; preds = %222
%237 = load i8*, i8** %12
%238 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%239 = call i64 @regexec(i32* %22, i8* %237, i32 20, %struct.TYPE_3__* %238, i32 0)
%240 = icmp ne i64 %239, 0
br i1 %240, label %241, label %246
241: ; preds = %236
%242 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%243 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %242, i32 0, i32 0
store i32 -1, i32* %243
%244 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%245 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %244, i32 0, i32 1
store i32 -1, i32* %245
br label %246
246: ; preds = %241, %236
%247 = call i32 @regfree(i32* %22)
store i32 1, i32* %18
br label %60
248: ; preds = %179
%249 = load i32, i32* %18
%250 = icmp ne i32 %249, 0
br i1 %250, label %254, label %251
251: ; preds = %248
%252 = load i64, i64* %19
%253 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0), i64 %252)
store i32 1, i32* %6
br label %60
254: ; preds = %248
%255 = load i8*, i8** %7
%256 = call i64 @strcmp(i8* %255, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%257 = icmp eq i64 %256, 0
br i1 %257, label %258, label %280
258: ; preds = %254
%259 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%260 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %259, i32 0, i32 0
%261 = load i32, i32* %260
%262 = icmp ne i32 %261, -1
br i1 %262, label %268, label %263
263: ; preds = %258
%264 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%265 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %264, i32 0, i32 1
%266 = load i32, i32* %265
%267 = icmp ne i32 %266, -1
br i1 %267, label %268, label %279
268: ; preds = %263, %258
%269 = load i64, i64* %19
%270 = load i8*, i8** %11
%271 = load i8*, i8** %12
%272 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%273 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %272, i32 0, i32 0
%274 = load i32, i32* %273
%275 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 0
%276 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %275, i32 0, i32 1
%277 = load i32, i32* %276
%278 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), i64 %269, i8* %270, i8* %271, i32 %274, i32 %277)
store i32 1, i32* %6
br label %279
279: ; preds = %268, %263
br label %60
280: ; preds = %254
%281 = load i8*, i8** %7
store i8* %281, i8** %20
%282 = load i8*, i8** %20
%283 = load i8, i8* %282
%284 = sext i8 %283 to i32
%285 = icmp eq i32 %284, 32
br i1 %285, label %286, label %289
286: ; preds = %280
%287 = load i8*, i8** %20
%288 = getelementptr inbounds i8, i8* %287, i32 1
store i8* %288, i8** %20
br label %289
289: ; preds = %286, %280
%290 = load i8*, i8** %20
%291 = call i64 @strtoul(i8* %290, i8** %20, i32 10)
store i64 %291, i64* %21
%292 = load i64, i64* %21
%293 = icmp uge i64 %292, 20
br i1 %293, label %305, label %294
294: ; preds = %289
%295 = load i8*, i8** %20
%296 = load i8, i8* %295
%297 = sext i8 %296 to i32
%298 = icmp ne i32 %297, 58
br i1 %298, label %305, label %299
299: ; preds = %294
%300 = load i8*, i8** %20
%301 = getelementptr inbounds i8, i8* %300, i64 1
%302 = load i8, i8* %301
%303 = sext i8 %302 to i32
%304 = icmp ne i32 %303, 32
br i1 %304, label %305, label %309
305: ; preds = %299, %294, %289
%306 = load i64, i64* %19
%307 = load i8*, i8** %7
%308 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i64 %306, i8* %307)
store i32 1, i32* %6
br label %60
309: ; preds = %299
%310 = load i64, i64* %21
%311 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %310
%312 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %311, i32 0, i32 0
%313 = load i32, i32* %312
%314 = icmp eq i32 %313, -1
br i1 %314, label %321, label %315
315: ; preds = %309
%316 = load i64, i64* %21
%317 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %316
%318 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %317, i32 0, i32 1
%319 = load i32, i32* %318
%320 = icmp eq i32 %319, -1
br i1 %320, label %321, label %341
321: ; preds = %315, %309
%322 = load i8*, i8** %20
%323 = getelementptr inbounds i8, i8* %322, i64 2
%324 = call i64 @strcmp(i8* %323, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%325 = icmp ne i64 %324, 0
br i1 %325, label %326, label %340
326: ; preds = %321
%327 = load i64, i64* %19
%328 = load i8*, i8** %11
%329 = load i8*, i8** %12
%330 = load i64, i64* %21
%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 0
%334 = load i32, i32* %333
%335 = load i64, i64* %21
%336 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %335
%337 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %336, i32 0, i32 1
%338 = load i32, i32* %337
%339 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.16, i64 0, i64 0), i64 %327, i8* %328, i8* %329, i64 %330, i32 %334, i32 %338)
store i32 1, i32* %6
br label %340
340: ; preds = %326, %321
br label %60
341: ; preds = %315
%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 1
%345 = load i32, i32* %344
%346 = load i64, i64* %21
%347 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %346
%348 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %347, i32 0, i32 0
%349 = load i32, i32* %348
%350 = icmp slt i32 %345, %349
br i1 %350, label %392, label %351
351: ; preds = %341
%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 1
%355 = load i32, i32* %354
%356 = load i64, i64* %21
%357 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %356
%358 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %357, i32 0, i32 0
%359 = load i32, i32* %358
%360 = sub nsw i32 %355, %359
%361 = sext i32 %360 to i64
%362 = load i64, i64* %9
%363 = load i8*, i8** %20
%364 = getelementptr inbounds i8, i8* %363, i64 2
%365 = load i8*, i8** %7
%366 = ptrtoint i8* %364 to i64
%367 = ptrtoint i8* %365 to i64
%368 = sub i64 %366, %367
%369 = sub i64 %362, %368
%370 = icmp ne i64 %361, %369
br i1 %370, label %392, label %371
371: ; preds = %351
%372 = load i8*, i8** %20
%373 = getelementptr inbounds i8, i8* %372, i64 2
%374 = load i8*, i8** %12
%375 = load i64, i64* %21
%376 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %375
%377 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %376, i32 0, i32 0
%378 = load i32, i32* %377
%379 = sext i32 %378 to i64
%380 = getelementptr inbounds i8, i8* %374, i64 %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 1
%384 = load i32, i32* %383
%385 = load i64, i64* %21
%386 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %385
%387 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %386, i32 0, i32 0
%388 = load i32, i32* %387
%389 = sub nsw i32 %384, %388
%390 = call i64 @strncmp(i8* %373, i8* %380, i32 %389)
%391 = icmp ne i64 %390, 0
br i1 %391, label %392, label %408
392: ; preds = %371, %351, %341
%393 = load i64, i64* %19
%394 = load i8*, i8** %11
%395 = load i8*, i8** %12
%396 = load i8*, i8** %20
%397 = getelementptr inbounds i8, i8* %396, i64 2
%398 = load i64, i64* %21
%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 0
%402 = load i32, i32* %401
%403 = load i64, i64* %21
%404 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %13, i64 0, i64 %403
%405 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %404, i32 0, i32 1
%406 = load i32, i32* %405
%407 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.17, i64 0, i64 0), i64 %393, i8* %394, i8* %395, i8* %397, i64 %398, i32 %402, i32 %406)
store i32 1, i32* %6
br label %60
408: ; preds = %371
br label %60
409: ; preds = %202, %151, %60
%410 = load i8*, i8** %11
%411 = call i32 @free(i8* %410)
%412 = load i8*, i8** %12
%413 = call i32 @free(i8* %412)
%414 = load i8*, i8** %7
%415 = call i32 @free(i8* %414)
%416 = load i32*, i32** %10
%417 = call i32 @fclose(i32* %416)
%418 = load i32, i32* %6
store i32 %418, i32* %3
br label %419
419: ; preds = %409, %52, %38, %28
%420 = load i32, i32* %3
ret i32 %420
}

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"
@REG_EXTENDED = global i32 0
@REG_ICASE = global i32 0
@.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 %262
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 %262
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 %262
46: ; preds = %33, %242
%47 = phi i8* [ %243, %242 ], [ null, %33 ]
%48 = phi i8* [ %244, %242 ], [ null, %33 ]
%49 = phi i64 [ %245, %242 ], [ 0, %33 ]
%50 = phi i64 [ %246, %242 ], [ 0, %33 ]
%51 = phi i32 [ %247, %242 ], [ 0, %33 ]
%52 = phi i32 [ %248, %242 ], [ 0, %33 ]
%53 = phi i32 [ %249, %242 ], [ 0, %33 ]
%54 = phi i64 [ %59, %242 ], [ 1, %33 ]
%55 = phi i32 [ %251, %242 ], [ 0, %33 ]
%56 = call i64 @getline(i8** %3, i64* %4, i32* %20)
%57 = icmp eq i64 %56, 0
br i1 %57, label %253, 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 %242
i8 0, label %71
i8 47, label %72
]
71: ; preds = %67
br label %242
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 %242
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 %242
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 %253
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 %242
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 %163
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 %157
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 %157
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 = load i32, i32* @REG_EXTENDED
%142 = icmp eq i32 %51, 0
%143 = load i32, i32* @REG_ICASE
%144 = select i1 %142, i32 0, i32 %143
%145 = or i32 %144, %141
%146 = call i32 @regcomp(i32* %7, i8* %47, i32 %145)
%147 = icmp eq i32 %146, 0
br i1 %147, label %151, label %148
148: ; preds = %135
%149 = call i32 @regerror(i32 %146, i32* %7, i8* %38, i32 500)
%150 = 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 %157
151: ; preds = %135
%152 = call i64 @regexec(i32* %7, i8* %136, i32 20, %struct.TYPE_3__* %39, i32 0)
%153 = icmp eq i64 %152, 0
br i1 %153, label %155, label %154
154: ; preds = %151
store i32 -1, i32* %35
store i32 -1, i32* %36
br label %155
155: ; preds = %154, %151
%156 = call i32 @regfree(i32* %7)
br label %157
157: ; preds = %155, %148, %133, %124
%158 = phi i8* [ null, %133 ], [ %136, %148 ], [ %136, %155 ], [ %48, %124 ]
%159 = phi i64 [ %50, %133 ], [ %137, %148 ], [ %137, %155 ], [ %50, %124 ]
%160 = phi i32 [ %53, %133 ], [ %53, %148 ], [ 1, %155 ], [ %53, %124 ]
%161 = phi i32 [ 3, %133 ], [ 2, %148 ], [ 2, %155 ], [ 2, %124 ]
%162 = phi i32 [ 1, %133 ], [ 1, %148 ], [ %55, %155 ], [ %55, %124 ]
br label %242
163: ; preds = %119
%164 = icmp eq i32 %53, 0
br i1 %164, label %165, label %167
165: ; preds = %163
%166 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0), i64 %59)
br label %242
167: ; preds = %163
%168 = load i8*, i8** %3
%169 = call i64 @strcmp(i8* %168, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%170 = icmp eq i64 %169, 0
br i1 %170, label %171, label %179
171: ; preds = %167
%172 = load i32, i32* %35
%173 = icmp ne i32 %172, -1
%174 = load i32, i32* %36
%175 = icmp ne i32 %174, -1
%176 = select i1 %173, i1 true, i1 %175
br i1 %176, label %177, label %242
177: ; preds = %171
%178 = 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 %172, i32 %174)
br label %242
179: ; preds = %167
%180 = load i8*, i8** %3
store i8* %180, i8** %6
%181 = load i8, i8* %180
%182 = icmp eq i8 %181, 32
br i1 %182, label %183, label %185
183: ; preds = %179
%184 = getelementptr inbounds i8, i8* %180, i64 1
store i8* %184, i8** %6
br label %185
185: ; preds = %183, %179
%186 = phi i8* [ %184, %183 ], [ %180, %179 ]
%187 = call i64 @strtoul(i8* %186, i8** %6, i32 10)
%188 = icmp ugt i64 %187, 19
br i1 %188, label %197, label %189
189: ; preds = %185
%190 = load i8*, i8** %6
%191 = load i8, i8* %190
%192 = icmp eq i8 %191, 58
br i1 %192, label %193, label %197
193: ; preds = %189
%194 = getelementptr inbounds i8, i8* %190, i64 1
%195 = load i8, i8* %194
%196 = icmp eq i8 %195, 32
br i1 %196, label %200, label %197
197: ; preds = %193, %189, %185
%198 = load i8*, i8** %3
%199 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i64 %59, i8* %198)
br label %242
200: ; preds = %193
%201 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %5, i64 0, i64 %187, i32 0
%202 = load i32, i32* %201
%203 = icmp eq i32 %202, -1
br i1 %203, label %208, label %204
204: ; preds = %200
%205 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %5, i64 0, i64 %187, i32 1
%206 = load i32, i32* %205
%207 = icmp eq i32 %206, -1
br i1 %207, label %208, label %217
208: ; preds = %204, %200
%209 = getelementptr inbounds i8, i8* %190, i64 2
%210 = call i64 @strcmp(i8* %209, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%211 = icmp eq i64 %210, 0
br i1 %211, label %242, label %212
212: ; preds = %208
%213 = load i32, i32* %201
%214 = getelementptr inbounds [20 x %struct.TYPE_3__], [20 x %struct.TYPE_3__]* %5, i64 0, i64 %187, i32 1
%215 = load i32, i32* %214
%216 = 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 %187, i32 %213, i32 %215)
br label %242
217: ; preds = %204
%218 = icmp slt i32 %206, %202
br i1 %218, label %237, label %219
219: ; preds = %217
%220 = sub nsw i32 %206, %202
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds i8, i8* %190, i64 2
%223 = load i8*, i8** %3
%224 = ptrtoint i8* %222 to i64
%225 = ptrtoint i8* %223 to i64
%226 = sub i64 %69, %224
%227 = add i64 %226, %225
%228 = icmp eq i64 %227, %221
br i1 %228, label %229, label %237
229: ; preds = %219
%230 = sext i32 %202 to i64
%231 = getelementptr inbounds i8, i8* %48, i64 %230
%232 = call i64 @strncmp(i8* %222, i8* %231, i32 %220)
%233 = icmp eq i64 %232, 0
br i1 %233, label %242, label %234
234: ; preds = %229
%235 = load i32, i32* %201
%236 = load i32, i32* %205
br label %237
237: ; preds = %234, %219, %217
%238 = phi i32 [ %236, %234 ], [ %206, %219 ], [ %206, %217 ]
%239 = phi i32 [ %235, %234 ], [ %202, %219 ], [ %202, %217 ]
%240 = getelementptr inbounds i8, i8* %190, i64 2
%241 = 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* %240, i64 %187, i32 %239, i32 %238)
br label %242
242: ; preds = %229, %208, %212, %177, %171, %67, %237, %197, %165, %157, %104, %85, %76, %71
%243 = phi i8* [ %47, %71 ], [ %47, %76 ], [ %108, %104 ], [ %47, %85 ], [ %47, %157 ], [ %47, %197 ], [ %47, %237 ], [ %47, %165 ], [ %47, %67 ], [ %47, %171 ], [ %47, %177 ], [ %47, %212 ], [ %47, %208 ], [ %47, %229 ]
%244 = phi i8* [ %48, %71 ], [ %48, %76 ], [ %48, %104 ], [ %48, %85 ], [ %158, %157 ], [ %48, %197 ], [ %48, %237 ], [ %48, %165 ], [ %48, %67 ], [ %48, %171 ], [ %48, %177 ], [ %48, %212 ], [ %48, %208 ], [ %48, %229 ]
%245 = phi i64 [ %49, %71 ], [ %49, %76 ], [ %109, %104 ], [ %49, %85 ], [ %49, %157 ], [ %49, %197 ], [ %49, %237 ], [ %49, %165 ], [ %49, %67 ], [ %49, %171 ], [ %49, %177 ], [ %49, %212 ], [ %49, %208 ], [ %49, %229 ]
%246 = phi i64 [ %50, %71 ], [ %50, %76 ], [ %50, %104 ], [ %50, %85 ], [ %159, %157 ], [ %50, %197 ], [ %50, %237 ], [ %50, %165 ], [ %50, %67 ], [ %50, %171 ], [ %50, %177 ], [ %50, %212 ], [ %50, %208 ], [ %50, %229 ]
%247 = phi i32 [ 0, %71 ], [ %51, %76 ], [ %88, %104 ], [ %51, %85 ], [ %51, %157 ], [ %51, %197 ], [ %51, %237 ], [ %51, %165 ], [ %51, %67 ], [ %51, %171 ], [ %51, %177 ], [ %51, %212 ], [ %51, %208 ], [ %51, %229 ]
%248 = phi i32 [ 0, %71 ], [ 0, %76 ], [ 1, %104 ], [ 0, %85 ], [ %52, %157 ], [ %52, %197 ], [ %52, %237 ], [ %52, %165 ], [ %52, %67 ], [ %52, %171 ], [ %52, %177 ], [ %52, %212 ], [ %52, %208 ], [ %52, %229 ]
%249 = phi i32 [ 0, %71 ], [ 0, %76 ], [ 0, %104 ], [ 0, %85 ], [ %160, %157 ], [ %53, %197 ], [ %53, %237 ], [ 0, %165 ], [ %53, %67 ], [ %53, %171 ], [ %53, %177 ], [ %53, %212 ], [ %53, %208 ], [ %53, %229 ]
%250 = phi i32 [ 2, %71 ], [ 2, %76 ], [ 2, %104 ], [ 2, %85 ], [ %161, %157 ], [ 2, %197 ], [ 2, %237 ], [ 2, %165 ], [ 2, %67 ], [ 2, %171 ], [ 2, %177 ], [ 2, %212 ], [ 2, %208 ], [ 0, %229 ]
%251 = phi i32 [ %55, %71 ], [ 1, %76 ], [ %55, %104 ], [ 1, %85 ], [ %162, %157 ], [ 1, %197 ], [ 1, %237 ], [ 1, %165 ], [ %55, %67 ], [ %55, %171 ], [ 1, %177 ], [ 1, %212 ], [ %55, %208 ], [ %55, %229 ]
%252 = icmp eq i32 %250, 3
br i1 %252, label %253, label %46
253: ; preds = %242, %46, %96
%254 = phi i8* [ null, %96 ], [ %47, %46 ], [ %243, %242 ]
%255 = phi i8* [ %48, %96 ], [ %48, %46 ], [ %244, %242 ]
%256 = phi i32 [ 1, %96 ], [ %55, %46 ], [ %251, %242 ]
%257 = call i32 @free(i8* %254)
%258 = call i32 @free(i8* %255)
%259 = load i8*, i8** %3
%260 = call i32 @free(i8* %259)
%261 = call i32 @fclose(i32* %20)
br label %262
262: ; preds = %253, %40, %22, %14
%263 = phi i32 [ 1, %14 ], [ 1, %22 ], [ 1, %40 ], [ %256, %253 ]
ret i32 %263
}