#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*/ getchar();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char myString1[15] = "Hello World!";
  char myString2[] = "Goodbye world; I shall never see thee again!";
  char myString3[25];
  char myString4[6];
  strcpy(myString3, "Nevermind world, I'm back again");
  myString4[0] = 'A';
  myString4[1] = 'd';
  myString4[2] = 'i';
  myString4[3] = 'o';
  myString4[4] = 's';
  myString4[5] = '\0';
  printf("\nThe value of myString1 is: %s", myString1);
  getchar();
  printf("\nThe value of myString2 is: %s", myString2);
  getchar();
  printf("\nThe value of myString3 is: %s", myString3);
  getchar();
  printf("\nThe value of myString4 is: %s", myString4);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xea8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xea2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xe9a(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe8e(%rip),%rsi
mov    $0x2d,%edx
call   1060 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1030 <strcpy@plt>
movb   $0x41,-0x66(%rbp)
movb   $0x64,-0x65(%rbp)
movb   $0x69,-0x64(%rbp)
movb   $0x6f,-0x63(%rbp)
movb   $0x73,-0x62(%rbp)
movb   $0x0,-0x61(%rbp)
lea    -0x13(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
lea    -0x40(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
lea    -0x60(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
lea    -0x66(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
movabs $0x21646c726f,%rax
mov    %rax,0x17(%rsp)
movabs $0x6f57206f6c6c6548,%rax
20 57 6f
mov    %rax,0x10(%rsp)
movups 0xed3(%rip),%xmm0
movups %xmm0,0x3d(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe9e(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0xebf(%rip),%rsi
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
movl   $0x6f696441,0xa(%rsp)
6f
movw   $0x73,0xe(%rsp)
lea    0xebc(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xec3(%rip),%rdi
lea    0x20(%rsp),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xed3(%rip),%rdi
lea    0xa(%rsp),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.myString1 = [15 x i8] c"Hello World!\00\00\00"
@__const.main.myString2 = [45 x i8] c"Goodbye world; I shall never see thee again!\00"
@.str = [32 x i8] c"Nevermind world, I'm back again\00"
@.str.1 = [31 x i8] c"\0AThe value of myString1 is: %s\00"
@.str.2 = [31 x i8] c"\0AThe value of myString2 is: %s\00"
@.str.3 = [31 x i8] c"\0AThe value of myString3 is: %s\00"
@.str.4 = [31 x i8] c"\0AThe value of myString4 is: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
%3 = alloca [45 x i8]
%4 = alloca [25 x i8]
%5 = alloca [6 x i8]
store i32 0, i32* %1
%6 = bitcast [15 x i8]* %2 to i8*
%7 = bitcast [45 x i8]* %3 to i8*
%8 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 0
store i8 65, i8* %10
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 1
store i8 100, i8* %11
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 2
store i8 105, i8* %12
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 3
store i8 111, i8* %13
%14 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 4
store i8 115, i8* %14
%15 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 5
store i8 0, i8* %15
%16 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = call i32 (...) @getchar()
%19 = getelementptr inbounds [45 x i8], [45 x i8]* %3, i64 0, i64 0
%20 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = call i32 (...) @getchar()
%22 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%23 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* %22)
%24 = call i32 (...) @getchar()
%25 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 0
%26 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %25)
%27 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.myString1 = [15 x i8] c"Hello World!\00\00\00"
@__const.main.myString2 = [45 x i8] c"Goodbye world; I shall never see thee again!\00"
@.str = [32 x i8] c"Nevermind world, I'm back again\00"
@.str.1 = [31 x i8] c"\0AThe value of myString1 is: %s\00"
@.str.2 = [31 x i8] c"\0AThe value of myString2 is: %s\00"
@.str.3 = [31 x i8] c"\0AThe value of myString3 is: %s\00"
@.str.4 = [31 x i8] c"\0AThe value of myString4 is: %s\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca [45 x i8]
%3 = alloca [25 x i8]
%4 = alloca [6 x i8]
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [45 x i8], [45 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%9 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i8 65, i8* %8
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 1
store i8 100, i8* %10
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 2
store i8 105, i8* %11
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 3
store i8 111, i8* %12
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 4
store i8 115, i8* %13
%14 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 5
store i8 0, i8* %14
%15 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%16 = call i32 (...) @getchar()
%17 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%18 = call i32 (...) @getchar()
%19 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* %7)
%20 = call i32 (...) @getchar()
%21 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %8)
%22 = call i32 (...) @getchar()
ret i32 0
}