#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*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char s1[] = "This", s2[] = "Class", result[64];
  printf("s1 = %s \n", s1);
  printf("s2 = %s \n", s2);
  strcpy(result, s1);
  strcat(result, " ");
  strcat(result, s2);
  printf("result = %s \n", result);
  printf("result = %s is Amazing. \n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xeb6(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeae(%rip),%eax
mov    %eax,-0xf(%rbp)
mov    0xea8(%rip),%ax
mov    %ax,-0xb(%rbp)
lea    -0x9(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
lea    -0xf(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
lea    -0x9(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rdi
lea    0xe82(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x50(%rbp),%rdi
lea    -0xf(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x50(%rbp),%rsi
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xe65(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
movb   $0x0,0x4(%rsp)
movl   $0x73696854,(%rsp)
movw   $0x73,0xc(%rsp)
movl   $0x73616c43,0x8(%rsp)
73
lea    0xeb0(%rip),%rdi
mov    %rsp,%r15
mov    %r15,%rsi
call   1040 <printf@plt>
lea    0xea8(%rip),%rdi
lea    0x8(%rsp),%r14
mov    %r14,%rsi
call   1040 <printf@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
lea    0xe8e(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
lea    0xe76(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xe75(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.s1 = [5 x i8] c"This\00"
@__const.main.s2 = [6 x i8] c"Class\00"
@.str = [10 x i8] c"s1 = %s \0A\00"
@.str.1 = [10 x i8] c"s2 = %s \0A\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [14 x i8] c"result = %s \0A\00"
@.str.4 = [26 x i8] c"result = %s is Amazing. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca [6 x i8]
%4 = alloca [64 x i8]
store i32 0, i32* %1
%5 = bitcast [5 x i8]* %2 to i8*
%6 = bitcast [6 x i8]* %3 to i8*
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%15 = call i32 @strcat(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%16 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%17 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%20 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%22 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %21)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [5 x i8] c"This\00"
@__const.main.s2 = [6 x i8] c"Class\00"
@.str = [10 x i8] c"s1 = %s \0A\00"
@.str.1 = [10 x i8] c"s2 = %s \0A\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [14 x i8] c"result = %s \0A\00"
@.str.4 = [26 x i8] c"result = %s is Amazing. \0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [6 x i8]
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%9 = call i32 @strcpy(i8* %6, i8* %4)
%10 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @strcat(i8* %6, i8* %5)
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %6)
ret i32 0
}