#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 */
typedef int /*<<< orphan*/ v;
typedef int /*<<< orphan*/ u;
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ convd(double *, int, double *, int, double *);
int /*<<< orphan*/ printvdnl(double *, int);
int main(void) {
  double u[] = {2, 6, 4};
  double v[] = {1, 2, 5, 4, 8};
  double result[(sizeof(u) / sizeof(u[0])) + (sizeof(v) / sizeof(v[0])) - 1] = {
      0};
  convd(u, (sizeof(u) / sizeof(u[0])), v, (sizeof(v) / sizeof(v[0])), result);
  printvdnl(result, (sizeof(result) / sizeof(result[0])));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xee7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe90(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe7b(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe66(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe51(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x38,%edx
call   1030 <memset@plt>
lea    -0x20(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    -0x90(%rbp),%r8
mov    $0x3,%esi
mov    $0x5,%ecx
call   1040 <convd@plt>
lea    -0x90(%rbp),%rdi
mov    $0x7,%esi
call   1050 <printvdnl@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
mov    0xf01(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movabs $0x4020000000000000,%rax
mov    %rax,0x40(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movq   $0x0,0x80(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rdx
lea    0x50(%rsp),%rbx
mov    $0x3,%esi
mov    $0x5,%ecx
mov    %rbx,%r8
call   1030 <convd@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <printvdnl@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.u = [3 x double] [double 2.000000e+00, double 6.000000e+00, double 4.000000e+00]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x double]
%3 = alloca [5 x double]
%4 = alloca [7 x double]
store i32 0, i32* %1
%5 = bitcast [3 x double]* %2 to i8*
%6 = bitcast [5 x double]* %3 to i8*
%7 = bitcast i8* %6 to [5 x double]*
%8 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 0
store double 1.000000e+00, double* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 1
store double 2.000000e+00, double* %9
%10 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 2
store double 5.000000e+00, double* %10
%11 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 3
store double 4.000000e+00, double* %11
%12 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 4
store double 8.000000e+00, double* %12
%13 = bitcast [7 x double]* %4 to i8*
%14 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%15 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 0
%16 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 0
%17 = call i32 @convd(double* %14, i32 3, double* %15, i32 5, double* %16)
%18 = getelementptr inbounds [7 x double], [7 x double]* %4, i64 0, i64 0
%19 = call i32 @printvdnl(double* %18, i32 7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.u = [3 x double] [double 2.000000e+00, double 6.000000e+00, double 4.000000e+00]
define i32 @main() {
%1 = alloca [3 x double]
%2 = alloca [5 x double]
%3 = alloca [7 x double]
%4 = bitcast [3 x double]* %1 to i8*
%5 = bitcast [5 x double]* %2 to i8*
%6 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 0
%7 = bitcast [5 x double]* %2 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 2.000000e+00>, <2 x double>* %7
%8 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 2
%9 = bitcast double* %8 to <2 x double>*
store <2 x double> <double 5.000000e+00, double 4.000000e+00>, <2 x double>* %9
%10 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 4
store double 8.000000e+00, double* %10
%11 = bitcast [7 x double]* %3 to i8*
%12 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%13 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 0
%14 = call i32 @convd(double* %12, i32 3, double* %6, i32 5, double* %13)
%15 = call i32 @printvdnl(double* %13, i32 7)
ret i32 0
}