int main(int argc, char **argv) {
  char x[100] = {"ABCBDAB"};
  char y[100] = {"BDCABA"};
  int b[100][100];
  int c[100][100];
  int m, n;
  m = strlen(x);
  n = strlen(y);
  LCSLength(x, y, m, n, c, b);
  PrintLCS(b, x, m, n);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x13980,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xe7c(%rip),%rsi
mov    $0x64,%edx
call   1070 <memcpy@plt>
lea    -0xf0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
movb   $0x42,-0xf0(%rbp)
movb   $0x44,-0xef(%rbp)
movb   $0x43,-0xee(%rbp)
movb   $0x41,-0xed(%rbp)
movb   $0x42,-0xec(%rbp)
movb   $0x41,-0xeb(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x13974(%rbp)
lea    -0xf0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x13978(%rbp)
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
mov    -0x13974(%rbp),%edx
mov    -0x13978(%rbp),%ecx
lea    -0x13970(%rbp),%r8
lea    -0x9d30(%rbp),%r9
mov    $0x0,%al
call   1040 <LCSLength@plt>
lea    -0x9d30(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    -0x13974(%rbp),%edx
mov    -0x13978(%rbp),%ecx
mov    $0x0,%al
call   1080 <PrintLCS@plt>
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x13980,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x13960,%rsp
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xe9c(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xe7d(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xe5e(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movl   $0x0,0xd0(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movl   $0x41434442,(%rsp)
movw   $0x4142,0x4(%rsp)
lea    0x70(%rsp),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%r12
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
lea    0xe0(%rsp),%r8
lea    0x9d20(%rsp),%r13
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
mov    %ebx,%ecx
mov    %r13,%r9
xor    %eax,%eax
call   1050 <LCSLength@plt>
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1060 <PrintLCS@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x13960,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.x = [100 x i8] c"ABCBDAB\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
%7 = alloca [100 x i8]
%8 = alloca [100 x [100 x i32]]
%9 = alloca [100 x [100 x i32]]
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = bitcast [100 x i8]* %6 to i8*
%13 = bitcast [100 x i8]* %7 to i8*
%14 = bitcast i8* %13 to [100 x i8]*
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i32 0, i32 0
store i8 66, i8* %15
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i32 0, i32 1
store i8 68, i8* %16
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i32 0, i32 2
store i8 67, i8* %17
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i32 0, i32 3
store i8 65, i8* %18
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i32 0, i32 4
store i8 66, i8* %19
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i32 0, i32 5
store i8 65, i8* %20
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%22 = call i64 @strlen(i8* %21)
%23 = trunc i64 %22 to i32
store i32 %23, i32* %10
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%25 = call i64 @strlen(i8* %24)
%26 = trunc i64 %25 to i32
store i32 %26, i32* %11
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%29 = load i32, i32* %10
%30 = load i32, i32* %11
%31 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %9, i64 0, i64 0
%32 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %8, i64 0, i64 0
%33 = call i32 (i8*, i8*, i32, i32, [100 x i32]*, [100 x i32]*, ...) bitcast (i32 (...)* @LCSLength to i32 (i8*, i8*, i32, i32, [100 x i32]*, [100 x i32]*, ...)*)(i8* %27, i8* %28, i32 %29, i32 %30, [100 x i32]* %31, [100 x i32]* %32)
%34 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %8, i64 0, i64 0
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%36 = load i32, i32* %10
%37 = load i32, i32* %11
%38 = call i32 ([100 x i32]*, i8*, i32, i32, ...) bitcast (i32 (...)* @PrintLCS to i32 ([100 x i32]*, i8*, i32, i32, ...)*)([100 x i32]* %34, i8* %35, i32 %36, i32 %37)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [100 x i8] c"ABCBDAB\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca [100 x [100 x i32]]
%6 = alloca [100 x [100 x i32]]
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
store i8 66, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 1
store i8 68, i8* %9
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 2
store i8 67, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 3
store i8 65, i8* %11
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 4
store i8 66, i8* %12
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 5
store i8 65, i8* %13
%14 = bitcast [100 x [100 x i32]]* %5 to i8*
%15 = bitcast [100 x [100 x i32]]* %6 to i8*
%16 = call i64 @strlen(i8* %7)
%17 = trunc i64 %16 to i32
%18 = call i64 @strlen(i8* %8)
%19 = trunc i64 %18 to i32
%20 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %6, i64 0, i64 0
%21 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %5, i64 0, i64 0
%22 = call i32 (i8*, i8*, i32, i32, [100 x i32]*, [100 x i32]*, ...) bitcast (i32 (...)* @LCSLength to i32 (i8*, i8*, i32, i32, [100 x i32]*, [100 x i32]*, ...)*)(i8* %7, i8* %8, i32 %17, i32 %19, [100 x i32]* %20, [100 x i32]* %21)
%23 = call i32 ([100 x i32]*, i8*, i32, i32, ...) bitcast (i32 (...)* @PrintLCS to i32 ([100 x i32]*, i8*, i32, i32, ...)*)([100 x i32]* %21, i8* %7, i32 %17, i32 %19)
%24 = call i32 @putchar(i32 10)
ret i32 0
}