	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar7240sw_setup
_ar7240sw_setup:                        ## @ar7240sw_setup
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %r14
	movq	_AR7240_REG_CPU_PORT@GOTPCREL(%rip), %rax
	movq	_AR7240_MIRROR_PORT_S@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$15, %edx
	shll	%cl, %edx
	movl	(%rax), %esi
	movq	_AR7240_CPU_PORT_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_ar7240sw_reg_write
	movq	_AR7240_REG_TAG_PRIORITY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$64080, %edx                    ## imm = 0xFA50
	callq	_ar7240sw_reg_write
	movq	%rbx, %rdi
	callq	_sw_is_ar934x
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_AR934X_REG_AT_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR934X_AT_CTRL_AGE_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_AR934X_AT_CTRL_LEARN_CHANGE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	orl	$43, %edx
	movq	%r14, %rdi
	callq	_ar7240sw_reg_write
	movq	_AR934X_REG_QM_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR934X_QM_CTRL_ARP_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_ar7240sw_reg_set
	movq	_AR934X_REG_FLOOD_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	xorl	%edi, %edi
	callq	_AR934X_FLOOD_MASK_BC_DP
	movl	%eax, %ebx
	xorl	%edi, %edi
	callq	_AR934X_FLOOD_MASK_MC_DP
	orl	%eax, %ebx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	callq	_ar7240sw_reg_set
	movq	_AR7240_REG_GLOBAL_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR9340_GLOBAL_CTRL_MTU_M@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%ecx, %edx
	callq	_ar7240sw_reg_rmw
	movq	_AR7240_REG_MIB_FUNCTION0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR934X_MIB_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_ar7240sw_reg_set
	jmp	LBB0_3
LBB0_2:
	movq	_AR7240_REG_AT_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR7240_AT_CTRL_RESERVED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_AR7240_AT_CTRL_AGE_EN@GOTPCREL(%rip), %rax
	movq	_AR7240_AT_CTRL_ARP_EN@GOTPCREL(%rip), %rcx
	orl	(%rax), %edx
	orl	(%rcx), %edx
	movq	_AR7240_AT_CTRL_LEARN_CHANGE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	orl	$43, %edx
	movq	%r14, %rdi
	callq	_ar7240sw_reg_write
	movq	_AR7240_REG_FLOOD_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR7240_FLOOD_MASK_BROAD_TO_CPU@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_ar7240sw_reg_set
	movq	_AR7240_REG_GLOBAL_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR7240_GLOBAL_CTRL_MTU_M@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%ecx, %edx
	callq	_ar7240sw_reg_rmw
