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

/* Variables and functions */
int /*<<< orphan*/ buildSuffixArray(char *, int, int *);
scalar_t__ isValid(int, int, int, int);
int /*<<< orphan*/ kasai_lcp(char *, int *, int *, int);
int *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ removeLCP(char *, char *, int, int);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strstr(char *, char *);
void findLCS(char *str1, char *str2, int len1, int len2, int K) {
  int i, j;
  char text[100000];
  printf("%s\n", str1);
  char tdp[90000];
  char jnc[90000];
  strcpy(tdp, str1);
  strcpy(jnc, str2);
  int tdp_len = len1;
  int jnc_len = len2;
  int k = 0;
  int old_pos[K];
  for (i = 0; i < K; i++) {
    old_pos[i] = -1;
  }
  int old_max[K];
  for (i = 0; i < K; i++) {
    old_max[i] = -1;
  }
  while (k < K) {
    sprintf(text, "%s#%s", str1, str2);
    int n = len1 + len2 + 1;
    int *suffArr = malloc(sizeof(int) * n);
    for (i = 0; i < n; i++) {
      suffArr[i] = -1;
    }
    buildSuffixArray(text, n, suffArr);
    int lcp_len = n - 1;
    int lcp[lcp_len];
    kasai_lcp(text, lcp, suffArr, n);
    int max_i = 0;
    int max_lcp = 0;
    for (i = 0; i < n; i++) {
      if (i > 0) {
        if ((lcp[i - 1] > max_lcp) &&
            (isValid(i, suffArr[i], suffArr[i - 1], len1))) {
          max_lcp = lcp[i - 1];
          max_i = i;
        }
      }
    }
    if ((max_lcp == 0) || (max_lcp == 1)) {
      k = k + 1;
    } else {
      for (i = 0; i < lcp_len + 1; i++) {
        if ((lcp[i - 1] == max_lcp) &&
            (isValid(i, suffArr[i], suffArr[i - 1], len1))) {
          char tmp[2];
          char lcs[max_lcp + 10];
          sprintf(lcs, "%c", text[suffArr[i - 1]]);
          for (j = suffArr[i - 1] + 1; j < suffArr[i - 1] + max_lcp; j++) {
            sprintf(tmp, "%c", text[j]);
            strcat(lcs, tmp);
          }
          char *result = strstr(jnc, lcs);
          int pos = result - jnc;
          int new = 1;
          int m;
          for (m = 0; m < K; m++) {
            if (old_pos[m] == pos) {
              result = result + max_lcp;
              result = strstr(result, lcs);
              pos = result - jnc;
              printf("pos: %d\n", pos);
            }
          }
          if (new == 1) {
            printf("INFRINGING SEGMENT %d LENGTH %d POSITION %d\n", k + 1,
                   max_lcp, pos);
            printf("%s\n", lcs);
            old_pos[k] = pos;
            k = k + 1;
            old_max[k] = max_lcp;
            removeLCP(str2, lcs, len2, max_lcp);
            len2 = len2 - max_lcp;
            printf("str2: %s, len2: %d, len1: %d\n", str2, len2, len1);
            break;
          }
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<findLCS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x446a0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe38(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    -0x2e660(%rbp),%rdi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rsi
lea    -0x445f0(%rbp),%rdi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x445f4(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x445f8(%rbp)
movl   $0x0,-0x445fc(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x44608(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x44680(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x44610(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    126e <findLCS+0xce>
mov    -0x44680(%rbp),%rax
movslq -0x20(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1242 <findLCS+0xa2>
mov    -0x1c(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x44688(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x44618(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12c7 <findLCS+0x127>
mov    -0x44688(%rbp),%rax
movslq -0x20(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    129b <findLCS+0xfb>
jmp    12cc <findLCS+0x12c>
mov    -0x445fc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1816 <findLCS+0x676>
lea    -0x186d0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xd13(%rip),%rsi
mov    $0x0,%al
call   10a0 <sprintf@plt>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4461c(%rbp)
movslq -0x4461c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x44628(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4461c(%rbp),%eax
jge    1356 <findLCS+0x1b6>
mov    -0x44628(%rbp),%rax
movslq -0x20(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1327 <findLCS+0x187>
mov    -0x4461c(%rbp),%esi
mov    -0x44628(%rbp),%rdx
lea    -0x186d0(%rbp),%rdi
call   1050 <buildSuffixArray@plt>
mov    -0x4461c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4462c(%rbp)
mov    -0x4462c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x44638(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,-0x44690(%rbp)
mov    %rsi,%rsp
mov    %rax,-0x44640(%rbp)
lea    -0x186d0(%rbp),%rdi
mov    -0x44628(%rbp),%rdx
mov    -0x4461c(%rbp),%ecx
call   1080 <kasai_lcp@plt>
movl   $0x0,-0x44644(%rbp)
movl   $0x0,-0x44648(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4461c(%rbp),%eax
jge    148d <findLCS+0x2ed>
cmpl   $0x0,-0x20(%rbp)
jle    147a <findLCS+0x2da>
mov    -0x44690(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x44648(%rbp),%eax
jle    1475 <findLCS+0x2d5>
mov    -0x20(%rbp),%edi
mov    -0x44628(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x44628(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x14(%rbp),%ecx
call   10b0 <isValid@plt>
cmp    $0x0,%rax
je     1475 <findLCS+0x2d5>
mov    -0x44690(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x44648(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x44644(%rbp)
jmp    147a <findLCS+0x2da>
jmp    147f <findLCS+0x2df>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13e5 <findLCS+0x245>
cmpl   $0x0,-0x44648(%rbp)
je     14a7 <findLCS+0x307>
cmpl   $0x1,-0x44648(%rbp)
jne    14bb <findLCS+0x31b>
mov    -0x445fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x445fc(%rbp)
jmp    1807 <findLCS+0x667>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x4462c(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1802 <findLCS+0x662>
mov    -0x44690(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x44648(%rbp),%eax
jne    17ef <findLCS+0x64f>
mov    -0x20(%rbp),%edi
mov    -0x44628(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x44628(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x14(%rbp),%ecx
call   10b0 <isValid@plt>
cmp    $0x0,%rax
je     17ef <findLCS+0x64f>
mov    -0x44648(%rbp),%eax
add    $0xa,%eax
mov    %rsp,%rcx
mov    %rcx,-0x44658(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x44698(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x44660(%rbp)
mov    -0x44628(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movslq (%rax,%rcx,4),%rax
movsbl -0x186d0(%rbp,%rax,1),%edx
ff
lea    0xa87(%rip),%rsi
mov    $0x0,%al
call   10a0 <sprintf@plt>
mov    -0x44628(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x44628(%rbp),%rcx
mov    -0x20(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
add    -0x44648(%rbp),%ecx
cmp    %ecx,%eax
jge    1609 <findLCS+0x469>
lea    -0x4464a(%rbp),%rdi
movslq -0x24(%rbp),%rax
movsbl -0x186d0(%rbp,%rax,1),%edx
ff
lea    0xa29(%rip),%rsi
mov    $0x0,%al
call   10a0 <sprintf@plt>
mov    -0x44698(%rbp),%rdi
lea    -0x4464a(%rbp),%rsi
call   1090 <strcat@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    15a3 <findLCS+0x403>
mov    -0x44698(%rbp),%rsi
lea    -0x445f0(%rbp),%rdi
call   10c0 <strstr@plt>
mov    %rax,-0x44668(%rbp)
mov    -0x44668(%rbp),%rax
lea    -0x445f0(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4466c(%rbp)
movl   $0x1,-0x44670(%rbp)
movl   $0x0,-0x44674(%rbp)
mov    -0x44674(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    16f0 <findLCS+0x550>
mov    -0x44680(%rbp),%rax
movslq -0x44674(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x4466c(%rbp),%eax
jne    16d7 <findLCS+0x537>
mov    -0x44698(%rbp),%rsi
mov    -0x44668(%rbp),%rax
movslq -0x44648(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x44668(%rbp)
mov    -0x44668(%rbp),%rdi
call   10c0 <strstr@plt>
mov    %rax,-0x44668(%rbp)
mov    -0x44668(%rbp),%rax
lea    -0x445f0(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4466c(%rbp)
mov    -0x4466c(%rbp),%esi
lea    0x93d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    16dc <findLCS+0x53c>
mov    -0x44674(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44674(%rbp)
jmp    164e <findLCS+0x4ae>
cmpl   $0x1,-0x44670(%rbp)
jne    17be <findLCS+0x61e>
mov    -0x445fc(%rbp),%esi
add    $0x1,%esi
mov    -0x44648(%rbp),%edx
mov    -0x4466c(%rbp),%ecx
lea    0x8fd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x44698(%rbp),%rsi
lea    0x8d2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x44680(%rbp),%rcx
mov    -0x44698(%rbp),%rsi
mov    -0x44688(%rbp),%rax
mov    -0x4466c(%rbp),%edi
movslq -0x445fc(%rbp),%rdx
mov    %edi,(%rcx,%rdx,4)
mov    -0x445fc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x445fc(%rbp)
mov    -0x44648(%rbp),%edx
movslq -0x445fc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    -0x44648(%rbp),%ecx
call   1060 <removeLCP@plt>
mov    -0x18(%rbp),%eax
sub    -0x44648(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0x89b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x10,-0x44678(%rbp)
jmp    17c8 <findLCS+0x628>
movl   $0x0,-0x44678(%rbp)
mov    -0x44658(%rbp),%rax
mov    %rax,%rsp
mov    -0x44678(%rbp),%eax
test   %eax,%eax
je     17ea <findLCS+0x64a>
jmp    17e5 <findLCS+0x645>
jmp    1802 <findLCS+0x662>
jmp    17ef <findLCS+0x64f>
jmp    17f4 <findLCS+0x654>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    14c2 <findLCS+0x322>
jmp    1807 <findLCS+0x667>
mov    -0x44638(%rbp),%rax
mov    %rax,%rsp
jmp    12cc <findLCS+0x12c>
mov    -0x44608(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findLCS>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x44648,%rsp
mov    %r8d,%r14d
mov    %ecx,%r13d
mov    %rdx,-0x38(%rbp)
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <puts@plt>
lea    -0x44670(%rbp),%rdi
mov    %rbx,-0xa8(%rbp)
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    -0x2e6e0(%rbp),%rdi
mov    %r15,-0x78(%rbp)
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rsp,-0xa0(%rbp)
mov    %r14d,%eax
mov    %rsp,%rcx
mov    %rax,-0x80(%rbp)
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %r14d,-0x6c(%rbp)
test   %r14d,%r14d
jle    15cd <findLCS+0x40d>
mov    -0x80(%rbp),%rax
lea    0x0(,%rax,4),%rdx
mov    -0x60(%rbp),%rdi
mov    $0xff,%esi
call   1080 <memset@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%eax
mov    %rax,-0x90(%rbp)
lea    -0x18750(%rbp),%r15
xor    %eax,%eax
jmp    12a0 <findLCS+0xe0>
mov    -0x58(%rbp),%r13
lea    -0x18750(%rbp),%r15
mov    -0x48(%rbp),%rax
nopl   0x0(%rax,%rax,1)
mov    -0x40(%rbp),%rcx
mov    %rcx,%rsp
cmp    -0x6c(%rbp),%eax
jge    15cd <findLCS+0x40d>
mov    %rax,-0x48(%rbp)
mov    %r15,%rdi
lea    0xd52(%rip),%rsi
mov    -0xa8(%rbp),%rdx
mov    -0x78(%rbp),%rcx
xor    %eax,%eax
call   10c0 <sprintf@plt>
mov    -0x38(%rbp),%rax
lea    (%rax,%r13,1),%ebx
lea    0x4(,%rbx,4),%edi
call   1090 <malloc@plt>
mov    %rax,%r14
mov    %rbx,-0x50(%rbp)
test   %ebx,%ebx
js     12fb <findLCS+0x13b>
mov    -0x90(%rbp),%rax
lea    (%rax,%r13,1),%edx
shl    $0x2,%rdx
mov    %r14,%rdi
mov    $0xff,%esi
call   1080 <memset@plt>
mov    -0x38(%rbp),%rax
mov    %r14,%rbx
lea    (%rax,%r13,1),%r14d
add    $0x1,%r14d
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1060 <buildSuffixArray@plt>
mov    %rsp,-0x40(%rbp)
mov    %r13,%r12
mov    -0x50(%rbp),%r13
mov    %r13d,%eax
mov    %r15,%rdi
mov    %rsp,%r15
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    %r15,%rsi
mov    %rbx,-0x98(%rbp)
mov    %rbx,%rdx
mov    %r14d,%ecx
call   10a0 <kasai_lcp@plt>
test   %r13d,%r13d
mov    %r12,%r13
js     13f0 <findLCS+0x230>
mov    -0x90(%rbp),%rax
lea    (%rax,%r13,1),%r12d
cmp    $0x1,%r12d
je     13f0 <findLCS+0x230>
mov    %r13,-0x58(%rbp)
xor    %esi,%esi
mov    $0x1,%ebx
movabs $0x100000000,%r13
mov    %r15,-0x68(%rbp)
jmp    139d <findLCS+0x1dd>
nop
add    $0x1,%rbx
add    $0x1,%r13
cmp    %rbx,%r12
je     13e0 <findLCS+0x220>
mov    %r13d,%r14d
cmp    %esi,(%r15,%r14,4)
jle    1390 <findLCS+0x1d0>
mov    %r12,%r15
mov    %rsi,%r12
mov    -0x98(%rbp),%rax
mov    (%rax,%rbx,4),%esi
mov    (%rax,%r14,4),%edx
mov    %ebx,%edi
mov    -0x38(%rbp),%rcx
call   10d0 <isValid@plt>
mov    %r12,%rsi
mov    %r15,%r12
mov    -0x68(%rbp),%r15
test   %rax,%rax
je     1390 <findLCS+0x1d0>
mov    (%r15,%r14,4),%esi
jmp    1390 <findLCS+0x1d0>
nopw   0x0(%rax,%rax,1)
cmp    $0x2,%esi
mov    -0x58(%rbp),%r13
jae    1403 <findLCS+0x243>
nopl   0x0(%rax)
mov    -0x48(%rbp),%rax
add    $0x1,%eax
lea    -0x18750(%rbp),%r15
jmp    1290 <findLCS+0xd0>
cmpl   $0x0,-0x50(%rbp)
js     127d <findLCS+0xbd>
xor    %r13d,%r13d
mov    -0x98(%rbp),%rbx
mov    %rsi,-0x88(%rbp)
jmp    142d <findLCS+0x26d>
add    $0x1,%r13
cmp    %r13,%r12
je     1279 <findLCS+0xb9>
cmp    %esi,-0x4(%r15,%r13,4)
jne    1420 <findLCS+0x260>
mov    -0x4(%rbx,%r13,4),%edx
mov    (%rbx,%r13,4),%esi
mov    %r13d,%edi
mov    -0x38(%rbp),%rcx
call   10d0 <isValid@plt>
mov    -0x88(%rbp),%rsi
test   %rax,%rax
je     1420 <findLCS+0x260>
mov    %rsp,-0x50(%rbp)
lea    0xa(%rsi),%eax
mov    %rsp,%r8
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %r8,%rcx
sub    %rax,%rcx
mov    %rcx,%rsp
neg    %rax
movslq -0x4(%rbx,%r13,4),%rdi
mov    %rbx,%rdx
mov    -0x18750(%rbp,%rdi,1),%bl
mov    %bl,(%r8,%rax,1)
movb   $0x0,0x1(%rcx)
lea    0x1(%rdi),%eax
add    %esi,%edi
movslq %esi,%r12
cmp    %edi,%eax
lea    -0x2a(%rbp),%r15
jge    14eb <findLCS+0x32b>
movslq %eax,%rbx
mov    %r12,-0x68(%rbp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl -0x18750(%rbp,%rbx,1),%eax
ff
mov    %al,-0x2a(%rbp)
movb   $0x0,-0x29(%rbp)
mov    %rcx,%rdi
mov    %r15,%rsi
mov    %rcx,%r14
mov    %rdx,%r12
call   10b0 <strcat@plt>
mov    %r12,%rdx
mov    -0x68(%rbp),%r12
mov    %r14,%rcx
add    $0x1,%rbx
movslq -0x4(%rdx,%r13,4),%rax
add    %r12,%rax
cmp    %rax,%rbx
jl     14b0 <findLCS+0x2f0>
lea    -0x2e6e0(%rbp),%rbx
mov    %rbx,%rdi
mov    %rcx,%rsi
mov    %rcx,%r15
call   10e0 <strstr@plt>
mov    %rax,%r14
mov    %r14d,%r13d
sub    %ebx,%r13d
xor    %ebx,%ebx
jmp    151a <findLCS+0x35a>
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,-0x80(%rbp)
je     1555 <findLCS+0x395>
mov    -0x60(%rbp),%rax
cmp    %r13d,(%rax,%rbx,4)
jne    1510 <findLCS+0x350>
add    %r12,%r14
mov    %r14,%rdi
mov    %r15,%rsi
call   10e0 <strstr@plt>
mov    %rax,%r14
mov    %r14d,%r13d
lea    -0x2e6e0(%rbp),%rax
sub    %eax,%r13d
lea    0xabd(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1510 <findLCS+0x350>
mov    -0x48(%rbp),%r12
lea    0x1(%r12),%r14d
lea    0xaaa(%rip),%rdi
mov    %r14d,%esi
mov    -0x88(%rbp),%rbx
mov    %ebx,%edx
mov    %r13d,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
movslq %r12d,%rax
mov    -0x60(%rbp),%rcx
mov    %r13d,(%rcx,%rax,4)
mov    -0x78(%rbp),%r12
mov    %r12,%rdi
mov    %r15,%rsi
mov    -0x58(%rbp),%r13
mov    %r13d,%edx
mov    %ebx,%ecx
call   1070 <removeLCP@plt>
sub    %ebx,%r13d
lea    0xa8c(%rip),%rdi
mov    %r12,%rsi
mov    %r13d,%edx
mov    -0x38(%rbp),%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x50(%rbp),%rsp
mov    %r14d,%eax
jmp    13f7 <findLCS+0x237>
mov    -0xa0(%rbp),%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%s#%s\00"
@.str.3 = [9 x i8] c"pos: %d\0A\00"
@.str.4 = [45 x i8] c"INFRINGING SEGMENT %d LENGTH %d POSITION %d\0A\00"
@.str.5 = [30 x i8] c"str2: %s, len2: %d, len1: %d\0A\00"
define void @findLCS(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca [100000 x i8]
%7 = alloca [90000 x i8]
%8 = alloca [90000 x i8]
%9 = alloca [2 x i8]
%10 = getelementptr inbounds [100000 x i8], [100000 x i8]* %6, i64 0, i64 0
%11 = tail call i32 @puts(i8* dereferenceable(1) %0)
%12 = getelementptr inbounds [90000 x i8], [90000 x i8]* %7, i64 0, i64 0
%13 = getelementptr inbounds [90000 x i8], [90000 x i8]* %8, i64 0, i64 0
%14 = call i32 @strcpy(i8* %12, i8* %0)
%15 = call i32 @strcpy(i8* %13, i8* %1)
%16 = zext i32 %4 to i64
%17 = call i8* @llvm.stacksave()
%18 = alloca i32, i64 %16
%19 = icmp sgt i32 %4, 0
br i1 %19, label %20, label %162
20: ; preds = %5
%21 = bitcast i32* %18 to i8*
%22 = shl nuw nsw i64 %16, 2
%23 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
%24 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 1
%25 = ptrtoint [90000 x i8]* %8 to i64
%26 = add i32 %2, 1
br label %27
27: ; preds = %20, %158
%28 = phi i32 [ %3, %20 ], [ %160, %158 ]
%29 = phi i32 [ 0, %20 ], [ %159, %158 ]
%30 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
%31 = add nsw i32 %28, %2
%32 = add nsw i32 %31, 1
%33 = shl i32 %32, 2
%34 = call i32* @malloc(i32 %33)
%35 = icmp slt i32 %31, 0
br i1 %35, label %41, label %36
36: ; preds = %27
%37 = bitcast i32* %34 to i8*
%38 = add i32 %26, %28
%39 = zext i32 %38 to i64
%40 = shl nuw nsw i64 %39, 2
br label %41
41: ; preds = %36, %27
%42 = call i32 @buildSuffixArray(i8* %10, i32 %32, i32* %34)
%43 = zext i32 %31 to i64
%44 = call i8* @llvm.stacksave()
%45 = alloca i32, i64 %43
%46 = call i32 @kasai_lcp(i8* %10, i32* %45, i32* %34, i32 %32)
br i1 %35, label %79, label %47
47: ; preds = %41
%48 = add i32 %26, %28
%49 = zext i32 %48 to i64
%50 = icmp eq i32 %48, 1
br i1 %50, label %79, label %51
51: ; preds = %47, %69
%52 = phi i64 [ %71, %69 ], [ 1, %47 ]
%53 = phi i32 [ %70, %69 ], [ 0, %47 ]
%54 = add nuw i64 %52, 4294967295
%55 = and i64 %54, 4294967295
%56 = getelementptr inbounds i32, i32* %45, i64 %55
%57 = load i32, i32* %56
%58 = icmp sgt i32 %57, %53
br i1 %58, label %59, label %69
59: ; preds = %51
%60 = getelementptr inbounds i32, i32* %34, i64 %52
%61 = load i32, i32* %60
%62 = getelementptr inbounds i32, i32* %34, i64 %55
%63 = load i32, i32* %62
%64 = trunc i64 %52 to i32
%65 = call i64 @isValid(i32 %64, i32 %61, i32 %63, i32 %2)
%66 = icmp eq i64 %65, 0
br i1 %66, label %69, label %67
67: ; preds = %59
%68 = load i32, i32* %56
br label %69
69: ; preds = %67, %59, %51
%70 = phi i32 [ %68, %67 ], [ %53, %59 ], [ %53, %51 ]
%71 = add nuw nsw i64 %52, 1
%72 = icmp eq i64 %71, %49
br i1 %72, label %73, label %51
73: ; preds = %69
%74 = icmp ult i32 %70, 2
br i1 %74, label %79, label %75
75: ; preds = %73
br i1 %35, label %158, label %76
76: ; preds = %75
%77 = add i32 %26, %28
%78 = zext i32 %77 to i64
br label %81
79: ; preds = %47, %41, %73
%80 = add nsw i32 %29, 1
br label %158
81: ; preds = %76, %155
%82 = phi i64 [ 0, %76 ], [ %156, %155 ]
%83 = add nsw i64 %82, -1
%84 = getelementptr inbounds i32, i32* %45, i64 %83
%85 = load i32, i32* %84
%86 = icmp eq i32 %85, %70
br i1 %86, label %87, label %155
87: ; preds = %81
%88 = getelementptr inbounds i32, i32* %34, i64 %82
%89 = load i32, i32* %88
%90 = getelementptr inbounds i32, i32* %34, i64 %83
%91 = load i32, i32* %90
%92 = trunc i64 %82 to i32
%93 = call i64 @isValid(i32 %92, i32 %89, i32 %91, i32 %2)
%94 = icmp eq i64 %93, 0
br i1 %94, label %155, label %95
95: ; preds = %87
%96 = getelementptr inbounds i32, i32* %34, i64 %83
%97 = add nsw i32 %70, 10
%98 = zext i32 %97 to i64
%99 = call i8* @llvm.stacksave()
%100 = alloca i8, i64 %98
%101 = load i32, i32* %96
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [100000 x i8], [100000 x i8]* %6, i64 0, i64 %102
%104 = load i8, i8* %103
store i8 %104, i8* %100
%105 = getelementptr inbounds i8, i8* %100, i64 1
store i8 0, i8* %105
%106 = add i32 %101, 1
%107 = add nsw i32 %101, %70
%108 = icmp slt i32 %106, %107
br i1 %108, label %109, label %121
109: ; preds = %95
%110 = sext i32 %106 to i64
br label %111
111: ; preds = %109, %111
%112 = phi i64 [ %110, %109 ], [ %116, %111 ]
%113 = getelementptr inbounds [100000 x i8], [100000 x i8]* %6, i64 0, i64 %112
%114 = load i8, i8* %113
store i8 %114, i8* %23
store i8 0, i8* %24
%115 = call i32 @strcat(i8* %100, i8* %23)
%116 = add nsw i64 %112, 1
%117 = load i32, i32* %96
%118 = add nsw i32 %117, %70
%119 = sext i32 %118 to i64
%120 = icmp slt i64 %116, %119
br i1 %120, label %111, label %121
121: ; preds = %111, %95
%122 = call i8* @strstr(i8* %13, i8* %100)
%123 = ptrtoint i8* %122 to i64
%124 = sub i64 %123, %25
%125 = trunc i64 %124 to i32
%126 = sext i32 %70 to i64
br label %127
127: ; preds = %121, %141
%128 = phi i64 [ 0, %121 ], [ %144, %141 ]
%129 = phi i32 [ %125, %121 ], [ %143, %141 ]
%130 = phi i8* [ %122, %121 ], [ %142, %141 ]
%131 = getelementptr inbounds i32, i32* %18, i64 %128
%132 = load i32, i32* %131
%133 = icmp eq i32 %132, %129
br i1 %133, label %134, label %141
134: ; preds = %127
%135 = getelementptr inbounds i8, i8* %130, i64 %126
%136 = call i8* @strstr(i8* %135, i8* %100)
%137 = ptrtoint i8* %136 to i64
%138 = sub i64 %137, %25
%139 = trunc i64 %138 to i32
%140 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %139)
br label %141
141: ; preds = %127, %134
%142 = phi i8* [ %136, %134 ], [ %130, %127 ]
%143 = phi i32 [ %139, %134 ], [ %129, %127 ]
%144 = add nuw nsw i64 %128, 1
%145 = icmp eq i64 %144, %16
br i1 %145, label %146, label %127
146: ; preds = %141
%147 = add nsw i32 %29, 1
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i32 %147, i32 %70, i32 %143)
%149 = call i32 @puts(i8* %100)
%150 = sext i32 %29 to i64
%151 = getelementptr inbounds i32, i32* %18, i64 %150
store i32 %143, i32* %151
%152 = call i32 @removeLCP(i8* %1, i8* %100, i32 %28, i32 %70)
%153 = sub nsw i32 %28, %70
%154 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %1, i32 %153, i32 %2)
br label %158
155: ; preds = %81, %87
%156 = add nuw nsw i64 %82, 1
%157 = icmp eq i64 %156, %78
br i1 %157, label %158, label %81
158: ; preds = %155, %75, %146, %79
%159 = phi i32 [ %80, %79 ], [ %147, %146 ], [ %29, %75 ], [ %29, %155 ]
%160 = phi i32 [ %28, %79 ], [ %153, %146 ], [ %28, %75 ], [ %28, %155 ]
%161 = icmp slt i32 %159, %4
br i1 %161, label %27, label %162
162: ; preds = %158, %5
ret void
}