	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_scd_update                     ## -- Begin function scd_update
	.p2align	4, 0x90
_scd_update:                            ## @scd_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	_cdc@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_cdc_dma_update
LBB0_2:
	movq	_scd@GOTPCREL(%rip), %r14
	movq	_SCYCLES_PER_LINE@GOTPCREL(%rip), %r15
	movq	_m68k@GOTPCREL(%rip), %r12
	movq	_s68k@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_m68k_run
	movslq	(%r15), %rdi
	addq	(%r14), %rdi
	callq	_s68k_run
	cmpl	%ebx, (%r12)
	jb	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movslq	(%r15), %rax
	movq	(%r14), %rcx
	addq	%rax, %rcx
	cmpq	%rcx, (%r13)
	jl	LBB0_3
## %bb.5:
	movq	%rcx, (%r14)
	leal	(%rax,%rax,2), %eax
	movq	_cdd@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	movl	%eax, (%rcx)
	cmpl	$2000000, %eax                  ## imm = 0x1E8480
	jl	LBB0_9
## %bb.6:
	addl	$-2000000, %eax                 ## imm = 0xFFE17B80
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_cdd_update
	movq	24(%r14), %rcx
	testb	$-16, 296(%rcx)
	jne	LBB0_9
## %bb.7:
	movl	$240, 296(%rcx)
	movl	8(%r14), %eax
	orl	$16, %eax
	movl	%eax, 8(%r14)
	movl	200(%rcx), %edi
	testb	$16, %dil
	je	LBB0_9
## %bb.8:
	andl	%eax, %edi
	sarl	%edi
	callq	_s68k_update_irq
LBB0_9:
	movq	16(%r14), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.10:
	movslq	(%r15), %rcx
	subq	%rcx, %rax
	movq	%rax, 16(%r14)
	jg	LBB0_13
## %bb.11:
	movq	24(%r14), %rcx
	movslq	192(%rcx), %rdx
	movq	_TIMERS_SCYCLES_RATIO@GOTPCREL(%rip), %rsi
	movslq	(%rsi), %rsi
	imulq	%rdx, %rsi
	addq	%rsi, %rax
	movq	%rax, 16(%r14)
	movl	200(%rcx), %eax
	testb	$8, %al
	je	LBB0_13
## %bb.12:
	movl	8(%r14), %edi
	orl	$8, %edi
	movl	%edi, 8(%r14)
	andl	%eax, %edi
	sarl	%edi
	callq	_s68k_update_irq
LBB0_13:
	movq	24(%r14), %rax
	testb	$-128, 356(%rax)
	jne	LBB0_15
## %bb.14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	(%r14), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gfx_update                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_cdc,8,3                        ## @cdc
	.comm	_scd,32,3                       ## @scd
	.comm	_SCYCLES_PER_LINE,4,2           ## @SCYCLES_PER_LINE
	.comm	_m68k,4,2                       ## @m68k
	.comm	_s68k,8,3                       ## @s68k
	.comm	_cdd,4,2                        ## @cdd
	.comm	_TIMERS_SCYCLES_RATIO,4,2       ## @TIMERS_SCYCLES_RATIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_scd_update                     ; -- Begin function scd_update
	.p2align	2
_scd_update:                            ; @scd_update
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _cdc@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cdc@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	bl	_cdc_dma_update
LBB0_2:
Lloh3:
	adrp	x20, _scd@GOTPAGE
Lloh4:
	ldr	x20, [x20, _scd@GOTPAGEOFF]
Lloh5:
	adrp	x21, _SCYCLES_PER_LINE@GOTPAGE
Lloh6:
	ldr	x21, [x21, _SCYCLES_PER_LINE@GOTPAGEOFF]
Lloh7:
	adrp	x22, _m68k@GOTPAGE
Lloh8:
	ldr	x22, [x22, _m68k@GOTPAGEOFF]
Lloh9:
	adrp	x23, _s68k@GOTPAGE
Lloh10:
	ldr	x23, [x23, _s68k@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_m68k_run
	ldr	x8, [x20]
	ldrsw	x9, [x21]
	add	x0, x8, x9
	bl	_s68k_run
	ldr	w8, [x22]
	cmp	w8, w19
	b.lo	LBB0_3
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x10, [x23]
	ldr	x8, [x20]
	ldrsw	x9, [x21]
	add	x8, x8, x9
	cmp	x10, x8
	b.lt	LBB0_3
; %bb.5:
	str	x8, [x20]
Lloh11:
	adrp	x8, _cdd@GOTPAGE
Lloh12:
	ldr	x8, [x8, _cdd@GOTPAGEOFF]
	add	w9, w9, w9, lsl #1
	ldr	w10, [x8]
	mov	w11, #33920
	movk	w11, #30, lsl #16
	add	w9, w10, w9
	cmp	w9, w11
	str	w9, [x8]
	b.lt	LBB0_9
; %bb.6:
	sub	w9, w9, #488, lsl #12           ; =1998848
	sub	w9, w9, #1152
	str	w9, [x8]
	bl	_cdd_update
	ldr	x8, [x20, #24]
	ldrb	w9, [x8, #296]
	tst	w9, #0xf0
	b.ne	LBB0_9
; %bb.7:
	mov	w9, #240
	str	w9, [x8, #296]
	ldr	w9, [x20, #8]
	orr	w9, w9, #0x10
	str	w9, [x20, #8]
	ldr	w8, [x8, #200]
	tbz	w8, #4, LBB0_9
; %bb.8:
	and	w8, w8, w9
	asr	w0, w8, #1
	bl	_s68k_update_irq
LBB0_9:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_13
; %bb.10:
	ldrsw	x9, [x21]
	sub	x8, x8, x9
	str	x8, [x20, #16]
	cmp	x8, #0
	b.gt	LBB0_13
; %bb.11:
	ldr	x9, [x20, #24]
	ldrsw	x10, [x9, #192]
Lloh13:
	adrp	x11, _TIMERS_SCYCLES_RATIO@GOTPAGE
Lloh14:
	ldr	x11, [x11, _TIMERS_SCYCLES_RATIO@GOTPAGEOFF]
Lloh15:
	ldrsw	x11, [x11]
	madd	x8, x11, x10, x8
	str	x8, [x20, #16]
	ldr	w8, [x9, #200]
	tbz	w8, #3, LBB0_13
; %bb.12:
	ldr	w9, [x20, #8]
	orr	w9, w9, #0x8
	str	w9, [x20, #8]
	and	w8, w9, w8
	asr	w0, w8, #1
	bl	_s68k_update_irq
LBB0_13:
	ldr	x8, [x20, #24]
	ldrb	w8, [x8, #356]
	tbnz	w8, #7, LBB0_15
; %bb.14:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_15:
	ldr	x0, [x20]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_gfx_update
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_cdc,8,3                        ; @cdc
	.comm	_scd,32,3                       ; @scd
	.comm	_SCYCLES_PER_LINE,4,2           ; @SCYCLES_PER_LINE
	.comm	_m68k,4,2                       ; @m68k
	.comm	_s68k,8,3                       ; @s68k
	.comm	_cdd,4,2                        ; @cdd
	.comm	_TIMERS_SCYCLES_RATIO,4,2       ; @TIMERS_SCYCLES_RATIO
.subsections_via_symbols
