// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/graphics/backends/cairo/surfacecairo.cpp
// Function: smooth::GUI::SurfaceCairo::GetSurfaceDPI() const
S::Short S::GUI::SurfaceCairo::GetSurfaceDPI() const
{
	if (Application::GetScaleFactor() != 0)	surfaceDPI = Math::Round(96.0 * Application::GetScaleFactor());

	if (surfaceDPI != -1) return surfaceDPI;

	Float	 dpi = 96.0;

	if (display != NIL)
	{
		/* Load gdk_screen_get_monitor_scale_factor dynamically.
		 */
		System::DynamicLoader	 gdk("gdk-3");
		gint			 (*ex_gdk_screen_get_monitor_scale_factor)(GdkScreen *, gint) = (gint (*)(GdkScreen *, gint)) gdk.GetFunctionAddress("gdk_screen_get_monitor_scale_factor");

		/* Get GDK scale factor.
		 */
		Float	 scale = 1.0;

		if (ex_gdk_screen_get_monitor_scale_factor != NIL) scale = ex_gdk_screen_get_monitor_scale_factor(gdk_screen_get_default(), 0);
		else						   scale = (Int64) Number::FromIntString(getenv("GDK_SCALE"));

		/* Alternatively, query the scale factor from the KDE configuration.
		 */
		if (scale <= 1.0) scale = Backends::BackendXLib::QueryKDESettings("KScreen", "ScaleFactor").ToFloat();

		/* Alternatively, query custom DPI setting via XfConf.
		 */
		if (scale <= 1.0) scale = Backends::BackendXLib::QueryXfConf("xsettings", "/Xft/DPI").ToInt() / dpi;

		/* Update DPI value if a scale factor has been determined.
		 */
		if (scale > 0) dpi *= scale;
	}

	surfaceDPI = Math::Round(dpi * Setup::FontSize);

	return surfaceDPI;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x168(%rbp)
callq 0x5c9d0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x12b2bc
jp 0x12b2bc
jmp 0x12b2dc
callq 0x5c9d0
movaps %xmm0, %xmm1
movsd 0x5c1f4(%rip), %xmm0    # 0x1874c0
mulsd %xmm1, %xmm0
callq 0x5a970
movw %ax, 0xe0954(%rip)      # 0x20bc30
movswl 0xe094d(%rip), %eax     # 0x20bc30
cmpl $-0x1, %eax
je 0x12b2f8
movw 0xe0941(%rip), %ax      # 0x20bc30
movw %ax, -0x2(%rbp)
jmp 0x12b747
movq -0x168(%rbp), %rax
movsd 0x5c1b9(%rip), %xmm0    # 0x1874c0
movsd %xmm0, -0x18(%rbp)
cmpq $0x0, 0x40(%rax)
je 0x12b720
leaq 0x7baca(%rip), %rsi     # 0x1a6de8
leaq -0x70(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x5c1f0
movq -0x170(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x5d500
jmp 0x12b340
leaq -0x70(%rbp), %rdi
callq 0x5df00
leaq 0x7ba9e(%rip), %rsi     # 0x1a6dee
leaq -0xa0(%rbp), %rdi
callq 0x5c1f0
jmp 0x12b35e
leaq -0x58(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x5d540
movq %rax, -0x178(%rbp)
jmp 0x12b377
leaq -0xa0(%rbp), %rdi
callq 0x5df00
movq -0x178(%rbp), %rax
movq %rax, -0x88(%rbp)
movsd 0x5bfcf(%rip), %xmm0    # 0x187368
movsd %xmm0, -0xa8(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x12b444
movq -0x88(%rbp), %rax
movq %rax, -0x188(%rbp)
callq 0x5d3e0
movq %rax, -0x180(%rbp)
jmp 0x12b3cb
movq -0x188(%rbp), %rax
movq -0x180(%rbp), %rdi
xorl %esi, %esi
callq *%rax
movl %eax, -0x18c(%rbp)
jmp 0x12b3e5
movl -0x18c(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xa8(%rbp)
jmp 0x12b4f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x5df00
jmp 0x12b754
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x12b715
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x5df00
jmp 0x12b715
leaq 0x7b9c7(%rip), %rdi     # 0x1a6e12
callq 0x5bea0
movq %rax, %rsi
leaq -0xd0(%rbp), %rdi
callq 0x5c1f0
jmp 0x12b461
leaq -0xb8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x5a1c0
jmp 0x12b476
leaq -0xb8(%rbp), %rdi
callq 0x5dbe0
movq %rax, -0x198(%rbp)
jmp 0x12b48b
movq -0x198(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0xa8(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x5d990
leaq -0xd0(%rbp), %rdi
callq 0x5df00
jmp 0x12b4f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x12b4df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x5d990
leaq -0xd0(%rbp), %rdi
callq 0x5df00
jmp 0x12b715
movsd 0x5be70(%rip), %xmm0    # 0x187368
ucomisd -0xa8(%rbp), %xmm0
jb 0x12b5e9
leaq 0x7b90f(%rip), %rsi     # 0x1a6e1c
leaq -0x100(%rbp), %rdi
callq 0x5c1f0
jmp 0x12b51b
leaq 0x7b902(%rip), %rsi     # 0x1a6e24
leaq -0x118(%rbp), %rdi
callq 0x5c1f0
jmp 0x12b530
leaq -0xe8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x118(%rbp), %rdx
callq 0x11f5f0
jmp 0x12b54c
leaq -0xe8(%rbp), %rdi
callq 0x5bf40
movsd %xmm0, -0x1a0(%rbp)
jmp 0x12b562
movsd -0x1a0(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x5df00
leaq -0x118(%rbp), %rdi
callq 0x5df00
leaq -0x100(%rbp), %rdi
callq 0x5df00
jmp 0x12b5e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x12b5d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x12b5cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x5df00
leaq -0x118(%rbp), %rdi
callq 0x5df00
leaq -0x100(%rbp), %rdi
callq 0x5df00
jmp 0x12b715
movsd 0x5bd77(%rip), %xmm0    # 0x187368
ucomisd -0xa8(%rbp), %xmm0
jb 0x12b6e7
leaq 0x7b82a(%rip), %rsi     # 0x1a6e30
leaq -0x148(%rbp), %rdi
callq 0x5c1f0
jmp 0x12b614
leaq 0x7b81f(%rip), %rsi     # 0x1a6e3a
leaq -0x160(%rbp), %rdi
callq 0x5c1f0
jmp 0x12b629
leaq -0x130(%rbp), %rdi
leaq -0x148(%rbp), %rsi
leaq -0x160(%rbp), %rdx
callq 0x11fbd0
jmp 0x12b645
leaq -0x130(%rbp), %rdi
callq 0x5adc0
movq %rax, -0x1a8(%rbp)
jmp 0x12b65a
movq -0x1a8(%rbp), %rax
cvtsi2sd %rax, %xmm0
divsd -0x18(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x5df00
leaq -0x160(%rbp), %rdi
callq 0x5df00
leaq -0x148(%rbp), %rdi
callq 0x5df00
jmp 0x12b6e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x12b6d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x12b6cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x5df00
leaq -0x160(%rbp), %rdi
callq 0x5df00
leaq -0x148(%rbp), %rdi
callq 0x5df00
jmp 0x12b715
movsd -0xa8(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x12b70a
movsd -0xa8(%rbp), %xmm0
mulsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x59d80
jmp 0x12b720
leaq -0x58(%rbp), %rdi
callq 0x59d80
jmp 0x12b754
movsd -0x18(%rbp), %xmm0
movq 0xdd0c4(%rip), %rax     # 0x2087f0
mulsd (%rax), %xmm0
callq 0x5a970
movw %ax, 0xe04f4(%rip)      # 0x20bc30
movw 0xe04ed(%rip), %ax      # 0x20bc30
movw %ax, -0x2(%rbp)
movw -0x2(%rbp), %ax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x5b6b0
nopl (%rax)