#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 /*<<< orphan*/ xfir_gen_lowpass(float *, size_t, float, int, float);
void xfir_gen_highpass(float taps[], size_t n_taps, float cut_freq,
                       int win_type, float alpha) {
  size_t i;
  xfir_gen_lowpass(taps, n_taps, 0.5f - cut_freq, win_type, alpha);
  for (i = ((n_taps + 1) / 2) & 1; i < n_taps; i += 2) {
    taps[i] = -taps[i];
  }
}


x86 assembly (clang, -O0):
<xfir_gen_highpass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movss  %xmm1,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  0xec3(%rip),%xmm0
subss  -0x14(%rbp),%xmm0
mov    -0x18(%rbp),%edx
movss  -0x1c(%rbp),%xmm1
call   1030 <xfir_gen_lowpass@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shr    $0x1,%rax
and    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    11a9 <xfir_gen_highpass+0x99>
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x28(%rbp)
jmp    1163 <xfir_gen_highpass+0x53>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfir_gen_highpass>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movss  0xede(%rip),%xmm2
subss  %xmm0,%xmm2
movaps %xmm2,%xmm0
call   1030 <xfir_gen_lowpass@plt>
lea    0x1(%r14),%eax
shr    %eax
and    $0x1,%eax
cmp    %r14,%rax
jae    1166 <xfir_gen_highpass+0x56>
movaps 0xecd(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movss  (%rbx,%rax,4),%xmm1
xorps  %xmm0,%xmm1
movss  %xmm1,(%rbx,%rax,4)
add    $0x2,%rax
cmp    %r14,%rax
jb     1150 <xfir_gen_highpass+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @xfir_gen_highpass(float* %0, i64 %1, float %2, i32 %3, float %4) {
%6 = alloca float*
%7 = alloca i64
%8 = alloca float
%9 = alloca i32
%10 = alloca float
%11 = alloca i64
store float* %0, float** %6
store i64 %1, i64* %7
store float %2, float* %8
store i32 %3, i32* %9
store float %4, float* %10
%12 = load float*, float** %6
%13 = load i64, i64* %7
%14 = load float, float* %8
%15 = fsub float 5.000000e-01, %14
%16 = load i32, i32* %9
%17 = load float, float* %10
%18 = call i32 @xfir_gen_lowpass(float* %12, i64 %13, float %15, i32 %16, float %17)
%19 = load i64, i64* %7
%20 = add i64 %19, 1
%21 = udiv i64 %20, 2
%22 = and i64 %21, 1
store i64 %22, i64* %11
br label %23
23: ; preds = %36, %5
%24 = load i64, i64* %11
%25 = load i64, i64* %7
%26 = icmp ult i64 %24, %25
br i1 %26, label %27, label %39
27: ; preds = %23
%28 = load float*, float** %6
%29 = load i64, i64* %11
%30 = getelementptr inbounds float, float* %28, i64 %29
%31 = load float, float* %30
%32 = fneg float %31
%33 = load float*, float** %6
%34 = load i64, i64* %11
%35 = getelementptr inbounds float, float* %33, i64 %34
store float %32, float* %35
br label %36
36: ; preds = %27
%37 = load i64, i64* %11
%38 = add i64 %37, 2
store i64 %38, i64* %11
br label %23
39: ; preds = %23
ret void
}

LLVM IR (-O2):
define void @xfir_gen_highpass(float* %0, i64 %1, float %2, i32 %3, float %4) {
%6 = fsub float 5.000000e-01, %2
%7 = tail call i32 @xfir_gen_lowpass(float* %0, i64 %1, float %6, i32 %3, float %4)
%8 = add i64 %1, 1
%9 = lshr i64 %8, 1
%10 = and i64 %9, 1
%11 = icmp ult i64 %10, %1
br i1 %11, label %12, label %19
12: ; preds = %5, %12
%13 = phi i64 [ %17, %12 ], [ %10, %5 ]
%14 = getelementptr inbounds float, float* %0, i64 %13
%15 = load float, float* %14
%16 = fneg float %15
store float %16, float* %14
%17 = add nuw i64 %13, 2
%18 = icmp ult i64 %17, %1
br i1 %18, label %12, label %19
19: ; preds = %12, %5
ret void
}