	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gfx_update                     ## -- Begin function gfx_update
	.p2align	4, 0x90
_gfx_update:                            ## @gfx_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_Pico_mcd@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	testb	$-128, 352(%rax)
	je	LBB0_9
## %bb.1:
	movl	392(%rax), %r14d
	shll	$8, %r14d
	orl	396(%rax), %r14d
	movl	400(%rax), %ebx
	shll	$8, %ebx
	orl	404(%rax), %ebx
	movq	_gfx@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movl	%ebx, %edx
	subl	%ecx, %edx
	jle	LBB0_2
## %bb.4:
	movl	%edx, %esi
	shrl	$8, %esi
	movl	%esi, 400(%rax)
	movl	%edx, 404(%rax)
	cmpl	%ecx, %ebx
	cmovgel	%ecx, %ebx
	movq	_PCD_EVENT_GFX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %eax
	imull	%ebx, %eax
	leal	(%rax,%rax,4), %edx
	callq	_pcd_event_schedule
	jmp	LBB0_5
LBB0_2:
	movl	$0, 352(%rax)
	movq	$0, 400(%rax)
	movq	_PCDS_IEN1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 204(%rax)
	je	LBB0_5
## %bb.3:
	movq	_EL_INTS@GOTPCREL(%rip), %rax
	movq	_EL_CD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elprintf
	movl	$1, %edi
	callq	_SekInterruptS68k
LBB0_5:
	movq	_PicoOpt@GOTPCREL(%rip), %rax
	movq	_POPT_EN_MCD_GFX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_9
## %bb.6:
	testl	%ebx, %ebx
	je	LBB0_9
## %bb.7:
	movl	4(%r15), %edi
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %esi
	callq	_gfx_render
	movl	4(%r15), %edi
	addl	$8, %edi
	movl	%edi, 4(%r15)
	decl	%ebx
	jne	LBB0_8
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_Pico_mcd,8,3                   ## @Pico_mcd
	.comm	_gfx,8,2                        ## @gfx
	.comm	_PCDS_IEN1,4,2                  ## @PCDS_IEN1
	.comm	_EL_INTS,4,2                    ## @EL_INTS
	.comm	_EL_CD,4,2                      ## @EL_CD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"s68k: gfx_cd irq 1"

	.comm	_PCD_EVENT_GFX,4,2              ## @PCD_EVENT_GFX
	.comm	_PicoOpt,4,2                    ## @PicoOpt
	.comm	_POPT_EN_MCD_GFX,4,2            ## @POPT_EN_MCD_GFX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gfx_update                     ; -- Begin function gfx_update
	.p2align	2
_gfx_update:                            ; @gfx_update
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x8, _Pico_mcd@GOTPAGE
Lloh1:
	ldr	x8, [x8, _Pico_mcd@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldrb	w9, [x8, #352]
	tbz	w9, #7, LBB0_8
; %bb.1:
	ldr	w9, [x8, #392]
	ldr	w10, [x8, #396]
	orr	w19, w10, w9, lsl #8
	ldr	w9, [x8, #400]
	ldr	w10, [x8, #404]
	orr	w20, w10, w9, lsl #8
Lloh3:
	adrp	x21, _gfx@GOTPAGE
Lloh4:
	ldr	x21, [x21, _gfx@GOTPAGEOFF]
	ldr	w9, [x21]
	sub	w10, w20, w9
	cmp	w10, #0
	b.le	LBB0_3
; %bb.2:
	lsr	w11, w10, #8
	str	w11, [x8, #400]
	str	w10, [x8, #404]
	cmp	w20, w9
	csel	w20, w20, w9, lt
Lloh5:
	adrp	x8, _PCD_EVENT_GFX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PCD_EVENT_GFX@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mul	w8, w19, w20
	add	w2, w8, w8, lsl #2
	bl	_pcd_event_schedule
	b	LBB0_5
LBB0_3:
	str	wzr, [x8, #352]
	str	xzr, [x8, #400]
	ldr	w8, [x8, #204]
Lloh8:
	adrp	x9, _PCDS_IEN1@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PCDS_IEN1@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
Lloh11:
	adrp	x8, _EL_INTS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EL_INTS@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _EL_CD@GOTPAGE
Lloh15:
	ldr	x9, [x9, _EL_CD@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w0, w9, w8
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elprintf
	mov	w0, #1
	bl	_SekInterruptS68k
LBB0_5:
Lloh19:
	adrp	x8, _PicoOpt@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PicoOpt@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	adrp	x9, _POPT_EN_MCD_GFX@GOTPAGE
Lloh23:
	ldr	x9, [x9, _POPT_EN_MCD_GFX@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	and	w8, w9, w8
	cmp	w8, #0
	ccmp	w20, #0, #4, ne
	b.eq	LBB0_8
; %bb.6:
	ldr	w0, [x21, #4]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	sub	w20, w20, #1
	mov	x1, x19
	bl	_gfx_render
	ldr	w8, [x21, #4]
	add	w0, w8, #8
	str	w0, [x21, #4]
	cbnz	w20, LBB0_7
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_Pico_mcd,8,3                   ; @Pico_mcd
	.comm	_gfx,8,2                        ; @gfx
	.comm	_PCDS_IEN1,4,2                  ; @PCDS_IEN1
	.comm	_EL_INTS,4,2                    ; @EL_INTS
	.comm	_EL_CD,4,2                      ; @EL_CD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"s68k: gfx_cd irq 1"

	.comm	_PCD_EVENT_GFX,4,2              ; @PCD_EVENT_GFX
	.comm	_PicoOpt,4,2                    ; @PicoOpt
	.comm	_POPT_EN_MCD_GFX,4,2            ; @POPT_EN_MCD_GFX
.subsections_via_symbols
