#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 /*<<< orphan*/ run_example(double *, double const **, int);
int main() {
  double a1[] = {0, 0, 1, 5, 2, 0, -1, 3, 3, 3};
  const double *c1[] = {a1, a1 + 10};
  int s1 = 2;
  run_example(a1, c1, 2);
  printf("\n");
  double a2[] = {0, 0, 3, 0, 3, 3, 0, 3, 1, 1, 2, 1, 2, 2, 1, 2};
  const double *c2[] = {a2, a2 + 8, a2 + 16};
  int s2 = 3;
  run_example(a2, c2, s2);
  printf("\n");
  double a3[] = {441, 0,   326, 0,   326, 889, 12,  889,
                 12,  992, 755, 992, 755, 889, 441, 889};
  const double *c3[] = {a3, a3 + 16};
  int s3 = 2;
  run_example(a3, c3, s3);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x50,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rax
mov    %rax,-0x70(%rbp)
lea    -0x60(%rbp),%rax
add    $0x50,%rax
mov    %rax,-0x68(%rbp)
movl   $0x2,-0x74(%rbp)
lea    -0x60(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    $0x2,%edx
call   1050 <run_example@plt>
lea    0xfc5(%rip),%rdi
call   1030 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    0xeb2(%rip),%rsi
mov    $0x80,%edx
call   1040 <memcpy@plt>
lea    -0x100(%rbp),%rax
mov    %rax,-0x120(%rbp)
lea    -0x100(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x118(%rbp)
lea    -0x100(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x110(%rbp)
movl   $0x3,-0x124(%rbp)
lea    -0x100(%rbp),%rdi
lea    -0x120(%rbp),%rsi
mov    -0x124(%rbp),%edx
call   1050 <run_example@plt>
lea    0xf4a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x1b0(%rbp),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x80,%edx
call   1040 <memcpy@plt>
lea    -0x1b0(%rbp),%rax
mov    %rax,-0x1c0(%rbp)
lea    -0x1b0(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x1b8(%rbp)
movl   $0x2,-0x1c4(%rbp)
lea    -0x1b0(%rbp),%rdi
lea    -0x1c0(%rbp),%rsi
mov    -0x1c4(%rbp),%edx
call   1050 <run_example@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x198,%rsp
movaps 0xf12(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe9f(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x40(%rsp),%rdi
mov    %rdi,0x10(%rsp)
lea    0x90(%rsp),%rax
mov    %rax,0x18(%rsp)
lea    0x10(%rsp),%rsi
mov    $0x2,%edx
call   1040 <run_example@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movaps 0xf23(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0xf04(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xea7(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xe88(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xe69(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xe4a(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
lea    0xd0(%rsp),%rax
lea    0x90(%rsp),%rdi
mov    %rdi,0x20(%rsp)
mov    %rax,0x28(%rsp)
lea    0x110(%rsp),%rax
mov    %rax,0x30(%rsp)
lea    0x20(%rsp),%rsi
mov    $0x3,%edx
call   1040 <run_example@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x180(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps 0xe8e(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movaps 0xe6f(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movaps 0xe50(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps 0xe31(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0xe12(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
lea    0x110(%rsp),%rdi
mov    %rdi,(%rsp)
lea    0x190(%rsp),%rax
mov    %rax,0x8(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edx
call   1040 <run_example@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x198,%rsp
ret

LLVM IR (-O0):
@__const.main.a1 = [10 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+00, double 5.000000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 3.000000e+00]
@.str = [2 x i8] c"\0A\00"
@__const.main.a2 = [16 x double] [double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double 0.000000e+00, double 3.000000e+00, double 3.000000e+00, double 0.000000e+00, double 3.000000e+00, double 1.000000e+00, double 1.000000e+00, double 2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 2.000000e+00, double 1.000000e+00, double 2.000000e+00]
@__const.main.a3 = [16 x double] [double 4.410000e+02, double 0.000000e+00, double 3.260000e+02, double 0.000000e+00, double 3.260000e+02, double 8.890000e+02, double 1.200000e+01, double 8.890000e+02, double 1.200000e+01, double 9.920000e+02, double 7.550000e+02, double 9.920000e+02, double 7.550000e+02, double 8.890000e+02, double 4.410000e+02, double 8.890000e+02]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x double]
%3 = alloca [2 x double*]
%4 = alloca i32
%5 = alloca [16 x double]
%6 = alloca [3 x double*]
%7 = alloca i32
%8 = alloca [16 x double]
%9 = alloca [2 x double*]
%10 = alloca i32
store i32 0, i32* %1
%11 = bitcast [10 x double]* %2 to i8*
%12 = getelementptr inbounds [2 x double*], [2 x double*]* %3, i64 0, i64 0
%13 = getelementptr inbounds [10 x double], [10 x double]* %2, i64 0, i64 0
store double* %13, double** %12
%14 = getelementptr inbounds double*, double** %12, i64 1
%15 = getelementptr inbounds [10 x double], [10 x double]* %2, i64 0, i64 0
%16 = getelementptr inbounds double, double* %15, i64 10
store double* %16, double** %14
store i32 2, i32* %4
%17 = getelementptr inbounds [10 x double], [10 x double]* %2, i64 0, i64 0
%18 = getelementptr inbounds [2 x double*], [2 x double*]* %3, i64 0, i64 0
%19 = call i32 @run_example(double* %17, double** %18, i32 2)
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = bitcast [16 x double]* %5 to i8*
%22 = getelementptr inbounds [3 x double*], [3 x double*]* %6, i64 0, i64 0
%23 = getelementptr inbounds [16 x double], [16 x double]* %5, i64 0, i64 0
store double* %23, double** %22
%24 = getelementptr inbounds double*, double** %22, i64 1
%25 = getelementptr inbounds [16 x double], [16 x double]* %5, i64 0, i64 0
%26 = getelementptr inbounds double, double* %25, i64 8
store double* %26, double** %24
%27 = getelementptr inbounds double*, double** %24, i64 1
%28 = getelementptr inbounds [16 x double], [16 x double]* %5, i64 0, i64 0
%29 = getelementptr inbounds double, double* %28, i64 16
store double* %29, double** %27
store i32 3, i32* %7
%30 = getelementptr inbounds [16 x double], [16 x double]* %5, i64 0, i64 0
%31 = getelementptr inbounds [3 x double*], [3 x double*]* %6, i64 0, i64 0
%32 = load i32, i32* %7
%33 = call i32 @run_example(double* %30, double** %31, i32 %32)
%34 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%35 = bitcast [16 x double]* %8 to i8*
%36 = getelementptr inbounds [2 x double*], [2 x double*]* %9, i64 0, i64 0
%37 = getelementptr inbounds [16 x double], [16 x double]* %8, i64 0, i64 0
store double* %37, double** %36
%38 = getelementptr inbounds double*, double** %36, i64 1
%39 = getelementptr inbounds [16 x double], [16 x double]* %8, i64 0, i64 0
%40 = getelementptr inbounds double, double* %39, i64 16
store double* %40, double** %38
store i32 2, i32* %10
%41 = getelementptr inbounds [16 x double], [16 x double]* %8, i64 0, i64 0
%42 = getelementptr inbounds [2 x double*], [2 x double*]* %9, i64 0, i64 0
%43 = load i32, i32* %10
%44 = call i32 @run_example(double* %41, double** %42, i32 %43)
%45 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.a1 = [10 x double] [double 0.000000e+00, double 0.000000e+00, double 1.000000e+00, double 5.000000e+00, double 2.000000e+00, double 0.000000e+00, double -1.000000e+00, double 3.000000e+00, double 3.000000e+00, double 3.000000e+00]
@__const.main.a2 = [16 x double] [double 0.000000e+00, double 0.000000e+00, double 3.000000e+00, double 0.000000e+00, double 3.000000e+00, double 3.000000e+00, double 0.000000e+00, double 3.000000e+00, double 1.000000e+00, double 1.000000e+00, double 2.000000e+00, double 1.000000e+00, double 2.000000e+00, double 2.000000e+00, double 1.000000e+00, double 2.000000e+00]
@__const.main.a3 = [16 x double] [double 4.410000e+02, double 0.000000e+00, double 3.260000e+02, double 0.000000e+00, double 3.260000e+02, double 8.890000e+02, double 1.200000e+01, double 8.890000e+02, double 1.200000e+01, double 9.920000e+02, double 7.550000e+02, double 9.920000e+02, double 7.550000e+02, double 8.890000e+02, double 4.410000e+02, double 8.890000e+02]
define i32 @main() {
%1 = alloca [10 x double]
%2 = alloca [2 x double*]
%3 = alloca [16 x double]
%4 = alloca [3 x double*]
%5 = alloca [16 x double]
%6 = alloca [2 x double*]
%7 = bitcast [10 x double]* %1 to i8*
%8 = bitcast [2 x double*]* %2 to i8*
%9 = getelementptr inbounds [2 x double*], [2 x double*]* %2, i64 0, i64 0
%10 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
store double* %10, double** %9
%11 = getelementptr inbounds [2 x double*], [2 x double*]* %2, i64 0, i64 1
%12 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 10
store double* %12, double** %11
%13 = call i32 @run_example(double* %10, double** %9, i32 2)
%14 = call i32 @putchar(i32 10)
%15 = bitcast [16 x double]* %3 to i8*
%16 = bitcast [3 x double*]* %4 to i8*
%17 = getelementptr inbounds [3 x double*], [3 x double*]* %4, i64 0, i64 0
%18 = getelementptr inbounds [16 x double], [16 x double]* %3, i64 0, i64 0
store double* %18, double** %17
%19 = getelementptr inbounds [3 x double*], [3 x double*]* %4, i64 0, i64 1
%20 = getelementptr inbounds [16 x double], [16 x double]* %3, i64 0, i64 8
store double* %20, double** %19
%21 = getelementptr inbounds [3 x double*], [3 x double*]* %4, i64 0, i64 2
%22 = getelementptr inbounds [16 x double], [16 x double]* %3, i64 0, i64 16
store double* %22, double** %21
%23 = call i32 @run_example(double* %18, double** %17, i32 3)
%24 = call i32 @putchar(i32 10)
%25 = bitcast [16 x double]* %5 to i8*
%26 = bitcast [2 x double*]* %6 to i8*
%27 = getelementptr inbounds [2 x double*], [2 x double*]* %6, i64 0, i64 0
%28 = getelementptr inbounds [16 x double], [16 x double]* %5, i64 0, i64 0
store double* %28, double** %27
%29 = getelementptr inbounds [2 x double*], [2 x double*]* %6, i64 0, i64 1
%30 = getelementptr inbounds [16 x double], [16 x double]* %5, i64 0, i64 16
store double* %30, double** %29
%31 = call i32 @run_example(double* %28, double** %27, i32 2)
%32 = call i32 @putchar(i32 10)
ret i32 0
}