#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] = {0, 1, 2, 3};
  short *pti;
  short index;
  double bills[4] = {4, 5, 6, 7};
  double *ptf;
  pti = dates;
  ptf = bills;
  printf("%23s %15s %15s %15s\n", "short", "double", "short val", "double val");
  for (index = 0; index < 4; index++) {
    printf("pointers + %d: %10p %10p %7d %16.2f \n", index, &pti[index],
           ptf + index, pti[index], *(ptf + index));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xedc(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xed9(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    0xec3(%rip),%rdi
lea    0xed1(%rip),%rsi
lea    0xed0(%rip),%rdx
lea    0xed0(%rip),%rcx
lea    0xed3(%rip),%r8
mov    $0x0,%al
call   1030 <printf@plt>
movw   $0x0,-0x1a(%rbp)
movswl -0x1a(%rbp),%eax
cmp    $0x4,%eax
jge    1205 <main+0xf5>
movswl -0x1a(%rbp),%esi
mov    -0x18(%rbp),%rdx
movswq -0x1a(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdx
mov    -0x48(%rbp),%rcx
movswl -0x1a(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x18(%rbp),%rax
movswq -0x1a(%rbp),%rdi
movswl (%rax,%rdi,2),%r8d
mov    -0x48(%rbp),%rax
movswl -0x1a(%rbp),%edi
movslq %edi,%rdi
movsd  (%rax,%rdi,8),%xmm0
lea    0xe7a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1a(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x1a(%rbp)
jmp    1196 <main+0x86>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movabs $0x3000200010000,%rax
mov    %rax,0x8(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x20(%rsp),%r14
lea    0xee6(%rip),%rdi
lea    0xef4(%rip),%rsi
lea    0xef3(%rip),%rdx
lea    0xef3(%rip),%rcx
lea    0xef6(%rip),%r8
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef3(%rip),%rbx
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
movsd  0xe7a(%rip),%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
xor    %r8d,%r8d
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xa(%rsp),%rdx
lea    0x18(%rsp),%rcx
movswl 0xa(%rsp),%r8d
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xc(%rsp),%rdx
movswl 0xc(%rsp),%r8d
movsd  0x20(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %r14,%rcx
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe(%rsp),%rdx
lea    0x28(%rsp),%rcx
movswl 0xe(%rsp),%r8d
movsd  0x28(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@__const.main.bills = [4 x double] [double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00]
@.str = [21 x i8] c"%23s %15s %15s %15s\0A\00"
@.str.1 = [6 x i8] c"short\00"
@.str.2 = [7 x i8] c"double\00"
@.str.3 = [10 x i8] c"short val\00"
@.str.4 = [11 x i8] c"double val\00"
@.str.5 = [38 x i8] c"pointers + %d: %10p %10p %7d %16.2f \0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca [4 x double]
%3 = bitcast i64* %1 to i8*
store i64 844433520132096, i64* %1
%4 = bitcast [4 x double]* %2 to i8*
%5 = bitcast i64* %1 to i16*
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 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), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, 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 ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i32 0, i64* %1, double* %7, i32 0, double 4.000000e+00)
%9 = getelementptr inbounds i16, i16* %5, i64 1
%10 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 1
%11 = load i16, i16* %9
%12 = sext i16 %11 to i32
%13 = load double, double* %10
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i32 1, i16* %9, double* %10, i32 %12, double %13)
%15 = getelementptr inbounds i16, i16* %5, i64 2
%16 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 2
%17 = load i16, i16* %15
%18 = sext i16 %17 to i32
%19 = load double, double* %16
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i32 2, i16* %15, double* %16, i32 %18, double %19)
%21 = getelementptr inbounds i16, i16* %5, i64 3
%22 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 3
%23 = load i16, i16* %21
%24 = sext i16 %23 to i32
%25 = load double, double* %22
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i32 3, i16* %21, double* %22, i32 %24, double %25)
ret i32 0
}