	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcd_sync_s68k                  ## -- Begin function pcd_sync_s68k
	.p2align	4, 0x90
_pcd_sync_s68k:                         ## @pcd_sync_s68k
	.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, %r15d
	movq	_mcd_m68k_cycle_base@GOTPCREL(%rip), %rax
	movl	%edi, %ebx
	subl	(%rax), %ebx
	movl	%esi, %r14d
	movq	_mcd_m68k_cycle_mult@GOTPCREL(%rip), %rax
	imulq	(%rax), %rbx
	movq	_mcd_s68k_cycle_base@GOTPCREL(%rip), %rax
	shrq	$16, %rbx
	addl	(%rax), %ebx
	movq	_EL_CD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SekCycleCntS68k@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	movl	%ebx, %r8d
	callq	_elprintf
	movq	_Pico_mcd@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	cmpl	$1, (%rax)
	jne	LBB0_14
## %bb.1:
	movl	(%r12), %esi
	movl	%ebx, %edi
	callq	_CYCLES_GT
	testq	%rax, %rax
	je	LBB0_12
## %bb.2:
	movq	_event_time_next@GOTPCREL(%rip), %r15
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r12), %esi
	movl	%ebx, %edi
	callq	_CYCLES_GT
	testq	%rax, %rax
	je	LBB0_12
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movl	%ebx, %edi
	testl	%esi, %esi
	je	LBB0_9
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r12), %edi
	callq	_CYCLES_GE
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r12), %edi
	callq	_pcd_run_events
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r15), %esi
	movl	%ebx, %edi
	testl	%esi, %esi
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, %edi
	callq	_CYCLES_GT
	movl	%ebx, %edi
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r15), %edi
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	callq	_SekRunS68k
	testl	%r14d, %r14d
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r13), %rax
	cmpq	$0, 8(%rax)
	jne	LBB0_11
LBB0_12:
	subl	(%r12), %ebx
	jmp	LBB0_13
LBB0_14:
	movq	_SekCycleAimS68k@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movl	%ebx, (%r12)
	movl	%r15d, %edi
	callq	_pcd_run_events
	xorl	%ebx, %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mcd_m68k_cycle_base,4,2        ## @mcd_m68k_cycle_base
	.comm	_mcd_s68k_cycle_base,8,3        ## @mcd_s68k_cycle_base
	.comm	_mcd_m68k_cycle_mult,8,3        ## @mcd_m68k_cycle_mult
	.comm	_EL_CD,4,2                      ## @EL_CD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"s68k sync to %u, %u->%u"

	.comm	_SekCycleCntS68k,4,2            ## @SekCycleCntS68k
	.comm	_Pico_mcd,8,3                   ## @Pico_mcd
	.comm	_SekCycleAimS68k,4,2            ## @SekCycleAimS68k
	.comm	_event_time_next,4,2            ## @event_time_next
	.comm	_now,4,2                        ## @now
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcd_sync_s68k                  ; -- Begin function pcd_sync_s68k
	.p2align	2
_pcd_sync_s68k:                         ; @pcd_sync_s68k
	.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, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _mcd_m68k_cycle_base@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mcd_m68k_cycle_base@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sub	w8, w0, w8
Lloh3:
	adrp	x9, _mcd_s68k_cycle_base@GOTPAGE
Lloh4:
	ldr	x9, [x9, _mcd_s68k_cycle_base@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _mcd_m68k_cycle_mult@GOTPAGE
Lloh7:
	ldr	x10, [x10, _mcd_m68k_cycle_mult@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	mul	x8, x10, x8
	lsr	x8, x8, #16
	add	w20, w8, w9
Lloh9:
	adrp	x8, _EL_CD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EL_CD@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x22, _SekCycleCntS68k@GOTPAGE
Lloh13:
	ldr	x22, [x22, _SekCycleCntS68k@GOTPAGEOFF]
	ldr	w3, [x22]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	mov	x4, x20
	bl	_elprintf
Lloh16:
	adrp	x23, _Pico_mcd@GOTPAGE
Lloh17:
	ldr	x23, [x23, _Pico_mcd@GOTPAGEOFF]
	ldr	x8, [x23]
	ldr	w8, [x8]
	cmp	w8, #1
	b.ne	LBB0_12
; %bb.1:
	ldr	w1, [x22]
	mov	x0, x20
	bl	_CYCLES_GT
	cbz	x0, LBB0_11
; %bb.2:
Lloh18:
	adrp	x21, _event_time_next@GOTPAGE
Lloh19:
	ldr	x21, [x21, _event_time_next@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x22]
	mov	x0, x20
	bl	_CYCLES_GT
	cbz	x0, LBB0_11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x20
	cbz	w1, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x22]
	bl	_CYCLES_GE
	cbz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x22]
	bl	_pcd_run_events
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x21]
	mov	x0, x20
	cbz	w1, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_CYCLES_GT
	ldr	w8, [x21]
	cmp	x0, #0
	csel	w0, w20, w8, eq
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	bl	_SekRunS68k
	cbz	w19, LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x23]
	ldr	x8, [x8, #8]
	cbnz	x8, LBB0_3
LBB0_11:
	ldr	w8, [x22]
	sub	w0, w20, w8
	b	LBB0_13
LBB0_12:
Lloh20:
	adrp	x8, _SekCycleAimS68k@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SekCycleAimS68k@GOTPAGEOFF]
Lloh22:
	str	w20, [x8]
	str	w20, [x22]
	mov	x0, x21
	bl	_pcd_run_events
	mov	w0, #0
LBB0_13:
	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
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotStr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_mcd_m68k_cycle_base,4,2        ; @mcd_m68k_cycle_base
	.comm	_mcd_s68k_cycle_base,8,3        ; @mcd_s68k_cycle_base
	.comm	_mcd_m68k_cycle_mult,8,3        ; @mcd_m68k_cycle_mult
	.comm	_EL_CD,4,2                      ; @EL_CD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"s68k sync to %u, %u->%u"

	.comm	_SekCycleCntS68k,4,2            ; @SekCycleCntS68k
	.comm	_Pico_mcd,8,3                   ; @Pico_mcd
	.comm	_SekCycleAimS68k,4,2            ; @SekCycleAimS68k
	.comm	_event_time_next,4,2            ; @event_time_next
	.comm	_now,4,2                        ; @now
.subsections_via_symbols
