#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*/ 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);
  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);
  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);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x50,%edx
call   1030 <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   1040 <run_example@plt>
lea    -0x100(%rbp),%rdi
lea    0xece(%rip),%rsi
mov    $0x80,%edx
call   1030 <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   1040 <run_example@plt>
lea    -0x1b0(%rbp),%rdi
lea    0xedf(%rip),%rsi
mov    $0x80,%edx
call   1030 <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   1040 <run_example@plt>
xor    %eax,%eax
add    $0x1d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x198,%rsp
movaps 0xf22(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xf03(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xee7(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeaf(%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   1030 <run_example@plt>
movaps 0xf3d(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0xf1e(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xeff(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xee0(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xea2(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xe83(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xe64(%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   1030 <run_example@plt>
movaps 0xf0f(%rip),%xmm0
movaps %xmm0,0x180(%rsp)
movaps 0xef0(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movaps 0xe93(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movaps 0xe74(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps 0xe55(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0xe36(%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   1030 <run_example@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]
@__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 = bitcast [16 x double]* %5 to i8*
%21 = getelementptr inbounds [3 x double*], [3 x double*]* %6, i64 0, i64 0
%22 = getelementptr inbounds [16 x double], [16 x double]* %5, i64 0, i64 0
store double* %22, double** %21
%23 = getelementptr inbounds double*, double** %21, i64 1
%24 = getelementptr inbounds [16 x double], [16 x double]* %5, i64 0, i64 0
%25 = getelementptr inbounds double, double* %24, i64 8
store double* %25, double** %23
%26 = getelementptr inbounds double*, double** %23, i64 1
%27 = getelementptr inbounds [16 x double], [16 x double]* %5, i64 0, i64 0
%28 = getelementptr inbounds double, double* %27, i64 16
store double* %28, double** %26
store i32 3, i32* %7
%29 = getelementptr inbounds [16 x double], [16 x double]* %5, i64 0, i64 0
%30 = getelementptr inbounds [3 x double*], [3 x double*]* %6, i64 0, i64 0
%31 = load i32, i32* %7
%32 = call i32 @run_example(double* %29, double** %30, i32 %31)
%33 = bitcast [16 x double]* %8 to i8*
%34 = getelementptr inbounds [2 x double*], [2 x double*]* %9, i64 0, i64 0
%35 = getelementptr inbounds [16 x double], [16 x double]* %8, i64 0, i64 0
store double* %35, double** %34
%36 = getelementptr inbounds double*, double** %34, i64 1
%37 = getelementptr inbounds [16 x double], [16 x double]* %8, i64 0, i64 0
%38 = getelementptr inbounds double, double* %37, i64 16
store double* %38, double** %36
store i32 2, i32* %10
%39 = getelementptr inbounds [16 x double], [16 x double]* %8, i64 0, i64 0
%40 = getelementptr inbounds [2 x double*], [2 x double*]* %9, i64 0, i64 0
%41 = load i32, i32* %10
%42 = call i32 @run_example(double* %39, double** %40, i32 %41)
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 = bitcast [16 x double]* %3 to i8*
%15 = bitcast [3 x double*]* %4 to i8*
%16 = getelementptr inbounds [3 x double*], [3 x double*]* %4, i64 0, i64 0
%17 = getelementptr inbounds [16 x double], [16 x double]* %3, i64 0, i64 0
store double* %17, double** %16
%18 = getelementptr inbounds [3 x double*], [3 x double*]* %4, i64 0, i64 1
%19 = getelementptr inbounds [16 x double], [16 x double]* %3, i64 0, i64 8
store double* %19, double** %18
%20 = getelementptr inbounds [3 x double*], [3 x double*]* %4, i64 0, i64 2
%21 = getelementptr inbounds [16 x double], [16 x double]* %3, i64 0, i64 16
store double* %21, double** %20
%22 = call i32 @run_example(double* %17, double** %16, i32 3)
%23 = bitcast [16 x double]* %5 to i8*
%24 = bitcast [2 x double*]* %6 to i8*
%25 = getelementptr inbounds [2 x double*], [2 x double*]* %6, i64 0, i64 0
%26 = getelementptr inbounds [16 x double], [16 x double]* %5, i64 0, i64 0
store double* %26, double** %25
%27 = getelementptr inbounds [2 x double*], [2 x double*]* %6, i64 0, i64 1
%28 = getelementptr inbounds [16 x double], [16 x double]* %5, i64 0, i64 16
store double* %28, double** %27
%29 = call i32 @run_example(double* %26, double** %25, i32 2)
ret i32 0
}