	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function retro_set_viewport_dimensions
_retro_set_viewport_dimensions:         ## @retro_set_viewport_dimensions
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_system_hw@GOTPCREL(%rip), %rcx
	movq	_SYSTEM_PBC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rcx), %eax
	movq	_SYSTEM_MD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_3
## %bb.1:
	movq	_SYSTEM_MCD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_3
## %bb.2:
	xorl	%edi, %edi
	callq	_system_frame_sms
	xorl	%edi, %edi
	callq	_system_frame_sms
	xorl	%edi, %edi
	callq	_system_frame_sms
	xorl	%edi, %edi
	callq	_system_frame_sms
	xorl	%edi, %edi
	callq	_system_frame_sms
	xorl	%edi, %edi
	callq	_system_frame_sms
	xorl	%edi, %edi
	callq	_system_frame_sms
	xorl	%edi, %edi
	callq	_system_frame_sms
	xorl	%edi, %edi
	callq	_system_frame_sms
	xorl	%edi, %edi
	callq	_system_frame_sms
	jmp	LBB0_4
LBB0_3:
	xorl	%edi, %edi
	callq	_system_frame_gen
	xorl	%edi, %edi
	callq	_system_frame_gen
	xorl	%edi, %edi
	callq	_system_frame_gen
	xorl	%edi, %edi
	callq	_system_frame_gen
	xorl	%edi, %edi
	callq	_system_frame_gen
	xorl	%edi, %edi
	callq	_system_frame_gen
	xorl	%edi, %edi
	callq	_system_frame_gen
	xorl	%edi, %edi
	callq	_system_frame_gen
	xorl	%edi, %edi
	callq	_system_frame_gen
	xorl	%edi, %edi
	callq	_system_frame_gen
LBB0_4:
	movq	_bitmap@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	addq	%rcx, %rcx
	addq	16(%rax), %rcx
	movq	_vwidth@GOTPCREL(%rip), %r14
	movq	%rcx, (%r14)
	movslq	4(%rax), %rcx
	addq	%rcx, %rcx
	addq	8(%rax), %rcx
	movq	_vheight@GOTPCREL(%rip), %rbx
	movq	%rcx, (%rbx)
	xorl	%eax, %eax
	callq	_retro_reset
	movq	(%r14), %rax
	movq	(%rbx), %rcx
	movq	_vdp_pal@GOTPCREL(%rip), %rdx
	cmpq	$0, (%rdx)
	jne	LBB0_5
## %bb.6:
	movq	_ntsc_fps@GOTPCREL(%rip), %rdx
	jmp	LBB0_7
LBB0_5:
	movq	_pal_fps@GOTPCREL(%rip), %rdx
