#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 main() {
  int *p = 0;
  int val1 = 100;
  int i = 0;
  int arr1[100];
  for (i = 0; i < 30; i++) {
    arr1[i] = i;
  };
  p = arr1;
  printf("p = %p as pointer and %d as digital;\n\n", p, *p);
  for (i = 0; i < 3; i++) {
    p++;
    printf("p = %p as pointer and %d as digital;\n", p, *p);
  };
  printf("-----------\n");
  for (i = 0; i < 3; i++) {
    p += 1;
    printf("p = %p as pointer and %d as digital;\n", p, *p);
  };
  printf("-----------\n");
  for (i = 0; i < 3; i++) {
    p += 5;
    printf("p = %p as pointer and %d as digital;\n", p, *p);
  };
  printf("-----------\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0x64,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1e,-0x10(%rbp)
jge    115e <main+0x4e>
mov    -0x10(%rbp),%ecx
movslq -0x10(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <main+0x28>
lea    -0x1a0(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    11c4 <main+0xb4>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1188 <main+0x78>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1215 <main+0x105>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11d9 <main+0xc9>
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1266 <main+0x156>
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    122a <main+0x11a>
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x198,%rsp
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%r15
movaps 0xecb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0x40(%rsp),%r14
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movabs $0x1d0000001c,%rax
mov    %rax,0x70(%rsp)
lea    0xecf(%rip),%rdi
mov    %rsp,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    0x4(%rsp),%edx
lea    0xeda(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec9(%rip),%r12
mov    %r12,%rdi
call   1030 <puts@plt>
mov    0x10(%rsp),%edx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x14(%rsp),%rsi
mov    0x14(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x18(%rsp),%rsi
mov    0x18(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
lea    0x2c(%rsp),%rsi
mov    0x2c(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x40(%rsp),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x54(%rsp),%rsi
mov    0x54(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [39 x i8] c"p = %p as pointer and %d as digital;\0A\0A\00"
@.str.1 = [38 x i8] c"p = %p as pointer and %d as digital;\0A\00"
@.str.2 = [13 x i8] c"-----------\0A\00"
define void @main() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i32]
store i32* null, i32** %1
store i32 100, i32* %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 30
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %11
store i32 %9, i32* %12
br label %13
13: ; preds = %8
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
store i32* %17, i32** %1
%18 = load i32*, i32** %1
%19 = load i32*, i32** %1
%20 = load i32, i32* %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32* %18, i32 %20)
store i32 0, i32* %3
br label %22
22: ; preds = %32, %16
%23 = load i32, i32* %3
%24 = icmp slt i32 %23, 3
br i1 %24, label %25, label %35
25: ; preds = %22
%26 = load i32*, i32** %1
%27 = getelementptr inbounds i32, i32* %26, i32 1
store i32* %27, i32** %1
%28 = load i32*, i32** %1
%29 = load i32*, i32** %1
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32* %28, i32 %30)
br label %32
32: ; preds = %25
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %22
35: ; preds = %22
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %37
37: ; preds = %47, %35
%38 = load i32, i32* %3
%39 = icmp slt i32 %38, 3
br i1 %39, label %40, label %50
40: ; preds = %37
%41 = load i32*, i32** %1
%42 = getelementptr inbounds i32, i32* %41, i64 1
store i32* %42, i32** %1
%43 = load i32*, i32** %1
%44 = load i32*, i32** %1
%45 = load i32, i32* %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32* %43, i32 %45)
br label %47
47: ; preds = %40
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 1
store i32 %49, i32* %3
br label %37
50: ; preds = %37
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %52
52: ; preds = %62, %50
%53 = load i32, i32* %3
%54 = icmp slt i32 %53, 3
br i1 %54, label %55, label %65
55: ; preds = %52
%56 = load i32*, i32** %1
%57 = getelementptr inbounds i32, i32* %56, i64 5
store i32* %57, i32** %1
%58 = load i32*, i32** %1
%59 = load i32*, i32** %1
%60 = load i32, i32* %59
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32* %58, i32 %60)
br label %62
62: ; preds = %55
%63 = load i32, i32* %3
%64 = add nsw i32 %63, 1
store i32 %64, i32* %3
br label %52
65: ; preds = %52
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"p = %p as pointer and %d as digital;\0A\0A\00"
@.str.1 = [38 x i8] c"p = %p as pointer and %d as digital;\0A\00"
@str.4 = [12 x i8] c"-----------\00"
define void @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%4 = bitcast [100 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %4
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 4
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %6
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 8
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %8
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 12
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, <4 x i32>* %10
%11 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 16
%12 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> <i32 16, i32 17, i32 18, i32 19>, <4 x i32>* %12
%13 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 20
%14 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> <i32 20, i32 21, i32 22, i32 23>, <4 x i32>* %14
%15 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 24
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> <i32 24, i32 25, i32 26, i32 27>, <4 x i32>* %16
%17 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 28
store i32 28, i32* %17
%18 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 29
store i32 29, i32* %18
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32* %3, i32 0)
%20 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 1
%21 = load i32, i32* %20
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32* %20, i32 %21)
%23 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 2
%24 = load i32, i32* %23
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32* %23, i32 %24)
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 3
%27 = load i32, i32* %26
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32* %26, i32 %27)
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0))
%30 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 4
%31 = load i32, i32* %30
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32* %30, i32 %31)
%33 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 5
%34 = load i32, i32* %33
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32* %33, i32 %34)
%36 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 6
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32* %36, i32 %37)
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0))
%40 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 11
%41 = load i32, i32* %40
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32* %40, i32 %41)
%43 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 16
%44 = load i32, i32* %43
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32* %43, i32 %44)
%46 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 21
%47 = load i32, i32* %46
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32* %46, i32 %47)
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0))
ret void
}