#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
main() {
  int i, j;
  char s1[20], s2[20], s3[20];
  char s4[60];
  puts("enter s1: ");
  gets(s1);
  puts("enter s2: ");
  gets(s2);
  puts("enter s3: ");
  gets(s3);
  strcpy(s4, s1);
  strcat(s4, s2);
  strcat(s4, s3);
  printf("%s", s4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    0xe9e(%rip),%rdi
call   1040 <puts@plt>
lea    -0x20(%rbp),%rdi
call   1060 <gets@plt>
lea    0xe94(%rip),%rdi
call   1040 <puts@plt>
lea    -0x40(%rbp),%rdi
call   1060 <gets@plt>
lea    0xe8a(%rip),%rdi
call   1040 <puts@plt>
lea    -0x60(%rbp),%rdi
call   1060 <gets@plt>
lea    -0xa0(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xa0(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1070 <strcat@plt>
lea    -0xa0(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1070 <strcat@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe49(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xa8,%rsp
lea    0xe9b(%rip),%rdi
call   1040 <puts@plt>
lea    0x40(%rsp),%r14
mov    %r14,%rdi
call   1060 <gets@plt>
lea    0xe8d(%rip),%rdi
call   1040 <puts@plt>
lea    0x20(%rsp),%r15
mov    %r15,%rdi
call   1060 <gets@plt>
lea    0xe7f(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%r12
mov    %r12,%rdi
call   1060 <gets@plt>
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1070 <strcat@plt>
lea    0xe4d(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"enter s1: \00"
@.str.1 = [11 x i8] c"enter s2: \00"
@.str.2 = [11 x i8] c"enter s3: \00"
@.str.3 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = alloca [20 x i8]
%5 = alloca [20 x i8]
%6 = alloca [60 x i8]
%7 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%9 = call i32 @gets(i8* %8)
%10 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%12 = call i32 @gets(i8* %11)
%13 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%15 = call i32 @gets(i8* %14)
%16 = getelementptr inbounds [60 x i8], [60 x i8]* %6, i64 0, i64 0
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = getelementptr inbounds [60 x i8], [60 x i8]* %6, i64 0, i64 0
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%21 = call i32 @strcat(i8* %19, i8* %20)
%22 = getelementptr inbounds [60 x i8], [60 x i8]* %6, i64 0, i64 0
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%24 = call i32 @strcat(i8* %22, i8* %23)
%25 = getelementptr inbounds [60 x i8], [60 x i8]* %6, i64 0, i64 0
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"enter s1: \00"
@.str.1 = [11 x i8] c"enter s2: \00"
@.str.2 = [11 x i8] c"enter s3: \00"
@.str.3 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = alloca [60 x i8]
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [60 x i8], [60 x i8]* %4, i64 0, i64 0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @gets(i8* %5)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @gets(i8* %6)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @gets(i8* %7)
%15 = call i32 @strcpy(i8* %8, i8* %5)
%16 = call i32 @strcat(i8* %8, i8* %6)
%17 = call i32 @strcat(i8* %8, i8* %7)
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %8)
ret i32 0
}