#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 backtrack(char *, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ lcs(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main(void) {
  char a[400] = {
      0,
  };
  char b[400] = {
      0,
  };
  int i, j;
  printf("Enter a= ");
  scanf("%s", a);
  printf("Enter b= ");
  scanf("%s", b);
  lcs(a, b);
  printf("\n%d \n", backtrack(a, b, strlen(a), strlen(b)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1060 <memset@plt>
lea    -0x330(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1060 <memset@plt>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1a0(%rbp),%rsi
lea    0xe56(%rip),%rdi
call   1080 <scanf@plt>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x330(%rbp),%rsi
lea    0xe35(%rip),%rdi
call   1080 <scanf@plt>
lea    -0x1a0(%rbp),%rdi
lea    -0x330(%rbp),%rsi
call   1040 <lcs@plt>
lea    -0x1a0(%rbp),%rax
mov    %rax,-0x350(%rbp)
lea    -0x330(%rbp),%rax
mov    %rax,-0x348(%rbp)
lea    -0x1a0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x33c(%rbp)
lea    -0x330(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x350(%rbp),%rdi
mov    -0x348(%rbp),%rsi
mov    -0x33c(%rbp),%edx
mov    %eax,%ecx
call   1070 <backtrack@plt>
mov    %eax,%esi
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x350,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x328,%rsp
lea    0x190(%rsp),%r14
mov    $0x190,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
mov    %rsp,%rbx
mov    $0x190,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
lea    0xe63(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe5f(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1080 <scanf@plt>
lea    0xe50(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <lcs@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
call   1070 <backtrack@plt>
lea    0xe15(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x328,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Enter a= \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [10 x i8] c"Enter b= \00"
@.str.3 = [6 x i8] c"\0A%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [400 x i8]
%3 = alloca [400 x i8]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [400 x i8]* %2 to i8*
%7 = bitcast [400 x i8]* %3 to i8*
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [400 x i8], [400 x i8]* %2, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%12 = getelementptr inbounds [400 x i8], [400 x i8]* %3, i64 0, i64 0
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [400 x i8], [400 x i8]* %2, i64 0, i64 0
%15 = getelementptr inbounds [400 x i8], [400 x i8]* %3, i64 0, i64 0
%16 = call i32 @lcs(i8* %14, i8* %15)
%17 = getelementptr inbounds [400 x i8], [400 x i8]* %2, i64 0, i64 0
%18 = getelementptr inbounds [400 x i8], [400 x i8]* %3, i64 0, i64 0
%19 = getelementptr inbounds [400 x i8], [400 x i8]* %2, i64 0, i64 0
%20 = call i32 @strlen(i8* %19)
%21 = getelementptr inbounds [400 x i8], [400 x i8]* %3, i64 0, i64 0
%22 = call i32 @strlen(i8* %21)
%23 = call i32 @backtrack(i8* %17, i8* %18, i32 %20, i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Enter a= \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [10 x i8] c"Enter b= \00"
@.str.3 = [6 x i8] c"\0A%d \0A\00"
define i32 @main() {
%1 = alloca [400 x i8]
%2 = alloca [400 x i8]
%3 = getelementptr inbounds [400 x i8], [400 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [400 x i8], [400 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%9 = call i32 @lcs(i8* %3, i8* %4)
%10 = call i32 @strlen(i8* %3)
%11 = call i32 @strlen(i8* %4)
%12 = call i32 @backtrack(i8* %3, i8* %4, i32 %10, i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %12)
ret i32 0
}