	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdl_video_update
_sdl_video_update:                      ## @sdl_video_update
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_system_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_SYSTEM_MCD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_2
## %bb.1:
	xorl	%edi, %edi
	callq	_system_frame_scd
	jmp	LBB0_5
LBB0_2:
	movq	_SYSTEM_PBC@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_SYSTEM_MD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_4
## %bb.3:
	xorl	%edi, %edi
	callq	_system_frame_gen
	jmp	LBB0_5
LBB0_4:
	xorl	%edi, %edi
	callq	_system_frame_sms
LBB0_5:
	movq	_bitmap@GOTPCREL(%rip), %rsi
	movl	(%rsi), %eax
	testb	$1, %al
	je	LBB0_11
## %bb.6:
	andl	$-2, %eax
	movl	%eax, (%rsi)
	movslq	16(%rsi), %rdx
	addq	%rdx, %rdx
	addq	8(%rsi), %rdx
	movq	_sdl_video@GOTPCREL(%rip), %r8
	movq	%rdx, 40(%r8)
	movslq	32(%rsi), %rcx
	addq	%rcx, %rcx
	addq	24(%rsi), %rcx
	movq	%rcx, 48(%r8)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 56(%r8)
	movq	_VIDEO_WIDTH@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rdx, %rdi
	subq	%rsi, %rdi
	jle	LBB0_8
## %bb.7:
	movq	%rdi, %rax
	shrq	$63, %rax
	addq	%rdi, %rax
	sarq	%rax
	movq	%rax, 64(%r8)
	movq	%rsi, 40(%r8)
	movq	%rsi, %rdx
LBB0_8:
	movq	_VIDEO_HEIGHT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rcx, %rax
	subq	%rdi, %rax
	jle	LBB0_10
## %bb.9:
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rax, %rcx
	sarq	%rcx
	movq	%rcx, 56(%r8)
	movq	%rdi, 48(%r8)
	movq	%rdi, %rcx
LBB0_10:
	movq	%rdx, 8(%r8)
	movq	%rcx, 16(%r8)
	subq	%rdx, %rsi
	movq	%rsi, %rax
	shrq	$63, %rax
	addq	%rsi, %rax
	sarq	%rax
	movq	%rax, 32(%r8)
	subq	%rcx, %rdi
	movq	%rdi, %rax
	shrq	$63, %rax
	addq	%rdi, %rax
	sarq	%rax
	movq	%rax, 24(%r8)
	movl	4(%r8), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_SDL_FillRect
