	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ksz9477_port_mdb_add
_ksz9477_port_mdb_add:                  ## @ksz9477_port_mdb_add
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movl	%esi, -68(%rbp)                 ## 4-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %r15
	movq	(%rdx), %rax
	movl	(%rax), %r14d
	movl	8(%rax), %ecx
	shll	$8, %r14d
	orl	4(%rax), %r14d
	shll	$24, %ecx
	movl	12(%rax), %r13d
	shll	$16, %r13d
	orl	%ecx, %r13d
	movl	16(%rax), %ecx
	shll	$8, %ecx
	orl	20(%rax), %r13d
	orl	%ecx, %r13d
	leaq	4(%r15), %rdi
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movl	(%r15), %eax
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jg	LBB0_1
## %bb.8:
	cmpl	%eax, %ebx
	jne	LBB0_9
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	incl	%ebx
	cmpl	(%r15), %ebx
	jge	LBB0_7
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_ALU_STAT_INDEX_S@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	movl	%ebx, %edx
	shll	%cl, %edx
	movq	_ALU_STAT_READ@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_ALU_STAT_START@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_REG_SW_ALU_STAT_CTRL__4@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ksz_write32
	movq	%r15, %rdi
	callq	_ksz9477_wait_alu_sta_ready
	testq	%rax, %rax
	jne	LBB0_12
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %rdi
	leaq	-64(%rbp), %rsi
	callq	_ksz9477_read_table
	movq	_ALU_V_STATIC_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -64(%rbp)
	je	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	-56(%rbp), %eax
	movq	_ALU_V_FID_S@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	movl	%eax, %edx
	sarl	%cl, %edx
	cmpl	8(%r12), %edx
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_ALU_V_MAC_ADDR_HI@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	cmpl	%r14d, %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r13d, -52(%rbp)
	jne	LBB0_6
LBB0_7:
	movl	(%r15), %eax
	cmpl	%eax, %ebx
	je	LBB0_13
LBB0_9:
	movq	_ALU_V_STATIC_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movl	-68(%rbp), %edi                 ## 4-byte Reload
	callq	_BIT
	orl	-60(%rbp), %eax
	movl	%eax, -60(%rbp)
	movl	8(%r12), %edx
	testl	%edx, %edx
	je	LBB0_11
## %bb.10:
	movq	_ALU_V_USE_FID@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -60(%rbp)
LBB0_11:
	movq	_ALU_V_FID_S@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edx
	orl	%r14d, %edx
	movl	%edx, -56(%rbp)
	movl	%r13d, -52(%rbp)
	leaq	-64(%rbp), %rsi
	movq	%r15, %rdi
	callq	_ksz9477_write_table
	movq	_ALU_STAT_INDEX_S@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	_ALU_STAT_START@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_REG_SW_ALU_STAT_CTRL__4@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_ksz_write32
	movq	%r15, %rdi
	callq	_ksz9477_wait_alu_sta_ready
	testq	%rax, %rax
	je	LBB0_13
