#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 *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char str_a[20];
  char *pointer;
  char *pointer2;
  strcpy(str_a, "Hello, world!\n");
  pointer = str_a;
  printf(pointer);
  pointer2 = pointer + 2;
  printf(pointer2);
  strcpy(pointer2, "y you guys!\n");
  printf(pointer);
  printf(str_a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0x2(%rsp),%r14
mov    %r14,%rdi
call   1040 <printf@plt>
lea    0xeba(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
@.str.1 = [13 x i8] c"y you guys!\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca i8*
%3 = alloca i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* %7)
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = call i32 @printf(i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%15 = load i8*, i8** %2
%16 = call i32 @printf(i8* %15)
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%18 = call i32 @printf(i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, world!\0A\00"
@.str.1 = [13 x i8] c"y you guys!\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %2)
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 2
%6 = call i32 @printf(i8* %5)
%7 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* %2)
%9 = call i32 @printf(i8* %2)
ret i32 0
}