	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function sdl_refresh_viewport
LCPI0_0:
	.long	0x7fffffff                      ## float NaN
	.long	0x7fffffff                      ## float NaN
	.long	0x7fffffff                      ## float NaN
	.long	0x7fffffff                      ## float NaN
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2
LCPI0_1:
	.long	0x38d1b717                      ## float 9.99999974E-5
LCPI0_2:
	.long	0xbf800000                      ## float -1
LCPI0_3:
	.long	0x3f000000                      ## float 0.5
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_sdl_refresh_viewport:                  ## @sdl_refresh_viewport
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	xorl	%eax, %eax
	callq	_config_get_ptr
	movq	%rax, %r13
	movl	40(%r15), %edi
	leaq	-52(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	callq	_SDL_GetWindowSize
	leaq	4(%r15), %r14
	movq	$0, 4(%r15)
	movl	-52(%rbp), %ebx
	movl	%ebx, 12(%r15)
	movl	-48(%rbp), %r12d
	movl	%r12d, 16(%r15)
	movl	%ebx, 20(%r15)
	movl	%r12d, 24(%r15)
	cmpq	$0, 8(%r13)
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_video_driver_get_aspect_ratio
	movq	32(%r15), %rcx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	_video_viewport_get_scaled_integer
	jmp	LBB0_9
LBB0_2:
	movq	(%r13), %rax
	movq	_ASPECT_RATIO_CUSTOM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_video_viewport_get_custom
	movups	(%rax), %xmm0
	movups	%xmm0, (%r14)
	jmp	LBB0_9
LBB0_4:
	cmpq	$0, 32(%r15)
	je	LBB0_9
## %bb.5:
	cvtsi2ss	%ebx, %xmm1
	cvtsi2ss	%r12d, %xmm0
	divss	%xmm0, %xmm1
	movss	%xmm1, -44(%rbp)                ## 4-byte Spill
	xorl	%eax, %eax
	callq	_video_driver_get_aspect_ratio
	movss	-44(%rbp), %xmm2                ## 4-byte Reload
                                        ## xmm2 = mem[0],zero,zero,zero
	movaps	%xmm0, %xmm3
	movaps	%xmm2, %xmm0
	subss	%xmm3, %xmm0
	andps	LCPI0_0(%rip), %xmm0
	movss	LCPI0_1(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	ja	LBB0_9
## %bb.6:
	ucomiss	%xmm3, %xmm2
	jbe	LBB0_8
## %bb.7:
	divss	%xmm2, %xmm3
	addss	LCPI0_2(%rip), %xmm3
	movss	LCPI0_3(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	xorps	%xmm1, %xmm1
	cvtsi2ssl	-52(%rbp), %xmm1
	mulss	%xmm0, %xmm3
	addss	%xmm0, %xmm3
	movss	%xmm3, -44(%rbp)                ## 4-byte Spill
	subss	%xmm3, %xmm0
	mulss	%xmm1, %xmm0
	callq	_roundf
	movl	%eax, 4(%r15)
	xorps	%xmm0, %xmm0
	cvtsi2ssl	-52(%rbp), %xmm0
	addss	%xmm0, %xmm0
	mulss	-44(%rbp), %xmm0                ## 4-byte Folded Reload
	callq	_roundf
	movl	%eax, 12(%r15)
	jmp	LBB0_9
LBB0_8:
	divss	%xmm3, %xmm2
	addss	LCPI0_2(%rip), %xmm2
	movss	LCPI0_3(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	xorps	%xmm1, %xmm1
	cvtsi2ssl	-48(%rbp), %xmm1
	mulss	%xmm0, %xmm2
	addss	%xmm0, %xmm2
	movss	%xmm2, -44(%rbp)                ## 4-byte Spill
	subss	%xmm2, %xmm0
	mulss	%xmm1, %xmm0
	callq	_roundf
	movl	%eax, 8(%r15)
	xorps	%xmm0, %xmm0
	cvtsi2ssl	-48(%rbp), %xmm0
	addss	%xmm0, %xmm0
	mulss	-44(%rbp), %xmm0                ## 4-byte Folded Reload
	callq	_roundf
	movl	%eax, 16(%r15)
LBB0_9:
	movl	$0, (%r15)
	movq	%r15, %rdi
	callq	_sdl_refresh_renderer
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ASPECT_RATIO_CUSTOM,8,3        ## @ASPECT_RATIO_CUSTOM
	.no_dead_strip	_sdl_refresh_viewport
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdl_refresh_viewport
_sdl_refresh_viewport:                  ; @sdl_refresh_viewport
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset b8, -72
	.cfi_offset b9, -80
	mov	x19, x0
	bl	_config_get_ptr
	mov	x23, x0
	ldr	w0, [x19, #40]
	add	x1, sp, #12
	add	x2, sp, #8
	bl	_SDL_GetWindowSize
	mov	x20, x19
	stp	wzr, wzr, [x20, #4]!
	ldp	w22, w21, [sp, #8]
	stp	w21, w22, [x20, #8]
	stp	w21, w22, [x20, #16]
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_2
; %bb.1:
	bl	_video_driver_get_aspect_ratio
	ldr	x3, [x19, #32]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_video_viewport_get_scaled_integer
	b	LBB0_9
LBB0_2:
	ldr	x8, [x23]
Lloh0:
	adrp	x9, _ASPECT_RATIO_CUSTOM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ASPECT_RATIO_CUSTOM@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	bl	_video_viewport_get_custom
	ldr	q0, [x0]
	str	q0, [x20]
	b	LBB0_9
LBB0_4:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_9
; %bb.5:
	scvtf	s0, w21
	scvtf	s1, w22
	fdiv	s8, s0, s1
	bl	_video_driver_get_aspect_ratio
	fabd	s1, s8, s0
	mov	w8, #46871
	movk	w8, #14545, lsl #16
	fmov	s2, w8
	fcmp	s1, s2
	b.mi	LBB0_9
; %bb.6:
	fcmp	s8, s0
	b.le	LBB0_8
; %bb.7:
	fdiv	s0, s0, s8
	fmov	s1, #-1.00000000
	fadd	s0, s0, s1
	fmov	s1, #0.50000000
	fmul	s0, s0, s1
	fadd	s8, s0, s1
	ldr	s0, [sp, #12]
	scvtf	s0, s0
	fsub	s1, s1, s8
	fmul	s0, s1, s0
	bl	_roundf
	str	w0, [x19, #4]
	ldr	s0, [sp, #12]
	scvtf	s0, s0
	fadd	s0, s0, s0
	fmul	s0, s8, s0
	bl	_roundf
	str	w0, [x19, #12]
	b	LBB0_9
LBB0_8:
	fdiv	s0, s8, s0
	fmov	s1, #-1.00000000
	fadd	s0, s0, s1
	fmov	s1, #0.50000000
	fmul	s0, s0, s1
	fadd	s8, s0, s1
	ldr	s0, [sp, #8]
	scvtf	s0, s0
	fsub	s1, s1, s8
	fmul	s0, s1, s0
	bl	_roundf
	str	w0, [x19, #8]
	ldr	s0, [sp, #8]
	scvtf	s0, s0
	fadd	s0, s0, s0
	fmul	s0, s8, s0
	bl	_roundf
	str	w0, [x19, #16]
LBB0_9:
	str	wzr, [x19]
	mov	x0, x19
	bl	_sdl_refresh_renderer
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ASPECT_RATIO_CUSTOM,8,3        ; @ASPECT_RATIO_CUSTOM
	.no_dead_strip	_sdl_refresh_viewport
.subsections_via_symbols