LBB0_12:
	movl	8(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
LBB0_13:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ALU_STAT_INDEX_S,4,2           ## @ALU_STAT_INDEX_S
	.comm	_ALU_STAT_READ,4,2              ## @ALU_STAT_READ
	.comm	_ALU_STAT_START,4,2             ## @ALU_STAT_START
	.comm	_REG_SW_ALU_STAT_CTRL__4,4,2    ## @REG_SW_ALU_STAT_CTRL__4
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to read ALU STATIC\n"

	.comm	_ALU_V_STATIC_VALID,4,2         ## @ALU_V_STATIC_VALID
	.comm	_ALU_V_FID_S,4,2                ## @ALU_V_FID_S
	.comm	_ALU_V_MAC_ADDR_HI,4,2          ## @ALU_V_MAC_ADDR_HI
	.comm	_ALU_V_USE_FID,4,2              ## @ALU_V_USE_FID
	.no_dead_strip	_ksz9477_port_mdb_add
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ksz9477_port_mdb_add
_ksz9477_port_mdb_add:                  ; @ksz9477_port_mdb_add
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	str	w1, [sp, #12]                   ; 4-byte Folded Spill
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	ldr	x19, [x0]
	ldr	x8, [x2]
	ldp	w9, w10, [x8]
	orr	w23, w10, w9, lsl #8
	ldp	w9, w10, [x8, #8]
	lsl	w10, w10, #16
	ldp	w11, w8, [x8, #16]
	orr	w9, w10, w9, lsl #24
	orr	w8, w9, w8
	orr	w26, w8, w11, lsl #8
	add	x0, x19, #4
	str	x0, [sp, #16]                   ; 8-byte Folded Spill
	bl	_mutex_lock
Lloh3:
	adrp	x27, _ALU_STAT_INDEX_S@GOTPAGE
Lloh4:
	ldr	x27, [x27, _ALU_STAT_INDEX_S@GOTPAGEOFF]
Lloh5:
	adrp	x25, _ALU_STAT_START@GOTPAGE
Lloh6:
	ldr	x25, [x25, _ALU_STAT_START@GOTPAGEOFF]
	ldr	w8, [x19]
Lloh7:
	adrp	x20, _ALU_V_STATIC_VALID@GOTPAGE
Lloh8:
	ldr	x20, [x20, _ALU_V_STATIC_VALID@GOTPAGEOFF]
Lloh9:
	adrp	x22, _ALU_V_FID_S@GOTPAGE
Lloh10:
	ldr	x22, [x22, _ALU_V_FID_S@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.1:
	mov	w28, #0
Lloh11:
	adrp	x24, _ALU_STAT_READ@GOTPAGE
Lloh12:
	ldr	x24, [x24, _ALU_STAT_READ@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w28, w28, #1
	ldr	w8, [x19]
	cmp	w28, w8
	b.ge	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x27]
	lsl	w8, w28, w8
	ldr	w9, [x24]
	orr	w8, w8, w9
	ldr	w9, [x25]
	orr	w2, w8, w9
Lloh13:
	adrp	x8, _REG_SW_ALU_STAT_CTRL__4@GOTPAGE
Lloh14:
	ldr	x8, [x8, _REG_SW_ALU_STAT_CTRL__4@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ksz_write32
	mov	x0, x19
	bl	_ksz9477_wait_alu_sta_ready
	cbnz	x0, LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x1, sp, #24
	mov	x0, x19
	bl	_ksz9477_read_table
	ldr	w8, [sp, #24]
	ldr	w9, [x20]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [sp, #32]
	ldr	w9, [x22]
	asr	w9, w8, w9
	ldr	w10, [x21, #8]
	cmp	w9, w10
	b.ne	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh16:
	adrp	x9, _ALU_V_MAC_ADDR_HI@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ALU_V_MAC_ADDR_HI@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	and	w8, w9, w8
	ldr	w9, [sp, #36]
	cmp	w8, w23
	ccmp	w9, w26, #0, eq
	b.ne	LBB0_2
LBB0_7:
	ldr	w8, [x19]
	cmp	w28, w8
	b.ne	LBB0_9
	b	LBB0_13
LBB0_8:
	mov	w28, #0
	cmp	w28, w8
	b.eq	LBB0_13
LBB0_9:
	ldr	w8, [x20]
	str	w8, [sp, #24]
	ldr	w0, [sp, #12]                   ; 4-byte Folded Reload
	bl	_BIT
	ldr	w8, [sp, #28]
	orr	w9, w8, w0
	str	w9, [sp, #28]
	ldr	w8, [x21, #8]
	cbz	w8, LBB0_11
; %bb.10:
Lloh19:
	adrp	x10, _ALU_V_USE_FID@GOTPAGE
Lloh20:
	ldr	x10, [x10, _ALU_V_USE_FID@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	orr	w9, w10, w9
	str	w9, [sp, #28]
LBB0_11:
	ldr	w9, [x22]
	lsl	w8, w8, w9
	orr	w8, w8, w23
	stp	w8, w26, [sp, #32]
	add	x1, sp, #24
	mov	x0, x19
	bl	_ksz9477_write_table
	ldr	w8, [x27]
	lsl	w8, w28, w8
	ldr	w9, [x25]
	orr	w2, w8, w9
Lloh22:
	adrp	x8, _REG_SW_ALU_STAT_CTRL__4@GOTPAGE
Lloh23:
	ldr	x8, [x8, _REG_SW_ALU_STAT_CTRL__4@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ksz_write32
	mov	x0, x19
	bl	_ksz9477_wait_alu_sta_ready
	cbz	x0, LBB0_13
LBB0_12:
	ldr	w0, [x19, #8]
Lloh25:
	adrp	x1, l_.str@PAGE
Lloh26:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
LBB0_13:
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	bl	_mutex_unlock
	ldr	x8, [sp, #40]
Lloh27:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh28:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_ALU_STAT_INDEX_S,4,2           ; @ALU_STAT_INDEX_S
	.comm	_ALU_STAT_READ,4,2              ; @ALU_STAT_READ
	.comm	_ALU_STAT_START,4,2             ; @ALU_STAT_START
	.comm	_REG_SW_ALU_STAT_CTRL__4,4,2    ; @REG_SW_ALU_STAT_CTRL__4
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to read ALU STATIC\n"

	.comm	_ALU_V_STATIC_VALID,4,2         ; @ALU_V_STATIC_VALID
	.comm	_ALU_V_FID_S,4,2                ; @ALU_V_FID_S
	.comm	_ALU_V_MAC_ADDR_HI,4,2          ; @ALU_V_MAC_ADDR_HI
	.comm	_ALU_V_USE_FID,4,2              ; @ALU_V_USE_FID
	.no_dead_strip	_ksz9477_port_mdb_add
.subsections_via_symbols
