#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 *, char *, char *);
int main() {
  char masked_raider[] = "Alive";
  char *jimmy = masked_raider;
  printf("Masked raider is %s, Jimmy is %s\n", masked_raider, jimmy);
  masked_raider[0] = 'D';
  masked_raider[1] = 'E';
  masked_raider[2] = 'A';
  masked_raider[3] = 'D';
  masked_raider[4] = '!';
  printf("Masked raider is %s, Jimmy is %s\n", masked_raider, jimmy);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xa(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
movb   $0x44,-0xa(%rbp)
movb   $0x45,-0x9(%rbp)
movb   $0x41,-0x8(%rbp)
movb   $0x44,-0x7(%rbp)
movb   $0x21,-0x6(%rbp)
lea    -0xa(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movw   $0x65,0x4(%rsp)
movl   $0x76696c41,(%rsp)
lea    0xedd(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
movl   $0x44414544,(%rsp)
movb   $0x21,0x4(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.masked_raider = [6 x i8] c"Alive\00"
@.str = [34 x i8] c"Masked raider is %s, Jimmy is %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
store i8 68, i8* %9
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 1
store i8 69, i8* %10
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 2
store i8 65, i8* %11
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 3
store i8 68, i8* %12
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 4
store i8 33, i8* %13
%14 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%15 = load i8*, i8** %3
%16 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
ret i32 0
}

LLVM IR (-O2):
@__const.main.masked_raider = [6 x i8] c"Alive\00"
@.str = [34 x i8] c"Masked raider is %s, Jimmy is %s\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %2)
store i8 68, i8* %2
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 1
store i8 69, i8* %4
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 2
store i8 65, i8* %5
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 3
store i8 68, i8* %6
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 4
store i8 33, i8* %7
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %2)
ret i32 0
}