LBB0_11:
	movq	_sdl_video@GOTPCREL(%rip), %rbx
	movl	4(%rbx), %edx
	movl	72(%rbx), %edi
	leaq	40(%rbx), %rsi
	leaq	8(%rbx), %rcx
	callq	_SDL_BlitSurface
	movl	4(%rbx), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_SDL_UpdateRect
	incl	(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_system_hw,4,2                  ## @system_hw
	.comm	_SYSTEM_MCD,4,2                 ## @SYSTEM_MCD
	.comm	_SYSTEM_PBC,4,2                 ## @SYSTEM_PBC
	.comm	_SYSTEM_MD,4,2                  ## @SYSTEM_MD
	.comm	_bitmap,40,3                    ## @bitmap
	.comm	_sdl_video,80,3                 ## @sdl_video
	.comm	_VIDEO_WIDTH,8,3                ## @VIDEO_WIDTH
	.comm	_VIDEO_HEIGHT,8,3               ## @VIDEO_HEIGHT
	.comm	_config,16,3                    ## @config
	.comm	_interlaced,8,3                 ## @interlaced
	.comm	_md_ntsc,8,3                    ## @md_ntsc
	.comm	_md_ntsc_composite,4,2          ## @md_ntsc_composite
	.comm	_md_ntsc_rgb,4,2                ## @md_ntsc_rgb
	.comm	_md_ntsc_svideo,4,2             ## @md_ntsc_svideo
	.comm	_rect,8,2                       ## @rect
	.comm	_reg,8,3                        ## @reg
	.comm	_sms_ntsc,8,3                   ## @sms_ntsc
	.comm	_sms_ntsc_composite,4,2         ## @sms_ntsc_composite
	.comm	_sms_ntsc_rgb,4,2               ## @sms_ntsc_rgb
	.comm	_sms_ntsc_svideo,4,2            ## @sms_ntsc_svideo
	.no_dead_strip	_sdl_video_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdl_video_update
_sdl_video_update:                      ; @sdl_video_update
	.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_MCD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SYSTEM_MCD@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	bl	_system_frame_scd
	b	LBB0_5
LBB0_2:
Lloh6:
	adrp	x9, _SYSTEM_PBC@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SYSTEM_PBC@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh9:
	adrp	x9, _SYSTEM_MD@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SYSTEM_MD@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.3:
	mov	w0, #0
	bl	_system_frame_gen
	b	LBB0_5
LBB0_4:
	mov	w0, #0
	bl	_system_frame_sms
LBB0_5:
Lloh12:
	adrp	x9, _bitmap@GOTPAGE
Lloh13:
	ldr	x9, [x9, _bitmap@GOTPAGEOFF]
	ldr	w8, [x9]
Lloh14:
	adrp	x19, _sdl_video@GOTPAGE
Lloh15:
	ldr	x19, [x19, _sdl_video@GOTPAGEOFF]
	tbz	w8, #0, LBB0_11
; %bb.6:
	and	w8, w8, #0xfffffffe
	str	w8, [x9]
	ldr	x8, [x9, #8]
	ldrsw	x10, [x9, #16]
	add	x8, x8, x10, lsl #1
	ldr	x10, [x9, #24]
	ldrsw	x9, [x9, #32]
	add	x9, x10, x9, lsl #1
	stp	x8, x9, [x19, #40]
	stp	xzr, xzr, [x19, #56]
Lloh16:
	adrp	x10, _VIDEO_WIDTH@GOTPAGE
Lloh17:
	ldr	x10, [x10, _VIDEO_WIDTH@GOTPAGEOFF]
Lloh18:
	ldr	x10, [x10]
	subs	x11, x8, x10
	b.le	LBB0_8
; %bb.7:
	cmp	x11, #0
	cinc	x8, x11, lt
	asr	x8, x8, #1
	str	x8, [x19, #64]
	str	x10, [x19, #40]
	mov	x8, x10
LBB0_8:
Lloh19:
	adrp	x11, _VIDEO_HEIGHT@GOTPAGE
Lloh20:
	ldr	x11, [x11, _VIDEO_HEIGHT@GOTPAGEOFF]
Lloh21:
	ldr	x11, [x11]
	subs	x12, x9, x11
	b.le	LBB0_10
; %bb.9:
	cmp	x12, #0
	cinc	x9, x12, lt
	asr	x9, x9, #1
	stp	x11, x9, [x19, #48]
	mov	x9, x11
LBB0_10:
	stp	x8, x9, [x19, #8]
	sub	x8, x10, x8
	cmp	x8, #0
	cinc	x8, x8, lt
	asr	x8, x8, #1
	sub	x9, x11, x9
	cmp	x9, #0
	cinc	x9, x9, lt
	asr	x9, x9, #1
	stp	x9, x8, [x19, #24]
	ldr	w0, [x19, #4]
	mov	w1, #0
	mov	w2, #0
	bl	_SDL_FillRect
LBB0_11:
	ldr	w0, [x19, #72]
	ldr	w2, [x19, #4]
	add	x1, x19, #40
	add	x3, x19, #8
	bl	_SDL_BlitSurface
	ldr	w0, [x19, #4]
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_SDL_UpdateRect
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_system_hw,4,2                  ; @system_hw
	.comm	_SYSTEM_MCD,4,2                 ; @SYSTEM_MCD
	.comm	_SYSTEM_PBC,4,2                 ; @SYSTEM_PBC
	.comm	_SYSTEM_MD,4,2                  ; @SYSTEM_MD
	.comm	_bitmap,40,3                    ; @bitmap
	.comm	_sdl_video,80,3                 ; @sdl_video
	.comm	_VIDEO_WIDTH,8,3                ; @VIDEO_WIDTH
	.comm	_VIDEO_HEIGHT,8,3               ; @VIDEO_HEIGHT
	.comm	_config,16,3                    ; @config
	.comm	_interlaced,8,3                 ; @interlaced
	.comm	_md_ntsc,8,3                    ; @md_ntsc
	.comm	_md_ntsc_composite,4,2          ; @md_ntsc_composite
	.comm	_md_ntsc_rgb,4,2                ; @md_ntsc_rgb
	.comm	_md_ntsc_svideo,4,2             ; @md_ntsc_svideo
	.comm	_rect,8,2                       ; @rect
	.comm	_reg,8,3                        ; @reg
	.comm	_sms_ntsc,8,3                   ; @sms_ntsc
	.comm	_sms_ntsc_composite,4,2         ; @sms_ntsc_composite
	.comm	_sms_ntsc_rgb,4,2               ; @sms_ntsc_rgb
	.comm	_sms_ntsc_svideo,4,2            ; @sms_ntsc_svideo
	.no_dead_strip	_sdl_video_update
.subsections_via_symbols
