void g11(double *x, double *f, double *g, double *h, int nx, int nf, int ng,
         int nh) {
  f[0] = x[0] * x[0] + (x[1] - 1.0) * (x[1] - 1.0);
  h[0] = x[1] - x[0] * x[0];
}


x86 assembly (clang, -O0):
<g11>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  0xebd(%rip),%xmm3
subsd  %xmm3,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm3
movsd  0xea8(%rip),%xmm4
subsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<g11>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
addsd  0xeef(%rip),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsi)
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rcx)
ret

LLVM IR (-O0):
define void @g11(double* %0, double* %1, double* %2, double* %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store double* %0, double** %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load double*, double** %9
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
%20 = load double*, double** %9
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double, double* %21
%23 = load double*, double** %9
%24 = getelementptr inbounds double, double* %23, i64 1
%25 = load double, double* %24
%26 = fsub double %25, 1.000000e+00
%27 = load double*, double** %9
%28 = getelementptr inbounds double, double* %27, i64 1
%29 = load double, double* %28
%30 = fsub double %29, 1.000000e+00
%31 = fmul double %26, %30
%32 = call double @llvm.fmuladd.f64(double %19, double %22, double %31)
%33 = load double*, double** %10
%34 = getelementptr inbounds double, double* %33, i64 0
store double %32, double* %34
%35 = load double*, double** %9
%36 = getelementptr inbounds double, double* %35, i64 1
%37 = load double, double* %36
%38 = load double*, double** %9
%39 = getelementptr inbounds double, double* %38, i64 0
%40 = load double, double* %39
%41 = load double*, double** %9
%42 = getelementptr inbounds double, double* %41, i64 0
%43 = load double, double* %42
%44 = fneg double %40
%45 = call double @llvm.fmuladd.f64(double %44, double %43, double %37)
%46 = load double*, double** %12
%47 = getelementptr inbounds double, double* %46, i64 0
store double %45, double* %47
ret void
}

LLVM IR (-O2):
define void @g11(double* nocapture %0, double* nocapture writeonly %1, double* nocapture readnone %2, double* nocapture writeonly %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = load double, double* %0
%10 = getelementptr inbounds double, double* %0, i64 1
%11 = load double, double* %10
%12 = fadd double %11, -1.000000e+00
%13 = fmul double %12, %12
%14 = tail call double @llvm.fmuladd.f64(double %9, double %9, double %13)
store double %14, double* %1
%15 = load double, double* %10
%16 = load double, double* %0
%17 = fneg double %16
%18 = tail call double @llvm.fmuladd.f64(double %17, double %16, double %15)
store double %18, double* %3
ret void
}