#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 */
float filtered_pulsetrain(float, double, float, int /*<<< orphan*/);
int /*<<< orphan*/ filterwidth(float);
scalar_t__ floor(float);
float compute_filtered_lines(float value, float width, float gain,
                             float offset) {
  float x = (value - offset) * gain;
  x -= floor(x);
  return 1.0 - filtered_pulsetrain(width, 1.0, x, filterwidth(offset));
}


x86 assembly (clang, -O0):
<compute_filtered_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <floor@plt>
cvtsi2ss %rax,%xmm1
movss  -0x14(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <filterwidth@plt>
movss  -0x1c(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
mov    %eax,%edi
movsd  0xe51(%rip),%xmm1
call   1050 <filtered_pulsetrain@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xe40(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_filtered_lines>:
sub    $0x18,%rsp
movss  %xmm3,0x10(%rsp)
movss  %xmm1,0x14(%rsp)
subss  %xmm3,%xmm0
mulss  %xmm0,%xmm2
movss  %xmm2,0xc(%rsp)
movaps %xmm2,%xmm0
call   1040 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
movss  0x10(%rsp),%xmm0
call   1030 <filterwidth@plt>
movsd  0xe7f(%rip),%xmm1
movss  0x14(%rsp),%xmm0
movss  0xc(%rsp),%xmm2
mov    %eax,%edi
call   1050 <filtered_pulsetrain@plt>
movss  0xe6c(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @compute_filtered_lines(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = load float, float* %5
%11 = load float, float* %8
%12 = fsub float %10, %11
%13 = load float, float* %7
%14 = fmul float %12, %13
store float %14, float* %9
%15 = load float, float* %9
%16 = call i64 @floor(float %15)
%17 = sitofp i64 %16 to float
%18 = load float, float* %9
%19 = fsub float %18, %17
store float %19, float* %9
%20 = load float, float* %6
%21 = load float, float* %9
%22 = load float, float* %8
%23 = call i32 @filterwidth(float %22)
%24 = call float @filtered_pulsetrain(float %20, double 1.000000e+00, float %21, i32 %23)
%25 = fpext float %24 to double
%26 = fsub double 1.000000e+00, %25
%27 = fptrunc double %26 to float
ret float %27
}

LLVM IR (-O2):
define float @compute_filtered_lines(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %3
%6 = fmul float %5, %2
%7 = tail call i64 @floor(float %6)
%8 = sitofp i64 %7 to float
%9 = fsub float %6, %8
%10 = tail call i32 @filterwidth(float %3)
%11 = tail call float @filtered_pulsetrain(float %1, double 1.000000e+00, float %9, i32 %10)
%12 = fsub float 1.000000e+00, %11
ret float %12
}