#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 main(void) {
  short dates[4];
  short *prti;
  short index;
  double bills[4];
  double *prtf;
  prti = dates;
  prtf = bills;
  printf("%23s %10s\n", "short", "double");
  for (index = 0; index < 4; index++)
    printf("pointers + %d: %10p %10p \n", index, prti + index, prtf + index);
  printf("dates[0]=%p \n", dates);
  printf("dates[0]=%p \n", &dates[0]);
  printf("dates[0]=%d \n", dates[0]);
  printf("dates[0]=%d \n", *dates);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    0xeca(%rip),%rdi
lea    0xece(%rip),%rsi
lea    0xecd(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movw   $0x0,-0x1a(%rbp)
movswl -0x1a(%rbp),%eax
cmp    $0x4,%eax
jge    11a3 <main+0x93>
movswl -0x1a(%rbp),%esi
mov    -0x18(%rbp),%rdx
movswl -0x1a(%rbp),%eax
cltq
shl    $0x1,%rax
add    %rax,%rdx
mov    -0x48(%rbp),%rcx
movswl -0x1a(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rcx
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1a(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x1a(%rbp)
jmp    1151 <main+0x41>
lea    -0xc(%rbp),%rsi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xc(%rbp),%rsi
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movswl -0xc(%rbp),%esi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movswl -0xc(%rbp),%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xee2(%rip),%rdi
lea    0xee6(%rip),%rsi
lea    0xee5(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rbx
lea    0x8(%rsp),%r14
lea    0x10(%rsp),%rcx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xa(%rsp),%rdx
lea    0x18(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rdx
lea    0x20(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe(%rsp),%rdx
lea    0x28(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe8e(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movswl 0x8(%rsp),%esi
lea    0xe76(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movswl 0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%23s %10s\0A\00"
@.str.1 = [6 x i8] c"short\00"
@.str.2 = [7 x i8] c"double\00"
@.str.3 = [27 x i8] c"pointers + %d: %10p %10p \0A\00"
@.str.4 = [14 x i8] c"dates[0]=%p \0A\00"
@.str.5 = [14 x i8] c"dates[0]=%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i16]
%3 = alloca i16*
%4 = alloca i16
%5 = alloca [4 x double]
%6 = alloca double*
store i32 0, i32* %1
%7 = getelementptr inbounds [4 x i16], [4 x i16]* %2, i64 0, i64 0
store i16* %7, i16** %3
%8 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
store double* %8, double** %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
store i16 0, i16* %4
br label %10
10: ; preds = %28, %0
%11 = load i16, i16* %4
%12 = sext i16 %11 to i32
%13 = icmp slt i32 %12, 4
br i1 %13, label %14, label %31
14: ; preds = %10
%15 = load i16, i16* %4
%16 = sext i16 %15 to i32
%17 = load i16*, i16** %3
%18 = load i16, i16* %4
%19 = sext i16 %18 to i32
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i16, i16* %17, i64 %20
%22 = load double*, double** %6
%23 = load i16, i16* %4
%24 = sext i16 %23 to i32
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %22, i64 %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %16, i16* %21, double* %26)
br label %28
28: ; preds = %14
%29 = load i16, i16* %4
%30 = add i16 %29, 1
store i16 %30, i16* %4
br label %10
31: ; preds = %10
%32 = getelementptr inbounds [4 x i16], [4 x i16]* %2, i64 0, i64 0
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i16* %32)
%34 = getelementptr inbounds [4 x i16], [4 x i16]* %2, i64 0, i64 0
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i16* %34)
%36 = getelementptr inbounds [4 x i16], [4 x i16]* %2, i64 0, i64 0
%37 = load i16, i16* %36
%38 = sext i16 %37 to i32
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds [4 x i16], [4 x i16]* %2, i64 0, i64 0
%41 = load i16, i16* %40
%42 = sext i16 %41 to i32
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %42)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%23s %10s\0A\00"
@.str.1 = [6 x i8] c"short\00"
@.str.2 = [7 x i8] c"double\00"
@.str.3 = [27 x i8] c"pointers + %d: %10p %10p \0A\00"
@.str.4 = [14 x i8] c"dates[0]=%p \0A\00"
@.str.5 = [14 x i8] c"dates[0]=%d \0A\00"
define i32 @main() {
%1 = alloca [4 x i16]
%2 = alloca [4 x double]
%3 = bitcast [4 x i16]* %1 to i8*
%4 = bitcast [4 x double]* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%6 = getelementptr inbounds [4 x i16], [4 x i16]* %1, i64 0, i64 0
%7 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 0, i16* %6, double* %7)
%9 = getelementptr inbounds [4 x i16], [4 x i16]* %1, i64 0, i64 1
%10 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 1
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 1, i16* %9, double* %10)
%12 = getelementptr inbounds [4 x i16], [4 x i16]* %1, i64 0, i64 2
%13 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 2
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 2, i16* %12, double* %13)
%15 = getelementptr inbounds [4 x i16], [4 x i16]* %1, i64 0, i64 3
%16 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 3
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 3, i16* %15, double* %16)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i16* %6)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i16* %6)
%20 = load i16, i16* %6
%21 = sext i16 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %21)
%23 = load i16, i16* %6
%24 = sext i16 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %24)
ret i32 0
}