#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 */
char *mystrcat2(char *, char *);
int /*<<< orphan*/ printf(char *, char *, ...);
int main() {
  char a[100] = "Hello, ";
  char b[] = "world";
  printf("\"%s\" + \"%s\" = ", a, b);
  printf("\"%s\"\n", mystrcat2(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
mov    0xf07(%rip),%eax
mov    %eax,-0x76(%rbp)
mov    0xf01(%rip),%ax
mov    %ax,-0x72(%rbp)
lea    -0x70(%rbp),%rsi
lea    -0x76(%rbp),%rdx
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
lea    -0x76(%rbp),%rsi
call   1030 <mystrcat2@plt>
mov    %rax,%rsi
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
movaps 0xf22(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf06(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xece(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe96(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x70(%rsp)
movw   $0x64,0xc(%rsp)
movl   $0x6c726f77,0x8(%rsp)
6c
lea    0xedd(%rip),%rdi
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <mystrcat2@plt>
lea    0xec3(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.a = [100 x i8] c"Hello, \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.b = [6 x i8] c"world\00"
@.str = [15 x i8] c"\22%s\22 + \22%s\22 = \00"
@.str.1 = [6 x i8] c"\22%s\22\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [6 x i8]
store i32 0, i32* %1
%4 = bitcast [100 x i8]* %2 to i8*
%5 = bitcast [6 x i8]* %3 to i8*
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%8 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%11 = call i8* @mystrcat2(i8* %9, i8* %10)
%12 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [100 x i8] c"Hello, \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.b = [6 x i8] c"world\00"
@.str = [15 x i8] c"\22%s\22 + \22%s\22 = \00"
@.str.1 = [6 x i8] c"\22%s\22\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = call i8* @mystrcat2(i8* %3, i8* %4)
%7 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}