#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__ floorf(int);
void pt_to_px(int px[2], int pt[2], float dpi_scale) {
  px[0] = (int)floorf(pt[0] * dpi_scale + 0.5f);
  px[1] = (int)floorf(pt[1] * dpi_scale + 0.5f);
}


x86 assembly (clang, -O0):
<pt_to_px>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
movss  -0x14(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xec2(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <floorf@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cvtsi2ssl 0x4(%rax),%xmm0
movss  -0x14(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xe93(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <floorf@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_to_px>:
push   %r14
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %rsi,%rbx
mov    %rdi,%r14
cvtsi2ssl (%rsi),%xmm1
mulss  %xmm0,%xmm1
addss  0xed0(%rip),%xmm1
cvttss2si %xmm1,%edi
call   1030 <floorf@plt>
mov    %eax,(%r14)
xorps  %xmm0,%xmm0
cvtsi2ssl 0x4(%rbx),%xmm0
mulss  0x4(%rsp),%xmm0
addss  0xeae(%rip),%xmm0
cvttss2si %xmm0,%edi
call   1030 <floorf@plt>
mov    %eax,0x4(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @pt_to_px(i32* %0, i32* %1, float %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca float
store i32* %0, i32** %4
store i32* %1, i32** %5
store float %2, float* %6
%7 = load i32*, i32** %5
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to float
%11 = load float, float* %6
%12 = call float @llvm.fmuladd.f32(float %10, float %11, float 5.000000e-01)
%13 = fptosi float %12 to i32
%14 = call i64 @floorf(i32 %13)
%15 = trunc i64 %14 to i32
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 0
store i32 %15, i32* %17
%18 = load i32*, i32** %5
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
%21 = sitofp i32 %20 to float
%22 = load float, float* %6
%23 = call float @llvm.fmuladd.f32(float %21, float %22, float 5.000000e-01)
%24 = fptosi float %23 to i32
%25 = call i64 @floorf(i32 %24)
%26 = trunc i64 %25 to i32
%27 = load i32*, i32** %4
%28 = getelementptr inbounds i32, i32* %27, i64 1
store i32 %26, i32* %28
ret void
}

LLVM IR (-O2):
define void @pt_to_px(i32* nocapture writeonly %0, i32* nocapture %1, float %2) {
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to float
%6 = tail call float @llvm.fmuladd.f32(float %5, float %2, float 5.000000e-01)
%7 = fptosi float %6 to i32
%8 = tail call i64 @floorf(i32 %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %0
%10 = getelementptr inbounds i32, i32* %1, i64 1
%11 = load i32, i32* %10
%12 = sitofp i32 %11 to float
%13 = tail call float @llvm.fmuladd.f32(float %12, float %2, float 5.000000e-01)
%14 = fptosi float %13 to i32
%15 = tail call i64 @floorf(i32 %14)
%16 = trunc i64 %15 to i32
%17 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %16, i32* %17
ret void
}