#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 *, int, ...);
void test_interview_one() {
  int a[5] = {1, 2, 3, 4, 5};
  int b_tmp = 8;
  int c_tmp = 9;
  int *ptr_a = a;
  printf("ptr a =%d \n", *(ptr_a + 1));
  int *ptr = (int *)(&a + 1);
  printf("ptr=%d \n", *(ptr));
  printf("interview one: %d,%d \n", *(a + 1), *(ptr - 1));
}


x86 assembly (clang, -O0):
<test_interview_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x8,-0x24(%rbp)
movl   $0x9,-0x28(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
mov    -0x38(%rbp),%rax
mov    -0x4(%rax),%edx
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_interview_one>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x2,%esi
mov    $0x5,%edx
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.test_interview_one.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [12 x i8] c"ptr a =%d \0A\00"
@.str.1 = [9 x i8] c"ptr=%d \0A\00"
@.str.2 = [23 x i8] c"interview one: %d,%d \0A\00"
define void @test_interview_one() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = bitcast [5 x i32]* %1 to i8*
store i32 8, i32* %2
store i32 9, i32* %3
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 1
%13 = bitcast [5 x i32]* %12 to i32*
store i32* %13, i32** %5
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = load i32*, i32** %5
%21 = getelementptr inbounds i32, i32* %20, i64 -1
%22 = load i32, i32* %21
%23 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %19, i32 %22)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"ptr a =%d \0A\00"
@.str.1 = [9 x i8] c"ptr=%d \0A\00"
@.str.2 = [23 x i8] c"interview one: %d,%d \0A\00"
define void @test_interview_one() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 poison)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 5)
ret void
}