	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar7240_hw_apply
_ar7240_hw_apply:                       ## @ar7240_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_sw_to_ar7240
	movq	%rax, %r15
	movq	_AR7240_NUM_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, %r14
	movq	_AR7240_VTU_OP_FLUSH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_ar7240_vtu_op
	leal	(,%rbx,4), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_memset
	cmpq	$0, 24(%r15)
	je	LBB0_12
## %bb.1:
	movq	_AR7240_MAX_VLANS@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	testl	%ecx, %ecx
	jle	LBB0_17
## %bb.2:
	xorl	%ebx, %ebx
	movq	_AR7240_VTU_VID_S@GOTPCREL(%rip), %r13
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rax,%rbx,4), %edx
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r15), %rax
	movl	(%rax,%rbx,4), %esi
	movb	(%r13), %cl
	shll	%cl, %esi
	movq	_AR7240_VTU_OP_LOAD@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ar7240_vtu_op
	movl	(%r12), %ecx
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movslq	%ecx, %rax
	cmpq	%rax, %rbx
	jge	LBB0_17
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	(%r15), %rax
	movl	(%rax,%rbx,4), %edx
	testl	%edx, %edx
	je	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	16(%r15), %esi
	testl	%esi, %esi
	jle	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%ecx, %ecx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=2
	incq	%rcx
	movslq	%esi, %rdi
	cmpq	%rdi, %rcx
	jge	LBB0_9
LBB0_6:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	$1, %edi
	shll	%cl, %edi
	btl	%ecx, %edx
	jae	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	notl	%edi
	andl	%edx, %edi
	orl	%edi, (%r14,%rcx,4)
	movl	16(%r15), %esi
	jmp	LBB0_8
LBB0_12:
	movl	16(%r15), %edx
	testl	%edx, %edx
	jle	LBB0_17
## %bb.13:
	movq	_AR7240_PORT_CPU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$1, %esi
	movl	%eax, %ecx
	shll	%cl, %esi
	movslq	%eax, %rdi
	xorl	%ecx, %ecx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	incq	%rcx
	movslq	%edx, %rbx
	cmpq	%rbx, %rcx
	jge	LBB0_17
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%rcx, %rax
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	%esi, (%r14,%rcx,4)
	movl	$1, %edx
	shll	%cl, %edx
	orl	%edx, (%r14,%rdi,4)
	movl	16(%r15), %edx
	jmp	LBB0_16
LBB0_17:
	cmpl	$0, 16(%r15)
	jle	LBB0_20
