	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ar8xxx_sw_hw_apply             ## -- Begin function ar8xxx_sw_hw_apply
	.p2align	4, 0x90
_ar8xxx_sw_hw_apply:                    ## @ar8xxx_sw_hw_apply
	.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	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_swdev_to_ar8xxx
	movq	%rax, %r12
	movq	32(%rax), %r15
	movq	_AR8X16_MAX_PORTS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	leaq	8(%r12), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	32(%r12), %rax
	movq	%r12, %rdi
	callq	*32(%rax)
	leal	(,%rbx,4), %edx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_memset
	cmpl	$0, 24(%r12)
	je	LBB0_4
## %bb.1:
	movl	(%r14), %r8d
	testl	%r8d, %r8d
	jle	LBB0_33
## %bb.2:
	movq	_AR8216_PORT_CPU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$1, %r10d
	movl	%eax, %ecx
	shll	%cl, %r10d
	movslq	%eax, %r9
	cmpl	$1, %r8d
	jne	LBB0_23
## %bb.3:
	xorl	%ebx, %ebx
	testb	$1, %r8b
	jne	LBB0_31
	jmp	LBB0_33
LBB0_4:
	movq	_AR8X16_MAX_VLANS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_33
## %bb.5:
	xorl	%ebx, %ebx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	(%r8,%rbx,4), %edx
LBB0_21:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	16(%r12), %rax
	movl	(%rax,%rbx,4), %esi
	movq	%r12, %rdi
	callq	*24(%r15)
	movq	_AR8X16_MAX_VLANS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_22:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_33
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movq	(%r12), %r8
	movl	(%r8,%rbx,4), %edx
	testl	%edx, %edx
	je	LBB0_22
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	(%r14), %r9d
	testl	%r9d, %r9d
	jle	LBB0_21
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$1, %r9d
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	xorl	%eax, %eax
	testb	$1, %r9b
	je	LBB0_20
	jmp	LBB0_18
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	%r9d, %edi
	andl	$-2, %edi
	xorl	%ecx, %ecx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_11 Depth=2
	incq	%rcx
	cmpq	%rdi, %rcx
	je	LBB0_16
LBB0_11:                                ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rcx, %rax
	movl	$1, %esi
	shll	%cl, %esi
	btl	%eax, %edx
	jae	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	notl	%esi
	andl	%edx, %esi
	orl	%esi, (%r13,%rax,4)
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=2
	leaq	1(%rax), %rcx
	movl	$1, %esi
	shll	%cl, %esi
	btl	%ecx, %edx
	jae	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=2
	notl	%esi
	andl	%edx, %esi
	orl	%esi, 4(%r13,%rax,4)
	jmp	LBB0_15
LBB0_16:                                ##   in Loop: Header=BB0_6 Depth=1
	addq	$2, %rax
	testb	$1, %r9b
	je	LBB0_20
LBB0_18:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	$1, %esi
	movl	%eax, %ecx
	shll	%cl, %esi
	btl	%eax, %edx
	jae	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_6 Depth=1
	notl	%esi
	andl	%esi, %edx
	orl	%edx, (%r13,%rax,4)
	jmp	LBB0_20
LBB0_23:
	movl	%r8d, %edi
	andl	$-2, %edi
	xorl	%edx, %edx
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_28:                                ##   in Loop: Header=BB0_24 Depth=1
	incq	%rdx
	cmpq	%rdi, %rdx
	je	LBB0_29
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movq	%rdx, %rbx
	cmpq	%rdx, %rax
	je	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=1
	movl	$1, %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	movl	%r10d, (%r13,%rbx,4)
	orl	%edx, (%r13,%r9,4)
LBB0_26:                                ##   in Loop: Header=BB0_24 Depth=1
	leaq	1(%rbx), %rdx
	cmpq	%rax, %rdx
	je	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_24 Depth=1
	leal	1(%rbx), %ecx
	movl	$1, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	movl	%r10d, 4(%r13,%rbx,4)
	orl	%esi, (%r13,%r9,4)
	jmp	LBB0_28
LBB0_29:
	addq	$2, %rbx
	testb	$1, %r8b
	je	LBB0_33
LBB0_31:
	cmpq	%rax, %rbx
	je	LBB0_33
## %bb.32:
	movl	$1, %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	movl	%r10d, (%r13,%rbx,4)
	orl	%eax, (%r13,%r9,4)
LBB0_33:
	cmpl	$0, (%r14)
	jle	LBB0_36
## %bb.34:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_35:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r13,%rbx,4), %edx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	*16(%r15)
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_35
LBB0_36:
	movq	%r12, %rdi
	callq	*8(%r15)
	movq	(%r15), %rsi
	testq	%rsi, %rsi
	je	LBB0_38
