#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 main() {
  char name[8] = "Julie";
  printf("name is %s.\n", name);
  int i;
  for (i = 0; i < 8; i++) {
    printf("[%i] %c - %d\n", i, name[i], name[i]);
  }
  name[3] = '\0';
  printf("name is %s.\n", name);
  for (i = 0; i < 8; i++) {
    printf("[%i] %c - %d\n", i, name[i], name[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    -0xc(%rbp),%rsi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    117e <main+0x6e>
mov    -0x10(%rbp),%esi
movslq -0x10(%rbp),%rax
movsbl -0xc(%rbp,%rax,1),%edx
movslq -0x10(%rbp),%rax
movsbl -0xc(%rbp,%rax,1),%ecx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1143 <main+0x33>
movb   $0x0,-0x9(%rbp)
lea    -0xc(%rbp),%rsi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    11d6 <main+0xc6>
mov    -0x10(%rbp),%esi
movslq -0x10(%rbp),%rax
movsbl -0xc(%rbp,%rax,1),%edx
movslq -0x10(%rbp),%rax
movsbl -0xc(%rbp,%rax,1),%ecx
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    119b <main+0x8b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movabs $0x65696c754a,%rax
mov    %rax,0x8(%rsp)
lea    0xed1(%rip),%r14
lea    0x8(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x8(%rsp),%ecx
lea    0xec0(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x9(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xa(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xb(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xc(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xd(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xe(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xf(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movb   $0x0,0xb(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x8(%rsp),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x9(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xa(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xb(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xc(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xd(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xe(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xf(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.name = [8 x i8] c"Julie\00\00\00"
@.str = [13 x i8] c"name is %s.\0A\00"
@.str.1 = [14 x i8] c"[%i] %c - %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i8]* %2 to i8*
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5)
store i32 0, i32* %3
br label %7
7: ; preds = %23, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %16, i32 %21)
br label %23
23: ; preds = %10
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %7
26: ; preds = %7
%27 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 3
store i8 0, i8* %27
%28 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %28)
store i32 0, i32* %3
br label %30
30: ; preds = %46, %26
%31 = load i32, i32* %3
%32 = icmp slt i32 %31, 8
br i1 %32, label %33, label %49
33: ; preds = %30
%34 = load i32, i32* %3
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = load i32, i32* %3
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 %41
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %34, i32 %39, i32 %44)
br label %46
46: ; preds = %33
%47 = load i32, i32* %3
%48 = add nsw i32 %47, 1
store i32 %48, i32* %3
br label %30
49: ; preds = %30
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"name is %s.\0A\00"
@.str.1 = [14 x i8] c"[%i] %c - %d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to [8 x i8]*
%3 = bitcast i64* %1 to i8*
store i64 435560412490, i64* %1
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64* %1)
%5 = bitcast i64* %1 to i8*
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %7, i32 %7)
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %11, i32 %11)
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 %15, i32 %15)
%17 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 %19, i32 %19)
%21 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 4
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 %23, i32 %23)
%25 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 5
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 %27, i32 %27)
%29 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 6
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 %31, i32 %31)
%33 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 7
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 7, i32 %35, i32 %35)
store i8 0, i8* %17
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64* %1)
%38 = load i8, i8* %5
%39 = sext i8 %38 to i32
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %39, i32 %39)
%41 = load i8, i8* %9
%42 = sext i8 %41 to i32
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %42, i32 %42)
%44 = load i8, i8* %13
%45 = sext i8 %44 to i32
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 %45, i32 %45)
%47 = load i8, i8* %17
%48 = sext i8 %47 to i32
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 %48, i32 %48)
%50 = load i8, i8* %21
%51 = sext i8 %50 to i32
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 %51, i32 %51)
%53 = load i8, i8* %25
%54 = sext i8 %53 to i32
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 %54, i32 %54)
%56 = load i8, i8* %29
%57 = sext i8 %56 to i32
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 %57, i32 %57)
%59 = load i8, i8* %33
%60 = sext i8 %59 to i32
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 7, i32 %60, i32 %60)
ret i32 0
}