#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*/ array;

/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char array[] = "Hello\n";
  char *a, *e;
  int x;
  puts(array);
  a = array;
  printf("Array 'array' is %d bytes long at %p.\n\n\n", sizeof(array), a);
  for (x = 0; x < sizeof(array); x++) {
    e = &array[x];
    printf("Letter %d of the array is %c.\n\t", x, *e);
    printf("It is %d bytes long at %p.\n", sizeof(array[x]), e);
  }
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xeb5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xead(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xb(%rbp),%rdi
call   1030 <puts@plt>
lea    -0xb(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
lea    0xe8f(%rip),%rdi
mov    $0x7,%esi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    $0x7,%rax
jae    11e5 <main+0xb5>
movslq -0x24(%rbp),%rcx
lea    -0xb(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rax
movsbl (%rax),%edx
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdx
lea    0xe85(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    118b <main+0x5b>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movl   $0xa6f6c,0x3(%rsp)
movl   $0x6c6c6548,(%rsp)
lea    0x3(%rsp),%r15
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
mov    $0x7,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
movsbl (%rsp),%edx
lea    0xeb8(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec5(%rip),%r12
mov    %r12,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1(%rsp),%rbx
movsbl 0x1(%rsp),%edx
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x2(%rsp),%rbx
movsbl 0x2(%rsp),%edx
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x3(%rsp),%edx
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rbx
movsbl 0x4(%rsp),%edx
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x5(%rsp),%rbx
movsbl 0x5(%rsp),%edx
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x6(%rsp),%rbx
movsbl 0x6(%rsp),%edx
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.array = [7 x i8] c"Hello\0A\00"
@.str = [41 x i8] c"Array 'array' is %d bytes long at %p.\0A\0A\0A\00"
@.str.1 = [32 x i8] c"Letter %d of the array is %c.\0A\09\00"
@.str.2 = [28 x i8] c"It is %d bytes long at %p.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [7 x i8]* %2 to i8*
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%8 = call i32 @puts(i8* %7)
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 7, i8* %10)
store i32 0, i32* %5
br label %12
12: ; preds = %27, %0
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = icmp ult i64 %14, 7
br i1 %15, label %16, label %30
16: ; preds = %12
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 %18
store i8* %19, i8** %4
%20 = load i32, i32* %5
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %23)
%25 = load i8*, i8** %4
%26 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 1, i8* %25)
br label %27
27: ; preds = %16
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %12
30: ; preds = %12
%31 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [7 x i8] c"Hello\0A\00"
@.str = [41 x i8] c"Array 'array' is %d bytes long at %p.\0A\0A\0A\00"
@.str.1 = [32 x i8] c"Letter %d of the array is %c.\0A\09\00"
@.str.2 = [28 x i8] c"It is %d bytes long at %p.\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @puts(i8* %2)
%4 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 7, i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %6)
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 1, i8* %2)
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %11)
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 1, i8* %9)
%14 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 %16)
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 1, i8* %14)
%19 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 %21)
%23 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 1, i8* %19)
%24 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 4
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 %26)
%28 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 1, i8* %24)
%29 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 5
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 %31)
%33 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 1, i8* %29)
%34 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 6
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 %36)
%38 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 1, i8* %34)
%39 = call i32 (...) @getchar()
ret i32 0
}