#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*/ p;
typedef int /*<<< orphan*/ numbers;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int numbers[3] = {101, 202, 303};
  int size = sizeof(numbers) / sizeof(int);
  int *p = numbers;
  int *end = p + size;
  for (; p != end; p++) {
    printf("%d\n", *p);
  }
  char *onePastArray = (char *)p + size;
  printf("%c\n", *onePastArray);
  printf("sizeof(pointer): %d\n", (int)sizeof(p));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xed1(%rip),%eax
mov    %eax,-0x14(%rbp)
movl   $0x3,-0x20(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x20(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
je     118d <main+0x7d>
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
jmp    115c <main+0x4c>
mov    -0x28(%rbp),%rax
movslq -0x20(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movsbl (%rax),%esi
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
lea    0xe5a(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xefd(%rip),%rbx
mov    %rbx,%rdi
mov    $0x65,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xca,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x12f,%esi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.numbers = [3 x i32] [i32 101, i32 202, i32 303]
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%c\0A\00"
@.str.2 = [21 x i8] c"sizeof(pointer): %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i32]
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = bitcast [3 x i32]* %6 to i8*
store i32 3, i32* %7
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32* %12, i32** %8
%13 = load i32*, i32** %8
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32* %16, i32** %9
br label %17
17: ; preds = %25, %2
%18 = load i32*, i32** %8
%19 = load i32*, i32** %9
%20 = icmp ne i32* %18, %19
br i1 %20, label %21, label %28
21: ; preds = %17
%22 = load i32*, i32** %8
%23 = load i32, i32* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %21
%26 = load i32*, i32** %8
%27 = getelementptr inbounds i32, i32* %26, i32 1
store i32* %27, i32** %8
br label %17
28: ; preds = %17
%29 = load i32*, i32** %8
%30 = bitcast i32* %29 to i8*
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
store i8* %33, i8** %10
%34 = load i8*, i8** %10
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %36)
%38 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%c\0A\00"
@.str.2 = [21 x i8] c"sizeof(pointer): %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 101)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 202)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 303)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 poison)
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}