#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 */
double const exp(double const);
void f(const double *x, double *res) {
  *res = 1 - *x * exp(*x);
  res[1] = 2 - x[1] * x[1];
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea3(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe5a(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsp)
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
movsd  0xecb(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
movsd  0x8(%rbx),%xmm0
mulsd  %xmm0,%xmm0
movsd  0xeb9(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @f(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %3
%8 = load double, double* %7
%9 = call double @exp(double %8)
%10 = fneg double %6
%11 = call double @llvm.fmuladd.f64(double %10, double %9, double 1.000000e+00)
%12 = load double*, double** %4
store double %11, double* %12
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = fneg double %15
%20 = call double @llvm.fmuladd.f64(double %19, double %18, double 2.000000e+00)
%21 = load double*, double** %4
%22 = getelementptr inbounds double, double* %21, i64 1
store double %20, double* %22
ret void
}

LLVM IR (-O2):
define void @f(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = tail call double @exp(double %3)
%5 = fneg double %3
%6 = tail call double @llvm.fmuladd.f64(double %5, double %4, double 1.000000e+00)
store double %6, double* %1
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = fneg double %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double %8, double 2.000000e+00)
%11 = getelementptr inbounds double, double* %1, i64 1
store double %10, double* %11
ret void
}