#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 *, void *, int);
int main() {
  char char_array[5] = {'a', 'b', 'c', 'd', 'e'};
  int int_array[5] = {1, 2, 3, 4, 5};
  void *void_pointer;
  void_pointer = (void *)char_array;
  for (int i = 0; i < 5; ++i) {
    printf("[char pointer] points to %p, which contains the char '%c'\n",
           void_pointer, *((char *)void_pointer));
    void_pointer = (void *)((char *)void_pointer + 1);
  }
  void_pointer = (void *)int_array;
  for (int i = 0; i < 5; ++i) {
    printf("[integer pointer] points to %p, which contains the integer %d\n",
           void_pointer, *((int *)void_pointer));
    void_pointer = (void *)((int *)void_pointer + 1);
  }
  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)
mov    0xed8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed5(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed3(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jge    119a <main+0x8a>
mov    -0x28(%rbp),%rsi
mov    -0x28(%rbp),%rax
movsbl (%rax),%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    115f <main+0x4f>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x30(%rbp)
cmpl   $0x5,-0x30(%rbp)
jge    11e3 <main+0xd3>
mov    -0x28(%rbp),%rsi
mov    -0x28(%rbp),%rax
mov    (%rax),%edx
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11a9 <main+0x99>
xor    %eax,%eax
add    $0x30,%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>
lea    0xeb3(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
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 = [59 x i8] c"[char pointer] points to %p, which contains the char '%c'\0A\00"
@.str.1 = [63 x i8] c"[integer pointer] points to %p, which contains the integer %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca [5 x i32]
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [5 x i8]* %2 to i8*
%8 = bitcast [5 x i32]* %3 to i8*
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
store i8* %9, i8** %4
store i32 0, i32* %5
br label %10
10: ; preds = %21, %0
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %24
13: ; preds = %10
%14 = load i8*, i8** %4
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %17)
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 1
store i8* %20, i8** %4
br label %21
21: ; preds = %13
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %10
24: ; preds = %10
%25 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%26 = bitcast i32* %25 to i8*
store i8* %26, i8** %4
store i32 0, i32* %6
br label %27
27: ; preds = %40, %24
%28 = load i32, i32* %6
%29 = icmp slt i32 %28, 5
br i1 %29, label %30, label %43
30: ; preds = %27
%31 = load i8*, i8** %4
%32 = load i8*, i8** %4
%33 = bitcast i8* %32 to i32*
%34 = load i32, i32* %33
%35 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %31, i32 %34)
%36 = load i8*, i8** %4
%37 = bitcast i8* %36 to i32*
%38 = getelementptr inbounds i32, i32* %37, i64 1
%39 = bitcast i32* %38 to i8*
store i8* %39, i8** %4
br label %40
40: ; preds = %30
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %27
43: ; preds = %27
ret i32 0
}

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 = [59 x i8] c"[char pointer] points to %p, which contains the char '%c'\0A\00"
@.str.1 = [63 x i8] c"[integer pointer] 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 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %3, i32 97)
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 1
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %8)
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %12)
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %16)
%18 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 4
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %18, i32 %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 1)
%23 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 1
%24 = bitcast i32* %23 to i8*
%25 = load i32, i32* %23
%26 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %24, i32 %25)
%27 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 2
%28 = bitcast i32* %27 to i8*
%29 = load i32, i32* %27
%30 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %28, i32 %29)
%31 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
%32 = bitcast i32* %31 to i8*
%33 = load i32, i32* %31
%34 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %32, i32 %33)
%35 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 4
%36 = bitcast i32* %35 to i8*
%37 = load i32, i32* %35
%38 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %36, i32 %37)
ret i32 0
}