#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 max(int, int);
int findLongestCommonSubseq(char strOne[], char strTwo[], int indOne,
                            int indTwo, int memoTable[][101]) {
  if (indOne < 0 || indTwo < 0)
    return 0;
  if (memoTable[indOne][indTwo] >= 0)
    return memoTable[indOne][indTwo];
  int maxLength = 0;
  if (strOne[indOne] == strTwo[indTwo])
    maxLength = 1;
  else
    maxLength = 0;
  maxLength += findLongestCommonSubseq(strOne, strTwo, indOne - 1, indTwo - 1,
                                       memoTable);
  maxLength = max(maxLength, findLongestCommonSubseq(strOne, strTwo, indOne,
                                                     indTwo - 1, memoTable));
  maxLength = max(maxLength, findLongestCommonSubseq(strOne, strTwo, indOne - 1,
                                                     indTwo, memoTable));
  memoTable[indOne][indTwo] = maxLength;
  return maxLength;
}


x86 assembly (clang, -O0):
<findLongestCommonSubseq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     114e <findLongestCommonSubseq+0x2e>
cmpl   $0x0,-0x20(%rbp)
jge    115a <findLongestCommonSubseq+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1274 <findLongestCommonSubseq+0x154>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x194,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jl     119b <findLongestCommonSubseq+0x7b>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x194,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1274 <findLongestCommonSubseq+0x154>
movl   $0x0,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    11ce <findLongestCommonSubseq+0xae>
movl   $0x1,-0x2c(%rbp)
jmp    11d5 <findLongestCommonSubseq+0xb5>
movl   $0x0,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x28(%rbp),%r8
call   1040 <findLongestCommonSubseq@plt>
add    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x28(%rbp),%r8
call   1040 <findLongestCommonSubseq@plt>
mov    -0x34(%rbp),%edi
mov    %eax,%esi
call   1030 <max@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
mov    -0x20(%rbp),%ecx
mov    -0x28(%rbp),%r8
call   1040 <findLongestCommonSubseq@plt>
mov    -0x30(%rbp),%edi
mov    %eax,%esi
call   1030 <max@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x194,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findLongestCommonSubseq>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%eax
or     %edx,%eax
js     11ce <findLongestCommonSubseq+0xae>
mov    %r8,%r12
movslq %edx,%rbx
movslq %ecx,%r13
imul   $0x194,%rbx,%rcx
add    %r8,%rcx
mov    (%rcx,%r13,4),%eax
test   %eax,%eax
jns    11d0 <findLongestCommonSubseq+0xb0>
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdi,%rbx,1),%al
xor    %ebp,%ebp
cmp    (%rsi,%r13,1),%al
lea    (%rcx,%r13,4),%rax
mov    %rax,0x10(%rsp)
sete   %bpl
lea    -0x1(%rbx),%edx
mov    %edx,0xc(%rsp)
lea    -0x1(%r13),%ecx
mov    %ecx,0x8(%rsp)
mov    %r12,%r8
call   1040 <findLongestCommonSubseq@plt>
add    %eax,%ebp
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
mov    0x8(%rsp),%ecx
mov    %r12,%r8
call   1040 <findLongestCommonSubseq@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <max@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
mov    0xc(%rsp),%edx
mov    %r13d,%ecx
mov    %r12,%r8
call   1040 <findLongestCommonSubseq@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <max@plt>
mov    0x10(%rsp),%rcx
mov    %eax,(%rcx)
jmp    11d0 <findLongestCommonSubseq+0xb0>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @findLongestCommonSubseq(i8* %0, i8* %1, i32 %2, i32 %3, [101 x i32]* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca [101 x i32]*
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store [101 x i32]* %4, [101 x i32]** %11
%13 = load i32, i32* %9
%14 = icmp slt i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %5
%16 = load i32, i32* %10
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15, %5
store i32 0, i32* %6
br label %92
19: ; preds = %15
%20 = load [101 x i32]*, [101 x i32]** %11
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [101 x i32], [101 x i32]* %20, i64 %22
%24 = load i32, i32* %10
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [101 x i32], [101 x i32]* %23, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = icmp sge i32 %27, 0
br i1 %28, label %29, label %38
29: ; preds = %19
%30 = load [101 x i32]*, [101 x i32]** %11
%31 = load i32, i32* %9
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [101 x i32], [101 x i32]* %30, i64 %32
%34 = load i32, i32* %10
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [101 x i32], [101 x i32]* %33, i64 0, i64 %35
%37 = load i32, i32* %36
store i32 %37, i32* %6
br label %92
38: ; preds = %19
store i32 0, i32* %12
%39 = load i8*, i8** %7
%40 = load i32, i32* %9
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %39, i64 %41
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = load i8*, i8** %8
%46 = load i32, i32* %10
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8, i8* %45, i64 %47
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %44, %50
br i1 %51, label %52, label %53
52: ; preds = %38
store i32 1, i32* %12
br label %54
53: ; preds = %38
store i32 0, i32* %12
br label %54
54: ; preds = %53, %52
%55 = load i8*, i8** %7
%56 = load i8*, i8** %8
%57 = load i32, i32* %9
%58 = sub nsw i32 %57, 1
%59 = load i32, i32* %10
%60 = sub nsw i32 %59, 1
%61 = load [101 x i32]*, [101 x i32]** %11
%62 = call i32 @findLongestCommonSubseq(i8* %55, i8* %56, i32 %58, i32 %60, [101 x i32]* %61)
%63 = load i32, i32* %12
%64 = add nsw i32 %63, %62
store i32 %64, i32* %12
%65 = load i32, i32* %12
%66 = load i8*, i8** %7
%67 = load i8*, i8** %8
%68 = load i32, i32* %9
%69 = load i32, i32* %10
%70 = sub nsw i32 %69, 1
%71 = load [101 x i32]*, [101 x i32]** %11
%72 = call i32 @findLongestCommonSubseq(i8* %66, i8* %67, i32 %68, i32 %70, [101 x i32]* %71)
%73 = call i32 @max(i32 %65, i32 %72)
store i32 %73, i32* %12
%74 = load i32, i32* %12
%75 = load i8*, i8** %7
%76 = load i8*, i8** %8
%77 = load i32, i32* %9
%78 = sub nsw i32 %77, 1
%79 = load i32, i32* %10
%80 = load [101 x i32]*, [101 x i32]** %11
%81 = call i32 @findLongestCommonSubseq(i8* %75, i8* %76, i32 %78, i32 %79, [101 x i32]* %80)
%82 = call i32 @max(i32 %74, i32 %81)
store i32 %82, i32* %12
%83 = load i32, i32* %12
%84 = load [101 x i32]*, [101 x i32]** %11
%85 = load i32, i32* %9
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [101 x i32], [101 x i32]* %84, i64 %86
%88 = load i32, i32* %10
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [101 x i32], [101 x i32]* %87, i64 0, i64 %89
store i32 %83, i32* %90
%91 = load i32, i32* %12
store i32 %91, i32* %6
br label %92
92: ; preds = %54, %29, %18
%93 = load i32, i32* %6
ret i32 %93
}

