#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 HUGE_VALF;
scalar_t__ isfinite(float);
scalar_t__ isnan(float);
void smf1splitv(float *u, float *low, float *high, float x, float w_2) {
  float t1, t2, u1;
  u1 = u[0];
  t1 = (x - u1) / (1.0f + w_2);
  t2 = u1 + w_2 * t1;
  u1 = w_2 * t1 + t2;
  u[0] = (isfinite(u1) ? (u1)
          : isnan(u1)  ? 0.0f
          : u1 > 0.0f  ? HUGE_VALF
                       : -HUGE_VALF);
  *low = t2;
  *high = t1;
}


x86 assembly (clang, -O0):
<smf1splitv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movss  %xmm1,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x1c(%rbp),%xmm0
subss  -0x2c(%rbp),%xmm0
movss  0xea3(%rip),%xmm1
addss  -0x20(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x2c(%rbp),%xmm1
movss  -0x20(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x20(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movss  -0x28(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
call   1030 <isfinite@plt>
cmp    $0x0,%rax
je     11c6 <smf1splitv+0xa6>
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
jmp    123e <smf1splitv+0x11e>
movss  -0x2c(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     11e7 <smf1splitv+0xc7>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
jmp    1234 <smf1splitv+0x114>
movss  -0x2c(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    120d <smf1splitv+0xed>
mov    0x2df1(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x38(%rbp)
jmp    122a <smf1splitv+0x10a>
mov    0x2ddc(%rip),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x24(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smf1splitv>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movaps %xmm1,%xmm3
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movss  (%rdi),%xmm2
subss  %xmm2,%xmm0
movss  0xebb(%rip),%xmm1
addss  %xmm3,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
mulss  %xmm0,%xmm3
addss  %xmm3,%xmm2
movss  %xmm2,0x8(%rsp)
addss  %xmm2,%xmm3
movss  %xmm3,0x4(%rsp)
movaps %xmm3,%xmm0
call   1030 <isfinite@plt>
test   %rax,%rax
je     1180 <smf1splitv+0x60>
movss  0x4(%rsp),%xmm0
jmp    11bb <smf1splitv+0x9b>
movss  0x4(%rsp),%xmm0
call   1040 <isnan@plt>
xorps  %xmm0,%xmm0
test   %rax,%rax
jne    11bb <smf1splitv+0x9b>
mov    0x2e56(%rip),%rax
movss  (%rax),%xmm1
movaps 0xe6b(%rip),%xmm2
xorps  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cmpltss 0x4(%rsp),%xmm0
andps  %xmm0,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
movss  %xmm0,(%rbx)
movss  0x8(%rsp),%xmm0
movss  %xmm0,(%r15)
movss  0xc(%rsp),%xmm0
movss  %xmm0,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@HUGE_VALF = global float 0.000000e+00
define void @smf1splitv(float* %0, float* %1, float* %2, float %3, float %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
store float* %0, float** %6
store float* %1, float** %7
store float* %2, float** %8
store float %3, float* %9
store float %4, float* %10
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
%16 = load float, float* %15
store float %16, float* %13
%17 = load float, float* %9
%18 = load float, float* %13
%19 = fsub float %17, %18
%20 = load float, float* %10
%21 = fadd float 1.000000e+00, %20
%22 = fdiv float %19, %21
store float %22, float* %11
%23 = load float, float* %13
%24 = load float, float* %10
%25 = load float, float* %11
%26 = call float @llvm.fmuladd.f32(float %24, float %25, float %23)
store float %26, float* %12
%27 = load float, float* %10
%28 = load float, float* %11
%29 = load float, float* %12
%30 = call float @llvm.fmuladd.f32(float %27, float %28, float %29)
store float %30, float* %13
%31 = load float, float* %13
%32 = call i64 @isfinite(float %31)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %5
%35 = load float, float* %13
br label %53
36: ; preds = %5
%37 = load float, float* %13
%38 = call i64 @isnan(float %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %36
br label %51
41: ; preds = %36
%42 = load float, float* %13
%43 = fcmp ogt float %42, 0.000000e+00
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = load float, float* @HUGE_VALF
br label %49
46: ; preds = %41
%47 = load float, float* @HUGE_VALF
%48 = fneg float %47
br label %49
49: ; preds = %46, %44
%50 = phi float [ %45, %44 ], [ %48, %46 ]
br label %51
51: ; preds = %49, %40
%52 = phi float [ 0.000000e+00, %40 ], [ %50, %49 ]
br label %53
53: ; preds = %51, %34
%54 = phi float [ %35, %34 ], [ %52, %51 ]
%55 = load float*, float** %6
%56 = getelementptr inbounds float, float* %55, i64 0
store float %54, float* %56
%57 = load float, float* %12
%58 = load float*, float** %7
store float %57, float* %58
%59 = load float, float* %11
%60 = load float*, float** %8
store float %59, float* %60
ret void
}

LLVM IR (-O2):
@HUGE_VALF = global float 0.000000e+00
define void @smf1splitv(float* nocapture %0, float* nocapture writeonly %1, float* nocapture writeonly %2, float %3, float %4) {
%6 = load float, float* %0
%7 = fsub float %3, %6
%8 = fadd float %4, 1.000000e+00
%9 = fdiv float %7, %8
%10 = tail call float @llvm.fmuladd.f32(float %4, float %9, float %6)
%11 = tail call float @llvm.fmuladd.f32(float %4, float %9, float %10)
%12 = tail call i64 @isfinite(float %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %5
%15 = tail call i64 @isnan(float %11)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = fcmp ogt float %11, 0.000000e+00
%19 = load float, float* @HUGE_VALF
%20 = fneg float %19
%21 = select i1 %18, float %19, float %20
br label %22
22: ; preds = %5, %17, %14
%23 = phi float [ %21, %17 ], [ 0.000000e+00, %14 ], [ %11, %5 ]
store float %23, float* %0
store float %10, float* %1
store float %9, float* %2
ret void
}