void mod2hs52(double *p, double *x, int m, int n, void *data) {
  x[0] = 4.0 * p[0] - p[1];
  x[1] = p[1] + p[2] - 2.0;
  x[2] = p[3] - 1.0;
  x[3] = p[4] - 1.0;
  x[4] = p[0] - 0.5;
}


x86 assembly (clang, -O0):
<mod2hs52>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xed2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x10(%rax),%xmm0
movsd  0xea0(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  0xe7a(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  0xe5c(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe37(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod2hs52>:
movsd  (%rdi),%xmm0
mulsd  0xef4(%rip),%xmm0
subsd  0x8(%rdi),%xmm0
movsd  %xmm0,(%rsi)
movsd  0x8(%rdi),%xmm0
addsd  0x10(%rdi),%xmm0
addsd  0xee1(%rip),%xmm0
movsd  %xmm0,0x8(%rsi)
movsd  0xedc(%rip),%xmm0
movsd  0x18(%rdi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsi)
addsd  0x20(%rdi),%xmm0
movsd  %xmm0,0x18(%rsi)
movsd  (%rdi),%xmm0
addsd  0xec0(%rip),%xmm0
movsd  %xmm0,0x20(%rsi)
ret

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

LLVM IR (-O2):
define void @mod2hs52(double* nocapture %0, double* nocapture writeonly %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = load double, double* %0
%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 %6, double 4.000000e+00, double %9)
store double %10, double* %1
%11 = load double, double* %7
%12 = getelementptr inbounds double, double* %0, i64 2
%13 = load double, double* %12
%14 = fadd double %11, %13
%15 = fadd double %14, -2.000000e+00
%16 = getelementptr inbounds double, double* %1, i64 1
store double %15, double* %16
%17 = getelementptr inbounds double, double* %0, i64 3
%18 = load double, double* %17
%19 = fadd double %18, -1.000000e+00
%20 = getelementptr inbounds double, double* %1, i64 2
store double %19, double* %20
%21 = getelementptr inbounds double, double* %0, i64 4
%22 = load double, double* %21
%23 = fadd double %22, -1.000000e+00
%24 = getelementptr inbounds double, double* %1, i64 3
store double %23, double* %24
%25 = load double, double* %0
%26 = fadd double %25, -5.000000e-01
%27 = getelementptr inbounds double, double* %1, i64 4
store double %26, double* %27
ret void
}