#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 lcs(char *, char *);
int /*<<< orphan*/ lcs_fprint(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *, char *);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  char A[1024];
  char B[1024];
  scanf("%s %s", A, B);
  printf("%d\n", lcs(A, B));
  lcs_fprint(stdout);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rsi
lea    -0x810(%rbp),%rdx
lea    0xe99(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
call   1030 <lcs@plt>
mov    %eax,%esi
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
call   1050 <lcs_fprint@plt>
xor    %eax,%eax
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x808,%rsp
lea    0xeaf(%rip),%rdi
lea    0x400(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <lcs@plt>
lea    0xe8d(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1050 <lcs_fprint@plt>
xor    %eax,%eax
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [1024 x i8]
%6 = alloca [1024 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%12 = call i32 @lcs(i8* %10, i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @stdout
%15 = call i32 @lcs_fprint(i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 @lcs(i8* %5, i8* %6)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @stdout
%11 = call i32 @lcs_fprint(i32 %10)
ret i32 0
}