#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 *, double);
int main() {
  double tab2[2] = {1.5, 2.5};
  double tab3[3] = {3.5, 4.5, 5.5};
  double *tabptr[2] = {tab2, tab3};
  printf("%.2lf\n", tabptr[0][1]);
  printf("%.2lf\n", *tabptr[0]);
  printf("%.2lf\n", *(*(tabptr + 1) + 1));
  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,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x50(%rbp),%rax
movsd  0x8(%rax),%xmm0
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
movsd  0x8(%rax),%xmm0
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf00(%rip),%rbx
movsd  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xed8(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xed0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.tab2 = [2 x double] [double 1.500000e+00, double 2.500000e+00]
@__const.main.tab3 = [3 x double] [double 3.500000e+00, double 4.500000e+00, double 5.500000e+00]
@.str = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x double]
%3 = alloca [3 x double]
%4 = alloca [2 x double*]
store i32 0, i32* %1
%5 = bitcast [2 x double]* %2 to i8*
%6 = bitcast [3 x double]* %3 to i8*
%7 = getelementptr inbounds [2 x double*], [2 x double*]* %4, i64 0, i64 0
%8 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
store double* %8, double** %7
%9 = getelementptr inbounds double*, double** %7, i64 1
%10 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
store double* %10, double** %9
%11 = getelementptr inbounds [2 x double*], [2 x double*]* %4, i64 0, i64 0
%12 = load double*, double** %11
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %14)
%16 = getelementptr inbounds [2 x double*], [2 x double*]* %4, i64 0, i64 0
%17 = load double*, double** %16
%18 = load double, double* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %18)
%20 = getelementptr inbounds [2 x double*], [2 x double*]* %4, i64 0, i64 0
%21 = getelementptr inbounds double*, double** %20, i64 1
%22 = load double*, double** %21
%23 = getelementptr inbounds double, double* %22, i64 1
%24 = load double, double* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 2.500000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 1.500000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 4.500000e+00)
ret i32 0
}