#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ LINES;
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ fputc(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ move(scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ *popen(char *, char *);
void *play(void *foo) {
  move(LINES - 1, 0);
  FILE *pipe = popen("aplay -r 48000 2>&1 > /dev/null", "w");
  int t;
  for (t = 0;; t++)
    fputc(f(t / 8.0), pipe);
}


x86 assembly (clang, -O0):
<play>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%rdi
sub    $0x1,%rdi
xor    %esi,%esi
call   1060 <move@plt>
lea    0xea0(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xe74(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <f@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <fputc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117f <play+0x3f>

x86 assembly (clang, -O2):
<play>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e9e(%rip),%rax
mov    (%rax),%rdi
add    $0xffffffffffffffff,%rdi
xor    %ebp,%ebp
xor    %esi,%esi
call   1060 <move@plt>
lea    0xea7(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,%rbx
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0xe81(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <f@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
add    $0x1,%ebp
jmp    1170 <play+0x30>

LLVM IR (-O0):
@LINES = global i64 0
@.str = [32 x i8] c"aplay -r 48000 2>&1 > /dev/null\00"
@.str.1 = [2 x i8] c"w\00"
define i8* @play(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i64, i64* @LINES
%6 = sub nsw i64 %5, 1
%7 = call i32 @move(i64 %6, i32 0)
%8 = call i32* @popen(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %3
store i32 0, i32* %4
br label %9
9: ; preds = %17, %1
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 8.000000e+00
%13 = fptosi double %12 to i32
%14 = call i32 @f(i32 %13)
%15 = load i32*, i32** %3
%16 = call i32 @fputc(i32 %14, i32* %15)
br label %17
17: ; preds = %9
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %9
}

LLVM IR (-O2):
@LINES = global i64 0
@.str = [32 x i8] c"aplay -r 48000 2>&1 > /dev/null\00"
@.str.1 = [2 x i8] c"w\00"
define noalias i8* @play(i8* nocapture readnone %0) {
%2 = load i64, i64* @LINES
%3 = add nsw i64 %2, -1
%4 = tail call i32 @move(i64 %3, i32 0)
%5 = tail call i32* @popen(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %6, %1
%7 = phi i32 [ 0, %1 ], [ %13, %6 ]
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 1.250000e-01
%10 = fptosi double %9 to i32
%11 = tail call i32 @f(i32 %10)
%12 = tail call i32 @fputc(i32 %11, i32* %5)
%13 = add nuw nsw i32 %7, 1
br label %6
}