#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*/ LCS_LENGTH(char *, char *, int, int, int **, int **);
int /*<<< orphan*/ PRINT_LCS(int **, char *, int, int);
int /*<<< orphan*/ printf(char *);
int strlen(char *);
int /*<<< orphan*/ system(char *);
int main() {
  int c[100][100], b[100][100];
  int x_size, y_size;
  char case1_x[] = "-xzyzzyx";
  char case1_y[] = "-zxyyzxz";
  x_size = strlen(case1_x);
  y_size = strlen(case1_y);
  LCS_LENGTH(case1_x, case1_y, x_size, y_size, c, b);
  PRINT_LCS(b, case1_x, x_size, y_size);
  printf("\n");
  char case2_x[] =
      "-MAEEEVAKLEKHLMLLRQEYVKLQKKLAETEKRCALLAAQANKESSSESFISRLLAIVAD";
  char case2_y[] =
      "-MAEEEVAKLEKHLMLLRQEYVKLQKKLAETEKRCTLLAAQANKENSNESFISRLLAIVAG";
  x_size = strlen(case2_x);
  y_size = strlen(case2_y);
  LCS_LENGTH(case2_x, case2_y, x_size, y_size, c, b);
  PRINT_LCS(b, case2_x, x_size, y_size);
  printf("\n");
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x13930,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe87(%rip),%rax
mov    %rax,-0x138a1(%rbp)
mov    0xe82(%rip),%al
mov    %al,-0x13899(%rbp)
mov    0xe76(%rip),%rax
mov    %rax,-0x138aa(%rbp)
mov    0xe71(%rip),%al
mov    %al,-0x138a2(%rbp)
lea    -0x138a1(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x13894(%rbp)
lea    -0x138aa(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x13898(%rbp)
lea    -0x138a1(%rbp),%rdi
lea    -0x138aa(%rbp),%rsi
mov    -0x13894(%rbp),%edx
mov    -0x13898(%rbp),%ecx
lea    -0x9c50(%rbp),%r8
lea    -0x13890(%rbp),%r9
call   1080 <LCS_LENGTH@plt>
lea    -0x13890(%rbp),%rdi
lea    -0x138a1(%rbp),%rsi
mov    -0x13894(%rbp),%edx
mov    -0x13898(%rbp),%ecx
call   1070 <PRINT_LCS@plt>
lea    0xdf5(%rip),%rdi
call   1050 <printf@plt>
lea    -0x138f0(%rbp),%rdi
lea    0xdf0(%rip),%rsi
mov    $0x3e,%edx
call   1060 <memcpy@plt>
lea    -0x13930(%rbp),%rdi
lea    0xe18(%rip),%rsi
mov    $0x3e,%edx
call   1060 <memcpy@plt>
lea    -0x138f0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x13894(%rbp)
lea    -0x13930(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x13898(%rbp)
lea    -0x138f0(%rbp),%rdi
lea    -0x13930(%rbp),%rsi
mov    -0x13894(%rbp),%edx
mov    -0x13898(%rbp),%ecx
lea    -0x9c50(%rbp),%r8
lea    -0x13890(%rbp),%r9
call   1080 <LCS_LENGTH@plt>
lea    -0x13890(%rbp),%rdi
lea    -0x138f0(%rbp),%rsi
mov    -0x13894(%rbp),%edx
mov    -0x13898(%rbp),%ecx
call   1070 <PRINT_LCS@plt>
lea    0xd49(%rip),%rdi
call   1050 <printf@plt>
lea    0xd3f(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x13930,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x13928,%rsp
movabs $0x78797a7a797a782d,%rax
7a 79 78
mov    %rax,0x10(%rsp)
movb   $0x0,0x18(%rsp)
movabs $0x7a787a7979787a2d,%rax
7a 78 7a
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
lea    0x10(%rsp),%r12
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %rsp,%r13
mov    %r13,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebx
lea    0x9ce0(%rsp),%r14
lea    0xa0(%rsp),%r15
mov    %r12,%rdi
mov    %r13,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
mov    %r14,%r8
mov    %r15,%r9
call   1070 <LCS_LENGTH@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1060 <PRINT_LCS@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movups 0xe65(%rip),%xmm0
movups %xmm0,0x8e(%rsp)
movaps 0xe48(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xe29(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xe0d(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movups 0xe6f(%rip),%xmm0
movups %xmm0,0x4e(%rsp)
movaps 0xe55(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe39(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe1d(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x60(%rsp),%r12
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
lea    0x20(%rsp),%r13
mov    %r13,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebx
mov    %r12,%rdi
mov    %r13,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
mov    %r14,%r8
mov    %r15,%r9
call   1070 <LCS_LENGTH@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1060 <PRINT_LCS@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd77(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x13928,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.case1_x = [9 x i8] c"-xzyzzyx\00"
@__const.main.case1_y = [9 x i8] c"-zxyyzxz\00"
@.str = [2 x i8] c"\0A\00"
@__const.main.case2_x = [62 x i8] c"-MAEEEVAKLEKHLMLLRQEYVKLQKKLAETEKRCALLAAQANKESSSESFISRLLAIVAD\00"
@__const.main.case2_y = [62 x i8] c"-MAEEEVAKLEKHLMLLRQEYVKLQKKLAETEKRCTLLAAQANKENSNESFISRLLAIVAG\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x [100 x i32]]
%3 = alloca [100 x [100 x i32]]
%4 = alloca i32
%5 = alloca i32
%6 = alloca [9 x i8]
%7 = alloca [9 x i8]
%8 = alloca [62 x i8]
%9 = alloca [62 x i8]
store i32 0, i32* %1
%10 = bitcast [9 x i8]* %6 to i8*
%11 = bitcast [9 x i8]* %7 to i8*
%12 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
store i32 %13, i32* %4
%14 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
store i32 %15, i32* %5
%16 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%17 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 0
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %2, i64 0, i64 0
%21 = bitcast [100 x i32]* %20 to i32**
%22 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %3, i64 0, i64 0
%23 = bitcast [100 x i32]* %22 to i32**
%24 = call i32 @LCS_LENGTH(i8* %16, i8* %17, i32 %18, i32 %19, i32** %21, i32** %23)
%25 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %3, i64 0, i64 0
%26 = bitcast [100 x i32]* %25 to i32**
%27 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%28 = load i32, i32* %4
%29 = load i32, i32* %5
%30 = call i32 @PRINT_LCS(i32** %26, i8* %27, i32 %28, i32 %29)
%31 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%32 = bitcast [62 x i8]* %8 to i8*
%33 = bitcast [62 x i8]* %9 to i8*
%34 = getelementptr inbounds [62 x i8], [62 x i8]* %8, i64 0, i64 0
%35 = call i32 @strlen(i8* %34)
store i32 %35, i32* %4
%36 = getelementptr inbounds [62 x i8], [62 x i8]* %9, i64 0, i64 0
%37 = call i32 @strlen(i8* %36)
store i32 %37, i32* %5
%38 = getelementptr inbounds [62 x i8], [62 x i8]* %8, i64 0, i64 0
%39 = getelementptr inbounds [62 x i8], [62 x i8]* %9, i64 0, i64 0
%40 = load i32, i32* %4
%41 = load i32, i32* %5
%42 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %2, i64 0, i64 0
%43 = bitcast [100 x i32]* %42 to i32**
%44 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %3, i64 0, i64 0
%45 = bitcast [100 x i32]* %44 to i32**
%46 = call i32 @LCS_LENGTH(i8* %38, i8* %39, i32 %40, i32 %41, i32** %43, i32** %45)
%47 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %3, i64 0, i64 0
%48 = bitcast [100 x i32]* %47 to i32**
%49 = getelementptr inbounds [62 x i8], [62 x i8]* %8, i64 0, i64 0
%50 = load i32, i32* %4
%51 = load i32, i32* %5
%52 = call i32 @PRINT_LCS(i32** %48, i8* %49, i32 %50, i32 %51)
%53 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%54 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.case1_x = [9 x i8] c"-xzyzzyx\00"
@__const.main.case1_y = [9 x i8] c"-zxyyzxz\00"
@__const.main.case2_x = [62 x i8] c"-MAEEEVAKLEKHLMLLRQEYVKLQKKLAETEKRCALLAAQANKESSSESFISRLLAIVAD\00"
@__const.main.case2_y = [62 x i8] c"-MAEEEVAKLEKHLMLLRQEYVKLQKKLAETEKRCTLLAAQANKENSNESFISRLLAIVAG\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca [100 x [100 x i32]]
%2 = alloca [100 x [100 x i32]]
%3 = alloca [9 x i8]
%4 = alloca [9 x i8]
%5 = alloca [62 x i8]
%6 = alloca [62 x i8]
%7 = bitcast [100 x [100 x i32]]* %1 to i8*
%8 = bitcast [100 x [100 x i32]]* %2 to i8*
%9 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%11 = call i32 @strlen(i8* %9)
%12 = call i32 @strlen(i8* %10)
%13 = bitcast [100 x [100 x i32]]* %1 to i32**
%14 = bitcast [100 x [100 x i32]]* %2 to i32**
%15 = call i32 @LCS_LENGTH(i8* %9, i8* %10, i32 %11, i32 %12, i32** %13, i32** %14)
%16 = call i32 @PRINT_LCS(i32** %14, i8* %9, i32 %11, i32 %12)
%17 = call i32 @putchar(i32 10)
%18 = getelementptr inbounds [62 x i8], [62 x i8]* %5, i64 0, i64 0
%19 = getelementptr inbounds [62 x i8], [62 x i8]* %6, i64 0, i64 0
%20 = call i32 @strlen(i8* %18)
%21 = call i32 @strlen(i8* %19)
%22 = call i32 @LCS_LENGTH(i8* %18, i8* %19, i32 %20, i32 %21, i32** %13, i32** %14)
%23 = call i32 @PRINT_LCS(i32** %14, i8* %18, i32 %20, i32 %21)
%24 = call i32 @putchar(i32 10)
%25 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}