#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*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
char *strcate(char *, char *);
int main() {
  char *a = malloc(256);
  char *b = malloc(256);
  scanf("%255s", a);
  scanf("%255s", b);
  printf("%s", a);
  char *ans = strcate(a, b);
  free(a);
  free(b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe6a(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <strcate@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
lea    0xe8a(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1070 <scanf@plt>
lea    0xe73(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcate@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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