int main() {
  int arr[] = {1, 2, 3, 5};
  char msg[] = "Test msg";
  int *p = arr;
  char *ch = msg;
  int arr_length = sizeof(arr) / sizeof(int);
  puts("arr = [");
  for (int i = 0; i < arr_length; i++) {
    printf(" %i ", arr[i]);
  }
  puts("]\n");
  printf("msg: %s\n", msg);
  printf("&msg: %p\n", &msg);
  puts("======");
  printf("ch: %s\n", ch);
  printf("&ch: %p\n", &ch);
  puts("======");
  printf("arr[0]: %i\n", arr[0]);
  printf("*arr: %i\n", *arr);
  printf("*(arr + 2): %i\n", *(arr + 2));
  printf("2[arr]: %i\n", 2 [arr]);
  printf("*(p + 50): %i\n", *(p + 50));
  printf("p + 50: %p\n", p + 50);
  puts("======");
  printf("&arr: %p\n", &arr);
  printf("p: %p\n", p);
  printf("arr: %p\n", arr);
  printf("arr == p == &arr = %p\n", arr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x29(%rbp)
mov    0xec2(%rip),%al
mov    %al,-0x21(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x29(%rbp),%rax
mov    %rax,-0x40(%rbp)
movl   $0x4,-0x44(%rbp)
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    11b5 <main+0x95>
movslq -0x48(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1185 <main+0x65>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    -0x29(%rbp),%rsi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe56(%rip),%rdi
lea    -0x29(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0x40(%rbp),%rsi
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe3d(%rip),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0x20(%rbp),%esi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rax
mov    0xc8(%rax),%esi
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rsi
add    $0xc8,%rsi
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xdf0(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xdc7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
movaps 0xed0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movabs $0x67736d2074736554,%rax
6d 73 67
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
lea    0x8(%rsp),%r15
mov    %r15,0x18(%rsp)
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe7b(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xe70(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe68(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe61(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xe57(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe4e(%rip),%rdi
lea    0x18(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xe3a(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe33(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe2a(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe27(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8(%rsp),%rbx
lea    0xe18(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe19(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xe0a(%rip),%rdi
lea    0x20(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdfe(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xde4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xde3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@__const.main.arr = [4 x i32] [i32 1, i32 2, i32 3, i32 5]
@__const.main.msg = [9 x i8] c"Test msg\00"
@.str = [8 x i8] c"arr = [\00"
@.str.1 = [5 x i8] c" %i \00"
@.str.2 = [3 x i8] c"]\0A\00"
@.str.3 = [9 x i8] c"msg: %s\0A\00"
@.str.4 = [10 x i8] c"&msg: %p\0A\00"
@.str.5 = [7 x i8] c"======\00"
@.str.6 = [8 x i8] c"ch: %s\0A\00"
@.str.7 = [9 x i8] c"&ch: %p\0A\00"
@.str.8 = [12 x i8] c"arr[0]: %i\0A\00"
@.str.9 = [10 x i8] c"*arr: %i\0A\00"
@.str.10 = [16 x i8] c"*(arr + 2): %i\0A\00"
@.str.11 = [12 x i8] c"2[arr]: %i\0A\00"
@.str.12 = [15 x i8] c"*(p + 50): %i\0A\00"
@.str.13 = [12 x i8] c"p + 50: %p\0A\00"
@.str.14 = [10 x i8] c"&arr: %p\0A\00"
@.str.15 = [7 x i8] c"p: %p\0A\00"
@.str.16 = [9 x i8] c"arr: %p\0A\00"
@.str.17 = [23 x i8] c"arr == p == &arr = %p\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca [9 x i8]
%3 = alloca i8*
%4 = bitcast [4 x i32]* %1 to i8*
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%6 = bitcast i8** %3 to i8*
store i8* %5, i8** %3
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 5)
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), [9 x i8]* %2)
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %5)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8** %3)
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 1)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 1)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 3)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i32 3)
%24 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 50
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32 undef)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), i32* %24)
%27 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), [4 x i32]* %1)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i32* %8)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i32* %8)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.17, i64 0, i64 0), i32* %8)
ret i32 0
}