#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*/ filter_setup();
int /*<<< orphan*/ filter_step(double, float *);
int /*<<< orphan*/ printf(char *, ...);
double sin(int);
int main(int argc __attribute__((unused)),
         char **argv __attribute__((unused))) {
  filter_setup();
  float time = 0;
  float output[10];
  for (int i = 0; i < 2222222; i++, time += 1.0 / 11025.0) {
    filter_step(0.5 + sin(100 * time) / 2.5, output);
    for (int j = 0; j < 10; j++)
      printf("%f ", output[j]);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <filter_setup@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x21e88e,-0x44(%rbp)
jge    1228 <main+0xe8>
movss  0xe97(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xe6e(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe5a(%rip),%xmm0
addsd  %xmm1,%xmm0
lea    -0x40(%rbp),%rdi
call   1060 <filter_step@plt>
movl   $0x0,-0x48(%rbp)
cmpl   $0xa,-0x48(%rbp)
jge    11ee <main+0xae>
movslq -0x48(%rbp),%rax
movss  -0x40(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe43(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    11ba <main+0x7a>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdfa(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    116c <main+0x2c>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
xor    %eax,%eax
call   1040 <filter_setup@plt>
xorps  %xmm0,%xmm0
mov    $0x21e88e,%ebp
lea    0x10(%rsp),%r14
lea    0xead(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movss  %xmm0,0xc(%rsp)
mulss  0xe72(%rip),%xmm0
cvttss2si %xmm0,%edi
call   1060 <sin@plt>
divsd  0xe69(%rip),%xmm0
addsd  0xe69(%rip),%xmm0
mov    %r14,%rdi
call   1070 <filter_step@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x24(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x28(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x2c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x30(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x34(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xd85(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0xffffffff,%ebp
jne    1180 <main+0x30>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca [10 x float]
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 (...) @filter_setup()
store float 0.000000e+00, float* %6
store i32 0, i32* %8
br label %11
11: ; preds = %38, %2
%12 = load i32, i32* %8
%13 = icmp slt i32 %12, 2222222
br i1 %13, label %14, label %45
14: ; preds = %11
%15 = load float, float* %6
%16 = fmul float 1.000000e+02, %15
%17 = fptosi float %16 to i32
%18 = call double @sin(i32 %17)
%19 = fdiv double %18, 2.500000e+00
%20 = fadd double 5.000000e-01, %19
%21 = getelementptr inbounds [10 x float], [10 x float]* %7, i64 0, i64 0
%22 = call i32 @filter_step(double %20, float* %21)
store i32 0, i32* %9
br label %23
23: ; preds = %33, %14
%24 = load i32, i32* %9
%25 = icmp slt i32 %24, 10
br i1 %25, label %26, label %36
26: ; preds = %23
%27 = load i32, i32* %9
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [10 x float], [10 x float]* %7, i64 0, i64 %28
%30 = load float, float* %29
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %31)
br label %33
33: ; preds = %26
%34 = load i32, i32* %9
%35 = add nsw i32 %34, 1
store i32 %35, i32* %9
br label %23
36: ; preds = %23
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %38
38: ; preds = %36
%39 = load i32, i32* %8
%40 = add nsw i32 %39, 1
store i32 %40, i32* %8
%41 = load float, float* %6
%42 = fpext float %41 to double
%43 = fadd double %42, 0x3F17C6F8C751F177
%44 = fptrunc double %43 to float
store float %44, float* %6
br label %11
45: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x float]
%4 = tail call i32 (...) @filter_setup()
%5 = bitcast [10 x float]* %3 to i8*
%6 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 0
%7 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 1
%8 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 2
%9 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 3
%10 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 4
%11 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 5
%12 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 6
%13 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 7
%14 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 8
%15 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 9
br label %17
16: ; preds = %17
ret i32 0
17: ; preds = %2, %17
%18 = phi i32 [ 0, %2 ], [ %57, %17 ]
%19 = phi float [ 0.000000e+00, %2 ], [ %60, %17 ]
%20 = fmul float %19, 1.000000e+02
%21 = fptosi float %20 to i32
%22 = call double @sin(i32 %21)
%23 = fdiv double %22, 2.500000e+00
%24 = fadd double %23, 5.000000e-01
%25 = call i32 @filter_step(double %24, float* %6)
%26 = load float, float* %6
%27 = fpext float %26 to double
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %27)
%29 = load float, float* %7
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %30)
%32 = load float, float* %8
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %33)
%35 = load float, float* %9
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %36)
%38 = load float, float* %10
%39 = fpext float %38 to double
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %39)
%41 = load float, float* %11
%42 = fpext float %41 to double
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %42)
%44 = load float, float* %12
%45 = fpext float %44 to double
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %45)
%47 = load float, float* %13
%48 = fpext float %47 to double
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %48)
%50 = load float, float* %14
%51 = fpext float %50 to double
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %51)
%53 = load float, float* %15
%54 = fpext float %53 to double
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %54)
%56 = call i32 @putchar(i32 10)
%57 = add nuw nsw i32 %18, 1
%58 = fpext float %19 to double
%59 = fadd double %58, 0x3F17C6F8C751F177
%60 = fptrunc double %59 to float
%61 = icmp eq i32 %57, 2222222
br i1 %61, label %16, label %17
}