#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 */
double M_PI;
int arr(int);
double note(int, double);
double pow(int, double);
double f(double t) {
  double semi = pow(2, 1.0 / 12.0);
  double tone = pow(2, 1.0 / 6.0);
  double third = pow(2, 1.0 / 3.0);
  double fifth = pow(2, 7.0 / 12.0);
  double st = t * M_PI / 32.0;
  int q = t / 1000;
  return note(arr(q) % (12 * 4), st);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x2,%edi
movsd  0xede(%rip),%xmm0
call   1040 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x2,%edi
movsd  0xebf(%rip),%xmm0
call   1040 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x2,%edi
movsd  0xea0(%rip),%xmm0
call   1040 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
mov    $0x2,%edi
movsd  0xe81(%rip),%xmm0
call   1040 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2e43(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xe57(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe39(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%edi
call   1050 <arr@plt>
mov    $0x30,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
movsd  -0x30(%rbp),%xmm0
call   1030 <note@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  0xebe(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0xeb4(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0xeaa(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0xea0(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    0x2e5f(%rip),%rax
movsd  (%rax),%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm1
mulsd  0xe81(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
divsd  0xe7b(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <arr@plt>
movslq %eax,%rdi
imul   $0x2aaaaaab,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x23,%rax
add    %ecx,%eax
shl    $0x4,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%edi
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
jmp    1030 <note@plt>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @f(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
store double %0, double* %2
%9 = call double @pow(i32 2, double 0x3FB5555555555555)
store double %9, double* %3
%10 = call double @pow(i32 2, double 0x3FC5555555555555)
store double %10, double* %4
%11 = call double @pow(i32 2, double 0x3FD5555555555555)
store double %11, double* %5
%12 = call double @pow(i32 2, double 0x3FE2AAAAAAAAAAAB)
store double %12, double* %6
%13 = load double, double* %2
%14 = load double, double* @M_PI
%15 = fmul double %13, %14
%16 = fdiv double %15, 3.200000e+01
store double %16, double* %7
%17 = load double, double* %2
%18 = fdiv double %17, 1.000000e+03
%19 = fptosi double %18 to i32
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = call i32 @arr(i32 %20)
%22 = srem i32 %21, 48
%23 = load double, double* %7
%24 = call double @note(i32 %22, double %23)
ret double %24
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @f(double %0) {
%2 = tail call double @pow(i32 2, double 0x3FB5555555555555)
%3 = tail call double @pow(i32 2, double 0x3FC5555555555555)
%4 = tail call double @pow(i32 2, double 0x3FD5555555555555)
%5 = tail call double @pow(i32 2, double 0x3FE2AAAAAAAAAAAB)
%6 = load double, double* @M_PI
%7 = fmul double %6, %0
%8 = fmul double %7, 3.125000e-02
%9 = fdiv double %0, 1.000000e+03
%10 = fptosi double %9 to i32
%11 = tail call i32 @arr(i32 %10)
%12 = srem i32 %11, 48
%13 = tail call double @note(i32 %12, double %8)
ret double %13
}