## %bb.37:
	movq	%r12, %rdi
	callq	_ar8xxx_set_age_time
LBB0_38:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_40
## %bb.39:
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_40:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AR8X16_MAX_PORTS,4,2           ## @AR8X16_MAX_PORTS
	.comm	_AR8X16_MAX_VLANS,4,2           ## @AR8X16_MAX_VLANS
	.comm	_AR8216_PORT_CPU,4,2            ## @AR8216_PORT_CPU
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ar8xxx_sw_hw_apply             ; -- Begin function ar8xxx_sw_hw_apply
	.p2align	2
_ar8xxx_sw_hw_apply:                    ; @ar8xxx_sw_hw_apply
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	sub	sp, sp, #16
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	bl	_swdev_to_ar8xxx
	mov	x19, x0
	ldr	x24, [x0, #32]
Lloh3:
	adrp	x8, _AR8X16_MAX_PORTS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR8X16_MAX_PORTS@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
	lsl	x8, x23, #2
	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, #0x7fffffff0
	sub	x22, x9, x8
	mov	sp, x22
	add	x21, x0, #8
	mov	x0, x21
	bl	_mutex_lock
	ldr	x8, [x19, #32]
	ldr	x8, [x8, #32]
	mov	x0, x19
	blr	x8
	lsl	w2, w23, #2
	mov	x0, x22
	mov	w1, #0
	bl	_memset
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_6
; %bb.1:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.2:
	mov	x9, #0
Lloh8:
	adrp	x10, _AR8216_PORT_CPU@GOTPAGE
Lloh9:
	ldr	x10, [x10, _AR8216_PORT_CPU@GOTPAGEOFF]
Lloh10:
	ldrsw	x13, [x10]
	mov	w10, #1
	lsl	w11, w10, w13
	and	x12, x13, #0xffffffff
	lsl	x13, x13, #2
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.eq	LBB0_17
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x12, x9
	b.eq	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w11, [x22, x9, lsl #2]
	lsl	w14, w10, w9
	ldr	w15, [x22, x13]
	orr	w14, w15, w14
	str	w14, [x22, x13]
	b	LBB0_3
LBB0_6:
Lloh11:
	adrp	x23, _AR8X16_MAX_VLANS@GOTPAGE
Lloh12:
	ldr	x23, [x23, _AR8X16_MAX_VLANS@GOTPAGEOFF]
	ldr	w9, [x23]
	cmp	w9, #1
	b.lt	LBB0_17
; %bb.7:
	mov	x25, #0
	mov	w26, #1
	b	LBB0_11
LBB0_8:                                 ;   in Loop: Header=BB0_11 Depth=1
	ldr	w2, [x8, x25, lsl #2]
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x24, #24]
	ldr	x9, [x19, #16]
	ldr	w1, [x9, x25, lsl #2]
	mov	x0, x19
	blr	x8
	ldr	w9, [x23]
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x25, x25, #1
	cmp	x25, w9, sxtw
	b.ge	LBB0_17
LBB0_11:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
	ldr	x8, [x19]
	ldr	w2, [x8, x25, lsl #2]
	cbz	w2, LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w9, [x20]
	cmp	w9, #1
	b.lt	LBB0_9
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x10, #0
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=2
	add	x10, x10, #1
	cmp	x9, x10
	b.eq	LBB0_8
LBB0_15:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	w11, w26, w10
	tst	w11, w2
	b.eq	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=2
	bic	w11, w2, w11
	lsl	x12, x10, #2
	ldr	w13, [x22, x12]
	orr	w11, w13, w11
	str	w11, [x22, x12]
	b	LBB0_14
LBB0_17:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.18:
	mov	x23, #0
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24, #16]
	ldr	w2, [x22, x23, lsl #2]
	mov	x0, x19
	mov	x1, x23
	blr	x8
	add	x23, x23, #1
	ldrsw	x8, [x20]
	cmp	x23, x8
	b.lt	LBB0_19
LBB0_20:
	ldr	x8, [x24, #8]
	mov	x0, x19
	blr	x8
	ldr	x1, [x24]
	cbz	x1, LBB0_22
; %bb.21:
	mov	x0, x19
	bl	_ar8xxx_set_age_time
LBB0_22:
	mov	x0, x21
	bl	_mutex_unlock
	ldur	x8, [x29, #-72]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_24
; %bb.23:
	mov	w0, #0
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_24:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_AR8X16_MAX_PORTS,4,2           ; @AR8X16_MAX_PORTS
	.comm	_AR8X16_MAX_VLANS,4,2           ; @AR8X16_MAX_VLANS
	.comm	_AR8216_PORT_CPU,4,2            ; @AR8216_PORT_CPU
.subsections_via_symbols
