#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);
float smf1lowv(float *u, 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);
  return t2;
}


x86 assembly (clang, -O0):
<smf1lowv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  0xeab(%rip),%xmm1
addss  -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x1c(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1030 <isfinite@plt>
cmp    $0x0,%rax
je     11be <smf1lowv+0x9e>
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
jmp    1236 <smf1lowv+0x116>
movss  -0x1c(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     11df <smf1lowv+0xbf>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    122c <smf1lowv+0x10c>
movss  -0x1c(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1205 <smf1lowv+0xe5>
mov    0x2df9(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x28(%rbp)
jmp    1222 <smf1lowv+0x102>
mov    0x2de4(%rip),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smf1lowv>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  (%rdi),%xmm2
subss  %xmm2,%xmm0
movss  0xec8(%rip),%xmm3
addss  %xmm1,%xmm3
divss  %xmm3,%xmm0
mulss  %xmm1,%xmm0
addss  %xmm0,%xmm2
movss  %xmm2,0xc(%rsp)
addss  %xmm2,%xmm0
movss  %xmm0,0x8(%rsp)
call   1030 <isfinite@plt>
test   %rax,%rax
je     116a <smf1lowv+0x4a>
movss  0x8(%rsp),%xmm0
jmp    11a5 <smf1lowv+0x85>
movss  0x8(%rsp),%xmm0
call   1040 <isnan@plt>
xorps  %xmm0,%xmm0
test   %rax,%rax
jne    11a5 <smf1lowv+0x85>
mov    0x2e6c(%rip),%rax
movss  (%rax),%xmm1
movaps 0xe81(%rip),%xmm2
xorps  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cmpltss 0x8(%rsp),%xmm0
andps  %xmm0,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
movss  %xmm0,(%rbx)
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

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

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