#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 int, int);
int main() {
  int i;
  char char_array[5] = {'a', 'b', 'c', 'd', 'e'};
  int int_array[5] = {1, 2, 3, 4, 5};
  unsigned int hacky_nonpointer;
  hacky_nonpointer = (unsigned int)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 = hacky_nonpointer + sizeof(char);
  }
  hacky_nonpointer = (unsigned int)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 = 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    %eax,-0x34(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1195 <main+0x85>
mov    -0x34(%rbp),%esi
mov    -0x34(%rbp),%eax
movsbl (%rax),%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%rax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115e <main+0x4e>
lea    -0x30(%rbp),%rax
mov    %eax,-0x34(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11d9 <main+0xc9>
mov    -0x34(%rbp),%esi
mov    -0x34(%rbp),%eax
mov    (%rax),%edx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x4,%rax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a3 <main+0x93>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movb   $0x65,0xc(%rsp)
movl   $0x64636261,0x8(%rsp)
64
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    %esi,%ebx
movsbl (%rbx),%edx
lea    0xed9(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0x1(%rbx),%rsi
movsbl 0x1(%rbx),%edx
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0x2(%rbx),%rsi
movsbl 0x2(%rbx),%edx
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0x3(%rbx),%rsi
movsbl 0x3(%rbx),%edx
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x4,%rbx
mov    %ebx,%eax
movsbl (%rax),%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %esi,%ebx
mov    (%rbx),%edx
lea    0xebd(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0x4(%rbx),%rsi
mov    0x4(%rbx),%edx
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0x8(%rbx),%rsi
mov    0x8(%rbx),%edx
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0xc(%rbx),%rsi
mov    0xc(%rbx),%edx
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x10,%rbx
mov    %ebx,%eax
mov    (%rax),%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
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 i32
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 i32
store i32 %9, i32* %5
store i32 0, i32* %2
br label %10
10: ; preds = %25, %0
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %28
13: ; preds = %10
%14 = load i32, i32* %5
%15 = load i32, i32* %5
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %19)
%21 = load i32, i32* %5
%22 = zext i32 %21 to i64
%23 = add i64 %22, 1
%24 = trunc i64 %23 to i32
store i32 %24, i32* %5
br label %25
25: ; preds = %13
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %10
28: ; preds = %10
%29 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%30 = ptrtoint i32* %29 to i32
store i32 %30, i32* %5
store i32 0, i32* %2
br label %31
31: ; preds = %45, %28
%32 = load i32, i32* %2
%33 = icmp slt i32 %32, 5
br i1 %33, label %34, label %48
34: ; preds = %31
%35 = load i32, i32* %5
%36 = load i32, i32* %5
%37 = zext i32 %36 to i64
%38 = inttoptr i64 %37 to i32*
%39 = load i32, i32* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i32 %35, i32 %39)
%41 = load i32, i32* %5
%42 = zext i32 %41 to i64
%43 = add i64 %42, 4
%44 = trunc i64 %43 to i32
store i32 %44, i32* %5
br label %45
45: ; preds = %34
%46 = load i32, i32* %2
%47 = add nsw i32 %46, 1
store i32 %47, i32* %2
br label %31
48: ; preds = %31
%49 = load i32, i32* %1
ret i32 %49
}

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 = trunc i64 %5 to i32
%7 = and i64 %5, 4294967295
%8 = inttoptr i64 %7 to i8*
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = trunc i64 %12 to i32
%14 = and i64 %12, 4294967295
%15 = inttoptr i64 %14 to i8*
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %17)
%19 = add nuw nsw i64 %14, 1
%20 = trunc i64 %19 to i32
%21 = and i64 %19, 4294967295
%22 = inttoptr i64 %21 to i8*
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %24)
%26 = add nuw nsw i64 %21, 1
%27 = trunc i64 %26 to i32
%28 = and i64 %26, 4294967295
%29 = inttoptr i64 %28 to i8*
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %27, i32 %31)
%33 = add nuw nsw i64 %28, 1
%34 = trunc i64 %33 to i32
%35 = and i64 %33, 4294967295
%36 = inttoptr i64 %35 to i8*
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %34, i32 %38)
%40 = ptrtoint [5 x i32]* %2 to i64
%41 = trunc i64 %40 to i32
%42 = and i64 %40, 4294967280
%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), i32 %41, i32 %44)
%46 = or i64 %42, 4
%47 = trunc i64 %46 to i32
%48 = inttoptr i64 %46 to i32*
%49 = load i32, i32* %48
%50 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i32 %47, i32 %49)
%51 = or i64 %42, 8
%52 = trunc i64 %51 to i32
%53 = inttoptr i64 %51 to i32*
%54 = load i32, i32* %53
%55 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i32 %52, i32 %54)
%56 = or i64 %42, 12
%57 = trunc i64 %56 to i32
%58 = inttoptr i64 %56 to i32*
%59 = load i32, i32* %58
%60 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i32 %57, i32 %59)
%61 = add nuw nsw i64 %42, 16
%62 = trunc i64 %61 to i32
%63 = and i64 %61, 4294967280
%64 = inttoptr i64 %63 to i32*
%65 = load i32, i32* %64
%66 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i32 %62, i32 %65)
ret i32 0
}