#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 *, ...);
int /*<<< orphan*/ strcpy1(char *, char *);
int /*<<< orphan*/ strcpy4(char *, char *);
main() {
  char amessage1[] = "a1:Now is the time";
  char amessage2[] = "a2:Now is the time";
  char *pmessage = "p: Now is the time";
  amessage1[14] = 'T';
  amessage1[15] = 'I';
  amessage1[16] = 'M';
  amessage1[17] = 'E';
  printf("%s\n", amessage1);
  printf("%s\n", amessage2);
  printf("%s\n", pmessage);
  pmessage = amessage2;
  printf("%s\n", pmessage);
  strcpy1(amessage2, amessage1);
  printf("%s\n", amessage2);
  strcpy4(amessage2, pmessage);
  printf("%s\n", amessage2);
  printf("\nPress any key to end...");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xeb1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeab(%rip),%ax
mov    %ax,-0x10(%rbp)
mov    0xea3(%rip),%al
mov    %al,-0xe(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xea1(%rip),%ax
mov    %ax,-0x30(%rbp)
mov    0xe99(%rip),%al
mov    %al,-0x2e(%rbp)
lea    0xe90(%rip),%rax
mov    %rax,-0x48(%rbp)
movb   $0x54,-0x12(%rbp)
movb   $0x49,-0x11(%rbp)
movb   $0x4d,-0x10(%rbp)
movb   $0x45,-0xf(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%rsi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rsi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <strcpy1@plt>
lea    -0x40(%rbp),%rsi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1060 <strcpy4@plt>
lea    -0x40(%rbp),%rsi
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movaps 0xea2(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x656d69,0xf(%rsp)
movaps 0xeaf(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movl   $0x656d69,0x2f(%rsp)
movb   $0x54,0xe(%rsp)
movb   $0x49,0xf(%rsp)
movw   $0x454d,0x10(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcpy1@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1070 <strcpy4@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe5e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.amessage1 = [19 x i8] c"a1:Now is the time\00"
@__const.main.amessage2 = [19 x i8] c"a2:Now is the time\00"
@.str = [19 x i8] c"p: Now is the time\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca [19 x i8]
%2 = alloca [19 x i8]
%3 = alloca i8*
%4 = bitcast [19 x i8]* %1 to i8*
%5 = bitcast [19 x i8]* %2 to i8*
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %3
%6 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 14
store i8 84, i8* %6
%7 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 15
store i8 73, i8* %7
%8 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 16
store i8 77, i8* %8
%9 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 17
store i8 69, i8* %9
%10 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
store i8* %16, i8** %3
%17 = load i8*, i8** %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%20 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 0
%21 = call i32 @strcpy1(i8* %19, i8* %20)
%22 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%25 = load i8*, i8** %3
%26 = call i32 @strcpy4(i8* %24, i8* %25)
%27 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%30 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.amessage1 = [19 x i8] c"a1:Now is the time\00"
@__const.main.amessage2 = [19 x i8] c"a2:Now is the time\00"
@.str = [19 x i8] c"p: Now is the time\00"
@.str.2 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca [19 x i8]
%2 = alloca [19 x i8]
%3 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 14
store i8 84, i8* %5
%6 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 15
store i8 73, i8* %6
%7 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 16
store i8 77, i8* %7
%8 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 17
store i8 69, i8* %8
%9 = call i32 @puts(i8* %3)
%10 = call i32 @puts(i8* %4)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @puts(i8* %4)
%13 = call i32 @strcpy1(i8* %4, i8* %3)
%14 = call i32 @puts(i8* %4)
%15 = call i32 @strcpy4(i8* %4, i8* %4)
%16 = call i32 @puts(i8* %4)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (...) @getchar()
ret i32 0
}