#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*/ matmul(char *, int, int, int, double, double *,
                          double const *, double, double *);
int /*<<< orphan*/ xyz2enu(double const *, double *);
extern void covenu(const double *pos, const double *P, double *Q) {
  double E[9], EP[9];
  xyz2enu(pos, E);
  matmul("NN", 3, 3, 3, 1.0, E, P, 0.0, EP);
  matmul("NT", 3, 3, 3, 1.0, EP, E, 0.0, Q);
}


x86 assembly (clang, -O0):
<covenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <xyz2enu@plt>
lea    -0x60(%rbp),%r8
mov    -0x10(%rbp),%r9
lea    -0xb0(%rbp),%rax
lea    0xeae(%rip),%rdi
mov    $0x3,%ecx
movsd  0xe99(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    %ecx,%esi
mov    %ecx,%edx
mov    %rax,(%rsp)
call   1040 <matmul@plt>
lea    -0xb0(%rbp),%r8
lea    -0x60(%rbp),%r9
mov    -0x18(%rbp),%rax
lea    0xe7e(%rip),%rdi
mov    $0x3,%ecx
movsd  0xe66(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    %ecx,%esi
mov    %ecx,%edx
mov    %rax,(%rsp)
call   1040 <matmul@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<covenu>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %rdx,%r15
mov    %rsi,%rbx
lea    0x60(%rsp),%r14
mov    %r14,%rsi
call   1030 <xyz2enu@plt>
lea    0x10(%rsp),%r12
mov    %r12,(%rsp)
lea    0xeb7(%rip),%rdi
movsd  0xea7(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    $0x3,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
mov    %r14,%r8
mov    %rbx,%r9
call   1040 <matmul@plt>
mov    %r15,(%rsp)
lea    0xe8a(%rip),%rdi
xorps  %xmm1,%xmm1
mov    $0x3,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
movsd  0xe65(%rip),%xmm0
mov    %r12,%r8
mov    %r14,%r9
call   1040 <matmul@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"NN\00"
@.str.1 = [3 x i8] c"NT\00"
define void @covenu(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [9 x double]
%8 = alloca [9 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%9 = load double*, double** %4
%10 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%11 = call i32 @xyz2enu(double* %9, double* %10)
%12 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%13 = load double*, double** %5
%14 = getelementptr inbounds [9 x double], [9 x double]* %8, i64 0, i64 0
%15 = call i32 @matmul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3, i32 3, i32 3, double 1.000000e+00, double* %12, double* %13, double 0.000000e+00, double* %14)
%16 = getelementptr inbounds [9 x double], [9 x double]* %8, i64 0, i64 0
%17 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%18 = load double*, double** %6
%19 = call i32 @matmul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 3, i32 3, double 1.000000e+00, double* %16, double* %17, double 0.000000e+00, double* %18)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"NN\00"
@.str.1 = [3 x i8] c"NT\00"
define void @covenu(double* %0, double* %1, double* %2) {
%4 = alloca [9 x double]
%5 = alloca [9 x double]
%6 = bitcast [9 x double]* %4 to i8*
%7 = bitcast [9 x double]* %5 to i8*
%8 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 0
%9 = call i32 @xyz2enu(double* %0, double* %8)
%10 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 0
%11 = call i32 @matmul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3, i32 3, i32 3, double 1.000000e+00, double* %8, double* %1, double 0.000000e+00, double* %10)
%12 = call i32 @matmul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 3, i32 3, double 1.000000e+00, double* %10, double* %8, double 0.000000e+00, double* %2)
ret void
}