LLVM IR (-O2):
define i32 @findLongestCommonSubseq(i8* %0, i8* %1, i32 %2, i32 %3, [101 x i32]* %4) {
%6 = or i32 %3, %2
%7 = icmp sgt i32 %6, -1
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = sext i32 %2 to i64
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds [101 x i32], [101 x i32]* %4, i64 %9, i64 %10
%12 = load i32, i32* %11
%13 = icmp sgt i32 %12, -1
br i1 %13, label %14, label %16
14: ; preds = %5, %8, %16
%15 = phi i32 [ %30, %16 ], [ 0, %5 ], [ %12, %8 ]
ret i32 %15
16: ; preds = %8
%17 = getelementptr inbounds i8, i8* %0, i64 %9
%18 = load i8, i8* %17
%19 = getelementptr inbounds i8, i8* %1, i64 %10
%20 = load i8, i8* %19
%21 = icmp eq i8 %18, %20
%22 = zext i1 %21 to i32
%23 = add nsw i32 %2, -1
%24 = add nsw i32 %3, -1
%25 = tail call i32 @findLongestCommonSubseq(i8* %0, i8* %1, i32 %23, i32 %24, [101 x i32]* %4)
%26 = add nsw i32 %25, %22
%27 = tail call i32 @findLongestCommonSubseq(i8* %0, i8* %1, i32 %2, i32 %24, [101 x i32]* %4)
%28 = tail call i32 @max(i32 %26, i32 %27)
%29 = tail call i32 @findLongestCommonSubseq(i8* %0, i8* %1, i32 %23, i32 %3, [101 x i32]* %4)
%30 = tail call i32 @max(i32 %28, i32 %29)
store i32 %30, i32* %11
br label %14
}