#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, float, float);
float smff2w_2(float);
void smf4band(float *u, int n, float *y, float *x, float *f, float *r) {
  int i;
  float t, w_2;
  for (i = 0; i < n; i++) {
    w_2 = smff2w_2(f[i]);
    t = smf2bandv(u, x[i], w_2, 1.847759065022574f);
    y[i] = smf2bandv(u + 2, t, w_2, 0.7653668647301796f * (1 - r[i]));
  }
}


x86 assembly (clang, -O0):
<smf4band>:
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    11e4 <smf4band+0xc4>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1040 <smff2w_2@plt>
movss  %xmm0,-0x3c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  -0x3c(%rbp),%xmm1
movss  0xe81(%rip),%xmm2
call   1030 <smf2bandv@plt>
movss  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
movss  -0x38(%rbp),%xmm0
movss  -0x3c(%rbp),%xmm1
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  0xe51(%rip),%xmm3
subss  (%rax,%rcx,4),%xmm3
movss  0xe40(%rip),%xmm2
mulss  %xmm3,%xmm2
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 <smf4band+0x26>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smf4band>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,0x10(%rsp)
mov    %rcx,0x8(%rsp)
test   %esi,%esi
jle    11b8 <smf4band+0x98>
mov    %r8,%r12
mov    %rdx,%r13
mov    %rdi,%rbx
lea    0x8(%rdi),%rbp
mov    %esi,%r14d
xor    %r15d,%r15d
nop
movss  (%r12,%r15,4),%xmm0
call   1040 <smff2w_2@plt>
movaps %xmm0,%xmm1
movss  %xmm0,0x4(%rsp)
mov    0x8(%rsp),%rax
movss  (%rax,%r15,4),%xmm0
mov    %rbx,%rdi
movss  0xe86(%rip),%xmm2
call   1030 <smf2bandv@plt>
movss  0xe7d(%rip),%xmm2
mov    0x10(%rsp),%rax
subss  (%rax,%r15,4),%xmm2
mulss  0xe6e(%rip),%xmm2
mov    %rbp,%rdi
movss  0x4(%rsp),%xmm1
call   1030 <smf2bandv@plt>
movss  %xmm0,0x0(%r13,%r15,4)
add    $0x1,%r15
cmp    %r15,%r14
jne    1150 <smf4band+0x30>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @smf4band(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
%14 = alloca float
%15 = alloca float
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 %16
16: ; preds = %51, %6
%17 = load i32, i32* %13
%18 = load i32, i32* %8
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %54
20: ; preds = %16
%21 = load float*, float** %11
%22 = load i32, i32* %13
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds float, float* %21, i64 %23
%25 = load float, float* %24
%26 = call float @smff2w_2(float %25)
store float %26, float* %15
%27 = load float*, float** %7
%28 = load float*, float** %10
%29 = load i32, i32* %13
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds float, float* %28, i64 %30
%32 = load float, float* %31
%33 = load float, float* %15
%34 = call float @smf2bandv(float* %27, float %32, float %33, float 0x3FFD906BC0000000)
store float %34, float* %14
%35 = load float*, float** %7
%36 = getelementptr inbounds float, float* %35, i64 2
%37 = load float, float* %14
%38 = load float, float* %15
%39 = load float*, float** %12
%40 = load i32, i32* %13
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds float, float* %39, i64 %41
%43 = load float, float* %42
%44 = fsub float 1.000000e+00, %43
%45 = fmul float 0x3FE87DE2A0000000, %44
%46 = call float @smf2bandv(float* %36, float %37, float %38, float %45)
%47 = load float*, float** %9
%48 = load i32, i32* %13
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds float, float* %47, i64 %49
store float %46, float* %50
br label %51
51: ; preds = %20
%52 = load i32, i32* %13
%53 = add nsw i32 %52, 1
store i32 %53, i32* %13
br label %16
54: ; preds = %16
ret void
}

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