int awavwave(dummy, nawav, sawav, swave, awav, wave, stat)
double dummy;
int nawav, sawav, swave;
const double awav[];
double wave[];
int stat[];
{
  int status = 0;
  double n, s;
  register int iawav, *statp;
  register const double *awavp;
  register double *wavep;
  awavp = awav;
  wavep = wave;
  statp = stat;
  for (iawav = 0; iawav < nawav; iawav++) {
    if (*awavp != 0.0) {
      s = 1.0 / (*awavp);
      s *= s;
      n = 2.554e8 / (0.41e14 - s);
      n += 294.981e8 / (1.46e14 - s);
      n += 1.000064328;
      *wavep = (*awavp) * n;
      *(statp++) = 0;
    } else {
      *(statp++) = 1;
      status = 4;
    }
    awavp += sawav;
    wavep += swave;
  }
  return status;
}


x86 assembly (clang, -O0):
<awavwave>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    126a <awavwave+0x16a>
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1170 <awavwave+0x70>
jp     1170 <awavwave+0x70>
jmp    1216 <awavwave+0x116>
mov    -0x60(%rbp),%rax
movsd  0xeac(%rip),%xmm0
divsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe84(%rip),%xmm1
subsd  -0x48(%rbp),%xmm1
movsd  0xe6f(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe56(%rip),%xmm1
subsd  -0x48(%rbp),%xmm1
movsd  0xe41(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe23(%rip),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    -0x68(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x58(%rbp)
movl   $0x0,(%rax)
jmp    1232 <awavwave+0x132>
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x58(%rbp)
movl   $0x1,(%rax)
movl   $0x4,-0x34(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x60(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x68(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1144 <awavwave+0x44>
mov    -0x34(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<awavwave>:
test   %edi,%edi
jle    11ce <awavwave+0xce>
movslq %esi,%r10
movslq %edx,%rdx
shl    $0x3,%rdx
shl    $0x3,%r10
mov    %edi,%r11d
xor    %esi,%esi
xorpd  %xmm0,%xmm0
movsd  0xed8(%rip),%xmm8
movsd  0xed7(%rip),%xmm9
movsd  0xed6(%rip),%xmm10
movsd  0xed6(%rip),%xmm4
movsd  0xed6(%rip),%xmm5
movsd  0xed6(%rip),%xmm6
xor    %eax,%eax
jmp    11b5 <awavwave+0xb5>
cs nopw 0x0(%rax,%rax,1)
movapd %xmm8,%xmm1
divsd  %xmm7,%xmm1
mulsd  %xmm1,%xmm1
movapd %xmm9,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm10,%xmm3
divsd  %xmm2,%xmm3
movapd %xmm4,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm5,%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
addsd  %xmm6,%xmm1
mulsd  %xmm7,%xmm1
movsd  %xmm1,(%r8)
xor    %edi,%edi
mov    %edi,(%r9,%rsi,4)
add    %rdx,%r8
add    %r10,%rcx
add    $0x1,%rsi
cmp    %esi,%r11d
je     11cd <awavwave+0xcd>
movsd  (%rcx),%xmm7
ucomisd %xmm0,%xmm7
jne    1160 <awavwave+0x60>
jp     1160 <awavwave+0x60>
mov    $0x4,%eax
mov    $0x1,%edi
jmp    11a2 <awavwave+0xa2>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @awavwave(double %0, i32 %1, i32 %2, i32 %3, double* %4, double* %5, i32* %6) {
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
%14 = alloca i32*
%15 = alloca i32
%16 = alloca double
%17 = alloca double
%18 = alloca i32
%19 = alloca i32*
%20 = alloca double*
%21 = alloca double*
store double %0, double* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
store i32* %6, i32** %14
store i32 0, i32* %15
%22 = load double*, double** %12
store double* %22, double** %20
%23 = load double*, double** %13
store double* %23, double** %21
%24 = load i32*, i32** %14
store i32* %24, i32** %19
store i32 0, i32* %18
br label %25
25: ; preds = %69, %7
%26 = load i32, i32* %18
%27 = load i32, i32* %9
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %72
29: ; preds = %25
%30 = load double*, double** %20
%31 = load double, double* %30
%32 = fcmp une double %31, 0.000000e+00
br i1 %32, label %33, label %57
33: ; preds = %29
%34 = load double*, double** %20
%35 = load double, double* %34
%36 = fdiv double 1.000000e+00, %35
store double %36, double* %17
%37 = load double, double* %17
%38 = load double, double* %17
%39 = fmul double %38, %37
store double %39, double* %17
%40 = load double, double* %17
%41 = fsub double 4.100000e+13, %40
%42 = fdiv double 2.554000e+08, %41
store double %42, double* %16
%43 = load double, double* %17
%44 = fsub double 1.460000e+14, %43
%45 = fdiv double 2.949810e+10, %44
%46 = load double, double* %16
%47 = fadd double %46, %45
store double %47, double* %16
%48 = load double, double* %16
%49 = fadd double %48, 0x3FF0004373EA7FDD
store double %49, double* %16
%50 = load double*, double** %20
%51 = load double, double* %50
%52 = load double, double* %16
%53 = fmul double %51, %52
%54 = load double*, double** %21
store double %53, double* %54
%55 = load i32*, i32** %19
%56 = getelementptr inbounds i32, i32* %55, i32 1
store i32* %56, i32** %19
store i32 0, i32* %55
br label %60
57: ; preds = %29
%58 = load i32*, i32** %19
%59 = getelementptr inbounds i32, i32* %58, i32 1
store i32* %59, i32** %19
store i32 1, i32* %58
store i32 4, i32* %15
br label %60
60: ; preds = %57, %33
%61 = load i32, i32* %10
%62 = load double*, double** %20
%63 = sext i32 %61 to i64
%64 = getelementptr inbounds double, double* %62, i64 %63
store double* %64, double** %20
%65 = load i32, i32* %11
%66 = load double*, double** %21
%67 = sext i32 %65 to i64
%68 = getelementptr inbounds double, double* %66, i64 %67
store double* %68, double** %21
br label %69
69: ; preds = %60
%70 = load i32, i32* %18
%71 = add nsw i32 %70, 1
store i32 %71, i32* %18
br label %25
72: ; preds = %25
%73 = load i32, i32* %15
ret i32 %73
}

LLVM IR (-O2):
define i32 @awavwave(double %0, i32 %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture writeonly %5, i32* nocapture writeonly %6) {
%8 = icmp sgt i32 %1, 0
br i1 %8, label %9, label %38
9: ; preds = %7
%10 = sext i32 %2 to i64
%11 = sext i32 %3 to i64
br label %12
12: ; preds = %9, %30
%13 = phi double* [ %5, %9 ], [ %35, %30 ]
%14 = phi double* [ %4, %9 ], [ %34, %30 ]
%15 = phi i32* [ %6, %9 ], [ %33, %30 ]
%16 = phi i32 [ 0, %9 ], [ %36, %30 ]
%17 = phi i32 [ 0, %9 ], [ %32, %30 ]
%18 = load double, double* %14
%19 = fcmp une double %18, 0.000000e+00
br i1 %19, label %20, label %30
20: ; preds = %12
%21 = fdiv double 1.000000e+00, %18
%22 = fmul double %21, %21
%23 = fsub double 4.100000e+13, %22
%24 = fdiv double 2.554000e+08, %23
%25 = fsub double 1.460000e+14, %22
%26 = fdiv double 2.949810e+10, %25
%27 = fadd double %24, %26
%28 = fadd double %27, 0x3FF0004373EA7FDD
%29 = fmul double %18, %28
store double %29, double* %13
br label %30
30: ; preds = %12, %20
%31 = phi i32 [ 0, %20 ], [ 1, %12 ]
%32 = phi i32 [ %17, %20 ], [ 4, %12 ]
%33 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %31, i32* %15
%34 = getelementptr inbounds double, double* %14, i64 %10
%35 = getelementptr inbounds double, double* %13, i64 %11
%36 = add nuw nsw i32 %16, 1
%37 = icmp eq i32 %36, %1
br i1 %37, label %38, label %12
38: ; preds = %30, %7
%39 = phi i32 [ 0, %7 ], [ %32, %30 ]
ret i32 %39
}