	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mv88e6352_tai_event_work
_mv88e6352_tai_event_work:              ## @mv88e6352_tai_event_work
	.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	%r12
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	callq	_to_delayed_work
	movq	%rax, %rdi
	callq	_dw_tai_event_to_chip
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_mv88e6xxx_reg_lock
	movq	_MV88E6XXX_TAI_EVENT_STATUS@GOTPCREL(%rip), %r12
	movl	(%r12), %ebx
	leaq	-64(%rbp), %r14
	movq	%r14, %rdi
	callq	_ARRAY_SIZE
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%r14, %rdx
	movl	%eax, %ecx
	callq	_mv88e6xxx_tai_read
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_mv88e6xxx_reg_unlock
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.1:
	movl	12(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_7
LBB0_2:
	movl	-64(%rbp), %eax
	movq	_MV88E6XXX_TAI_EVENT_STATUS_ERROR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movl	12(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_warn
	jmp	LBB0_7
LBB0_4:
	movq	_MV88E6XXX_TAI_EVENT_STATUS_VALID@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_6
## %bb.5:
	movl	-56(%rbp), %r14d
	shll	$16, %r14d
	orl	-60(%rbp), %r14d
	notl	%ecx
	andl	%ecx, %eax
	movl	%eax, -64(%rbp)
	movq	%r15, %rdi
	callq	_mv88e6xxx_reg_lock
	movl	(%r12), %esi
	movl	-64(%rbp), %edx
	movq	%r15, %rdi
	callq	_mv88e6xxx_tai_write
	movq	%r15, %rdi
	callq	_mv88e6xxx_reg_unlock
	movq	_PTP_CLOCK_EXTTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movq	$0, -80(%rbp)
	movq	%r15, %rdi
	callq	_mv88e6xxx_reg_lock
	movq	%r15, %rdi
	addq	$8, %rdi
	movl	%r14d, %esi
	callq	_timecounter_cyc2time
	movl	%eax, -88(%rbp)
	movq	%r15, %rdi
	callq	_mv88e6xxx_reg_unlock
	movl	4(%r15), %edi
	leaq	-88(%rbp), %rsi
	callq	_ptp_clock_event
LBB0_6:
	movq	_TAI_EVENT_WORK_INTERVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_schedule_delayed_work
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MV88E6XXX_TAI_EVENT_STATUS,4,2 ## @MV88E6XXX_TAI_EVENT_STATUS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read TAI status register\n"

	.comm	_MV88E6XXX_TAI_EVENT_STATUS_ERROR,4,2 ## @MV88E6XXX_TAI_EVENT_STATUS_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"missed event capture\n"

	.comm	_MV88E6XXX_TAI_EVENT_STATUS_VALID,4,2 ## @MV88E6XXX_TAI_EVENT_STATUS_VALID
	.comm	_PTP_CLOCK_EXTTS,4,2            ## @PTP_CLOCK_EXTTS
	.comm	_TAI_EVENT_WORK_INTERVAL,4,2    ## @TAI_EVENT_WORK_INTERVAL
	.no_dead_strip	_mv88e6352_tai_event_work
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mv88e6352_tai_event_work
_mv88e6352_tai_event_work:              ; @mv88e6352_tai_event_work
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	bl	_to_delayed_work
	bl	_dw_tai_event_to_chip
	mov	x19, x0
	bl	_mv88e6xxx_reg_lock
Lloh3:
	adrp	x21, _MV88E6XXX_TAI_EVENT_STATUS@GOTPAGE
Lloh4:
	ldr	x21, [x21, _MV88E6XXX_TAI_EVENT_STATUS@GOTPAGEOFF]
	ldr	w20, [x21]
	add	x0, sp, #24
	bl	_ARRAY_SIZE
	mov	x3, x0
	add	x2, sp, #24
	mov	x0, x19
	mov	x1, x20
	bl	_mv88e6xxx_tai_read
	mov	x20, x0
	mov	x0, x19
	bl	_mv88e6xxx_reg_unlock
	cbz	w20, LBB0_2
; %bb.1:
	ldr	w0, [x19, #12]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_7
LBB0_2:
	ldr	w8, [sp, #24]
Lloh7:
	adrp	x9, _MV88E6XXX_TAI_EVENT_STATUS_ERROR@GOTPAGE
Lloh8:
	ldr	x9, [x9, _MV88E6XXX_TAI_EVENT_STATUS_ERROR@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	ldr	w0, [x19, #12]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
	b	LBB0_7
LBB0_4:
Lloh12:
	adrp	x9, _MV88E6XXX_TAI_EVENT_STATUS_VALID@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MV88E6XXX_TAI_EVENT_STATUS_VALID@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	ldp	w11, w10, [sp, #28]
	orr	w20, w11, w10, lsl #16
	bic	w8, w8, w9
	str	w8, [sp, #24]
	mov	x0, x19
	bl	_mv88e6xxx_reg_lock
	ldr	w1, [x21]
	ldr	w2, [sp, #24]
	mov	x0, x19
	bl	_mv88e6xxx_tai_write
	mov	x0, x19
	bl	_mv88e6xxx_reg_unlock
Lloh15:
	adrp	x8, _PTP_CLOCK_EXTTS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PTP_CLOCK_EXTTS@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [sp, #16]
	str	xzr, [sp, #8]
	mov	x0, x19
	bl	_mv88e6xxx_reg_lock
	add	x0, x19, #8
	mov	x1, x20
	bl	_timecounter_cyc2time
	str	w0, [sp]
	mov	x0, x19
	bl	_mv88e6xxx_reg_unlock
	ldr	w0, [x19, #4]
	mov	x1, sp
	bl	_ptp_clock_event
LBB0_6:
Lloh18:
	adrp	x8, _TAI_EVENT_WORK_INTERVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TAI_EVENT_WORK_INTERVAL@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_schedule_delayed_work
LBB0_7:
	ldr	x8, [sp, #40]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MV88E6XXX_TAI_EVENT_STATUS,4,2 ; @MV88E6XXX_TAI_EVENT_STATUS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read TAI status register\n"

	.comm	_MV88E6XXX_TAI_EVENT_STATUS_ERROR,4,2 ; @MV88E6XXX_TAI_EVENT_STATUS_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"missed event capture\n"

	.comm	_MV88E6XXX_TAI_EVENT_STATUS_VALID,4,2 ; @MV88E6XXX_TAI_EVENT_STATUS_VALID
	.comm	_PTP_CLOCK_EXTTS,4,2            ; @PTP_CLOCK_EXTTS
	.comm	_TAI_EVENT_WORK_INTERVAL,4,2    ; @TAI_EVENT_WORK_INTERVAL
	.no_dead_strip	_mv88e6352_tai_event_work
.subsections_via_symbols
