#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 */
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *, char *, int);
int sameChars(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char *a = malloc(10 * sizeof(char));
  char *b = malloc(10 * sizeof(char));
  scanf("%s", a);
  scanf("%s", b);
  printf("%s %s %d", a, b, sameChars(a, b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe81(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <sameChars@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xe9a(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <sameChars@plt>
lea    0xe75(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [9 x i8] c"%s %s %d\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = tail call i32 @sameChars(i8* %1, i8* %2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %2, i32 %5)
ret i32 0
}