LBB0_3:
	movq	_AR7240_REG_SERVICE_TAG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR7240_SERVICE_TAG_M@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ar7240sw_reg_rmw               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AR7240_REG_CPU_PORT,4,2        ## @AR7240_REG_CPU_PORT
	.comm	_AR7240_CPU_PORT_EN,4,2         ## @AR7240_CPU_PORT_EN
	.comm	_AR7240_MIRROR_PORT_S,4,2       ## @AR7240_MIRROR_PORT_S
	.comm	_AR7240_REG_TAG_PRIORITY,4,2    ## @AR7240_REG_TAG_PRIORITY
	.comm	_AR934X_REG_AT_CTRL,4,2         ## @AR934X_REG_AT_CTRL
	.comm	_AR934X_AT_CTRL_AGE_EN,4,2      ## @AR934X_AT_CTRL_AGE_EN
	.comm	_AR934X_AT_CTRL_LEARN_CHANGE,4,2 ## @AR934X_AT_CTRL_LEARN_CHANGE
	.comm	_AR934X_REG_QM_CTRL,4,2         ## @AR934X_REG_QM_CTRL
	.comm	_AR934X_QM_CTRL_ARP_EN,4,2      ## @AR934X_QM_CTRL_ARP_EN
	.comm	_AR934X_REG_FLOOD_MASK,4,2      ## @AR934X_REG_FLOOD_MASK
	.comm	_AR7240_REG_GLOBAL_CTRL,4,2     ## @AR7240_REG_GLOBAL_CTRL
	.comm	_AR9340_GLOBAL_CTRL_MTU_M,4,2   ## @AR9340_GLOBAL_CTRL_MTU_M
	.comm	_AR7240_REG_MIB_FUNCTION0,4,2   ## @AR7240_REG_MIB_FUNCTION0
	.comm	_AR934X_MIB_ENABLE,4,2          ## @AR934X_MIB_ENABLE
	.comm	_AR7240_REG_AT_CTRL,4,2         ## @AR7240_REG_AT_CTRL
	.comm	_AR7240_AT_CTRL_RESERVED,4,2    ## @AR7240_AT_CTRL_RESERVED
	.comm	_AR7240_AT_CTRL_AGE_EN,4,2      ## @AR7240_AT_CTRL_AGE_EN
	.comm	_AR7240_AT_CTRL_ARP_EN,4,2      ## @AR7240_AT_CTRL_ARP_EN
	.comm	_AR7240_AT_CTRL_LEARN_CHANGE,4,2 ## @AR7240_AT_CTRL_LEARN_CHANGE
	.comm	_AR7240_REG_FLOOD_MASK,4,2      ## @AR7240_REG_FLOOD_MASK
	.comm	_AR7240_FLOOD_MASK_BROAD_TO_CPU,4,2 ## @AR7240_FLOOD_MASK_BROAD_TO_CPU
	.comm	_AR7240_GLOBAL_CTRL_MTU_M,4,2   ## @AR7240_GLOBAL_CTRL_MTU_M
	.comm	_AR7240_REG_SERVICE_TAG,4,2     ## @AR7240_REG_SERVICE_TAG
	.comm	_AR7240_SERVICE_TAG_M,4,2       ## @AR7240_SERVICE_TAG_M
	.no_dead_strip	_ar7240sw_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar7240sw_setup
_ar7240sw_setup:                        ; @ar7240sw_setup
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _AR7240_REG_CPU_PORT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR7240_REG_CPU_PORT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _AR7240_CPU_PORT_EN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR7240_CPU_PORT_EN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _AR7240_MIRROR_PORT_S@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AR7240_MIRROR_PORT_S@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	mov	w10, #15
	lsl	w9, w10, w9
	orr	w2, w9, w8
	mov	x0, x19
	bl	_ar7240sw_reg_write
Lloh9:
	adrp	x8, _AR7240_REG_TAG_PRIORITY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AR7240_REG_TAG_PRIORITY@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #64080
	bl	_ar7240sw_reg_write
	mov	x0, x20
	bl	_sw_is_ar934x
	cbz	x0, LBB0_2
; %bb.1:
Lloh12:
	adrp	x8, _AR934X_REG_AT_CTRL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AR934X_REG_AT_CTRL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _AR934X_AT_CTRL_AGE_EN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AR934X_AT_CTRL_AGE_EN@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _AR934X_AT_CTRL_LEARN_CHANGE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _AR934X_AT_CTRL_LEARN_CHANGE@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w8, w9
	mov	w9, #43
	orr	w2, w8, w9
	mov	x0, x19
	bl	_ar7240sw_reg_write
Lloh21:
	adrp	x8, _AR934X_REG_QM_CTRL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AR934X_REG_QM_CTRL@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _AR934X_QM_CTRL_ARP_EN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AR934X_QM_CTRL_ARP_EN@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_ar7240sw_reg_set
Lloh27:
	adrp	x8, _AR934X_REG_FLOOD_MASK@GOTPAGE
Lloh28:
	ldr	x8, [x8, _AR934X_REG_FLOOD_MASK@GOTPAGEOFF]
Lloh29:
	ldr	w20, [x8]
	mov	w0, #0
	bl	_AR934X_FLOOD_MASK_BC_DP
	mov	x21, x0
	mov	w0, #0
	bl	_AR934X_FLOOD_MASK_MC_DP
	orr	w2, w0, w21
	mov	x0, x19
	mov	x1, x20
	bl	_ar7240sw_reg_set
