#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 makeEqual(char *, int, char *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int n1, n2;
  char *s1, *s2;
  scanf("%d\n", &n1);
  s1 = (char *)malloc((n1 + 1) * sizeof(char));
  for (int i = 0; i < n1; i++) {
    scanf("%c", s1 + i);
  }
  scanf("%d\n", &n2);
  s2 = (char *)malloc((n2 + 1) * sizeof(char));
  for (int i = 0; i < n2; i++) {
    scanf("%c", s2 + i);
  }
  int d = makeEqual(s1, n1, s2, n2);
  printf("%d", d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b2 <main+0x72>
mov    -0x18(%rbp),%rsi
movslq -0x24(%rbp),%rax
add    %rax,%rsi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    117f <main+0x3f>
lea    0xe47(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1215 <main+0xd5>
mov    -0x20(%rbp),%rsi
movslq -0x28(%rbp),%rax
add    %rax,%rsi
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11e2 <main+0xa2>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0xc(%rbp),%ecx
call   1040 <makeEqual@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xdd2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xeb1(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    (%rsp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
cmpl   $0x0,(%rsp)
jle    119b <main+0x5b>
lea    0xe90(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    (%r14,%rbx,1),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
add    $0x1,%rbx
movslq (%rsp),%rax
cmp    %rax,%rbx
jl     1180 <main+0x40>
lea    0xe5e(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    0x4(%rsp),%ecx
test   %ecx,%ecx
jle    11ec <main+0xac>
lea    0xe38(%rip),%r15
xor    %ebx,%ebx
xchg   %ax,%ax
lea    (%r12,%rbx,1),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
add    $0x1,%rbx
movslq 0x4(%rsp),%rcx
cmp    %rcx,%rbx
jl     11d0 <main+0x90>
mov    (%rsp),%esi
mov    %r14,%rdi
mov    %r12,%rdx
call   1040 <makeEqual@plt>
lea    0xe06(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 1
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %4
store i32 0, i32* %6
br label %17
17: ; preds = %27, %0
%18 = load i32, i32* %6
%19 = load i32, i32* %2
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %30
21: ; preds = %17
%22 = load i8*, i8** %4
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %25)
br label %27
27: ; preds = %21
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %17
30: ; preds = %17
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
%34 = sext i32 %33 to i64
%35 = mul i64 %34, 1
%36 = trunc i64 %35 to i32
%37 = call i64 @malloc(i32 %36)
%38 = inttoptr i64 %37 to i8*
store i8* %38, i8** %5
store i32 0, i32* %7
br label %39
39: ; preds = %49, %30
%40 = load i32, i32* %7
%41 = load i32, i32* %3
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %52
43: ; preds = %39
%44 = load i8*, i8** %5
%45 = load i32, i32* %7
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %44, i64 %46
%48 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %47)
br label %49
49: ; preds = %43
%50 = load i32, i32* %7
%51 = add nsw i32 %50, 1
store i32 %51, i32* %7
br label %39
52: ; preds = %39
%53 = load i8*, i8** %4
%54 = load i32, i32* %2
%55 = load i8*, i8** %5
%56 = load i32, i32* %3
%57 = call i32 @makeEqual(i8* %53, i32 %54, i8* %55, i32 %56)
store i32 %57, i32* %8
%58 = load i32, i32* %8
%59 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %58)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %20, label %12
12: ; preds = %20, %0
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
%16 = call i64 @malloc(i32 %15)
%17 = inttoptr i64 %16 to i8*
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, 0
br i1 %19, label %33, label %28
20: ; preds = %0, %20
%21 = phi i64 [ %24, %20 ], [ 0, %0 ]
%22 = getelementptr inbounds i8, i8* %9, i64 %21
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = add nuw nsw i64 %21, 1
%25 = load i32, i32* %1
%26 = sext i32 %25 to i64
%27 = icmp slt i64 %24, %26
br i1 %27, label %20, label %12
28: ; preds = %33, %12
%29 = phi i32 [ %18, %12 ], [ %38, %33 ]
%30 = load i32, i32* %1
%31 = call i32 @makeEqual(i8* %9, i32 %30, i8* %17, i32 %29)
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %31)
ret i32 0
33: ; preds = %12, %33
%34 = phi i64 [ %37, %33 ], [ 0, %12 ]
%35 = getelementptr inbounds i8, i8* %17, i64 %34
%36 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %35)
%37 = add nuw nsw i64 %34, 1
%38 = load i32, i32* %2
%39 = sext i32 %38 to i64
%40 = icmp slt i64 %37, %39
br i1 %40, label %33, label %28
}