#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 smf2nv(float, float);
void smf2n(int n, float *note, float *f, float *root) {
  while (n--) {
    note[n] = smf2nv(f[n], root[n]);
  }
}


x86 assembly (clang, -O0):
<smf2n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     116c <smf2n+0x5c>
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x4(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
call   1030 <smf2nv@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    1127 <smf2n+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smf2n>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edi,%edi
je     1160 <smf2n+0x50>
mov    %edi,%r13d
movslq %edi,%rax
lea    (%rdx,%rax,4),%r14
add    $0xfffffffffffffffc,%r14
lea    (%rcx,%rax,4),%r15
add    $0xfffffffffffffffc,%r15
lea    (%rsi,%rax,4),%r12
add    $0xfffffffffffffffc,%r12
neg    %r13d
xor    %ebx,%ebx
movss  (%r14,%rbx,4),%xmm0
movss  (%r15,%rbx,4),%xmm1
call   1030 <smf2nv@plt>
movss  %xmm0,(%r12,%rbx,4)
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r13d
jne    1140 <smf2n+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @smf2n(i32 %0, float* %1, float* %2, float* %3) {
%5 = alloca i32
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
store i32 %0, i32* %5
store float* %1, float** %6
store float* %2, float** %7
store float* %3, float** %8
br label %9
9: ; preds = %13, %4
%10 = load i32, i32* %5
%11 = add nsw i32 %10, -1
store i32 %11, i32* %5
%12 = icmp ne i32 %10, 0
br i1 %12, label %13, label %29
13: ; preds = %9
%14 = load float*, float** %7
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds float, float* %14, i64 %16
%18 = load float, float* %17
%19 = load float*, float** %8
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds float, float* %19, i64 %21
%23 = load float, float* %22
%24 = call float @smf2nv(float %18, float %23)
%25 = load float*, float** %6
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds float, float* %25, i64 %27
store float %24, float* %28
br label %9
29: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @smf2n(i32 %0, float* nocapture writeonly %1, float* nocapture %2, float* nocapture %3) {
%5 = icmp eq i32 %0, 0
br i1 %5, label %19, label %6
6: ; preds = %4
%7 = sext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ %7, %6 ], [ %10, %8 ]
%10 = add nsw i64 %9, -1
%11 = getelementptr inbounds float, float* %2, i64 %10
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %3, i64 %10
%14 = load float, float* %13
%15 = tail call float @smf2nv(float %12, float %14)
%16 = getelementptr inbounds float, float* %1, i64 %10
store float %15, float* %16
%17 = trunc i64 %10 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %8
19: ; preds = %8, %4
ret void
}