Lloh30:
	adrp	x8, _AR7240_REG_GLOBAL_CTRL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _AR7240_REG_GLOBAL_CTRL@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
Lloh33:
	adrp	x8, _AR9340_GLOBAL_CTRL_MTU_M@GOTPAGE
Lloh34:
	ldr	x8, [x8, _AR9340_GLOBAL_CTRL_MTU_M@GOTPAGEOFF]
Lloh35:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x2
	bl	_ar7240sw_reg_rmw
Lloh36:
	adrp	x8, _AR7240_REG_MIB_FUNCTION0@GOTPAGE
Lloh37:
	ldr	x8, [x8, _AR7240_REG_MIB_FUNCTION0@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
Lloh39:
	adrp	x8, _AR934X_MIB_ENABLE@GOTPAGE
Lloh40:
	ldr	x8, [x8, _AR934X_MIB_ENABLE@GOTPAGEOFF]
Lloh41:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_ar7240sw_reg_set
	b	LBB0_3
LBB0_2:
Lloh42:
	adrp	x8, _AR7240_REG_AT_CTRL@GOTPAGE
Lloh43:
	ldr	x8, [x8, _AR7240_REG_AT_CTRL@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
Lloh45:
	adrp	x8, _AR7240_AT_CTRL_RESERVED@GOTPAGE
Lloh46:
	ldr	x8, [x8, _AR7240_AT_CTRL_RESERVED@GOTPAGEOFF]
Lloh47:
	ldr	w8, [x8]
Lloh48:
	adrp	x9, _AR7240_AT_CTRL_AGE_EN@GOTPAGE
Lloh49:
	ldr	x9, [x9, _AR7240_AT_CTRL_AGE_EN@GOTPAGEOFF]
Lloh50:
	ldr	w9, [x9]
Lloh51:
	adrp	x10, _AR7240_AT_CTRL_ARP_EN@GOTPAGE
Lloh52:
	ldr	x10, [x10, _AR7240_AT_CTRL_ARP_EN@GOTPAGEOFF]
Lloh53:
	ldr	w10, [x10]
Lloh54:
	adrp	x11, _AR7240_AT_CTRL_LEARN_CHANGE@GOTPAGE
Lloh55:
	ldr	x11, [x11, _AR7240_AT_CTRL_LEARN_CHANGE@GOTPAGEOFF]
Lloh56:
	ldr	w11, [x11]
	orr	w8, w8, w9
	orr	w8, w8, w10
	orr	w8, w8, w11
	mov	w9, #43
	orr	w2, w8, w9
	mov	x0, x19
	bl	_ar7240sw_reg_write
Lloh57:
	adrp	x8, _AR7240_REG_FLOOD_MASK@GOTPAGE
Lloh58:
	ldr	x8, [x8, _AR7240_REG_FLOOD_MASK@GOTPAGEOFF]
Lloh59:
	ldr	w1, [x8]
Lloh60:
	adrp	x8, _AR7240_FLOOD_MASK_BROAD_TO_CPU@GOTPAGE
Lloh61:
	ldr	x8, [x8, _AR7240_FLOOD_MASK_BROAD_TO_CPU@GOTPAGEOFF]
Lloh62:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_ar7240sw_reg_set
Lloh63:
	adrp	x8, _AR7240_REG_GLOBAL_CTRL@GOTPAGE
Lloh64:
	ldr	x8, [x8, _AR7240_REG_GLOBAL_CTRL@GOTPAGEOFF]
Lloh65:
	ldr	w1, [x8]
Lloh66:
	adrp	x8, _AR7240_GLOBAL_CTRL_MTU_M@GOTPAGE
Lloh67:
	ldr	x8, [x8, _AR7240_GLOBAL_CTRL_MTU_M@GOTPAGEOFF]
Lloh68:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x2
	bl	_ar7240sw_reg_rmw
LBB0_3:
Lloh69:
	adrp	x8, _AR7240_REG_SERVICE_TAG@GOTPAGE
Lloh70:
	ldr	x8, [x8, _AR7240_REG_SERVICE_TAG@GOTPAGEOFF]
Lloh71:
	adrp	x9, _AR7240_SERVICE_TAG_M@GOTPAGE
Lloh72:
	ldr	x9, [x9, _AR7240_SERVICE_TAG_M@GOTPAGEOFF]
Lloh73:
	ldr	w1, [x8]
Lloh74:
	ldr	w2, [x9]
	mov	x0, x19
	mov	w3, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ar7240sw_reg_rmw
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh66, Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh71, Lloh72, Lloh74
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh73
	.cfi_endproc
                                        ; -- End function
	.comm	_AR7240_REG_CPU_PORT,4,2        ; @AR7240_REG_CPU_PORT
	.comm	_AR7240_CPU_PORT_EN,4,2         ; @AR7240_CPU_PORT_EN
	.comm	_AR7240_MIRROR_PORT_S,4,2       ; @AR7240_MIRROR_PORT_S
	.comm	_AR7240_REG_TAG_PRIORITY,4,2    ; @AR7240_REG_TAG_PRIORITY
	.comm	_AR934X_REG_AT_CTRL,4,2         ; @AR934X_REG_AT_CTRL
	.comm	_AR934X_AT_CTRL_AGE_EN,4,2      ; @AR934X_AT_CTRL_AGE_EN
	.comm	_AR934X_AT_CTRL_LEARN_CHANGE,4,2 ; @AR934X_AT_CTRL_LEARN_CHANGE
	.comm	_AR934X_REG_QM_CTRL,4,2         ; @AR934X_REG_QM_CTRL
	.comm	_AR934X_QM_CTRL_ARP_EN,4,2      ; @AR934X_QM_CTRL_ARP_EN
	.comm	_AR934X_REG_FLOOD_MASK,4,2      ; @AR934X_REG_FLOOD_MASK
	.comm	_AR7240_REG_GLOBAL_CTRL,4,2     ; @AR7240_REG_GLOBAL_CTRL
	.comm	_AR9340_GLOBAL_CTRL_MTU_M,4,2   ; @AR9340_GLOBAL_CTRL_MTU_M
	.comm	_AR7240_REG_MIB_FUNCTION0,4,2   ; @AR7240_REG_MIB_FUNCTION0
	.comm	_AR934X_MIB_ENABLE,4,2          ; @AR934X_MIB_ENABLE
	.comm	_AR7240_REG_AT_CTRL,4,2         ; @AR7240_REG_AT_CTRL
	.comm	_AR7240_AT_CTRL_RESERVED,4,2    ; @AR7240_AT_CTRL_RESERVED
	.comm	_AR7240_AT_CTRL_AGE_EN,4,2      ; @AR7240_AT_CTRL_AGE_EN
	.comm	_AR7240_AT_CTRL_ARP_EN,4,2      ; @AR7240_AT_CTRL_ARP_EN
	.comm	_AR7240_AT_CTRL_LEARN_CHANGE,4,2 ; @AR7240_AT_CTRL_LEARN_CHANGE
	.comm	_AR7240_REG_FLOOD_MASK,4,2      ; @AR7240_REG_FLOOD_MASK
	.comm	_AR7240_FLOOD_MASK_BROAD_TO_CPU,4,2 ; @AR7240_FLOOD_MASK_BROAD_TO_CPU
	.comm	_AR7240_GLOBAL_CTRL_MTU_M,4,2   ; @AR7240_GLOBAL_CTRL_MTU_M
	.comm	_AR7240_REG_SERVICE_TAG,4,2     ; @AR7240_REG_SERVICE_TAG
	.comm	_AR7240_SERVICE_TAG_M,4,2       ; @AR7240_SERVICE_TAG_M
	.no_dead_strip	_ar7240sw_setup
.subsections_via_symbols
