#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*/ puts(char const *);
int main(void) {
  char str1[80] = "An array was initalized to me.";
  const char *str2 = "A pointer was initialized to me.";
  puts("I'm an argument to puts().");
  puts("I am a #defined string.");
  puts(str1);
  puts(str2);
  puts(&str1[5]);
  puts(str2 + 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x50,%edx
call   1040 <memcpy@plt>
lea    0xf05(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    0xf1b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2a(%rip),%rdi
call   1030 <puts@plt>
lea    -0x60(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x68(%rbp),%rdi
call   1030 <puts@plt>
lea    -0x60(%rbp),%rdi
add    $0x5,%rdi
call   1030 <puts@plt>
mov    -0x68(%rbp),%rdi
add    $0x4,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xf1b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2a(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1030 <puts@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0x5(%rsp),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.str1 = [80 x i8] c"An array was initalized to me.\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"
@.str = [33 x i8] c"A pointer was initialized to me.\00"
@.str.1 = [27 x i8] c"I'm an argument to puts().\00"
@.str.2 = [24 x i8] c"I am a #defined string.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [80 x i8]* %2 to i8*
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%8 = call i32 @puts(i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @puts(i8* %9)
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 5
%12 = call i32 @puts(i8* %11)
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 4
%15 = call i32 @puts(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [80 x i8] c"An array was initalized to me.\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"
@.str = [33 x i8] c"A pointer was initialized to me.\00"
@.str.1 = [27 x i8] c"I'm an argument to puts().\00"
@.str.2 = [24 x i8] c"I am a #defined string.\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @puts(i8* %2)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 5
%8 = call i32 @puts(i8* %7)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 4))
ret i32 0
}