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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x5,-0x34(%rbp)
jge    11a4 <main+0x94>
mov    -0x30(%rbp),%rsi
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
lea    0xea2(%rip),%rdi
movsbl %al,%edx
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x30(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1167 <main+0x57>
movl   $0x0,-0x38(%rbp)
cmpl   $0x5,-0x38(%rbp)
jge    11e6 <main+0xd6>
mov    -0x28(%rbp),%rsi
mov    -0x28(%rbp),%rax
lea    0xe9f(%rip),%rdi
movsbl (%rax),%edx
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11ab <main+0x9b>
xor    %eax,%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),%r14
mov    0xeef(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x20(%rsp),%r15
lea    0xed7(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
movsbl 0x14(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
movsbl 0x18(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x1c(%rsp),%rsi
movsbl 0x1c(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0x20(%rsp),%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
lea    0xeb7(%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    %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"[integer pointer] points to %p, which contains the integer %d\0A\00"
@.str.1 = [59 x i8] c"[char pointer] points to %p, which contains the char '%c'\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
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [5 x i8]* %2 to i8*
%9 = bitcast [5 x i32]* %3 to i8*
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
store i8* %10, i8** %4
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
store i32* %11, i32** %5
store i32 0, i32* %6
br label %12
12: ; preds = %24, %0
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 5
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = load i32*, i32** %5
%17 = bitcast i32* %16 to i8*
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = trunc i32 %19 to i8
%21 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %17, i8 signext %20)
%22 = load i32*, i32** %5
%23 = getelementptr inbounds i32, i32* %22, i64 1
store i32* %23, i32** %5
br label %24
24: ; preds = %15
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %12
27: ; preds = %12
store i32 0, i32* %7
br label %28
28: ; preds = %38, %27
%29 = load i32, i32* %7
%30 = icmp slt i32 %29, 5
br i1 %30, label %31, label %41
31: ; preds = %28
%32 = load i8*, i8** %4
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %32, i8 signext %34)
%36 = load i8*, i8** %4
%37 = getelementptr inbounds i8, i8* %36, i64 1
store i8* %37, i8** %4
br label %38
38: ; preds = %31
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 1
store i32 %40, i32* %7
br label %28
41: ; preds = %28
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 = [63 x i8] c"[integer pointer] points to %p, which contains the integer %d\0A\00"
@.str.1 = [59 x i8] c"[char pointer] points to %p, which contains the char '%c'\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 = bitcast [5 x i32]* %2 to i8*
%6 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %5, i8 signext 1)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 1
%8 = bitcast i32* %7 to i8*
%9 = load i32, i32* %7
%10 = trunc i32 %9 to i8
%11 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %8, i8 signext %10)
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 2
%13 = bitcast i32* %12 to i8*
%14 = load i32, i32* %12
%15 = trunc i32 %14 to i8
%16 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %13, i8 signext %15)
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
%18 = bitcast i32* %17 to i8*
%19 = load i32, i32* %17
%20 = trunc i32 %19 to i8
%21 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %18, i8 signext %20)
%22 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 4
%23 = bitcast i32* %22 to i8*
%24 = load i32, i32* %22
%25 = trunc i32 %24 to i8
%26 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %23, i8 signext %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8 signext 97)
%28 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 1
%29 = load i8, i8* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %28, i8 signext %29)
%31 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 2
%32 = load i8, i8* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %31, i8 signext %32)
%34 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 3
%35 = load i8, i8* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %34, i8 signext %35)
%37 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 4
%38 = load i8, i8* %37
%39 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i8* %37, i8 signext %38)
ret i32 0
}