#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 */
scalar_t__ ceil(double);
scalar_t__ floor(double);
int transform(register int x, register int y, float ef, float sl) {
  register double acc;
  acc = ef * x + sl * y;
  return (int)(acc >= 0 ? floor(acc + 0.5) : ceil(acc - 0.5));
}


x86 assembly (clang, -O0):
<transform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm2
movss  -0x10(%rbp),%xmm1
cvtsi2ssl -0x8(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     118e <transform+0x6e>
movsd  0xe85(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1040 <floor@plt>
mov    %rax,-0x20(%rbp)
jmp    11a8 <transform+0x88>
movsd  -0x18(%rbp),%xmm0
movsd  0xe65(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transform>:
push   %rax
cvtsi2ss %edi,%xmm2
cvtsi2ss %esi,%xmm3
mulss  %xmm1,%xmm3
mulss  %xmm0,%xmm2
addss  %xmm3,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm2
jae    1153 <transform+0x33>
addsd  0xebc(%rip),%xmm0
call   1030 <ceil@plt>
pop    %rcx
ret
addsd  0xea5(%rip),%xmm0
call   1040 <floor@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @transform(i32 %0, i32 %1, float %2, float %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store float %2, float* %7
store float %3, float* %8
%10 = load float, float* %7
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to float
%13 = load float, float* %8
%14 = load i32, i32* %6
%15 = sitofp i32 %14 to float
%16 = fmul float %13, %15
%17 = call float @llvm.fmuladd.f32(float %10, float %12, float %16)
%18 = fpext float %17 to double
store double %18, double* %9
%19 = load double, double* %9
%20 = fcmp oge double %19, 0.000000e+00
br i1 %20, label %21, label %25
21: ; preds = %4
%22 = load double, double* %9
%23 = fadd double %22, 5.000000e-01
%24 = call i64 @floor(double %23)
br label %29
25: ; preds = %4
%26 = load double, double* %9
%27 = fsub double %26, 5.000000e-01
%28 = call i64 @ceil(double %27)
br label %29
29: ; preds = %25, %21
%30 = phi i64 [ %24, %21 ], [ %28, %25 ]
%31 = trunc i64 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @transform(i32 %0, i32 %1, float %2, float %3) {
%5 = sitofp i32 %0 to float
%6 = sitofp i32 %1 to float
%7 = fmul float %6, %3
%8 = tail call float @llvm.fmuladd.f32(float %2, float %5, float %7)
%9 = fpext float %8 to double
%10 = fcmp ult float %8, 0.000000e+00
br i1 %10, label %14, label %11
11: ; preds = %4
%12 = fadd double %9, 5.000000e-01
%13 = tail call i64 @floor(double %12)
br label %17
14: ; preds = %4
%15 = fadd double %9, -5.000000e-01
%16 = tail call i64 @ceil(double %15)
br label %17
17: ; preds = %14, %11
%18 = phi i64 [ %13, %11 ], [ %16, %14 ]
%19 = trunc i64 %18 to i32
ret i32 %19
}