#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 sin(double);
double mc_cornic(double *xs) {
  double x = xs[0];
  double y = xs[1];
  return (sin(x + y) + ((x - y) * (x - y)) - (1.5 * x) + (2.5 * y) + 1.0);
}


x86 assembly (clang, -O0):
<mc_cornic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe9e(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xe81(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe69(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_cornic>:
sub    $0x18,%rsp
movsd  (%rdi),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rdi),%xmm1
movsd  %xmm1,0x10(%rsp)
addsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  0x8(%rsp),%xmm3
movapd %xmm3,%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
mulsd  0xeaa(%rip),%xmm3
mulsd  0xeaa(%rip),%xmm2
addsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
addsd  0xea2(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @mc_cornic(double* %0) {
%2 = alloca double*
%3 = alloca double
%4 = alloca double
store double* %0, double** %2
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
store double %7, double* %3
%8 = load double*, double** %2
%9 = getelementptr inbounds double, double* %8, i64 1
%10 = load double, double* %9
store double %10, double* %4
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fadd double %11, %12
%14 = call double @sin(double %13)
%15 = load double, double* %3
%16 = load double, double* %4
%17 = fsub double %15, %16
%18 = load double, double* %3
%19 = load double, double* %4
%20 = fsub double %18, %19
%21 = call double @llvm.fmuladd.f64(double %17, double %20, double %14)
%22 = load double, double* %3
%23 = call double @llvm.fmuladd.f64(double -1.500000e+00, double %22, double %21)
%24 = load double, double* %4
%25 = call double @llvm.fmuladd.f64(double 2.500000e+00, double %24, double %23)
%26 = fadd double %25, 1.000000e+00
ret double %26
}

LLVM IR (-O2):
define double @mc_cornic(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fadd double %2, %4
%6 = tail call double @sin(double %5)
%7 = fsub double %2, %4
%8 = tail call double @llvm.fmuladd.f64(double %7, double %7, double %6)
%9 = tail call double @llvm.fmuladd.f64(double %2, double -1.500000e+00, double %8)
%10 = tail call double @llvm.fmuladd.f64(double %4, double 2.500000e+00, double %9)
%11 = fadd double %10, 1.000000e+00
ret double %11
}