#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 *, unsigned long, int);
int main() {
  int i;
  char char_array[5] = {'a', 'b', 'c', 'd', 'e'};
  int int_array[5] = {1, 2, 3, 4, 5};
  unsigned long hacky_nonpointer;
  hacky_nonpointer = (unsigned long)char_array;
  for (i = 0; i < 5; i++) {
    printf("[hacky_nonpointer] points to %p, which contains the char '%c'\n",
           hacky_nonpointer, *((char *)hacky_nonpointer));
    hacky_nonpointer = (unsigned long)((char *)hacky_nonpointer + 1);
  }
  hacky_nonpointer = (unsigned long)int_array;
  for (i = 0; i < 5; i++) {
    printf("[hacky_nonpointer] points to %p, which contains the integer %d\n",
           hacky_nonpointer, *((int *)hacky_nonpointer));
    hacky_nonpointer += sizeof(int);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xd(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x9(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed5(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed3(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0xd(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    119a <main+0x8a>
mov    -0x38(%rbp),%rsi
mov    -0x38(%rbp),%rax
movsbl (%rax),%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115f <main+0x4f>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11e3 <main+0xd3>
mov    -0x38(%rbp),%rsi
mov    -0x38(%rbp),%rax
mov    (%rax),%edx
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a9 <main+0x99>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
movb   $0x65,0xc(%rsp)
movl   $0x64636261,0x8(%rsp)
64
lea    0xc(%rsp),%r15
mov    0xeef(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x20(%rsp),%r14
lea    0xed7(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x61,%edx
call   1030 <printf@plt>
lea    0x9(%rsp),%rsi
movsbl 0x9(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xa(%rsp),%rsi
movsbl 0xa(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xb(%rsp),%rsi
movsbl 0xb(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xc(%rsp),%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
mov    0x10(%rsp),%edx
lea    0xeb3(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
mov    0x14(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
mov    0x18(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    0x1c(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.char_array = [5 x i8] c"abcde"
@__const.main.int_array = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [63 x i8] c"[hacky_nonpointer] points to %p, which contains the char '%c'\0A\00"
@.str.1 = [64 x i8] c"[hacky_nonpointer] points to %p, which contains the integer %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x i8]
%4 = alloca [5 x i32]
%5 = alloca i64
store i32 0, i32* %1
%6 = bitcast [5 x i8]* %3 to i8*
%7 = bitcast [5 x i32]* %4 to i8*
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%9 = ptrtoint i8* %8 to i64
store i64 %9, i64* %5
store i32 0, i32* %2
br label %10
10: ; preds = %24, %0
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %27
13: ; preds = %10
%14 = load i64, i64* %5
%15 = load i64, i64* %5
%16 = inttoptr i64 %15 to i8*
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i64 %14, i32 %18)
%20 = load i64, i64* %5
%21 = inttoptr i64 %20 to i8*
%22 = getelementptr inbounds i8, i8* %21, i64 1
%23 = ptrtoint i8* %22 to i64
store i64 %23, i64* %5
br label %24
24: ; preds = %13
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %10
27: ; preds = %10
%28 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%29 = ptrtoint i32* %28 to i64
store i64 %29, i64* %5
store i32 0, i32* %2
br label %30
30: ; preds = %41, %27
%31 = load i32, i32* %2
%32 = icmp slt i32 %31, 5
br i1 %32, label %33, label %44
33: ; preds = %30
%34 = load i64, i64* %5
%35 = load i64, i64* %5
%36 = inttoptr i64 %35 to i32*
%37 = load i32, i32* %36
%38 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i64 %34, i32 %37)
%39 = load i64, i64* %5
%40 = add i64 %39, 4
store i64 %40, i64* %5
br label %41
41: ; preds = %33
%42 = load i32, i32* %2
%43 = add nsw i32 %42, 1
store i32 %43, i32* %2
br label %30
44: ; preds = %30
%45 = load i32, i32* %1
ret i32 %45
}

LLVM IR (-O2):
@__const.main.char_array = [5 x i8] c"abcde"
@__const.main.int_array = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [63 x i8] c"[hacky_nonpointer] points to %p, which contains the char '%c'\0A\00"
@.str.1 = [64 x i8] c"[hacky_nonpointer] points to %p, which contains the integer %d\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [5 x i32]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = bitcast [5 x i32]* %2 to i8*
%5 = ptrtoint [5 x i8]* %1 to i64
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i64 %5, i32 %8)
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 1
%11 = ptrtoint i8* %10 to i64
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i64 %11, i32 %13)
%15 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 2
%16 = ptrtoint i8* %15 to i64
%17 = load i8, i8* %15
%18 = sext i8 %17 to i32
%19 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i64 %16, i32 %18)
%20 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 3
%21 = ptrtoint i8* %20 to i64
%22 = load i8, i8* %20
%23 = sext i8 %22 to i32
%24 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i64 %21, i32 %23)
%25 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 4
%26 = ptrtoint i8* %25 to i64
%27 = load i8, i8* %25
%28 = sext i8 %27 to i32
%29 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i64 %26, i32 %28)
%30 = ptrtoint [5 x i32]* %2 to i64
%31 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%32 = load i32, i32* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i64 %30, i32 %32)
%34 = or i64 %30, 4
%35 = inttoptr i64 %34 to i32*
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i64 %34, i32 %36)
%38 = or i64 %30, 8
%39 = inttoptr i64 %38 to i32*
%40 = load i32, i32* %39
%41 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i64 %38, i32 %40)
%42 = or i64 %30, 12
%43 = inttoptr i64 %42 to i32*
%44 = load i32, i32* %43
%45 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i64 %42, i32 %44)
%46 = add i64 %30, 16
%47 = inttoptr i64 %46 to i32*
%48 = load i32, i32* %47
%49 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i64 %46, i32 %48)
ret i32 0
}