#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*/ strcat1(char *, char *);
int main() {
  char s1[100] = "hello ", s2[100] = "world!";
  strcat1(s1, s2);
  printf("%s\n", s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movb   $0x68,-0x70(%rbp)
movb   $0x65,-0x6f(%rbp)
movb   $0x6c,-0x6e(%rbp)
movb   $0x6c,-0x6d(%rbp)
movb   $0x6f,-0x6c(%rbp)
movb   $0x20,-0x6b(%rbp)
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movb   $0x77,-0xe0(%rbp)
movb   $0x6f,-0xdf(%rbp)
movb   $0x72,-0xde(%rbp)
movb   $0x6c,-0xdd(%rbp)
movb   $0x64,-0xdc(%rbp)
movb   $0x21,-0xdb(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1050 <strcat1@plt>
lea    -0x70(%rbp),%rsi
lea    0xe3e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xe0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movl   $0x0,0xd0(%rsp)
movl   $0x6c6c6568,0x70(%rsp)
6c
movw   $0x206f,0x74(%rsp)
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movl   $0x6c726f77,(%rsp)
movw   $0x2164,0x4(%rsp)
lea    0x70(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <strcat1@plt>
lea    0xe44(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = bitcast [100 x i8]* %2 to i8*
%5 = bitcast i8* %4 to [100 x i8]*
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 0
store i8 104, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 1
store i8 101, i8* %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 2
store i8 108, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 3
store i8 108, i8* %9
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 4
store i8 111, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 5
store i8 32, i8* %11
%12 = bitcast [100 x i8]* %3 to i8*
%13 = bitcast i8* %12 to [100 x i8]*
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i32 0, i32 0
store i8 119, i8* %14
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i32 0, i32 1
store i8 111, i8* %15
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i32 0, i32 2
store i8 114, i8* %16
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i32 0, i32 3
store i8 108, i8* %17
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i32 0, i32 4
store i8 100, i8* %18
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i32 0, i32 5
store i8 33, i8* %19
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%22 = call i32 @strcat1(i8* %20, i8* %21)
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
store i8 104, i8* %3
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 1
store i8 101, i8* %4
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 2
store i8 108, i8* %5
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 3
store i8 108, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 4
store i8 111, i8* %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 5
store i8 32, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8 119, i8* %9
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 1
store i8 111, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 2
store i8 114, i8* %11
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 3
store i8 108, i8* %12
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 4
store i8 100, i8* %13
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 5
store i8 33, i8* %14
%15 = call i32 @strcat1(i8* %3, i8* %9)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}