#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 *);
int main() {
  char name[8];
  name[0] = 'J';
  name[1] = 'o';
  name[2] = 'e';
  name[3] = '\0';
  printf("name is %s.\n", name);
  name[4] = 'n';
  name[5] = 'y';
  name[6] = '\0';
  printf("name is %s.\n", name);
  name[2] = 'h';
  name[3] = 'n';
  printf("name is %s.\n", name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x4a,-0xc(%rbp)
movb   $0x6f,-0xb(%rbp)
movb   $0x65,-0xa(%rbp)
movb   $0x0,-0x9(%rbp)
lea    -0xc(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
movb   $0x6e,-0x8(%rbp)
movb   $0x79,-0x7(%rbp)
movb   $0x0,-0x6(%rbp)
lea    -0xc(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
movb   $0x68,-0xa(%rbp)
movb   $0x6e,-0x9(%rbp)
lea    -0xc(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x656f4a,(%rsp)
lea    0xede(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
movw   $0x796e,0x4(%rsp)
movb   $0x0,0x6(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
movw   $0x6e68,0x2(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"name is %s.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
store i8 74, i8* %3
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 1
store i8 111, i8* %4
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 2
store i8 101, i8* %5
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 3
store i8 0, i8* %6
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 4
store i8 110, i8* %9
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 5
store i8 121, i8* %10
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 6
store i8 0, i8* %11
%12 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 2
store i8 104, i8* %14
%15 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 3
store i8 110, i8* %15
%16 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"name is %s.\0A\00"
define i32 @main() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
store i8 74, i8* %2
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 1
store i8 111, i8* %3
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 2
store i8 101, i8* %4
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 3
store i8 0, i8* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 4
store i8 110, i8* %7
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 5
store i8 121, i8* %8
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 6
store i8 0, i8* %9
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %2)
store i8 104, i8* %4
store i8 110, i8* %5
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}