	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function switch_update_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
_switch_update_viewport:                ## @switch_update_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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_config_get_ptr
	movss	8(%rbx), %xmm3                  ## xmm3 = mem[0],zero,zero,zero
	movss	12(%rbx), %xmm2                 ## xmm2 = mem[0],zero,zero,zero
	cmpq	$0, 40(%rbx)
	je	LBB0_2
## %bb.1:
	movss	(%rbx), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	movss	4(%rbx), %xmm1                  ## xmm1 = mem[0],zero,zero,zero
	subss	%xmm0, %xmm3
	cvttss2si	%xmm3, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movl	%ecx, 16(%rbx)
	subss	%xmm1, %xmm2
	cvttss2si	%xmm2, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movl	%ecx, 20(%rbx)
	movss	%xmm0, 24(%rbx)
	movss	%xmm1, 28(%rbx)
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%rax, %r14
	movss	%xmm3, -32(%rbp)                ## 4-byte Spill
	movss	%xmm2, -36(%rbp)                ## 4-byte Spill
	xorl	%eax, %eax
	callq	_video_driver_get_aspect_ratio
	leaq	L_.str(%rip), %rdi
	movss	%xmm0, -28(%rbp)                ## 4-byte Spill
	callq	_printf
	cmpq	$0, 8(%r14)
	je	LBB0_3
## %bb.14:
	leaq	8(%rbx), %rdi
	movss	8(%rbx), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	movss	12(%rbx), %xmm1                 ## xmm1 = mem[0],zero,zero,zero
	movl	32(%rbx), %esi
	movss	-28(%rbp), %xmm2                ## 4-byte Reload
                                        ## xmm2 = mem[0],zero,zero,zero
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_video_viewport_get_scaled_integer ## TAILCALL
LBB0_3:
	movss	-28(%rbp), %xmm2                ## 4-byte Reload
                                        ## xmm2 = mem[0],zero,zero,zero
	cmpl	$0, 32(%rbx)
	je	LBB0_11
