#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*/ array_print(double **);
int /*<<< orphan*/ printf(char *, int, int, double);
int /*<<< orphan*/ putchar(char);
int main(void) {
  double array[2][2] = {{0.0, 0.1}, {1.0, 1.1}};
  {
    int element1, element2;
    for (element1 = 0; element1 < (2); ++element1) {
      for (element2 = 0; element2 < (2); ++element2)
        printf("array"
               "[%d][%d] = %f\n",
               element1, element2, array[element1][element2]);
    }
  };
  putchar('\n');
  double *pointer_array[2] = {array[0], array[1]};
  array_print(pointer_array);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x2,-0x34(%rbp)
jge    11d8 <main+0xa8>
movl   $0x0,-0x38(%rbp)
cmpl   $0x2,-0x38(%rbp)
jge    11c5 <main+0x95>
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
movslq -0x34(%rbp),%rcx
lea    -0x30(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1183 <main+0x53>
jmp    11ca <main+0x9a>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1172 <main+0x42>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x30(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x48(%rbp)
lea    -0x50(%rbp),%rdi
call   1050 <array_print@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movaps 0xef2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x20(%rsp),%r14
lea    0xee5(%rip),%rbx
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <printf@plt>
movsd  0xe8e(%rip),%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <printf@plt>
movsd  0xe7f(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <printf@plt>
movsd  0xe70(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x10(%rsp),%rax
mov    %rax,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rsp,%rdi
call   1050 <array_print@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@__const.main.array = [2 x [2 x double]] [[2 x double] [double 0.000000e+00, double 1.000000e-01], [2 x double] [double 1.000000e+00, double 1.100000e+00]]
@.str = [20 x i8] c"array[%d][%d] = %f\0A\00"
define i32 @main() {
%1 = alloca [2 x [2 x double]]
%2 = alloca [2 x double*]
%3 = bitcast [2 x [2 x double]]* %1 to i8*
%4 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %1, i64 0, i64 0, i64 0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, double 0.000000e+00)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, double 1.000000e-01)
%7 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %1, i64 0, i64 1, i64 0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, double 1.000000e+00)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, double 1.100000e+00)
%10 = tail call i32 @putchar(i8 signext 10)
%11 = bitcast [2 x double*]* %2 to i8*
%12 = getelementptr inbounds [2 x double*], [2 x double*]* %2, i64 0, i64 0
store double* %4, double** %12
%13 = getelementptr inbounds [2 x double*], [2 x double*]* %2, i64 0, i64 1
store double* %7, double** %13
%14 = call i32 @array_print(double** %12)
ret i32 0
}