void polyev(int nn, double sr, double si, double *pr, double *pi, double *qr,
            double *qi, double *pvr, double *pvi) {
  double t;
  int i;
  qr[0] = pr[0];
  qi[0] = pi[0];
  *pvr = qr[0];
  *pvi = qi[0];
  for (i = 1; i < nn; i++) {
    t = (*pvr) * sr - (*pvi) * si + pr[i];
    *pvi = (*pvr) * si + (*pvi) * sr + pi[i];
    *pvr = t;
    qr[i] = *pvr;
    qi[i] = *pvi;
  }
}


x86 assembly (clang, -O0):
<polyev>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1243 <polyev+0x143>
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x10(%rbp),%xmm2
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x4c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x18(%rbp),%xmm2
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x4c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1170 <polyev+0x70>
pop    %rbp
ret

x86 assembly (clang, -O2):
<polyev>:
mov    0x8(%rsp),%rax
movsd  (%rsi),%xmm2
movsd  %xmm2,(%rcx)
movsd  (%rdx),%xmm2
movsd  %xmm2,(%r8)
movsd  (%rcx),%xmm2
movsd  %xmm2,(%r9)
movsd  (%r8),%xmm2
movsd  %xmm2,(%rax)
cmp    $0x2,%edi
jl     119a <polyev+0x9a>
mov    %edi,%r10d
add    $0xfffffffffffffffe,%r10
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
movsd  (%r9),%xmm3
movapd %xmm2,%xmm4
mulsd  %xmm1,%xmm4
movapd %xmm3,%xmm5
mulsd  %xmm0,%xmm5
subsd  %xmm4,%xmm5
addsd  0x8(%rsi,%rdi,8),%xmm5
mulsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
addsd  0x8(%rdx,%rdi,8),%xmm3
movsd  %xmm3,(%rax)
movsd  %xmm5,(%r9)
movsd  %xmm5,0x8(%rcx,%rdi,8)
movsd  (%rax),%xmm2
movsd  %xmm2,0x8(%r8,%rdi,8)
cmp    %rdi,%r10
je     119a <polyev+0x9a>
movsd  (%rax),%xmm2
add    $0x1,%rdi
jmp    1140 <polyev+0x40>
ret

LLVM IR (-O0):
define void @polyev(i32 %0, double %1, double %2, double* %3, double* %4, double* %5, double* %6, double* %7, double* %8) {
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double
%20 = alloca i32
store i32 %0, i32* %10
store double %1, double* %11
store double %2, double* %12
store double* %3, double** %13
store double* %4, double** %14
store double* %5, double** %15
store double* %6, double** %16
store double* %7, double** %17
store double* %8, double** %18
%21 = load double*, double** %13
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = load double*, double** %15
%25 = getelementptr inbounds double, double* %24, i64 0
store double %23, double* %25
%26 = load double*, double** %14
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = load double*, double** %16
%30 = getelementptr inbounds double, double* %29, i64 0
store double %28, double* %30
%31 = load double*, double** %15
%32 = getelementptr inbounds double, double* %31, i64 0
%33 = load double, double* %32
%34 = load double*, double** %17
store double %33, double* %34
%35 = load double*, double** %16
%36 = getelementptr inbounds double, double* %35, i64 0
%37 = load double, double* %36
%38 = load double*, double** %18
store double %37, double* %38
store i32 1, i32* %20
br label %39
39: ; preds = %88, %9
%40 = load i32, i32* %20
%41 = load i32, i32* %10
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %91
43: ; preds = %39
%44 = load double*, double** %17
%45 = load double, double* %44
%46 = load double, double* %11
%47 = load double*, double** %18
%48 = load double, double* %47
%49 = load double, double* %12
%50 = fmul double %48, %49
%51 = fneg double %50
%52 = call double @llvm.fmuladd.f64(double %45, double %46, double %51)
%53 = load double*, double** %13
%54 = load i32, i32* %20
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds double, double* %53, i64 %55
%57 = load double, double* %56
%58 = fadd double %52, %57
store double %58, double* %19
%59 = load double*, double** %17
%60 = load double, double* %59
%61 = load double, double* %12
%62 = load double*, double** %18
%63 = load double, double* %62
%64 = load double, double* %11
%65 = fmul double %63, %64
%66 = call double @llvm.fmuladd.f64(double %60, double %61, double %65)
%67 = load double*, double** %14
%68 = load i32, i32* %20
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %67, i64 %69
%71 = load double, double* %70
%72 = fadd double %66, %71
%73 = load double*, double** %18
store double %72, double* %73
%74 = load double, double* %19
%75 = load double*, double** %17
store double %74, double* %75
%76 = load double*, double** %17
%77 = load double, double* %76
%78 = load double*, double** %15
%79 = load i32, i32* %20
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds double, double* %78, i64 %80
store double %77, double* %81
%82 = load double*, double** %18
%83 = load double, double* %82
%84 = load double*, double** %16
%85 = load i32, i32* %20
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %84, i64 %86
store double %83, double* %87
br label %88
88: ; preds = %43
%89 = load i32, i32* %20
%90 = add nsw i32 %89, 1
store i32 %90, i32* %20
br label %39
91: ; preds = %39
ret void
}

LLVM IR (-O2):
define void @polyev(i32 %0, double %1, double %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, double* nocapture %6, double* nocapture %7, double* nocapture %8) {
%10 = load double, double* %3
store double %10, double* %5
%11 = load double, double* %4
store double %11, double* %6
%12 = load double, double* %5
store double %12, double* %7
%13 = load double, double* %6
store double %13, double* %8
%14 = icmp sgt i32 %0, 1
br i1 %14, label %15, label %39
15: ; preds = %9
%16 = zext i32 %0 to i64
br label %17
17: ; preds = %37, %15
%18 = phi double [ %13, %15 ], [ %38, %37 ]
%19 = phi i64 [ 1, %15 ], [ %35, %37 ]
%20 = load double, double* %7
%21 = fneg double %18
%22 = fmul double %21, %2
%23 = tail call double @llvm.fmuladd.f64(double %20, double %1, double %22)
%24 = getelementptr inbounds double, double* %3, i64 %19
%25 = load double, double* %24
%26 = fadd double %25, %23
%27 = fmul double %18, %1
%28 = tail call double @llvm.fmuladd.f64(double %20, double %2, double %27)
%29 = getelementptr inbounds double, double* %4, i64 %19
%30 = load double, double* %29
%31 = fadd double %28, %30
store double %31, double* %8
store double %26, double* %7
%32 = getelementptr inbounds double, double* %5, i64 %19
store double %26, double* %32
%33 = load double, double* %8
%34 = getelementptr inbounds double, double* %6, i64 %19
store double %33, double* %34
%35 = add nuw nsw i64 %19, 1
%36 = icmp eq i64 %35, %16
br i1 %36, label %39, label %37
37: ; preds = %17
%38 = load double, double* %8
br label %17
39: ; preds = %17, %9
ret void
}