#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*/ dcsqf1(int, float *, float *, float *, int *);
void __ogg_fdcosqf(int n, float *x, float *wsave, int *ifac) {
  static float sqrt2 = 1.4142135623730950488016887242097;
  float tsqx;
  switch (n) {
  case 0:
  case 1:
    return;
  case 2:
    tsqx = sqrt2 * x[1];
    x[1] = x[0] - tsqx;
    x[0] += tsqx;
    return;
  default:
    dcsqf1(n, x, wsave, wsave + n, ifac);
    return;
  }
}


x86 assembly (clang, -O0):
<__ogg_fdcosqf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x2,%eax
jb     114c <__ogg_fdcosqf+0x3c>
jmp    113b <__ogg_fdcosqf+0x2b>
mov    -0x28(%rbp),%eax
sub    $0x2,%eax
je     1151 <__ogg_fdcosqf+0x41>
jmp    1193 <__ogg_fdcosqf+0x83>
jmp    11b6 <__ogg_fdcosqf+0xa6>
movss  0x2ecf(%rip),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
subss  -0x24(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x24(%rbp),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,(%rax)
jmp    11b6 <__ogg_fdcosqf+0xa6>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
mov    -0x20(%rbp),%r8
call   1030 <dcsqf1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ogg_fdcosqf>:
cmp    $0x2,%edi
jb     113c <__ogg_fdcosqf+0x2c>
jne    113d <__ogg_fdcosqf+0x2d>
movss  (%rsi),%xmm0
movss  0x4(%rsi),%xmm1
mulss  0xed8(%rip),%xmm1
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
movss  %xmm2,0x4(%rsi)
addss  %xmm0,%xmm1
movss  %xmm1,(%rsi)
ret
mov    %rcx,%r8
movslq %edi,%rax
lea    (%rdx,%rax,4),%rcx
jmp    1030 <dcsqf1@plt>

LLVM IR (-O0):
@__ogg_fdcosqf.sqrt2 = internal global float 0x3FF6A09E60000000
define void @__ogg_fdcosqf(i32 %0, float* %1, float* %2, i32* %3) {
%5 = alloca i32
%6 = alloca float*
%7 = alloca float*
%8 = alloca i32*
%9 = alloca float
store i32 %0, i32* %5
store float* %1, float** %6
store float* %2, float** %7
store i32* %3, i32** %8
%10 = load i32, i32* %5
switch i32 %10, label %30 [
i32 0, label %11
i32 1, label %11
i32 2, label %12
]
11: ; preds = %4, %4
br label %40
12: ; preds = %4
%13 = load float, float* @__ogg_fdcosqf.sqrt2
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
store float %17, float* %9
%18 = load float*, float** %6
%19 = getelementptr inbounds float, float* %18, i64 0
%20 = load float, float* %19
%21 = load float, float* %9
%22 = fsub float %20, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float, float* %9
%26 = load float*, float** %6
%27 = getelementptr inbounds float, float* %26, i64 0
%28 = load float, float* %27
%29 = fadd float %28, %25
store float %29, float* %27
br label %40
30: ; preds = %4
%31 = load i32, i32* %5
%32 = load float*, float** %6
%33 = load float*, float** %7
%34 = load float*, float** %7
%35 = load i32, i32* %5
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float, float* %34, i64 %36
%38 = load i32*, i32** %8
%39 = call i32 @dcsqf1(i32 %31, float* %32, float* %33, float* %37, i32* %38)
br label %40
40: ; preds = %30, %12, %11
ret void
}

LLVM IR (-O2):
define void @__ogg_fdcosqf(i32 %0, float* %1, float* %2, i32* %3) {
switch i32 %0, label %12 [
i32 0, label %16
i32 1, label %16
i32 2, label %5
]
5: ; preds = %4
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = fmul float %7, 0x3FF6A09E60000000
%9 = load float, float* %1
%10 = fsub float %9, %8
store float %10, float* %6
%11 = fadd float %9, %8
store float %11, float* %1
br label %16
12: ; preds = %4
%13 = sext i32 %0 to i64
%14 = getelementptr inbounds float, float* %2, i64 %13
%15 = tail call i32 @dcsqf1(i32 %0, float* %1, float* %2, float* %14, i32* %3)
br label %16
16: ; preds = %4, %4, %12, %5
ret void
}