#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 smf2bandv(float *, float, int /*<<< orphan*/, float);
int /*<<< orphan*/ smff2w_2(float);
void smf2band(float *u, int n, float *y, float *x, float *f, float *r) {
  int i;
  for (i = 0; i < n; i++) {
    y[i] = smf2bandv(u, x[i], smff2w_2(f[i]), 1.414213562373095f * (1 - r[i]));
  }
}


x86 assembly (clang, -O0):
<smf2band>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ca <smf2band+0xaa>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1040 <smff2w_2@plt>
mov    -0x40(%rbp),%rdi
movss  -0x38(%rbp),%xmm0
mov    %eax,%esi
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  0xe6b(%rip),%xmm2
subss  (%rax,%rcx,4),%xmm2
movss  0xe5a(%rip),%xmm1
mulss  %xmm2,%xmm1
call   1030 <smf2bandv@plt>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1146 <smf2band+0x26>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smf2band>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,0x10(%rsp)
test   %esi,%esi
jle    11a2 <smf2band+0x82>
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rdi,%rbx
mov    %esi,%ebp
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
movss  (%r12,%r14,4),%xmm0
movss  %xmm0,0xc(%rsp)
movss  (%r15,%r14,4),%xmm0
call   1040 <smff2w_2@plt>
movss  0xe91(%rip),%xmm1
mov    0x10(%rsp),%rcx
subss  (%rcx,%r14,4),%xmm1
mulss  0xe82(%rip),%xmm1
mov    %rbx,%rdi
movss  0xc(%rsp),%xmm0
mov    %eax,%esi
call   1030 <smf2bandv@plt>
movss  %xmm0,0x0(%r13,%r14,4)
add    $0x1,%r14
cmp    %r14,%rbp
jne    1150 <smf2band+0x30>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @smf2band(float* %0, i32 %1, float* %2, float* %3, float* %4, float* %5) {
%7 = alloca float*
%8 = alloca i32
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca i32
store float* %0, float** %7
store i32 %1, i32* %8
store float* %2, float** %9
store float* %3, float** %10
store float* %4, float** %11
store float* %5, float** %12
store i32 0, i32* %13
br label %14
14: ; preds = %43, %6
%15 = load i32, i32* %13
%16 = load i32, i32* %8
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %46
18: ; preds = %14
%19 = load float*, float** %7
%20 = load float*, float** %10
%21 = load i32, i32* %13
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds float, float* %20, i64 %22
%24 = load float, float* %23
%25 = load float*, float** %11
%26 = load i32, i32* %13
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds float, float* %25, i64 %27
%29 = load float, float* %28
%30 = call i32 @smff2w_2(float %29)
%31 = load float*, float** %12
%32 = load i32, i32* %13
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds float, float* %31, i64 %33
%35 = load float, float* %34
%36 = fsub float 1.000000e+00, %35
%37 = fmul float 0x3FF6A09E60000000, %36
%38 = call float @smf2bandv(float* %19, float %24, i32 %30, float %37)
%39 = load float*, float** %9
%40 = load i32, i32* %13
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds float, float* %39, i64 %41
store float %38, float* %42
br label %43
43: ; preds = %18
%44 = load i32, i32* %13
%45 = add nsw i32 %44, 1
store i32 %45, i32* %13
br label %14
46: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @smf2band(float* %0, i32 %1, float* nocapture writeonly %2, float* nocapture %3, float* nocapture %4, float* nocapture %5) {
%7 = icmp sgt i32 %1, 0
br i1 %7, label %8, label %25
8: ; preds = %6
%9 = zext i32 %1 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %23, %10 ]
%12 = getelementptr inbounds float, float* %3, i64 %11
%13 = load float, float* %12
%14 = getelementptr inbounds float, float* %4, i64 %11
%15 = load float, float* %14
%16 = tail call i32 @smff2w_2(float %15)
%17 = getelementptr inbounds float, float* %5, i64 %11
%18 = load float, float* %17
%19 = fsub float 1.000000e+00, %18
%20 = fmul float %19, 0x3FF6A09E60000000
%21 = tail call float @smf2bandv(float* %0, float %13, i32 %16, float %20)
%22 = getelementptr inbounds float, float* %2, i64 %11
store float %21, float* %22
%23 = add nuw nsw i64 %11, 1
%24 = icmp eq i64 %23, %9
br i1 %24, label %25, label %10
25: ; preds = %10, %6
ret void
}