#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 */
int freqwave(double, int, int, int, double const *, double *, int *);
int waveawav(double, int, int, int, double *, double *, int *);
int freqawav(double dummy, int nfreq, int sfreq, int sawav, const double freq[],
             double awav[], int stat[]) {
  int status;
  if ((status = freqwave(dummy, nfreq, sfreq, sawav, freq, awav, stat))) {
    return status;
  }
  return waveawav(dummy, nfreq, sawav, sawav, awav, awav, stat);
}


x86 assembly (clang, -O0):
<freqawav>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
call   1040 <freqwave@plt>
mov    %eax,-0x3c(%rbp)
cmp    $0x0,%eax
je     1178 <freqawav+0x58>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119a <freqawav+0x7a>
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
call   1030 <waveawav@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freqawav>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %edx,%ebp
mov    %edi,%ebx
movsd  %xmm0,(%rsp)
call   1040 <freqwave@plt>
test   %eax,%eax
je     114a <freqawav+0x2a>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
movsd  (%rsp),%xmm0
mov    %ebx,%edi
mov    %ebp,%esi
mov    %ebp,%edx
mov    %r15,%rcx
mov    %r15,%r8
mov    %r14,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <waveawav@plt>

LLVM IR (-O0):
define i32 @freqawav(double %0, i32 %1, i32 %2, i32 %3, double* %4, double* %5, i32* %6) {
%8 = alloca i32
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32*
%16 = alloca i32
store double %0, double* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store double* %4, double** %13
store double* %5, double** %14
store i32* %6, i32** %15
%17 = load double, double* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = load double*, double** %13
%22 = load double*, double** %14
%23 = load i32*, i32** %15
%24 = call i32 @freqwave(double %17, i32 %18, i32 %19, i32 %20, double* %21, double* %22, i32* %23)
store i32 %24, i32* %16
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %7
%27 = load i32, i32* %16
store i32 %27, i32* %8
br label %37
28: ; preds = %7
%29 = load double, double* %9
%30 = load i32, i32* %10
%31 = load i32, i32* %12
%32 = load i32, i32* %12
%33 = load double*, double** %14
%34 = load double*, double** %14
%35 = load i32*, i32** %15
%36 = call i32 @waveawav(double %29, i32 %30, i32 %31, i32 %32, double* %33, double* %34, i32* %35)
store i32 %36, i32* %8
br label %37
37: ; preds = %28, %26
%38 = load i32, i32* %8
ret i32 %38
}

LLVM IR (-O2):
define i32 @freqawav(double %0, i32 %1, i32 %2, i32 %3, double* %4, double* %5, i32* %6) {
%8 = tail call i32 @freqwave(double %0, i32 %1, i32 %2, i32 %3, double* %4, double* %5, i32* %6)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @waveawav(double %0, i32 %1, i32 %3, i32 %3, double* %5, double* %5, i32* %6)
br label %12
12: ; preds = %7, %10
%13 = phi i32 [ %11, %10 ], [ %8, %7 ]
ret i32 %13
}