## %bb.18:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14,%rbx,4), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_ar7240sw_setup_port
	incq	%rbx
	movslq	16(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_19
LBB0_20:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_22
## %bb.21:
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AR7240_NUM_PORTS,4,2           ## @AR7240_NUM_PORTS
	.comm	_AR7240_VTU_OP_FLUSH,4,2        ## @AR7240_VTU_OP_FLUSH
	.comm	_AR7240_MAX_VLANS,4,2           ## @AR7240_MAX_VLANS
	.comm	_AR7240_VTU_OP_LOAD,4,2         ## @AR7240_VTU_OP_LOAD
	.comm	_AR7240_VTU_VID_S,4,2           ## @AR7240_VTU_VID_S
	.comm	_AR7240_PORT_CPU,4,2            ## @AR7240_PORT_CPU
	.no_dead_strip	_ar7240_hw_apply
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar7240_hw_apply
_ar7240_hw_apply:                       ; @ar7240_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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	bl	_sw_to_ar7240
	mov	x19, x0
Lloh3:
	adrp	x8, _AR7240_NUM_PORTS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR7240_NUM_PORTS@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	lsl	x8, x21, #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	x20, x9, x8
	mov	sp, x20
Lloh8:
	adrp	x8, _AR7240_VTU_OP_FLUSH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AR7240_VTU_OP_FLUSH@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_ar7240_vtu_op
	lsl	w2, w21, #2
	mov	x0, x20
	mov	w1, #0
	bl	_memset
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_12
; %bb.1:
Lloh11:
	adrp	x21, _AR7240_MAX_VLANS@GOTPAGE
Lloh12:
	ldr	x21, [x21, _AR7240_MAX_VLANS@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w9, #1
	b.lt	LBB0_17
; %bb.2:
	mov	x22, #0
	mov	w23, #1
Lloh13:
	adrp	x24, _AR7240_VTU_OP_LOAD@GOTPAGE
Lloh14:
	ldr	x24, [x24, _AR7240_VTU_OP_LOAD@GOTPAGEOFF]
Lloh15:
	adrp	x25, _AR7240_VTU_VID_S@GOTPAGE
Lloh16:
	ldr	x25, [x25, _AR7240_VTU_VID_S@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w2, [x8, x22, lsl #2]
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x24]
	ldr	x9, [x19, #8]
	ldr	w9, [x9, x22, lsl #2]
	ldr	w10, [x25]
	lsl	w9, w9, w10
	orr	w1, w9, w8
	mov	x0, x19
	bl	_ar7240_vtu_op
	ldr	w9, [x21]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x22, x22, #1
	cmp	x22, w9, sxtw
	b.ge	LBB0_17
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	ldr	x8, [x19]
	ldr	w2, [x8, x22, lsl #2]
	cbz	w2, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w9, [x19, #16]
	cmp	w9, #1
	b.lt	LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x10, #0
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=2
	add	x10, x10, #1
	cmp	x10, w9, sxtw
	b.ge	LBB0_3
LBB0_10:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	w11, w23, w10
	tst	w11, w2
	b.eq	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	bic	w9, w2, w11
	lsl	x11, x10, #2
	ldr	w12, [x20, x11]
	orr	w9, w12, w9
	str	w9, [x20, x11]
	ldr	w9, [x19, #16]
	b	LBB0_9
LBB0_12:
	ldr	w9, [x19, #16]
	cmp	w9, #1
	b.lt	LBB0_17
; %bb.13:
	mov	x8, #0
Lloh17:
	adrp	x10, _AR7240_PORT_CPU@GOTPAGE
Lloh18:
	ldr	x10, [x10, _AR7240_PORT_CPU@GOTPAGEOFF]
Lloh19:
	ldrsw	x13, [x10]
	mov	w10, #1
	lsl	w11, w10, w13
	and	x12, x13, #0xffffffff
	lsl	x13, x13, #2
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x8, x8, #1
	cmp	x8, w9, sxtw
	b.ge	LBB0_17
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	cmp	x12, x8
	b.eq	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	str	w11, [x20, x8, lsl #2]
	lsl	w9, w10, w8
	ldr	w14, [x20, x13]
	orr	w9, w14, w9
	str	w9, [x20, x13]
	ldr	w9, [x19, #16]
	b	LBB0_14
LBB0_17:
	ldr	w8, [x19, #16]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.18:
	mov	x21, #0
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x20, x21, lsl #2]
	mov	x0, x19
	mov	x1, x21
	bl	_ar7240sw_setup_port
	add	x21, x21, #1
	ldrsw	x8, [x19, #16]
	cmp	x21, x8
	b.lt	LBB0_19
LBB0_20:
	ldur	x8, [x29, #-72]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.21:
	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_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_AR7240_NUM_PORTS,4,2           ; @AR7240_NUM_PORTS
	.comm	_AR7240_VTU_OP_FLUSH,4,2        ; @AR7240_VTU_OP_FLUSH
	.comm	_AR7240_MAX_VLANS,4,2           ; @AR7240_MAX_VLANS
	.comm	_AR7240_VTU_OP_LOAD,4,2         ; @AR7240_VTU_OP_LOAD
	.comm	_AR7240_VTU_VID_S,4,2           ; @AR7240_VTU_VID_S
	.comm	_AR7240_PORT_CPU,4,2            ; @AR7240_PORT_CPU
	.no_dead_strip	_ar7240_hw_apply
.subsections_via_symbols
