#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*/ arrcpy(int, int, double **, double **);
int /*<<< orphan*/ showarr(int, int, double **);
int main(void) {
  double ar[3][5] = {{1.1, 2.2, 3.3, 4.4, 5.5},
                     {2.2, 3.3, 4.4, 5.5, 6.6},
                     {3.3, 4.4, 5.5, 6.6, 7.7}};
  double dest[3][5];
  arrcpy(3, 5, ar, dest);
  showarr(3, 5, ar);
  showarr(3, 5, dest);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x78,%edx
call   1050 <memcpy@plt>
lea    -0x80(%rbp),%rdx
lea    -0x100(%rbp),%rcx
mov    $0x3,%edi
mov    $0x5,%esi
call   1040 <arrcpy@plt>
lea    -0x80(%rbp),%rdx
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <showarr@plt>
lea    -0x100(%rbp),%rdx
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <showarr@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xf8,%rsp
mov    0xf3f(%rip),%rax
mov    %rax,0x70(%rsp)
movaps 0xf23(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf07(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe97(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe7b(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
lea    0x80(%rsp),%r14
mov    $0x3,%edi
mov    $0x5,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <arrcpy@plt>
mov    $0x3,%edi
mov    $0x5,%esi
mov    %rbx,%rdx
call   1030 <showarr@plt>
mov    $0x3,%edi
mov    $0x5,%esi
mov    %r14,%rdx
call   1030 <showarr@plt>
xor    %eax,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.ar = [3 x [5 x double]] [[5 x double] [double 1.100000e+00, double 2.200000e+00, double 3.300000e+00, double 4.400000e+00, double 5.500000e+00], [5 x double] [double 2.200000e+00, double 3.300000e+00, double 4.400000e+00, double 5.500000e+00, double 6.600000e+00], [5 x double] [double 3.300000e+00, double 4.400000e+00, double 5.500000e+00, double 6.600000e+00, double 7.700000e+00]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [5 x double]]
%3 = alloca [3 x [5 x double]]
store i32 0, i32* %1
%4 = bitcast [3 x [5 x double]]* %2 to i8*
%5 = getelementptr inbounds [3 x [5 x double]], [3 x [5 x double]]* %2, i64 0, i64 0
%6 = bitcast [5 x double]* %5 to double**
%7 = getelementptr inbounds [3 x [5 x double]], [3 x [5 x double]]* %3, i64 0, i64 0
%8 = bitcast [5 x double]* %7 to double**
%9 = call i32 @arrcpy(i32 3, i32 5, double** %6, double** %8)
%10 = getelementptr inbounds [3 x [5 x double]], [3 x [5 x double]]* %2, i64 0, i64 0
%11 = bitcast [5 x double]* %10 to double**
%12 = call i32 @showarr(i32 3, i32 5, double** %11)
%13 = getelementptr inbounds [3 x [5 x double]], [3 x [5 x double]]* %3, i64 0, i64 0
%14 = bitcast [5 x double]* %13 to double**
%15 = call i32 @showarr(i32 3, i32 5, double** %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.ar = [3 x [5 x double]] [[5 x double] [double 1.100000e+00, double 2.200000e+00, double 3.300000e+00, double 4.400000e+00, double 5.500000e+00], [5 x double] [double 2.200000e+00, double 3.300000e+00, double 4.400000e+00, double 5.500000e+00, double 6.600000e+00], [5 x double] [double 3.300000e+00, double 4.400000e+00, double 5.500000e+00, double 6.600000e+00, double 7.700000e+00]]
define i32 @main() {
%1 = alloca [3 x [5 x double]]
%2 = alloca [3 x [5 x double]]
%3 = bitcast [3 x [5 x double]]* %1 to i8*
%4 = bitcast [3 x [5 x double]]* %2 to i8*
%5 = bitcast [3 x [5 x double]]* %1 to double**
%6 = bitcast [3 x [5 x double]]* %2 to double**
%7 = call i32 @arrcpy(i32 3, i32 5, double** %5, double** %6)
%8 = call i32 @showarr(i32 3, i32 5, double** %5)
%9 = call i32 @showarr(i32 3, i32 5, double** %6)
ret i32 0
}