## %bb.4:
	movss	8(%rbx), %xmm3                  ## xmm3 = mem[0],zero,zero,zero
	divss	12(%rbx), %xmm3
	movaps	%xmm3, %xmm0
	subss	%xmm2, %xmm0
	andps	LCPI0_0(%rip), %xmm0
	xorl	%r14d, %r14d
	movss	LCPI0_1(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	jbe	LBB0_6
## %bb.5:
	xorl	%r15d, %r15d
	movss	-36(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	jmp	LBB0_9
LBB0_11:
	movq	$0, 16(%rbx)
	movss	-32(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 24(%rbx)
	movss	-36(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	jmp	LBB0_12
LBB0_6:
	ucomiss	%xmm2, %xmm3
	jbe	LBB0_8
## %bb.7:
	divss	%xmm3, %xmm2
	addss	LCPI0_2(%rip), %xmm2
	movss	LCPI0_3(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm2
	addss	%xmm0, %xmm2
	movss	%xmm2, -28(%rbp)                ## 4-byte Spill
	subss	%xmm2, %xmm0
	mulss	-32(%rbp), %xmm0                ## 4-byte Folded Reload
	callq	_roundf
	movq	%rax, %r14
	movss	-32(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm0
	mulss	-28(%rbp), %xmm0                ## 4-byte Folded Reload
	callq	_roundf
	movl	%eax, %eax
	xorps	%xmm1, %xmm1
	cvtsi2ss	%rax, %xmm1
	xorl	%r15d, %r15d
	movss	-36(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	jmp	LBB0_10
LBB0_8:
	divss	%xmm2, %xmm3
	addss	LCPI0_2(%rip), %xmm3
	movss	LCPI0_3(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm3
	addss	%xmm0, %xmm3
	movss	%xmm3, -28(%rbp)                ## 4-byte Spill
	subss	%xmm3, %xmm0
	mulss	-36(%rbp), %xmm0                ## 4-byte Folded Reload
	callq	_roundf
	movq	%rax, %r15
	movss	-36(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm0
	mulss	-28(%rbp), %xmm0                ## 4-byte Folded Reload
	callq	_roundf
	movl	%eax, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rax, %xmm0
LBB0_9:
	movss	-32(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
LBB0_10:
	movl	%r14d, 16(%rbx)
	movl	%r15d, 20(%rbx)
	movss	%xmm1, 24(%rbx)
LBB0_12:
	movss	%xmm0, 28(%rbx)
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[Video] Aspect: %f\n"

	.comm	_ASPECT_RATIO_CUSTOM,8,3        ## @ASPECT_RATIO_CUSTOM
	.no_dead_strip	_switch_update_viewport
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function switch_update_viewport
_switch_update_viewport:                ; @switch_update_viewport
	.cfi_startproc
; %bb.0:
	stp	d11, d10, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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 b8, -56
	.cfi_offset b9, -64
	.cfi_offset b10, -72
	.cfi_offset b11, -80
	mov	x19, x0
	bl	_config_get_ptr
	mov	x20, x19
	ldp	s10, s9, [x20, #8]!
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_3
; %bb.1:
	ldp	s0, s1, [x19]
	fsub	s2, s10, s0
	fcvtzs	w8, s2
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	fsub	s2, s9, s1
	fcvtzs	w9, s2
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w9, w9, #1
	stp	w8, w9, [x19, #16]
	stp	s0, s1, [x19, #24]
LBB0_2:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x21, x0
	bl	_video_driver_get_aspect_ratio
	fmov	s8, s0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_5
; %bb.4:
	ldp	s0, s1, [x19, #8]
	ldr	w1, [x19, #32]
	mov	x0, x20
	fmov	s2, s8
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	ldp	d11, d10, [sp], #80             ; 16-byte Folded Reload
	b	_video_viewport_get_scaled_integer
LBB0_5:
	ldr	w8, [x19, #32]
	cbz	w8, LBB0_8
; %bb.6:
	ldp	s0, s1, [x19, #8]
	fdiv	s0, s0, s1
	fabd	s1, s0, s8
	mov	w8, #46871
	movk	w8, #14545, lsl #16
	fmov	s2, w8
	fcmp	s1, s2
	b.pl	LBB0_9
; %bb.7:
	mov	w20, #0
	mov	w21, #0
	b	LBB0_12
LBB0_8:
	str	xzr, [x19, #16]
	b	LBB0_13
LBB0_9:
	fcmp	s0, s8
	b.le	LBB0_11
; %bb.10:
	fdiv	s0, s8, s0
	fmov	s1, #-1.00000000
	fadd	s0, s0, s1
	fmov	s1, #0.50000000
	fmul	s0, s0, s1
	fadd	s8, s0, s1
	fsub	s0, s1, s8
	fmul	s0, s10, s0
	bl	_roundf
	mov	x21, x0
	fadd	s0, s10, s10
	fmul	s0, s0, s8
	bl	_roundf
	mov	w20, #0
	ucvtf	s10, w0
	b	LBB0_12
LBB0_11:
	fdiv	s0, s0, s8
	fmov	s1, #-1.00000000
	fadd	s0, s0, s1
	fmov	s1, #0.50000000
	fmul	s0, s0, s1
	fadd	s8, s0, s1
	fsub	s0, s1, s8
	fmul	s0, s9, s0
	bl	_roundf
	mov	x20, x0
	fadd	s0, s9, s9
	fmul	s0, s0, s8
	bl	_roundf
	mov	w21, #0
	ucvtf	s9, w0
LBB0_12:
	stp	w21, w20, [x19, #16]
LBB0_13:
	stp	s10, s9, [x19, #24]
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[Video] Aspect: %f\n"

	.comm	_ASPECT_RATIO_CUSTOM,8,3        ; @ASPECT_RATIO_CUSTOM
	.no_dead_strip	_switch_update_viewport
.subsections_via_symbols