LBB0_7:
	movl	(%rdx), %edx
	movq	_g_av_info@GOTPCREL(%rip), %rsi
	movabsq	$4608683618675807573, %rdi      ## imm = 0x3FF5555555555555
	movq	%rdi, 8(%rsi)
	movabsq	$2473901163216, %rdi            ## imm = 0x240000002D0
	movq	%rdi, 16(%rsi)
	movq	%rcx, 24(%rsi)
	movq	%rax, 32(%rsi)
	movl	$48000, (%rsi)                  ## imm = 0xBB80
	movl	%edx, 4(%rsi)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_system_hw,4,2                  ## @system_hw
	.comm	_SYSTEM_PBC,4,2                 ## @SYSTEM_PBC
	.comm	_SYSTEM_MD,4,2                  ## @SYSTEM_MD
	.comm	_SYSTEM_MCD,4,2                 ## @SYSTEM_MCD
	.comm	_bitmap,24,3                    ## @bitmap
	.comm	_vwidth,8,3                     ## @vwidth
	.comm	_vheight,8,3                    ## @vheight
	.comm	_vdp_pal,8,3                    ## @vdp_pal
	.comm	_pal_fps,4,2                    ## @pal_fps
	.comm	_ntsc_fps,4,2                   ## @ntsc_fps
	.comm	_g_av_info,40,3                 ## @g_av_info
	.comm	_config,8,3                     ## @config
	.no_dead_strip	_retro_set_viewport_dimensions
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function retro_set_viewport_dimensions
lCPI0_0:
	.long	720                             ; 0x2d0
	.long	576                             ; 0x240
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_retro_set_viewport_dimensions:         ; @retro_set_viewport_dimensions
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _system_hw@GOTPAGE
Lloh1:
	ldr	x8, [x8, _system_hw@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _SYSTEM_PBC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SYSTEM_PBC@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh6:
	adrp	x9, _SYSTEM_MD@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SYSTEM_MD@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _SYSTEM_MCD@GOTPAGE
Lloh10:
	ldr	x10, [x10, _SYSTEM_MCD@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	cmp	w8, w9
	mov	w0, #0
	ccmp	w8, w10, #4, ne
	b.ne	LBB0_2
; %bb.1:
	bl	_system_frame_gen
	mov	w0, #0
	bl	_system_frame_gen
	mov	w0, #0
	bl	_system_frame_gen
	mov	w0, #0
	bl	_system_frame_gen
	mov	w0, #0
	bl	_system_frame_gen
	mov	w0, #0
	bl	_system_frame_gen
	mov	w0, #0
	bl	_system_frame_gen
	mov	w0, #0
	bl	_system_frame_gen
	mov	w0, #0
	bl	_system_frame_gen
	mov	w0, #0
	bl	_system_frame_gen
	b	LBB0_3
LBB0_2:
	bl	_system_frame_sms
	mov	w0, #0
	bl	_system_frame_sms
	mov	w0, #0
	bl	_system_frame_sms
	mov	w0, #0
	bl	_system_frame_sms
	mov	w0, #0
	bl	_system_frame_sms
	mov	w0, #0
	bl	_system_frame_sms
	mov	w0, #0
	bl	_system_frame_sms
	mov	w0, #0
	bl	_system_frame_sms
	mov	w0, #0
	bl	_system_frame_sms
	mov	w0, #0
	bl	_system_frame_sms
LBB0_3:
Lloh12:
	adrp	x8, _bitmap@GOTPAGE
Lloh13:
	ldr	x8, [x8, _bitmap@GOTPAGEOFF]
Lloh14:
	adrp	x19, _vwidth@GOTPAGE
Lloh15:
	ldr	x19, [x19, _vwidth@GOTPAGEOFF]
	ldp	x10, x9, [x8, #8]
	ldpsw	x11, x8, [x8]
	add	x9, x9, x11, lsl #1
	str	x9, [x19]
	add	x8, x10, x8, lsl #1
Lloh16:
	adrp	x20, _vheight@GOTPAGE
Lloh17:
	ldr	x20, [x20, _vheight@GOTPAGEOFF]
	str	x8, [x20]
	bl	_retro_reset
	ldr	x8, [x19]
	ldr	x9, [x20]
Lloh18:
	adrp	x10, _vdp_pal@GOTPAGE
Lloh19:
	ldr	x10, [x10, _vdp_pal@GOTPAGEOFF]
Lloh20:
	adrp	x11, _ntsc_fps@GOTPAGE
Lloh21:
	ldr	x11, [x11, _ntsc_fps@GOTPAGEOFF]
Lloh22:
	ldr	x10, [x10]
Lloh23:
	adrp	x12, _pal_fps@GOTPAGE
Lloh24:
	ldr	x12, [x12, _pal_fps@GOTPAGEOFF]
	cmp	x10, #0
	csel	x10, x11, x12, eq
	ldr	w10, [x10]
Lloh25:
	adrp	x11, _g_av_info@GOTPAGE
Lloh26:
	ldr	x11, [x11, _g_av_info@GOTPAGEOFF]
	mov	x12, #6148914691236517205
	movk	x12, #16373, lsl #48
	str	x12, [x11, #8]
Lloh27:
	adrp	x12, lCPI0_0@PAGE
Lloh28:
	ldr	d0, [x12, lCPI0_0@PAGEOFF]
	str	d0, [x11, #16]
	stp	x9, x8, [x11, #24]
	mov	w8, #48000
	stp	w8, w10, [x11]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdr	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh22
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_system_hw,4,2                  ; @system_hw
	.comm	_SYSTEM_PBC,4,2                 ; @SYSTEM_PBC
	.comm	_SYSTEM_MD,4,2                  ; @SYSTEM_MD
	.comm	_SYSTEM_MCD,4,2                 ; @SYSTEM_MCD
	.comm	_bitmap,24,3                    ; @bitmap
	.comm	_vwidth,8,3                     ; @vwidth
	.comm	_vheight,8,3                    ; @vheight
	.comm	_vdp_pal,8,3                    ; @vdp_pal
	.comm	_pal_fps,4,2                    ; @pal_fps
	.comm	_ntsc_fps,4,2                   ; @ntsc_fps
	.comm	_g_av_info,40,3                 ; @g_av_info
	.comm	_config,8,3                     ; @config
	.no_dead_strip	_retro_set_viewport_dimensions
.subsections_via_symbols
