#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*/ printX(double *, int, char);
int /*<<< orphan*/ printf(char *);
double *product(double *, double *, int, int);
int main(int argc, char const *argv[]) {
  double a[2] = {-4, -1};
  double b[3] = {3, 5, 0};
  double *c = product(a, b, 2, 3);
  printf("Input\n");
  printX(a, 2, '1');
  printX(b, 3, '1');
  printf("Output\n");
  printX(c, 3, '1');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1050 <product@plt>
mov    %rax,-0x48(%rbp)
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
mov    $0x31,%edx
call   1030 <printX@plt>
lea    -0x40(%rbp),%rdi
mov    $0x3,%esi
mov    $0x31,%edx
call   1030 <printX@plt>
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x48(%rbp),%rdi
mov    $0x3,%esi
mov    $0x31,%edx
call   1030 <printX@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
movaps 0xec0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xed4(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%r15
mov    %rsp,%r14
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1050 <product@plt>
mov    %rax,%rbx
lea    0xea5(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x31,%edx
call   1030 <printX@plt>
mov    %r14,%rdi
mov    $0x3,%esi
mov    $0x31,%edx
call   1030 <printX@plt>
lea    0xe7b(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x31,%edx
call   1030 <printX@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.a = [2 x double] [double -4.000000e+00, double -1.000000e+00]
@__const.main.b = [3 x double] [double 3.000000e+00, double 5.000000e+00, double 0.000000e+00]
@.str = [7 x i8] c"Input\0A\00"
@.str.1 = [8 x i8] c"Output\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x double]
%7 = alloca [3 x double]
%8 = alloca double*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [2 x double]* %6 to i8*
%10 = bitcast [3 x double]* %7 to i8*
%11 = getelementptr inbounds [2 x double], [2 x double]* %6, i64 0, i64 0
%12 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%13 = call double* @product(double* %11, double* %12, i32 2, i32 3)
store double* %13, double** %8
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%15 = getelementptr inbounds [2 x double], [2 x double]* %6, i64 0, i64 0
%16 = call i32 @printX(double* %15, i32 2, i8 signext 49)
%17 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%18 = call i32 @printX(double* %17, i32 3, i8 signext 49)
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%20 = load double*, double** %8
%21 = call i32 @printX(double* %20, i32 3, i8 signext 49)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [2 x double] [double -4.000000e+00, double -1.000000e+00]
@__const.main.b = [3 x double] [double 3.000000e+00, double 5.000000e+00, double 0.000000e+00]
@str = [6 x i8] c"Input\00"
@str.2 = [7 x i8] c"Output\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x double]
%4 = alloca [3 x double]
%5 = bitcast [2 x double]* %3 to i8*
%6 = bitcast [3 x double]* %4 to i8*
%7 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%8 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%9 = call double* @product(double* %7, double* %8, i32 2, i32 3)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%11 = call i32 @printX(double* %7, i32 2, i8 signext 49)
%12 = call i32 @printX(double* %8, i32 3, i8 signext 49)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
%14 = call i32 @printX(double* %9, i32 3, i8 signext 49)
ret i32 0
}