#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*/ mystrcat(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char s[1024] = "start";
  char t1[] = "one";
  char t2[] = "two";
  mystrcat(s, t1);
  mystrcat(s, t2);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
movb   $0x73,-0x410(%rbp)
movb   $0x74,-0x40f(%rbp)
movb   $0x61,-0x40e(%rbp)
movb   $0x72,-0x40d(%rbp)
movb   $0x74,-0x40c(%rbp)
mov    0xe82(%rip),%eax
mov    %eax,-0x414(%rbp)
mov    0xe7a(%rip),%eax
mov    %eax,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
lea    -0x414(%rbp),%rsi
call   1050 <mystrcat@plt>
lea    -0x410(%rbp),%rdi
lea    -0x418(%rbp),%rsi
call   1050 <mystrcat@plt>
lea    -0x410(%rbp),%rsi
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x410,%rsp
lea    0x10(%rsp),%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
movl   $0x72617473,0x10(%rsp)
72
movb   $0x74,0x14(%rsp)
movl   $0x656e6f,0xc(%rsp)
movl   $0x6f7774,0x8(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <mystrcat@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <mystrcat@plt>
lea    0xe76(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.t1 = [4 x i8] c"one\00"
@__const.main.t2 = [4 x i8] c"two\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca [4 x i8]
%4 = alloca [4 x i8]
store i32 0, i32* %1
%5 = bitcast [1024 x i8]* %2 to i8*
%6 = bitcast i8* %5 to [1024 x i8]*
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i32 0, i32 0
store i8 115, i8* %7
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i32 0, i32 1
store i8 116, i8* %8
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i32 0, i32 2
store i8 97, i8* %9
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i32 0, i32 3
store i8 114, i8* %10
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i32 0, i32 4
store i8 116, i8* %11
%12 = bitcast [4 x i8]* %3 to i8*
%13 = bitcast [4 x i8]* %4 to i8*
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%16 = call i32 @mystrcat(i8* %14, i8* %15)
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%19 = call i32 @mystrcat(i8* %17, i8* %18)
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
store i8 115, i8* %4
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 1
store i8 116, i8* %5
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 2
store i8 97, i8* %6
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 3
store i8 114, i8* %7
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 4
store i8 116, i8* %8
%9 = bitcast i32* %2 to i8*
store i32 6647407, i32* %2
%10 = bitcast i32* %3 to i8*
store i32 7305076, i32* %3
%11 = call i32 @mystrcat(i8* %4, i8* %9)
%12 = call i32 @mystrcat(i8* %4, i8* %10)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}