#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 */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char s[] = {'H', 'e', 'l', 'l', 'o'};
  char *pBegin = s;
  char *pEnd = s + (sizeof(s) / sizeof(*s));
  char *p = NULL;
  for (p = pBegin; p < pEnd; p++)
    printf("%c", *p);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x9(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1189 <main+0x79>
mov    -0x28(%rbp),%rax
movsbl (%rax),%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1155 <main+0x45>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = call i32 @putchar(i32 72)
%2 = call i32 @putchar(i32 101)
%3 = call i32 @putchar(i32 108)
%4 = call i32 @putchar(i32 108)
%5 = call i32 @putchar(i32 111)
%6 = call i32 @putchar(i32 10)
ret i32 0
}