#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 sqrt(double);
void wood(double *p, double *x, int m, int n, void *data) {
  register int i;
  for (i = 0; i < n; i += 6) {
    x[i] = 10.0 * (p[1] - p[0] * p[0]);
    x[i + 1] = 1.0 - p[0];
    x[i + 2] = sqrt(90.0) * (p[3] - p[2] * p[2]);
    x[i + 3] = 1.0 - p[2];
    x[i + 4] = sqrt(10.0) * (p[1] + p[3] - 2.0);
    x[i + 5] = (p[1] - p[3]) / sqrt(10.0);
  }
}


x86 assembly (clang, -O0):
<wood>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
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    12c1 <wood+0x1b1>
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  0xe83(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movsd  0xe76(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xe60(%rip),%xmm0
call   1030 <sqrt@plt>
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movsd  0xdf7(%rip),%xmm0
subsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xdc8(%rip),%xmm0
call   1030 <sqrt@plt>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
addsd  0x18(%rax),%xmm1
movsd  0xdb1(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xd70(%rip),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x24(%rbp)
jmp    1131 <wood+0x21>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wood>:
test   %ecx,%ecx
jle    121c <wood+0x11c>
mov    %ecx,%r10d
lea    -0x1(%r10),%r9
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mov    %r9,%rax
mul    %rcx
cmp    $0x6,%r9
jb     1157 <wood+0x57>
mov    %rdx,%r8
mov    %r9,%rax
mul    %rcx
lea    0x20(%rdi),%rax
cmp    %rsi,%rax
jbe    121d <wood+0x11d>
shr    $0x2,%rdx
lea    (%rdx,%rdx,2),%rax
shl    $0x4,%rax
add    %rsi,%rax
add    $0x30,%rax
cmp    %rdi,%rax
jbe    121d <wood+0x11d>
xor    %eax,%eax
movsd  0xe9f(%rip),%xmm0
movsd  0xe9f(%rip),%xmm1
movsd  0xe9f(%rip),%xmm2
movsd  0xe9f(%rip),%xmm3
movsd  0xe9f(%rip),%xmm4
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rdi),%xmm5
movsd  0x8(%rdi),%xmm6
mulsd  %xmm5,%xmm5
subsd  %xmm5,%xmm6
mulsd  %xmm0,%xmm6
movsd  %xmm6,(%rsi,%rax,8)
movapd %xmm1,%xmm5
subsd  (%rdi),%xmm5
movsd  %xmm5,0x8(%rsi,%rax,8)
movsd  0x10(%rdi),%xmm5
movsd  0x18(%rdi),%xmm6
mulsd  %xmm5,%xmm5
subsd  %xmm5,%xmm6
mulsd  %xmm2,%xmm6
movsd  %xmm6,0x10(%rsi,%rax,8)
movapd %xmm1,%xmm5
subsd  0x10(%rdi),%xmm5
movsd  %xmm5,0x18(%rsi,%rax,8)
movsd  0x8(%rdi),%xmm5
addsd  0x18(%rdi),%xmm5
addsd  %xmm3,%xmm5
mulsd  %xmm4,%xmm5
movsd  %xmm5,0x20(%rsi,%rax,8)
movsd  0x8(%rdi),%xmm5
subsd  0x18(%rdi),%xmm5
divsd  %xmm4,%xmm5
movsd  %xmm5,0x28(%rsi,%rax,8)
add    $0x6,%rax
cmp    %r10,%rax
jb     1190 <wood+0x90>
ret
shr    $0x2,%r8
add    $0x1,%r8
mov    %r8,%r9
and    $0xfffffffffffffffe,%r9
lea    (%r9,%r9,1),%rax
lea    (%rax,%rax,2),%rax
movsd  0xdc3(%rip),%xmm8
movsd  0xdc3(%rip),%xmm2
movsd  0xdc2(%rip),%xmm9
movsd  0xdc1(%rip),%xmm10
movsd  0xdc1(%rip),%xmm4
mov    %rsi,%rdx
mov    %r9,%rcx
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rdi),%xmm7
movsd  0x8(%rdi),%xmm3
movapd %xmm2,%xmm1
subsd  %xmm7,%xmm1
mulsd  %xmm7,%xmm7
movapd %xmm3,%xmm5
subsd  %xmm7,%xmm5
mulsd  %xmm8,%xmm5
unpcklpd %xmm1,%xmm5
movsd  0x18(%rdi),%xmm1
movsd  0x10(%rdi),%xmm7
movapd %xmm2,%xmm0
subsd  %xmm7,%xmm0
mulsd  %xmm7,%xmm7
movapd %xmm3,%xmm6
addsd  %xmm1,%xmm6
subsd  %xmm1,%xmm3
subsd  %xmm7,%xmm1
mulsd  %xmm9,%xmm1
unpcklpd %xmm0,%xmm1
addsd  %xmm10,%xmm6
mulsd  %xmm4,%xmm6
divsd  %xmm4,%xmm3
unpcklpd %xmm3,%xmm6
movupd %xmm6,0x50(%rdx)
movupd %xmm1,0x40(%rdx)
movupd %xmm5,0x30(%rdx)
movupd %xmm6,0x20(%rdx)
movupd %xmm1,0x10(%rdx)
movupd %xmm5,(%rdx)
add    $0x60,%rdx
add    $0xfffffffffffffffe,%rcx
jne    1270 <wood+0x170>
cmp    %r9,%r8
je     121c <wood+0x11c>
jmp    1159 <wood+0x59>

LLVM IR (-O0):
define void @wood(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 = %98, %5
%13 = load i32, i32* %11
%14 = load i32, i32* %9
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %101
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 = call double @sqrt(double 9.000000e+01)
%43 = load double*, double** %6
%44 = getelementptr inbounds double, double* %43, i64 3
%45 = load double, double* %44
%46 = load double*, double** %6
%47 = getelementptr inbounds double, double* %46, i64 2
%48 = load double, double* %47
%49 = load double*, double** %6
%50 = getelementptr inbounds double, double* %49, i64 2
%51 = load double, double* %50
%52 = fneg double %48
%53 = call double @llvm.fmuladd.f64(double %52, double %51, double %45)
%54 = fmul double %42, %53
%55 = load double*, double** %7
%56 = load i32, i32* %11
%57 = add nsw i32 %56, 2
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %55, i64 %58
store double %54, double* %59
%60 = load double*, double** %6
%61 = getelementptr inbounds double, double* %60, i64 2
%62 = load double, double* %61
%63 = fsub double 1.000000e+00, %62
%64 = load double*, double** %7
%65 = load i32, i32* %11
%66 = add nsw i32 %65, 3
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %64, i64 %67
store double %63, double* %68
%69 = call double @sqrt(double 1.000000e+01)
%70 = load double*, double** %6
%71 = getelementptr inbounds double, double* %70, i64 1
%72 = load double, double* %71
%73 = load double*, double** %6
%74 = getelementptr inbounds double, double* %73, i64 3
%75 = load double, double* %74
%76 = fadd double %72, %75
%77 = fsub double %76, 2.000000e+00
%78 = fmul double %69, %77
%79 = load double*, double** %7
%80 = load i32, i32* %11
%81 = add nsw i32 %80, 4
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %79, i64 %82
store double %78, double* %83
%84 = load double*, double** %6
%85 = getelementptr inbounds double, double* %84, i64 1
%86 = load double, double* %85
%87 = load double*, double** %6
%88 = getelementptr inbounds double, double* %87, i64 3
%89 = load double, double* %88
%90 = fsub double %86, %89
%91 = call double @sqrt(double 1.000000e+01)
%92 = fdiv double %90, %91
%93 = load double*, double** %7
%94 = load i32, i32* %11
%95 = add nsw i32 %94, 5
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %93, i64 %96
store double %92, double* %97
br label %98
98: ; preds = %16
%99 = load i32, i32* %11
%100 = add nsw i32 %99, 6
store i32 %100, i32* %11
br label %12
101: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @wood(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 %120
7: ; preds = %5
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = getelementptr inbounds double, double* %0, i64 3
%10 = getelementptr inbounds double, double* %0, i64 2
%11 = zext i32 %3 to i64
%12 = add nsw i64 %11, -1
%13 = udiv i64 %12, 6
%14 = add nuw nsw i64 %13, 1
%15 = icmp ult i64 %12, 6
br i1 %15, label %80, label %16
16: ; preds = %7
%17 = add nsw i64 %11, -1
%18 = urem i64 %17, 6
%19 = sub nsw i64 %17, %18
%20 = add nsw i64 %19, 6
%21 = getelementptr double, double* %1, i64 %20
%22 = getelementptr double, double* %0, i64 4
%23 = icmp ugt double* %22, %1
%24 = icmp ugt double* %21, %0
%25 = and i1 %23, %24
br i1 %25, label %80, label %26
26: ; preds = %16
%27 = and i64 %14, 9223372036854775806
%28 = mul i64 %27, 6
br label %29
29: ; preds = %29, %26
%30 = phi i64 [ 0, %26 ], [ %76, %29 ]
%31 = mul i64 %30, 6
%32 = load double, double* %8
%33 = insertelement <2 x double> poison, double %32, i64 0
%34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> zeroinitializer
%35 = load double, double* %0
%36 = insertelement <2 x double> poison, double %35, i64 0
%37 = shufflevector <2 x double> %36, <2 x double> poison, <2 x i32> zeroinitializer
%38 = fneg <2 x double> %37
%39 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %38, <2 x double> %37, <2 x double> %34)
%40 = fmul <2 x double> %39, <double 1.000000e+01, double 1.000000e+01>
%41 = insertelement <2 x double> poison, double %35, i64 0
%42 = fsub <2 x double> <double 1.000000e+00, double poison>, %41
%43 = shufflevector <2 x double> %42, <2 x double> poison, <2 x i32> zeroinitializer
%44 = load double, double* %9
%45 = insertelement <2 x double> poison, double %44, i64 0
%46 = shufflevector <2 x double> %45, <2 x double> poison, <2 x i32> zeroinitializer
%47 = load double, double* %10
%48 = insertelement <2 x double> poison, double %47, i64 0
%49 = shufflevector <2 x double> %48, <2 x double> poison, <2 x i32> zeroinitializer
%50 = fneg <2 x double> %49
%51 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %50, <2 x double> %49, <2 x double> %46)
%52 = fmul <2 x double> %51, <double 0x4022F9422C23C47E, double 0x4022F9422C23C47E>
%53 = insertelement <2 x double> poison, double %47, i64 0
%54 = fsub <2 x double> <double 1.000000e+00, double poison>, %53
%55 = shufflevector <2 x double> %54, <2 x double> poison, <2 x i32> zeroinitializer
%56 = load double, double* %8
%57 = load double, double* %9
%58 = fadd double %56, %57
%59 = fadd double %58, -2.000000e+00
%60 = fmul double %59, 0x40094C583ADA5B53
%61 = insertelement <2 x double> poison, double %60, i64 0
%62 = shufflevector <2 x double> %61, <2 x double> poison, <2 x i32> zeroinitializer
%63 = load double, double* %8
%64 = load double, double* %9
%65 = fsub double %63, %64
%66 = fdiv double %65, 0x40094C583ADA5B53
%67 = insertelement <2 x double> poison, double %66, i64 0
%68 = shufflevector <2 x double> %67, <2 x double> poison, <2 x i32> zeroinitializer
%69 = getelementptr inbounds double, double* %1, i64 %31
%70 = bitcast double* %69 to <12 x double>*
%71 = shufflevector <2 x double> %40, <2 x double> %43, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%72 = shufflevector <2 x double> %52, <2 x double> %55, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%73 = shufflevector <4 x double> %71, <4 x double> %72, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%74 = shufflevector <2 x double> %62, <2 x double> %68, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef>
%75 = shufflevector <8 x double> %73, <8 x double> %74, <12 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 1, i32 3, i32 5, i32 7, i32 9, i32 11>
store <12 x double> %75, <12 x double>* %70
%76 = add nuw i64 %30, 2
%77 = icmp eq i64 %76, %27
br i1 %77, label %78, label %29
78: ; preds = %29
%79 = icmp eq i64 %14, %27
br i1 %79, label %120, label %80
80: ; preds = %16, %7, %78
%81 = phi i64 [ 0, %16 ], [ 0, %7 ], [ %28, %78 ]
br label %82
82: ; preds = %80, %82
%83 = phi i64 [ %118, %82 ], [ %81, %80 ]
%84 = load double, double* %8
%85 = load double, double* %0
%86 = fneg double %85
%87 = tail call double @llvm.fmuladd.f64(double %86, double %85, double %84)
%88 = fmul double %87, 1.000000e+01
%89 = getelementptr inbounds double, double* %1, i64 %83
store double %88, double* %89
%90 = load double, double* %0
%91 = fsub double 1.000000e+00, %90
%92 = or i64 %83, 1
%93 = getelementptr inbounds double, double* %1, i64 %92
store double %91, double* %93
%94 = load double, double* %9
%95 = load double, double* %10
%96 = fneg double %95
%97 = tail call double @llvm.fmuladd.f64(double %96, double %95, double %94)
%98 = fmul double %97, 0x4022F9422C23C47E
%99 = add nuw nsw i64 %83, 2
%100 = getelementptr inbounds double, double* %1, i64 %99
store double %98, double* %100
%101 = load double, double* %10
%102 = fsub double 1.000000e+00, %101
%103 = add nuw nsw i64 %83, 3
%104 = getelementptr inbounds double, double* %1, i64 %103
store double %102, double* %104
%105 = load double, double* %8
%106 = load double, double* %9
%107 = fadd double %105, %106
%108 = fadd double %107, -2.000000e+00
%109 = fmul double %108, 0x40094C583ADA5B53
%110 = add nuw nsw i64 %83, 4
%111 = getelementptr inbounds double, double* %1, i64 %110
store double %109, double* %111
%112 = load double, double* %8
%113 = load double, double* %9
%114 = fsub double %112, %113
%115 = fdiv double %114, 0x40094C583ADA5B53
%116 = add nuw nsw i64 %83, 5
%117 = getelementptr inbounds double, double* %1, i64 %116
store double %115, double* %117
%118 = add nuw nsw i64 %83, 6
%119 = icmp ult i64 %118, %11
br i1 %119, label %82, label %120
120: ; preds = %82, %78, %5
ret void
}