	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ocelot_mact_read
_ocelot_mact_read:                      ## @ocelot_mact_read
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, %r12d
	movl	%esi, %r13d
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %rbx
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	_ANA_TABLES_MACTINDX_M_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_ocelot_field_write
	movq	_ANA_TABLES_MACTINDX_BUCKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	callq	_ocelot_field_write
	movq	_MACACCESS_CMD_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ANA_TABLES_MACACCESS_MAC_TABLE_CMD
	movq	_ANA_TABLES_MACACCESS@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_ocelot_write
	movq	%rbx, %rdi
	callq	_ocelot_mact_wait_for_completion
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_3:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_ocelot_read
	movq	_ANA_TABLES_MACACCESS_VALID@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.5:
	movq	_ANA_TABLES_MACACCESS_DEST_IDX_M@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	sarl	$3, %eax
	cmpl	(%r15), %eax
	jne	LBB0_4
## %bb.6:
	movq	_ANA_TABLES_MACLDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ocelot_read
	movl	%eax, %r15d
	movq	_ANA_TABLES_MACHDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ocelot_read
	movq	%r14, %rsi
	movb	%ah, (%rsi)
	movb	%al, 1(%r14)
	movl	%r15d, %edx
	movl	%r15d, %ecx
	shrl	$24, %ecx
	movb	%cl, 2(%r14)
	movl	%r15d, %ecx
	shrl	$16, %ecx
	movb	%cl, 3(%r14)
	movb	%dh, 4(%rsi)
	movb	%dl, 5(%r14)
	shrl	$16, %eax
	andl	$4095, %eax                     ## imm = 0xFFF
	movl	%eax, (%r13)
	movl	4(%r13), %edi
	callq	_ether_addr_copy
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_9
## %bb.8:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ETH_ALEN,4,2                   ## @ETH_ALEN
	.comm	_ANA_TABLES_MACTINDX_M_INDEX,4,2 ## @ANA_TABLES_MACTINDX_M_INDEX
	.comm	_ANA_TABLES_MACTINDX_BUCKET,4,2 ## @ANA_TABLES_MACTINDX_BUCKET
	.comm	_MACACCESS_CMD_READ,4,2         ## @MACACCESS_CMD_READ
	.comm	_ANA_TABLES_MACACCESS,4,2       ## @ANA_TABLES_MACACCESS
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_ANA_TABLES_MACACCESS_VALID,4,2 ## @ANA_TABLES_MACACCESS_VALID
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ANA_TABLES_MACACCESS_DEST_IDX_M,4,2 ## @ANA_TABLES_MACACCESS_DEST_IDX_M
	.comm	_ANA_TABLES_MACLDATA,4,2        ## @ANA_TABLES_MACLDATA
	.comm	_ANA_TABLES_MACHDATA,4,2        ## @ANA_TABLES_MACHDATA
	.no_dead_strip	_ocelot_mact_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ocelot_mact_read
_ocelot_mact_read:                      ; @ocelot_mact_read
	.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
	sub	sp, sp, #16
	mov	x19, x3
	mov	x23, x2
	mov	x2, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	ldr	x21, [x0, #8]
Lloh3:
	adrp	x8, _ETH_ALEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ETH_ALEN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x20, x9, x8
	mov	sp, x20
Lloh8:
	adrp	x8, _ANA_TABLES_MACTINDX_M_INDEX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ANA_TABLES_MACTINDX_M_INDEX@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_ocelot_field_write
Lloh11:
	adrp	x8, _ANA_TABLES_MACTINDX_BUCKET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ANA_TABLES_MACTINDX_BUCKET@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x23
	bl	_ocelot_field_write
Lloh14:
	adrp	x8, _MACACCESS_CMD_READ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MACACCESS_CMD_READ@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_ANA_TABLES_MACACCESS_MAC_TABLE_CMD
	mov	x1, x0
Lloh17:
	adrp	x23, _ANA_TABLES_MACACCESS@GOTPAGE
Lloh18:
	ldr	x23, [x23, _ANA_TABLES_MACACCESS@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x21
	bl	_ocelot_write
	mov	x0, x21
	bl	_ocelot_mact_wait_for_completion
	cbz	x0, LBB0_2
; %bb.1:
Lloh19:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_6
LBB0_2:
	ldr	w1, [x23]
	mov	x0, x21
	bl	_ocelot_read
Lloh21:
	adrp	x8, _ANA_TABLES_MACACCESS_VALID@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ANA_TABLES_MACACCESS_VALID@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.3:
Lloh24:
	adrp	x8, _ANA_TABLES_MACACCESS_DEST_IDX_M@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ANA_TABLES_MACACCESS_DEST_IDX_M@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	and	w8, w8, w0
	ldr	w9, [x22]
	cmp	w9, w8, asr #3
	b.ne	LBB0_5
; %bb.4:
Lloh27:
	adrp	x8, _ANA_TABLES_MACLDATA@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ANA_TABLES_MACLDATA@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_ocelot_read
	mov	x22, x0
Lloh30:
	adrp	x8, _ANA_TABLES_MACHDATA@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ANA_TABLES_MACHDATA@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_ocelot_read
	lsr	w8, w0, #8
	strb	w8, [x20]
	strb	w0, [x20, #1]
	lsr	w8, w22, #24
	strb	w8, [x20, #2]
	lsr	w8, w22, #16
	strb	w8, [x20, #3]
	lsr	w8, w22, #8
	strb	w8, [x20, #4]
	strb	w22, [x20, #5]
	ubfx	w8, w0, #16, #12
	str	w8, [x19]
	ldr	w0, [x19, #4]
	mov	x1, x20
	bl	_ether_addr_copy
	mov	w0, #0
	b	LBB0_7
LBB0_5:
Lloh33:
	adrp	x8, _EINVAL@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldur	x8, [x29, #-56]
Lloh35:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh36:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	sub	sp, x29, #48
	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_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_ETH_ALEN,4,2                   ; @ETH_ALEN
	.comm	_ANA_TABLES_MACTINDX_M_INDEX,4,2 ; @ANA_TABLES_MACTINDX_M_INDEX
	.comm	_ANA_TABLES_MACTINDX_BUCKET,4,2 ; @ANA_TABLES_MACTINDX_BUCKET
	.comm	_MACACCESS_CMD_READ,4,2         ; @MACACCESS_CMD_READ
	.comm	_ANA_TABLES_MACACCESS,4,2       ; @ANA_TABLES_MACACCESS
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_ANA_TABLES_MACACCESS_VALID,4,2 ; @ANA_TABLES_MACACCESS_VALID
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ANA_TABLES_MACACCESS_DEST_IDX_M,4,2 ; @ANA_TABLES_MACACCESS_DEST_IDX_M
	.comm	_ANA_TABLES_MACLDATA,4,2        ; @ANA_TABLES_MACLDATA
	.comm	_ANA_TABLES_MACHDATA,4,2        ; @ANA_TABLES_MACHDATA
	.no_dead_strip	_ocelot_mact_read
.subsections_via_symbols
