void modros(double *p, double *x, int m, int n, void *data) {
  register int i;
  for (i = 0; i < n; i += 3) {
    x[i] = 10 * (p[1] - p[0] * p[0]);
    x[i + 1] = 1.0 - p[0];
    x[i + 2] = 1E02;
  }
}


x86 assembly (clang, -O0):
<modros>:
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)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11c4 <modros+0xc4>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xea7(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movsd  0xe82(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  0xe4f(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x24(%rbp)
jmp    111d <modros+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<modros>:
test   %ecx,%ecx
jle    11a6 <modros+0xa6>
mov    %ecx,%r10d
lea    -0x1(%r10),%r9
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mov    %r9,%rax
mul    %rcx
cmp    $0x3,%r9
jb     114b <modros+0x4b>
mov    %rdx,%r8
mov    %r9,%rax
mul    %rcx
lea    0x10(%rdi),%rax
cmp    %rsi,%rax
jbe    11a7 <modros+0xa7>
shr    %rdx
lea    (%rdx,%rdx,2),%rax
lea    (%rsi,%rax,8),%rax
add    $0x18,%rax
cmp    %rdi,%rax
jbe    11a7 <modros+0xa7>
xor    %eax,%eax
movsd  0xeab(%rip),%xmm0
movsd  0xeab(%rip),%xmm1
movabs $0x4059000000000000,%rcx
nopw   0x0(%rax,%rax,1)
movsd  (%rdi),%xmm2
movsd  0x8(%rdi),%xmm3
mulsd  %xmm2,%xmm2
subsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,(%rsi,%rax,8)
movapd %xmm1,%xmm2
subsd  (%rdi),%xmm2
movsd  %xmm2,0x8(%rsi,%rax,8)
mov    %rcx,0x10(%rsi,%rax,8)
add    $0x3,%rax
cmp    %r10,%rax
jb     1170 <modros+0x70>
ret
shr    %r8
add    $0x1,%r8
movabs $0x7ffffffffffffffe,%r9
ff ff 7f
and    %r8,%r9
lea    (%r9,%r9,2),%rax
movsd  0xe39(%rip),%xmm0
movsd  0xe39(%rip),%xmm1
movsd  0xe39(%rip),%xmm2
movapd 0xe41(%rip),%xmm3
mov    %rsi,%rdx
mov    %r9,%rcx
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rdi),%xmm4
movsd  0x8(%rdi),%xmm5
movapd %xmm1,%xmm6
subsd  %xmm4,%xmm6
mulsd  %xmm4,%xmm4
subsd  %xmm4,%xmm5
mulsd  %xmm0,%xmm5
movapd %xmm2,%xmm4
unpcklpd %xmm5,%xmm4
unpcklpd %xmm6,%xmm5
shufpd $0x2,%xmm3,%xmm6
movupd %xmm6,0x20(%rdx)
movupd %xmm4,0x10(%rdx)
movupd %xmm5,(%rdx)
add    $0x30,%rdx
add    $0xfffffffffffffffe,%rcx
jne    11f0 <modros+0xf0>
cmp    %r9,%r8
je     11a6 <modros+0xa6>
jmp    114d <modros+0x4d>

LLVM IR (-O0):
define void @modros(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*
%11 = alloca i32
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
store i32 0, i32* %11
br label %12
12: ; preds = %47, %5
%13 = load i32, i32* %11
%14 = load i32, i32* %9
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %50
16: ; preds = %12
%17 = load double*, double** %6
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = load double*, double** %6
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double, double* %21
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 0
%25 = load double, double* %24
%26 = fneg double %22
%27 = call double @llvm.fmuladd.f64(double %26, double %25, double %19)
%28 = fmul double 1.000000e+01, %27
%29 = load double*, double** %7
%30 = load i32, i32* %11
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %29, i64 %31
store double %28, double* %32
%33 = load double*, double** %6
%34 = getelementptr inbounds double, double* %33, i64 0
%35 = load double, double* %34
%36 = fsub double 1.000000e+00, %35
%37 = load double*, double** %7
%38 = load i32, i32* %11
%39 = add nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %37, i64 %40
store double %36, double* %41
%42 = load double*, double** %7
%43 = load i32, i32* %11
%44 = add nsw i32 %43, 2
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %42, i64 %45
store double 1.000000e+02, double* %46
br label %47
47: ; preds = %16
%48 = load i32, i32* %11
%49 = add nsw i32 %48, 3
store i32 %49, i32* %11
br label %12
50: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @modros(double* nocapture %0, double* nocapture writeonly %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = icmp sgt i32 %3, 0
br i1 %6, label %7, label %68
7: ; preds = %5
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = zext i32 %3 to i64
%10 = add nsw i64 %9, -1
%11 = udiv i64 %10, 3
%12 = add nuw nsw i64 %11, 1
%13 = icmp ult i64 %10, 3
br i1 %13, label %50, label %14
14: ; preds = %7
%15 = add nsw i64 %9, -1
%16 = urem i64 %15, 3
%17 = sub nsw i64 %15, %16
%18 = add nsw i64 %17, 3
%19 = getelementptr double, double* %1, i64 %18
%20 = getelementptr double, double* %0, i64 2
%21 = icmp ugt double* %20, %1
%22 = icmp ugt double* %19, %0
%23 = and i1 %21, %22
br i1 %23, label %50, label %24
24: ; preds = %14
%25 = and i64 %12, 9223372036854775806
%26 = mul i64 %25, 3
br label %27
27: ; preds = %27, %24
%28 = phi i64 [ 0, %24 ], [ %46, %27 ]
%29 = mul i64 %28, 3
%30 = load double, double* %8
%31 = insertelement <2 x double> poison, double %30, i64 0
%32 = shufflevector <2 x double> %31, <2 x double> poison, <2 x i32> zeroinitializer
%33 = load double, double* %0
%34 = insertelement <2 x double> poison, double %33, i64 0
%35 = shufflevector <2 x double> %34, <2 x double> poison, <2 x i32> zeroinitializer
%36 = fneg <2 x double> %35
%37 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %36, <2 x double> %35, <2 x double> %32)
%38 = fmul <2 x double> %37, <double 1.000000e+01, double 1.000000e+01>
%39 = insertelement <2 x double> poison, double %33, i64 0
%40 = fsub <2 x double> <double 1.000000e+00, double poison>, %39
%41 = shufflevector <2 x double> %40, <2 x double> poison, <2 x i32> zeroinitializer
%42 = getelementptr inbounds double, double* %1, i64 %29
%43 = bitcast double* %42 to <6 x double>*
%44 = shufflevector <2 x double> %38, <2 x double> %41, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%45 = shufflevector <4 x double> %44, <4 x double> <double 1.000000e+02, double 1.000000e+02, double poison, double poison>, <6 x i32> <i32 0, i32 2, i32 4, i32 1, i32 3, i32 5>
store <6 x double> %45, <6 x double>* %43
%46 = add nuw i64 %28, 2
%47 = icmp eq i64 %46, %25
br i1 %47, label %48, label %27
48: ; preds = %27
%49 = icmp eq i64 %12, %25
br i1 %49, label %68, label %50
50: ; preds = %14, %7, %48
%51 = phi i64 [ 0, %14 ], [ 0, %7 ], [ %26, %48 ]
br label %52
52: ; preds = %50, %52
%53 = phi i64 [ %66, %52 ], [ %51, %50 ]
%54 = load double, double* %8
%55 = load double, double* %0
%56 = fneg double %55
%57 = tail call double @llvm.fmuladd.f64(double %56, double %55, double %54)
%58 = fmul double %57, 1.000000e+01
%59 = getelementptr inbounds double, double* %1, i64 %53
store double %58, double* %59
%60 = load double, double* %0
%61 = fsub double 1.000000e+00, %60
%62 = add nuw nsw i64 %53, 1
%63 = getelementptr inbounds double, double* %1, i64 %62
store double %61, double* %63
%64 = add nuw nsw i64 %53, 2
%65 = getelementptr inbounds double, double* %1, i64 %64
store double 1.000000e+02, double* %65
%66 = add nuw nsw i64 %53, 3
%67 = icmp ult i64 %66, %9
br i1 %67, label %52, label %68
68: ; preds = %52, %48, %5
ret void
}