#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 */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *combine(char *, char *);
char *compact(char *);
int /*<<< orphan*/ die(char *);
int /*<<< orphan*/ expand(char *, char *, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int find_in(char **, int, char *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ qsort_arr(char **, char **, int /*<<< orphan*/, int);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main(int argc, const char *argv[]) {
  FILE *in, *out;
  char *pattab_key[(256 * 1024)];
  char *pattab_val[(256 * 1024)];
  int patterns = 0;
  char *newpattab_key[(256 * 1024)];
  char *newpattab_val[(256 * 1024)];
  int newpatterns = 0;
  char format[132];
  int p;
  if (argc != 3)
    die("Usage: <orig-file> <new-file>\n");
  if ((in = fopen(argv[1], "r")) == NULL)
    die("Could not read input");
  if ((out = fopen(argv[2], "w")) == NULL)
    die("Could not create output");
  while (fgets(format, 132, in)) {
    int l = strlen(format);
    if (format[l - 1] == '\n') {
      l--;
      format[l] = 0;
    }
    if (format[0] == '%' || format[0] == 0) {
    } else {
      if (format[l - 1] == '%') {
        l--;
        format[l] = 0;
      }
      int i, j;
      char *pat = (char *)malloc(l + 1);
      char *org = (char *)malloc(l * 2 + 1);
      expand(org, format, l);
      for (i = 0, j = 0; i < l; i++) {
        char c = format[i];
        if (c < '0' || c > '9')
          pat[j++] = c;
      }
      pat[j] = 0;
      p = patterns;
      pattab_key[patterns] = pat;
      pattab_val[patterns++] = org;
      if (patterns > (256 * 1024))
        die("to many base patterns");
    }
  }
  fclose(in);
  qsort_arr(pattab_key, pattab_val, 0, patterns - 1);
  for (p = 0; p < patterns; p++) {
    char *pat = pattab_key[p];
    int patsize = strlen(pat);
    int j, l;
    for (l = 1; l <= patsize; l++) {
      for (j = 1; j <= l; j++) {
        int i = l - j;
        int subpat_ndx;
        char subpat[132];
        strncpy(subpat, pat + i, j);
        subpat[j] = 0;
        if ((subpat_ndx = find_in(pattab_key, patterns, subpat)) >= 0) {
          int newpat_ndx;
          char *newpat = malloc(l + 1);
          strncpy(newpat, pat + 0, l);
          newpat[l] = 0;
          if ((newpat_ndx = find_in(newpattab_key, newpatterns, newpat)) < 0) {
            char *neworg = malloc(132);
            expand(neworg, newpat, l);
            newpattab_key[newpatterns] = newpat;
            newpattab_val[newpatterns++] =
                combine(neworg, pattab_val[subpat_ndx]);
            if (newpatterns > (256 * 1024))
              die("to many new patterns");
          } else {
            free(newpat);
            newpattab_val[newpat_ndx] =
                combine(newpattab_val[newpat_ndx], pattab_val[subpat_ndx]);
          }
        }
      }
    }
  }
  for (p = 0; p < newpatterns; p++) {
    fprintf(out, "%s\n", compact(newpattab_val[p]));
    free(newpattab_key[p]);
    free(newpattab_val[p]);
  }
  fclose(out);
  for (p = 0; p < patterns; p++) {
    free(pattab_key[p]);
    free(pattab_val[p]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8001b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x400024(%rbp)
movl   $0x0,-0x800034(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1223 <main+0x43>
lea    0xde2(%rip),%rdi
call   10e0 <die@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xded(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1251 <main+0x71>
lea    0xdd5(%rip),%rdi
call   10e0 <die@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdd6(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    127f <main+0x9f>
lea    0xdbe(%rip),%rdi
call   10e0 <die@plt>
jmp    1284 <main+0xa4>
lea    -0x8000c0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x84,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     14a7 <main+0x2c7>
lea    -0x8000c0(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x8000c8(%rbp)
mov    -0x8000c8(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x8000c0(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    12ef <main+0x10f>
mov    -0x8000c8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8000c8(%rbp)
movslq -0x8000c8(%rbp),%rax
movb   $0x0,-0x8000c0(%rbp,%rax,1)
movsbl -0x8000c0(%rbp),%eax
cmp    $0x25,%eax
je     130f <main+0x12f>
movsbl -0x8000c0(%rbp),%eax
cmp    $0x0,%eax
jne    1314 <main+0x134>
jmp    14a2 <main+0x2c2>
mov    -0x8000c8(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x8000c0(%rbp,%rax,1),%eax
ff
cmp    $0x25,%eax
jne    134e <main+0x16e>
mov    -0x8000c8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8000c8(%rbp)
movslq -0x8000c8(%rbp),%rax
movb   $0x0,-0x8000c0(%rbp,%rax,1)
mov    -0x8000c8(%rbp),%edi
add    $0x1,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x8000d8(%rbp)
mov    -0x8000c8(%rbp),%edi
shl    $0x1,%edi
add    $0x1,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x8000e0(%rbp)
mov    -0x8000e0(%rbp),%rdi
lea    -0x8000c0(%rbp),%rsi
mov    -0x8000c8(%rbp),%edx
call   10f0 <expand@plt>
movl   $0x0,-0x8000cc(%rbp)
movl   $0x0,-0x8000d0(%rbp)
mov    -0x8000cc(%rbp),%eax
cmp    -0x8000c8(%rbp),%eax
jge    142b <main+0x24b>
movslq -0x8000cc(%rbp),%rax
mov    -0x8000c0(%rbp,%rax,1),%al
mov    %al,-0x8000e1(%rbp)
movsbl -0x8000e1(%rbp),%eax
cmp    $0x30,%eax
jl     13ee <main+0x20e>
movsbl -0x8000e1(%rbp),%eax
cmp    $0x39,%eax
jle    1412 <main+0x232>
mov    -0x8000e1(%rbp),%dl
mov    -0x8000d8(%rbp),%rax
mov    -0x8000d0(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x8000d0(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1417 <main+0x237>
mov    -0x8000cc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8000cc(%rbp)
jmp    13a8 <main+0x1c8>
mov    -0x8000d8(%rbp),%rax
movslq -0x8000d0(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x400024(%rbp),%eax
mov    %eax,-0x8000c4(%rbp)
mov    -0x8000d8(%rbp),%rcx
movslq -0x400024(%rbp),%rax
mov    %rcx,-0x200020(%rbp,%rax,8)
ff
mov    -0x8000e0(%rbp),%rcx
mov    -0x400024(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x400024(%rbp)
cltq
mov    %rcx,-0x400020(%rbp,%rax,8)
ff
cmpl   $0x40000,-0x400024(%rbp)
jle    149d <main+0x2bd>
lea    0xbb8(%rip),%rdi
call   10e0 <die@plt>
jmp    14a2 <main+0x2c2>
jmp    1284 <main+0xa4>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
lea    -0x200020(%rbp),%rdi
lea    -0x400020(%rbp),%rsi
mov    -0x400024(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   10c0 <qsort_arr@plt>
movl   $0x0,-0x8000c4(%rbp)
mov    -0x8000c4(%rbp),%eax
cmp    -0x400024(%rbp),%eax
jge    1749 <main+0x569>
movslq -0x8000c4(%rbp),%rax
mov    -0x200020(%rbp,%rax,8),%rax
ff
mov    %rax,-0x8000f0(%rbp)
mov    -0x8000f0(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x8000f4(%rbp)
movl   $0x1,-0x8000fc(%rbp)
mov    -0x8000fc(%rbp),%eax
cmp    -0x8000f4(%rbp),%eax
jg     1730 <main+0x550>
movl   $0x1,-0x8000f8(%rbp)
mov    -0x8000f8(%rbp),%eax
cmp    -0x8000fc(%rbp),%eax
jg     1717 <main+0x537>
mov    -0x8000fc(%rbp),%eax
sub    -0x8000f8(%rbp),%eax
mov    %eax,-0x800100(%rbp)
lea    -0x800190(%rbp),%rdi
mov    -0x8000f0(%rbp),%rsi
movslq -0x800100(%rbp),%rax
add    %rax,%rsi
mov    -0x8000f8(%rbp),%edx
call   1040 <strncpy@plt>
movslq -0x8000f8(%rbp),%rax
movb   $0x0,-0x800190(%rbp,%rax,1)
lea    -0x200020(%rbp),%rdi
mov    -0x400024(%rbp),%esi
lea    -0x800190(%rbp),%rdx
call   1100 <find_in@plt>
mov    %eax,-0x800104(%rbp)
cmp    $0x0,%eax
jl     16fe <main+0x51e>
mov    -0x8000fc(%rbp),%edi
add    $0x1,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x8001a0(%rbp)
mov    -0x8001a0(%rbp),%rdi
mov    -0x8000f0(%rbp),%rsi
mov    -0x8000fc(%rbp),%edx
call   1040 <strncpy@plt>
mov    -0x8001a0(%rbp),%rax
movslq -0x8000fc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
lea    -0x600030(%rbp),%rdi
mov    -0x800034(%rbp),%esi
mov    -0x8001a0(%rbp),%rdx
call   1100 <find_in@plt>
mov    %eax,-0x800194(%rbp)
cmp    $0x0,%eax
jge    16b8 <main+0x4d8>
mov    $0x84,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x8001a8(%rbp)
mov    -0x8001a8(%rbp),%rdi
mov    -0x8001a0(%rbp),%rsi
mov    -0x8000fc(%rbp),%edx
call   10f0 <expand@plt>
mov    -0x8001a0(%rbp),%rcx
movslq -0x800034(%rbp),%rax
mov    %rcx,-0x600030(%rbp,%rax,8)
ff
mov    -0x8001a8(%rbp),%rdi
movslq -0x800104(%rbp),%rax
mov    -0x400020(%rbp,%rax,8),%rsi
ff
call   1070 <combine@plt>
mov    %rax,%rcx
mov    -0x800034(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x800034(%rbp)
cltq
mov    %rcx,-0x800030(%rbp,%rax,8)
ff
cmpl   $0x40000,-0x800034(%rbp)
jle    16b3 <main+0x4d3>
lea    0x9b8(%rip),%rdi
call   10e0 <die@plt>
jmp    16f9 <main+0x519>
mov    -0x8001a0(%rbp),%rdi
call   1030 <free@plt>
movslq -0x800194(%rbp),%rax
mov    -0x800030(%rbp,%rax,8),%rdi
ff
movslq -0x800104(%rbp),%rax
mov    -0x400020(%rbp,%rax,8),%rsi
ff
call   1070 <combine@plt>
mov    %rax,%rcx
movslq -0x800194(%rbp),%rax
mov    %rcx,-0x800030(%rbp,%rax,8)
ff
jmp    16fe <main+0x51e>
jmp    1703 <main+0x523>
mov    -0x8000f8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8000f8(%rbp)
jmp    1538 <main+0x358>
jmp    171c <main+0x53c>
mov    -0x8000fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8000fc(%rbp)
jmp    151c <main+0x33c>
jmp    1735 <main+0x555>
mov    -0x8000c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8000c4(%rbp)
jmp    14d8 <main+0x2f8>
movl   $0x0,-0x8000c4(%rbp)
mov    -0x8000c4(%rbp),%eax
cmp    -0x800034(%rbp),%eax
jge    17d6 <main+0x5f6>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8001b0(%rbp)
movslq -0x8000c4(%rbp),%rax
mov    -0x800030(%rbp,%rax,8),%rdi
ff
call   10a0 <compact@plt>
mov    -0x8001b0(%rbp),%rdi
mov    %rax,%rdx
lea    0x8e6(%rip),%rsi
call   1090 <fprintf@plt>
movslq -0x8000c4(%rbp),%rax
mov    -0x600030(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
movslq -0x8000c4(%rbp),%rax
mov    -0x800030(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
mov    -0x8000c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8000c4(%rbp)
jmp    1753 <main+0x573>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x8000c4(%rbp)
mov    -0x8000c4(%rbp),%eax
cmp    -0x400024(%rbp),%eax
jge    1837 <main+0x657>
movslq -0x8000c4(%rbp),%rax
mov    -0x200020(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
movslq -0x8000c4(%rbp),%rax
mov    -0x400020(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
mov    -0x8000c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8000c4(%rbp)
jmp    17e9 <main+0x609>
xor    %eax,%eax
add    $0x8001b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x800188,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
je     1205 <main+0x25>
lea    0xe00(%rip),%rdi
call   10e0 <die@plt>
mov    0x8(%rbx),%rdi
lea    0xe0f(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%r15
test   %rax,%rax
jne    1229 <main+0x49>
lea    0xdfd(%rip),%rdi
call   10e0 <die@plt>
mov    0x10(%rbx),%rdi
lea    0xe02(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    124d <main+0x6d>
lea    0xdf0(%rip),%rdi
call   10e0 <die@plt>
mov    %rbx,0x10(%rsp)
lea    0x60(%rsp),%rdi
mov    $0x84,%esi
mov    %r15,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     13cb <main+0x1eb>
xor    %eax,%eax
mov    %rax,0x8(%rsp)
lea    0x60(%rsp),%r12
lea    0xdd0(%rip),%r14
jmp    12a9 <main+0xc9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
mov    $0x84,%esi
mov    %r15,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     13d2 <main+0x1f2>
mov    %r12,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebx
cltq
cmpb   $0xa,0x5f(%rsp,%rax,1)
jne    12c7 <main+0xe7>
add    $0xffffffffffffffff,%rax
movb   $0x0,0x60(%rsp,%rax,1)
mov    %eax,%ebx
mov    0x60(%rsp),%al
test   %al,%al
je     1290 <main+0xb0>
cmp    $0x25,%al
je     1290 <main+0xb0>
movslq %ebx,%rax
cmpb   $0x25,0x5f(%rsp,%rax,1)
jne    12e8 <main+0x108>
add    $0xffffffffffffffff,%rax
movb   $0x0,0x60(%rsp,%rax,1)
mov    %eax,%ebx
lea    0x1(%rbx),%edi
call   10b0 <malloc@plt>
mov    %rax,%rbp
lea    (%rbx,%rbx,1),%edi
add    $0x1,%edi
call   10b0 <malloc@plt>
mov    %rax,%r13
mov    %rax,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   10f0 <expand@plt>
test   %ebx,%ebx
jle    133a <main+0x15a>
mov    %ebx,%ecx
cmp    $0x1,%ebx
jne    1378 <main+0x198>
xor    %edx,%edx
xor    %eax,%eax
test   $0x1,%cl
je     133c <main+0x15c>
mov    0x60(%rsp,%rdx,1),%cl
lea    -0x3a(%rcx),%edx
cmp    $0xf5,%dl
ja     133c <main+0x15c>
movslq %eax,%rdx
add    $0x1,%eax
mov    %cl,0x0(%rbp,%rdx,1)
jmp    133c <main+0x15c>
xor    %eax,%eax
cltq
movb   $0x0,0x0(%rbp,%rax,1)
movslq 0x8(%rsp),%rax
mov    %rbp,0x200180(%rsp,%rax,8)
lea    0x1(%rax),%ecx
mov    %rcx,0x8(%rsp)
mov    %r13,0x180(%rsp,%rax,8)
cmp    $0x40000,%eax
jl     1290 <main+0xb0>
mov    %r14,%rdi
call   10e0 <die@plt>
jmp    1290 <main+0xb0>
mov    %ecx,%esi
and    $0xfffffffe,%esi
xor    %edx,%edx
xor    %eax,%eax
jmp    1399 <main+0x1b9>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x2,%rdx
cmp    %rdx,%rsi
je     131d <main+0x13d>
movzbl 0x60(%rsp,%rdx,1),%edi
lea    -0x3a(%rdi),%ebx
cmp    $0xf5,%bl
ja     13b1 <main+0x1d1>
movslq %eax,%rbx
add    $0x1,%eax
mov    %dil,0x0(%rbp,%rbx,1)
movzbl 0x61(%rsp,%rdx,1),%edi
lea    -0x3a(%rdi),%ebx
cmp    $0xf5,%bl
ja     1390 <main+0x1b0>
movslq %eax,%rbx
add    $0x1,%eax
mov    %dil,0x0(%rbp,%rbx,1)
jmp    1390 <main+0x1b0>
xor    %eax,%eax
mov    %rax,0x8(%rsp)
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    0x8(%rsp),%rbx
lea    -0x1(%rbx),%ecx
lea    0x200180(%rsp),%rdi
lea    0x180(%rsp),%rsi
xor    %r13d,%r13d
xor    %edx,%edx
call   10c0 <qsort_arr@plt>
test   %ebx,%ebx
jle    1695 <main+0x4b5>
mov    %ebx,%eax
mov    %rax,0x18(%rsp)
xor    %ebp,%ebp
mov    %rbx,0x8(%rsp)
jmp    1434 <main+0x254>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x30(%rsp),%rbp
add    $0x1,%rbp
cmp    0x18(%rsp),%rbp
je     15e9 <main+0x409>
mov    0x200180(%rsp,%rbp,8),%r15
mov    %r15,%rdi
call   1060 <strlen@plt>
test   %eax,%eax
mov    %rbp,0x30(%rsp)
jle    1420 <main+0x240>
add    $0x1,%eax
xor    %ecx,%ecx
mov    %rcx,0x28(%rsp)
mov    %r15,0x50(%rsp)
mov    $0x1,%ecx
mov    %rax,0x38(%rsp)
jmp    1491 <main+0x2b1>
nopl   0x0(%rax,%rax,1)
mov    0x40(%rsp),%r15
add    $0x1,%r15
addq   $0xffffffffffffffff,0x28(%rsp)
mov    0x20(%rsp),%rdx
mov    %rdx,%rcx
mov    0x38(%rsp),%rax
cmp    %rax,%rdx
je     1420 <main+0x240>
mov    %rcx,0x58(%rsp)
lea    0x1(%rcx),%rax
mov    %rax,0x20(%rsp)
mov    %r15,0x40(%rsp)
mov    $0x1,%r14d
jmp    1502 <main+0x322>
nopl   0x0(%rax)
mov    %eax,%ebx
mov    %rbp,%rdi
mov    %rcx,%r13
call   1030 <free@plt>
mov    %ebx,%ebx
mov    0x400180(%rsp,%rbx,8),%rdi
mov    %r12d,%eax
mov    0x180(%rsp,%rax,8),%rsi
call   1070 <combine@plt>
mov    %rax,0x400180(%rsp,%rbx,8)
mov    0x8(%rsp),%rbx
add    $0xffffffffffffffff,%r15
mov    0x28(%rsp),%rax
add    %r14,%rax
add    $0x1,%rax
add    $0x1,%r14
cmp    $0x2,%rax
je     1470 <main+0x290>
lea    0xf0(%rsp),%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1040 <strncpy@plt>
movb   $0x0,0xf0(%rsp,%r14,1)
lea    0x200180(%rsp),%rdi
mov    %ebx,%esi
mov    %rbp,%rdx
call   1100 <find_in@plt>
test   %eax,%eax
js     14e4 <main+0x304>
mov    %eax,%r12d
mov    0x20(%rsp),%rdi
call   10b0 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    0x50(%rsp),%rsi
mov    %r13,%rbx
mov    0x58(%rsp),%r13
mov    %r13d,%edx
call   1040 <strncpy@plt>
movb   $0x0,0x0(%rbp,%r13,1)
lea    0x600180(%rsp),%rdi
mov    %ebx,%esi
mov    %rbp,%rdx
call   1100 <find_in@plt>
mov    %rbx,%rcx
test   %eax,%eax
jns    14b0 <main+0x2d0>
mov    $0x84,%edi
mov    %rcx,%rbx
call   10b0 <malloc@plt>
mov    %rax,0x48(%rsp)
mov    %rax,%rdi
mov    %rbp,%rsi
mov    %r13d,%edx
call   10f0 <expand@plt>
movslq %ebx,%r13
mov    %rbp,0x600180(%rsp,%r13,8)
mov    %r12d,%eax
mov    0x180(%rsp,%rax,8),%rsi
mov    0x48(%rsp),%rdi
call   1070 <combine@plt>
lea    0x1(%rbx),%ebp
mov    %rax,0x400180(%rsp,%r13,8)
cmp    $0x40000,%ebx
jl     15e1 <main+0x401>
lea    0xa8a(%rip),%rdi
call   10e0 <die@plt>
mov    %ebp,%r13d
jmp    14df <main+0x2ff>
test   %r13d,%r13d
mov    %r13,%rax
mov    0x10(%rsp),%r13
jle    164c <main+0x46c>
mov    %eax,%r15d
xor    %ebx,%ebx
lea    0xa79(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x400180(%rsp,%rbx,8),%rbp
mov    %rbp,%rdi
call   10a0 <compact@plt>
mov    %r13,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1090 <fprintf@plt>
mov    0x600180(%rsp,%rbx,8),%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1610 <main+0x430>
mov    %r13,%rdi
call   1050 <fclose@plt>
cmpl   $0x0,0x8(%rsp)
mov    0x18(%rsp),%rbp
jle    169f <main+0x4bf>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x200180(%rsp,%rbx,8),%rdi
call   1030 <free@plt>
mov    0x180(%rsp,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1670 <main+0x490>
jmp    169f <main+0x4bf>
mov    0x10(%rsp),%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x800188,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [31 x i8] c"Usage: <orig-file> <new-file>\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [21 x i8] c"Could not read input\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [24 x i8] c"Could not create output\00"
@.str.5 = [22 x i8] c"to many base patterns\00"
@.str.6 = [21 x i8] c"to many new patterns\00"
@.str.7 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [262144 x i8*]
%4 = alloca [262144 x i8*]
%5 = alloca [262144 x i8*]
%6 = alloca [262144 x i8*]
%7 = alloca [132 x i8]
%8 = alloca [132 x i8]
%9 = bitcast [262144 x i8*]* %3 to i8*
%10 = bitcast [262144 x i8*]* %4 to i8*
%11 = bitcast [262144 x i8*]* %5 to i8*
%12 = bitcast [262144 x i8*]* %6 to i8*
%13 = getelementptr inbounds [132 x i8], [132 x i8]* %7, i64 0, i64 0
%14 = icmp eq i32 %0, 3
br i1 %14, label %17, label %15
15: ; preds = %2
%16 = tail call i32 @die(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %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 %24
22: ; preds = %17
%23 = tail call i32 @die(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %17
%25 = getelementptr inbounds i8*, i8** %1, i64 2
%26 = load i8*, i8** %25
%27 = tail call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = tail call i32 @die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %31
31: ; preds = %29, %24
%32 = call i64 @fgets(i8* %13, i32 132, i32* %20)
%33 = icmp eq i64 %32, 0
br i1 %33, label %125, label %34
34: ; preds = %31, %121
%35 = phi i32 [ %122, %121 ], [ 0, %31 ]
%36 = call i32 @strlen(i8* %13)
%37 = add nsw i32 %36, -1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [132 x i8], [132 x i8]* %7, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = icmp eq i8 %40, 10
br i1 %41, label %42, label %43
42: ; preds = %34
store i8 0, i8* %39
br label %43
43: ; preds = %42, %34
%44 = phi i32 [ %37, %42 ], [ %36, %34 ]
%45 = load i8, i8* %13
switch i8 %45, label %46 [
i8 37, label %121
i8 0, label %121
]
46: ; preds = %43
%47 = add nsw i32 %44, -1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [132 x i8], [132 x i8]* %7, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = icmp eq i8 %50, 37
br i1 %51, label %52, label %53
52: ; preds = %46
store i8 0, i8* %49
br label %53
53: ; preds = %52, %46
%54 = phi i32 [ %47, %52 ], [ %44, %46 ]
%55 = add nsw i32 %54, 1
%56 = call i8* @malloc(i32 %55)
%57 = shl nsw i32 %54, 1
%58 = or i32 %57, 1
%59 = call i8* @malloc(i32 %58)
%60 = call i32 @expand(i8* %59, i8* %13, i32 %54)
%61 = icmp sgt i32 %54, 0
br i1 %61, label %62, label %110
62: ; preds = %53
%63 = zext i32 %54 to i64
%64 = and i64 %63, 1
%65 = icmp eq i32 %54, 1
br i1 %65, label %96, label %66
66: ; preds = %62
%67 = and i64 %63, 4294967294
br label %68
68: ; preds = %91, %66
%69 = phi i64 [ 0, %66 ], [ %93, %91 ]
%70 = phi i32 [ 0, %66 ], [ %92, %91 ]
%71 = phi i64 [ 0, %66 ], [ %94, %91 ]
%72 = getelementptr inbounds [132 x i8], [132 x i8]* %7, i64 0, i64 %69
%73 = load i8, i8* %72
%74 = add i8 %73, -58
%75 = icmp ult i8 %74, -10
br i1 %75, label %76, label %80
76: ; preds = %68
%77 = add nsw i32 %70, 1
%78 = sext i32 %70 to i64
%79 = getelementptr inbounds i8, i8* %56, i64 %78
store i8 %73, i8* %79
br label %80
80: ; preds = %68, %76
%81 = phi i32 [ %77, %76 ], [ %70, %68 ]
%82 = or i64 %69, 1
%83 = getelementptr inbounds [132 x i8], [132 x i8]* %7, i64 0, i64 %82
%84 = load i8, i8* %83
%85 = add i8 %84, -58
%86 = icmp ult i8 %85, -10
br i1 %86, label %87, label %91
87: ; preds = %80
%88 = add nsw i32 %81, 1
%89 = sext i32 %81 to i64
%90 = getelementptr inbounds i8, i8* %56, i64 %89
store i8 %84, i8* %90
br label %91
91: ; preds = %87, %80
%92 = phi i32 [ %88, %87 ], [ %81, %80 ]
%93 = add nuw nsw i64 %69, 2
%94 = add i64 %71, 2
%95 = icmp eq i64 %94, %67
br i1 %95, label %96, label %68
96: ; preds = %91, %62
%97 = phi i32 [ undef, %62 ], [ %92, %91 ]
%98 = phi i64 [ 0, %62 ], [ %93, %91 ]
%99 = phi i32 [ 0, %62 ], [ %92, %91 ]
%100 = icmp eq i64 %64, 0
br i1 %100, label %110, label %101
101: ; preds = %96
%102 = getelementptr inbounds [132 x i8], [132 x i8]* %7, i64 0, i64 %98
%103 = load i8, i8* %102
%104 = add i8 %103, -58
%105 = icmp ult i8 %104, -10
br i1 %105, label %106, label %110
106: ; preds = %101
%107 = add nsw i32 %99, 1
%108 = sext i32 %99 to i64
%109 = getelementptr inbounds i8, i8* %56, i64 %108
store i8 %103, i8* %109
br label %110
110: ; preds = %96, %106, %101, %53
%111 = phi i32 [ 0, %53 ], [ %97, %96 ], [ %107, %106 ], [ %99, %101 ]
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i8, i8* %56, i64 %112
store i8 0, i8* %113
%114 = sext i32 %35 to i64
%115 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %3, i64 0, i64 %114
store i8* %56, i8** %115
%116 = add nsw i32 %35, 1
%117 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %4, i64 0, i64 %114
store i8* %59, i8** %117
%118 = icmp sgt i32 %35, 262143
br i1 %118, label %119, label %121
119: ; preds = %110
%120 = call i32 @die(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %121
121: ; preds = %110, %119, %43, %43
%122 = phi i32 [ %35, %43 ], [ %35, %43 ], [ %116, %119 ], [ %116, %110 ]
%123 = call i64 @fgets(i8* %13, i32 132, i32* %20)
%124 = icmp eq i64 %123, 0
br i1 %124, label %125, label %34
125: ; preds = %121, %31
%126 = phi i32 [ 0, %31 ], [ %122, %121 ]
%127 = call i32 @fclose(i32* %20)
%128 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %3, i64 0, i64 0
%129 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %4, i64 0, i64 0
%130 = add nsw i32 %126, -1
%131 = call i32 @qsort_arr(i8** %128, i8** %129, i32 0, i32 %130)
%132 = icmp sgt i32 %126, 0
br i1 %132, label %135, label %133
133: ; preds = %125
%134 = call i32 @fclose(i32* %27)
br label %236
135: ; preds = %125
%136 = getelementptr inbounds [132 x i8], [132 x i8]* %8, i64 0, i64 0
%137 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %5, i64 0, i64 0
%138 = zext i32 %126 to i64
br label %143
139: ; preds = %206
%140 = icmp sgt i32 %207, 0
br i1 %140, label %141, label %222
141: ; preds = %139
%142 = zext i32 %207 to i64
br label %210
143: ; preds = %135, %206
%144 = phi i64 [ 0, %135 ], [ %208, %206 ]
%145 = phi i32 [ 0, %135 ], [ %207, %206 ]
%146 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %3, i64 0, i64 %144
%147 = load i8*, i8** %146
%148 = call i32 @strlen(i8* %147)
%149 = icmp slt i32 %148, 1
br i1 %149, label %206, label %150
150: ; preds = %143
%151 = add nuw i32 %148, 1
%152 = zext i32 %151 to i64
br label %153
153: ; preds = %150, %203
%154 = phi i64 [ 1, %150 ], [ %157, %203 ]
%155 = phi i64 [ 2, %150 ], [ %204, %203 ]
%156 = phi i32 [ %145, %150 ], [ %200, %203 ]
%157 = add nuw nsw i64 %154, 1
%158 = trunc i64 %157 to i32
%159 = trunc i64 %154 to i32
br label %160
160: ; preds = %153, %199
%161 = phi i64 [ 1, %153 ], [ %201, %199 ]
%162 = phi i32 [ %156, %153 ], [ %200, %199 ]
%163 = sub nsw i64 %154, %161
%164 = getelementptr inbounds i8, i8* %147, i64 %163
%165 = trunc i64 %161 to i32
%166 = call i32 @strncpy(i8* %136, i8* %164, i32 %165)
%167 = getelementptr inbounds [132 x i8], [132 x i8]* %8, i64 0, i64 %161
store i8 0, i8* %167
%168 = call i32 @find_in(i8** %128, i32 %126, i8* %136)
%169 = icmp sgt i32 %168, -1
br i1 %169, label %170, label %199
170: ; preds = %160
%171 = call i8* @malloc(i32 %158)
%172 = call i32 @strncpy(i8* %171, i8* %147, i32 %159)
%173 = getelementptr inbounds i8, i8* %171, i64 %154
store i8 0, i8* %173
%174 = call i32 @find_in(i8** %137, i32 %162, i8* %171)
%175 = icmp slt i32 %174, 0
br i1 %175, label %176, label %190
176: ; preds = %170
%177 = call dereferenceable_or_null(132) i8* @malloc(i32 132)
%178 = call i32 @expand(i8* %177, i8* %171, i32 %159)
%179 = sext i32 %162 to i64
%180 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %5, i64 0, i64 %179
store i8* %171, i8** %180
%181 = zext i32 %168 to i64
%182 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %4, i64 0, i64 %181
%183 = load i8*, i8** %182
%184 = call i8* @combine(i8* %177, i8* %183)
%185 = add nsw i32 %162, 1
%186 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %6, i64 0, i64 %179
store i8* %184, i8** %186
%187 = icmp sgt i32 %162, 262143
br i1 %187, label %188, label %199
188: ; preds = %176
%189 = call i32 @die(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %199
190: ; preds = %170
%191 = call i32 @free(i8* %171)
%192 = zext i32 %174 to i64
%193 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %6, i64 0, i64 %192
%194 = load i8*, i8** %193
%195 = zext i32 %168 to i64
%196 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %4, i64 0, i64 %195
%197 = load i8*, i8** %196
%198 = call i8* @combine(i8* %194, i8* %197)
store i8* %198, i8** %193
br label %199
199: ; preds = %190, %188, %176, %160
%200 = phi i32 [ %162, %160 ], [ %162, %190 ], [ %185, %188 ], [ %185, %176 ]
%201 = add nuw nsw i64 %161, 1
%202 = icmp eq i64 %201, %155
br i1 %202, label %203, label %160
203: ; preds = %199
%204 = add nuw nsw i64 %155, 1
%205 = icmp eq i64 %157, %152
br i1 %205, label %206, label %153
206: ; preds = %203, %143
%207 = phi i32 [ %145, %143 ], [ %200, %203 ]
%208 = add nuw nsw i64 %144, 1
%209 = icmp eq i64 %208, %138
br i1 %209, label %139, label %143
210: ; preds = %141, %210
%211 = phi i64 [ 0, %141 ], [ %220, %210 ]
%212 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %6, i64 0, i64 %211
%213 = load i8*, i8** %212
%214 = call i8* @compact(i8* %213)
%215 = call i32 @fprintf(i32* %27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %214)
%216 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %5, i64 0, i64 %211
%217 = load i8*, i8** %216
%218 = call i32 @free(i8* %217)
%219 = call i32 @free(i8* %213)
%220 = add nuw nsw i64 %211, 1
%221 = icmp eq i64 %220, %142
br i1 %221, label %222, label %210
222: ; preds = %210, %139
%223 = call i32 @fclose(i32* %27)
br i1 %132, label %224, label %236
224: ; preds = %222
%225 = zext i32 %126 to i64
br label %226
226: ; preds = %224, %226
%227 = phi i64 [ 0, %224 ], [ %234, %226 ]
%228 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %3, i64 0, i64 %227
%229 = load i8*, i8** %228
%230 = call i32 @free(i8* %229)
%231 = getelementptr inbounds [262144 x i8*], [262144 x i8*]* %4, i64 0, i64 %227
%232 = load i8*, i8** %231
%233 = call i32 @free(i8* %232)
%234 = add nuw nsw i64 %227, 1
%235 = icmp eq i64 %234, %225
br i1 %235, label %236, label %226
236: ; preds = %226, %133, %222
ret i32 0
}