#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 *, ...);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char *nume = "Mugurel";
  char aaray[] = "John";
  nume = aaray;
  puts(nume);
  printf("1st letter of that is %s\b\b\b\b\b\b%s\n", nume, "      ");
  printf("1st letter of that is %c\n", *(nume));
  printf("2nd letter of that is %c\n", *(nume + 1));
  printf("3rd letter of that is %c\n", nume[2]);
  printf("4th letter of that is %c\n", *(nume + 3));
  printf("5th letter of that is %c\n", nume[4]);
  printf("6th letter of that is %c\n", *(nume + 5));
  printf("7th letter of that is %c\n", nume[6]);
  printf("8th letter of that is %c\n\n", *(nume + 7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xec3(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x15(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%rsi
lea    0xea5(%rip),%rdi
lea    0xec0(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl 0x4(%rax),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl 0x5(%rax),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl 0x6(%rax),%esi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl 0x7(%rax),%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x6e686f4a,0x8(%rsp)
6e
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xebf(%rip),%rdi
lea    0xeda(%rip),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x8(%rsp),%esi
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x9(%rsp),%esi
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xa(%rsp),%esi
lea    0xed9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xb(%rsp),%esi
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xc(%rsp),%esi
lea    0xee7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xd(%rsp),%esi
lea    0xeee(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xe(%rsp),%esi
lea    0xef5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xf(%rsp),%esi
lea    0xefc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Mugurel\00"
@__const.main.aaray = [5 x i8] c"John\00"
@.str.1 = [34 x i8] c"1st letter of that is %s\08\08\08\08\08\08%s\0A\00"
@.str.2 = [7 x i8] c" \00"
@.str.3 = [26 x i8] c"1st letter of that is %c\0A\00"
@.str.4 = [26 x i8] c"2nd letter of that is %c\0A\00"
@.str.5 = [26 x i8] c"3rd letter of that is %c\0A\00"
@.str.6 = [26 x i8] c"4th letter of that is %c\0A\00"
@.str.7 = [26 x i8] c"5th letter of that is %c\0A\00"
@.str.8 = [26 x i8] c"6th letter of that is %c\0A\00"
@.str.9 = [26 x i8] c"7th letter of that is %c\0A\00"
@.str.10 = [27 x i8] c"8th letter of that is %c\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [5 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = bitcast [5 x i8]* %3 to i8*
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @puts(i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 2
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %27)
%29 = load i8*, i8** %2
%30 = getelementptr inbounds i8, i8* %29, i64 4
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32 %32)
%34 = load i8*, i8** %2
%35 = getelementptr inbounds i8, i8* %34, i64 5
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %37)
%39 = load i8*, i8** %2
%40 = getelementptr inbounds i8, i8* %39, i64 6
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %42)
%44 = load i8*, i8** %2
%45 = getelementptr inbounds i8, i8* %44, i64 7
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i32 %47)
ret i32 0
}

LLVM IR (-O2):
@__const.main.aaray = [5 x i8] c"John\00"
@.str.1 = [34 x i8] c"1st letter of that is %s\08\08\08\08\08\08%s\0A\00"
@.str.2 = [7 x i8] c" \00"
@.str.3 = [26 x i8] c"1st letter of that is %c\0A\00"
@.str.4 = [26 x i8] c"2nd letter of that is %c\0A\00"
@.str.5 = [26 x i8] c"3rd letter of that is %c\0A\00"
@.str.6 = [26 x i8] c"4th letter of that is %c\0A\00"
@.str.7 = [26 x i8] c"5th letter of that is %c\0A\00"
@.str.8 = [26 x i8] c"6th letter of that is %c\0A\00"
@.str.9 = [26 x i8] c"7th letter of that is %c\0A\00"
@.str.10 = [27 x i8] c"8th letter of that is %c\0A\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @puts(i8* %2)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 4
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 5
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 6
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 7
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i32 %34)
ret i32 0
}