#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 */
int /*<<< orphan*/ smf4linkwitz_rileyv(float *, float *, float *, float,
                                       int /*<<< orphan*/);
int /*<<< orphan*/ smff2w_2(float);
void smf4split(float *u, int n, float **y, float *x, float *bw) {
  int i, j;
  float f, _bw, t;
  for (i = 0; i < n; i++) {
    _bw = bw[i];
    t = x[i];
    for (j = 0, f = _bw; f < 0.5f; f += _bw, j++) {
      smf4linkwitz_rileyv(u + 6 * j, &y[j][i], &t, t, smff2w_2(f));
    }
    y[j][i] = t;
  }
}


x86 assembly (clang, -O0):
<smf4split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1237 <smf4split+0x117>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x3c(%rbp)
movl   $0x0,-0x30(%rbp)
movss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  0xe75(%rip),%xmm0
ucomiss -0x34(%rbp),%xmm0
jbe    120f <smf4split+0xef>
mov    -0x8(%rbp),%rax
imul   $0x6,-0x30(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x34(%rbp),%xmm0
call   1040 <smff2w_2@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
movss  -0x40(%rbp),%xmm0
mov    %eax,%ecx
lea    -0x3c(%rbp),%rdx
call   1030 <smf4linkwitz_rileyv@plt>
movss  -0x38(%rbp),%xmm0
addss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1183 <smf4split+0x63>
movss  -0x3c(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1142 <smf4split+0x22>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smf4split>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
test   %esi,%esi
jle    12a8 <smf4split+0x188>
mov    %rdx,%r14
mov    %rdi,%r13
mov    %esi,%edx
xor    %esi,%esi
movss  0xeb8(%rip),%xmm1
lea    0x4(%rsp),%rbp
mov    %r8,0x20(%rsp)
mov    %rcx,0x18(%rsp)
mov    %rdx,0x10(%rsp)
jmp    1193 <smf4split+0x73>
xchg   %ax,%ax
movss  0x4(%rsp),%xmm2
mov    0x20(%rsp),%r8
mov    0x18(%rsp),%rcx
mov    0x10(%rsp),%rdx
mov    0x28(%rsp),%rsi
mov    %r12d,%eax
mov    (%r14,%rax,8),%rax
movss  %xmm2,(%rax,%rsi,4)
add    $0x1,%rsi
cmp    %rdx,%rsi
je     12a8 <smf4split+0x188>
movss  (%r8,%rsi,4),%xmm0
movss  (%rcx,%rsi,4),%xmm2
movss  %xmm2,0x4(%rsp)
ucomiss %xmm0,%xmm1
jbe    12a0 <smf4split+0x180>
mov    %rsi,0x28(%rsp)
lea    0x0(,%rsi,4),%rax
mov    (%r14),%rbx
mov    %rax,0x30(%rsp)
add    %rax,%rbx
movss  %xmm0,0x8(%rsp)
movss  %xmm2,(%rsp)
call   1040 <smff2w_2@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
movss  (%rsp),%xmm0
mov    %eax,%ecx
call   1030 <smf4linkwitz_rileyv@plt>
movss  0xe0e(%rip),%xmm1
movss  0x8(%rsp),%xmm0
addss  %xmm0,%xmm0
mov    $0x1,%r12d
ucomiss %xmm0,%xmm1
jbe    1160 <smf4split+0x40>
mov    $0x1,%r12d
mov    $0x6,%ebx
cs nopw 0x0(%rax,%rax,1)
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %ebx,%eax
and    $0xfffffffe,%eax
lea    0x0(,%rax,4),%rbp
add    %r13,%rbp
mov    %r14,%r15
mov    (%r14,%r12,8),%r14
add    0x30(%rsp),%r14
movss  (%rsp),%xmm0
call   1040 <smff2w_2@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r15,%r14
lea    0x4(%rsp),%rbp
mov    %rbp,%rdx
movss  0xc(%rsp),%xmm0
mov    %eax,%ecx
call   1030 <smf4linkwitz_rileyv@plt>
movss  0xd83(%rip),%xmm1
movss  (%rsp),%xmm0
addss  0x8(%rsp),%xmm0
add    $0x1,%r12
add    $0x6,%rbx
ucomiss %xmm0,%xmm1
ja     1220 <smf4split+0x100>
jmp    1160 <smf4split+0x40>
nopw   0x0(%rax,%rax,1)
xor    %r12d,%r12d
jmp    117a <smf4split+0x5a>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @smf4split(float* %0, i32 %1, float** %2, float* %3, float* %4) {
%6 = alloca float*
%7 = alloca i32
%8 = alloca float**
%9 = alloca float*
%10 = alloca float*
%11 = alloca i32
%12 = alloca i32
%13 = alloca float
%14 = alloca float
%15 = alloca float
store float* %0, float** %6
store i32 %1, i32* %7
store float** %2, float*** %8
store float* %3, float** %9
store float* %4, float** %10
store i32 0, i32* %11
br label %16
16: ; preds = %69, %5
%17 = load i32, i32* %11
%18 = load i32, i32* %7
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %72
20: ; preds = %16
%21 = load float*, float** %10
%22 = load i32, i32* %11
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds float, float* %21, i64 %23
%25 = load float, float* %24
store float %25, float* %14
%26 = load float*, float** %9
%27 = load i32, i32* %11
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds float, float* %26, i64 %28
%30 = load float, float* %29
store float %30, float* %15
store i32 0, i32* %12
%31 = load float, float* %14
store float %31, float* %13
br label %32
32: ; preds = %53, %20
%33 = load float, float* %13
%34 = fcmp olt float %33, 5.000000e-01
br i1 %34, label %35, label %59
35: ; preds = %32
%36 = load float*, float** %6
%37 = load i32, i32* %12
%38 = mul nsw i32 6, %37
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds float, float* %36, i64 %39
%41 = load float**, float*** %8
%42 = load i32, i32* %12
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds float*, float** %41, i64 %43
%45 = load float*, float** %44
%46 = load i32, i32* %11
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds float, float* %45, i64 %47
%49 = load float, float* %15
%50 = load float, float* %13
%51 = call i32 @smff2w_2(float %50)
%52 = call i32 @smf4linkwitz_rileyv(float* %40, float* %48, float* %15, float %49, i32 %51)
br label %53
53: ; preds = %35
%54 = load float, float* %14
%55 = load float, float* %13
%56 = fadd float %55, %54
store float %56, float* %13
%57 = load i32, i32* %12
%58 = add nsw i32 %57, 1
store i32 %58, i32* %12
br label %32
59: ; preds = %32
%60 = load float, float* %15
%61 = load float**, float*** %8
%62 = load i32, i32* %12
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds float*, float** %61, i64 %63
%65 = load float*, float** %64
%66 = load i32, i32* %11
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds float, float* %65, i64 %67
store float %60, float* %68
br label %69
69: ; preds = %59
%70 = load i32, i32* %11
%71 = add nsw i32 %70, 1
store i32 %71, i32* %11
br label %16
72: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @smf4split(float* %0, i32 %1, float** nocapture %2, float* nocapture %3, float* nocapture %4) {
%6 = alloca float
%7 = bitcast float* %6 to i8*
%8 = icmp sgt i32 %1, 0
br i1 %8, label %9, label %52
9: ; preds = %5
%10 = zext i32 %1 to i64
br label %11
11: ; preds = %9, %43
%12 = phi i64 [ 0, %9 ], [ %50, %43 ]
%13 = getelementptr inbounds float, float* %4, i64 %12
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %3, i64 %12
%16 = load float, float* %15
store float %16, float* %6
%17 = fcmp olt float %14, 5.000000e-01
br i1 %17, label %18, label %43
18: ; preds = %11
%19 = load float*, float** %2
%20 = getelementptr inbounds float, float* %19, i64 %12
%21 = call i32 @smff2w_2(float %14)
%22 = call i32 @smf4linkwitz_rileyv(float* %0, float* %20, float* %6, float %16, i32 %21)
%23 = fadd float %14, %14
%24 = fcmp olt float %23, 5.000000e-01
br i1 %24, label %25, label %40
25: ; preds = %18, %25
%26 = phi i64 [ %38, %25 ], [ 1, %18 ]
%27 = phi float [ %37, %25 ], [ %23, %18 ]
%28 = load float, float* %6
%29 = mul i64 %26, 6
%30 = and i64 %29, 4294967294
%31 = getelementptr inbounds float, float* %0, i64 %30
%32 = getelementptr inbounds float*, float** %2, i64 %26
%33 = load float*, float** %32
%34 = getelementptr inbounds float, float* %33, i64 %12
%35 = call i32 @smff2w_2(float %27)
%36 = call i32 @smf4linkwitz_rileyv(float* %31, float* %34, float* %6, float %28, i32 %35)
%37 = fadd float %14, %27
%38 = add nuw i64 %26, 1
%39 = fcmp olt float %37, 5.000000e-01
br i1 %39, label %25, label %40
40: ; preds = %25, %18
%41 = phi i64 [ 1, %18 ], [ %38, %25 ]
%42 = load float, float* %6
br label %43
43: ; preds = %40, %11
%44 = phi float [ %16, %11 ], [ %42, %40 ]
%45 = phi i64 [ 0, %11 ], [ %41, %40 ]
%46 = and i64 %45, 4294967295
%47 = getelementptr inbounds float*, float** %2, i64 %46
%48 = load float*, float** %47
%49 = getelementptr inbounds float, float* %48, i64 %12
store float %44, float* %49
%50 = add nuw nsw i64 %12, 1
%51 = icmp eq i64 %50, %10
br i1 %51, label %52, label %11
52: ; preds = %43, %5
ret void
}