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


x86 assembly (clang, -O0):
<px_to_pt>:
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
divss  -0x14(%rbp),%xmm0
movss  0xec6(%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
divss  -0x14(%rbp),%xmm0
movss  0xe9b(%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):
<px_to_pt>:
push   %r14
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %rsi,%rbx
mov    %rdi,%r14
cvtsi2ssl (%rsi),%xmm1
divss  %xmm0,%xmm1
addss  0xed0(%rip),%xmm1
cvttss2si %xmm1,%edi
call   1030 <floorf@plt>
mov    %eax,(%r14)
xorps  %xmm0,%xmm0
cvtsi2ssl 0x4(%rbx),%xmm0
divss  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 @px_to_pt(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 = fdiv float %10, %11
%13 = fadd float %12, 5.000000e-01
%14 = fptosi float %13 to i32
%15 = call i64 @floorf(i32 %14)
%16 = trunc i64 %15 to i32
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 0
store i32 %16, i32* %18
%19 = load i32*, i32** %5
%20 = getelementptr inbounds i32, i32* %19, i64 1
%21 = load i32, i32* %20
%22 = sitofp i32 %21 to float
%23 = load float, float* %6
%24 = fdiv float %22, %23
%25 = fadd float %24, 5.000000e-01
%26 = fptosi float %25 to i32
%27 = call i64 @floorf(i32 %26)
%28 = trunc i64 %27 to i32
%29 = load i32*, i32** %4
%30 = getelementptr inbounds i32, i32* %29, i64 1
store i32 %28, i32* %30
ret void
}

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