#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, char *, char);
int main() {
  char c[10] = "HELLO", *cp, i;
  for (i = 0, cp = &c[0]; i < 10; i++) {
    printf("c[%d]:%c is *(%p):%d\n", i, c[i], (cp + 1), (*cp + 1));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0x6(%rbp)
movb   $0x0,-0x19(%rbp)
lea    -0xe(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0xa,%eax
jge    1191 <main+0x81>
mov    -0x19(%rbp),%sil
movsbq -0x19(%rbp),%rax
mov    -0xe(%rbp,%rax,1),%dl
mov    -0x18(%rbp),%rcx
add    $0x1,%rcx
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
add    $0x1,%eax
lea    0xe96(%rip),%rdi
movsbl %sil,%esi
movsbl %dl,%edx
movsbl %al,%r8d
call   1030 <printf@plt>
mov    -0x19(%rbp),%al
add    $0x1,%al
mov    %al,-0x19(%rbp)
jmp    1141 <main+0x31>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x4f4c4c4548,%rax
mov    %rax,0x8(%rsp)
movw   $0x0,0x10(%rsp)
lea    0x9(%rsp),%r14
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x48,%edx
mov    %r14,%rcx
mov    $0x49,%r8d
call   1030 <printf@plt>
movsbl 0x9(%rsp),%edx
mov    0x8(%rsp),%al
add    $0x1,%al
movsbl %al,%r8d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14,%rcx
call   1030 <printf@plt>
movsbl 0xa(%rsp),%edx
mov    0x8(%rsp),%al
add    $0x1,%al
movsbl %al,%r8d
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %r14,%rcx
call   1030 <printf@plt>
movsbl 0xb(%rsp),%edx
mov    0x8(%rsp),%al
add    $0x1,%al
movsbl %al,%r8d
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %r14,%rcx
call   1030 <printf@plt>
movsbl 0xc(%rsp),%edx
mov    0x8(%rsp),%al
add    $0x1,%al
movsbl %al,%r8d
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r14,%rcx
call   1030 <printf@plt>
movsbl 0xd(%rsp),%edx
mov    0x8(%rsp),%al
add    $0x1,%al
movsbl %al,%r8d
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %r14,%rcx
call   1030 <printf@plt>
movsbl 0xe(%rsp),%edx
mov    0x8(%rsp),%al
add    $0x1,%al
movsbl %al,%r8d
mov    %rbx,%rdi
mov    $0x6,%esi
mov    %r14,%rcx
call   1030 <printf@plt>
movsbl 0xf(%rsp),%edx
mov    0x8(%rsp),%al
add    $0x1,%al
movsbl %al,%r8d
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %r14,%rcx
call   1030 <printf@plt>
movsbl 0x10(%rsp),%edx
mov    0x8(%rsp),%al
add    $0x1,%al
movsbl %al,%r8d
mov    %rbx,%rdi
mov    $0x8,%esi
mov    %r14,%rcx
call   1030 <printf@plt>
movsbl 0x11(%rsp),%edx
mov    0x8(%rsp),%al
add    $0x1,%al
movsbl %al,%r8d
mov    %rbx,%rdi
mov    $0x9,%esi
mov    %r14,%rcx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.c = [10 x i8] c"HELLO\00\00\00\00\00"
@.str = [22 x i8] c"c[%d]:%c is *(%p):%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i8*
%4 = alloca i8
store i32 0, i32* %1
%5 = bitcast [10 x i8]* %2 to i8*
store i8 0, i8* %4
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
store i8* %6, i8** %3
br label %7
7: ; preds = %25, %0
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %28
11: ; preds = %7
%12 = load i8, i8* %4
%13 = load i8, i8* %4
%14 = sext i8 %13 to i64
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = add nsw i32 %21, 1
%23 = trunc i32 %22 to i8
%24 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext %12, i8 signext %16, i8* %18, i8 signext %23)
br label %25
25: ; preds = %11
%26 = load i8, i8* %4
%27 = add i8 %26, 1
store i8 %27, i8* %4
br label %7
28: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@__const.main.c = [10 x i8] c"HELLO\00\00\00\00\00"
@.str = [22 x i8] c"c[%d]:%c is *(%p):%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext 0, i8 signext 72, i8* %3, i8 signext 73)
%5 = load i8, i8* %3
%6 = load i8, i8* %2
%7 = add i8 %6, 1
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext 1, i8 signext %5, i8* %3, i8 signext %7)
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
%10 = load i8, i8* %9
%11 = load i8, i8* %2
%12 = add i8 %11, 1
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext 2, i8 signext %10, i8* %3, i8 signext %12)
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 3
%15 = load i8, i8* %14
%16 = load i8, i8* %2
%17 = add i8 %16, 1
%18 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext 3, i8 signext %15, i8* %3, i8 signext %17)
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 4
%20 = load i8, i8* %19
%21 = load i8, i8* %2
%22 = add i8 %21, 1
%23 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext 4, i8 signext %20, i8* %3, i8 signext %22)
%24 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 5
%25 = load i8, i8* %24
%26 = load i8, i8* %2
%27 = add i8 %26, 1
%28 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext 5, i8 signext %25, i8* %3, i8 signext %27)
%29 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 6
%30 = load i8, i8* %29
%31 = load i8, i8* %2
%32 = add i8 %31, 1
%33 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext 6, i8 signext %30, i8* %3, i8 signext %32)
%34 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 7
%35 = load i8, i8* %34
%36 = load i8, i8* %2
%37 = add i8 %36, 1
%38 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext 7, i8 signext %35, i8* %3, i8 signext %37)
%39 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 8
%40 = load i8, i8* %39
%41 = load i8, i8* %2
%42 = add i8 %41, 1
%43 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext 8, i8 signext %40, i8* %3, i8 signext %42)
%44 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 9
%45 = load i8, i8* %44
%46 = load i8, i8* %2
%47 = add i8 %46, 1
%48 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext 9, i8 signext %45, i8* %3, i8 signext %47)
ret i32 0
}