	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atl2_setup_mac_ctrl
_atl2_setup_mac_ctrl:                   ## @atl2_setup_mac_ctrl
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %r14
	movq	_MAC_CTRL_TX_EN@GOTPCREL(%rip), %rcx
	movq	_MAC_CTRL_RX_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	movq	_MAC_CTRL_MACLP_CLK_PHY@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_FULL_DUPLEX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	xorl	%ecx, %ecx
	cmpq	(%rdi), %rdx
	jne	LBB0_2
## %bb.1:
	movq	_MAC_CTRL_DUPLX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_2:
	movq	_MAC_CTRL_TX_FLOW@GOTPCREL(%rip), %rdx
	movq	_MAC_CTRL_RX_FLOW@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rdx), %esi
	orl	%esi, %eax
	orl	%ecx, %eax
	movq	_MAC_CTRL_ADD_CRC@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_MAC_CTRL_PAD@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_MAC_CTRL_PRMLEN_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	16(%rbx), %edx
	movq	_MAC_CTRL_PRMLEN_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%eax, %edx
	movl	%edx, -20(%rbp)
	movl	4(%r14), %edi
	leaq	-20(%rbp), %rsi
	callq	___atl2_vlan_mode
	movq	_MAC_CTRL_BC_EN@GOTPCREL(%rip), %rcx
	movl	-20(%rbp), %eax
	orl	(%rcx), %eax
	movl	(%r14), %ecx
	movq	_IFF_PROMISC@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_4
## %bb.3:
	movq	_MAC_CTRL_PROMIS_EN@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_4:
	movq	_IFF_ALLMULTI@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_7
## %bb.5:
	movq	_MAC_CTRL_MC_ALL_EN@GOTPCREL(%rip), %rcx
LBB0_6:
	orl	(%rcx), %eax
LBB0_7:
	movq	_MAC_CTRL_HALF_LEFT_BUF_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	8(%rbx), %edx
	addq	$8, %rbx
	movq	_MAC_CTRL_HALF_LEFT_BUF_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%eax, %edx
	movl	%edx, -20(%rbp)
	movq	_REG_MAC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ATL2_WRITE_REG
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAC_CTRL_TX_EN,4,2             ## @MAC_CTRL_TX_EN
	.comm	_MAC_CTRL_RX_EN,4,2             ## @MAC_CTRL_RX_EN
	.comm	_MAC_CTRL_MACLP_CLK_PHY,4,2     ## @MAC_CTRL_MACLP_CLK_PHY
	.comm	_FULL_DUPLEX,8,3                ## @FULL_DUPLEX
	.comm	_MAC_CTRL_DUPLX,4,2             ## @MAC_CTRL_DUPLX
	.comm	_MAC_CTRL_TX_FLOW,4,2           ## @MAC_CTRL_TX_FLOW
	.comm	_MAC_CTRL_RX_FLOW,4,2           ## @MAC_CTRL_RX_FLOW
	.comm	_MAC_CTRL_ADD_CRC,4,2           ## @MAC_CTRL_ADD_CRC
	.comm	_MAC_CTRL_PAD,4,2               ## @MAC_CTRL_PAD
	.comm	_MAC_CTRL_PRMLEN_MASK,4,2       ## @MAC_CTRL_PRMLEN_MASK
	.comm	_MAC_CTRL_PRMLEN_SHIFT,4,2      ## @MAC_CTRL_PRMLEN_SHIFT
	.comm	_MAC_CTRL_BC_EN,4,2             ## @MAC_CTRL_BC_EN
	.comm	_IFF_PROMISC,4,2                ## @IFF_PROMISC
	.comm	_MAC_CTRL_PROMIS_EN,4,2         ## @MAC_CTRL_PROMIS_EN
	.comm	_IFF_ALLMULTI,4,2               ## @IFF_ALLMULTI
	.comm	_MAC_CTRL_MC_ALL_EN,4,2         ## @MAC_CTRL_MC_ALL_EN
	.comm	_MAC_CTRL_HALF_LEFT_BUF_MASK,4,2 ## @MAC_CTRL_HALF_LEFT_BUF_MASK
	.comm	_MAC_CTRL_HALF_LEFT_BUF_SHIFT,4,2 ## @MAC_CTRL_HALF_LEFT_BUF_SHIFT
	.comm	_REG_MAC_CTRL,4,2               ## @REG_MAC_CTRL
	.no_dead_strip	_atl2_setup_mac_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atl2_setup_mac_ctrl
_atl2_setup_mac_ctrl:                   ; @atl2_setup_mac_ctrl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _MAC_CTRL_TX_EN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAC_CTRL_TX_EN@GOTPAGEOFF]
	ldr	x20, [x0, #24]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _MAC_CTRL_RX_EN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MAC_CTRL_RX_EN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _MAC_CTRL_MACLP_CLK_PHY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MAC_CTRL_MACLP_CLK_PHY@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh9:
	adrp	x9, _FULL_DUPLEX@GOTPAGE
Lloh10:
	ldr	x9, [x9, _FULL_DUPLEX@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	ldr	x10, [x0]
Lloh12:
	adrp	x11, _MAC_CTRL_DUPLX@GOTPAGE
Lloh13:
	ldr	x11, [x11, _MAC_CTRL_DUPLX@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	cmp	x9, x10
	csel	w9, w11, wzr, eq
	orr	w8, w8, w9
Lloh15:
	adrp	x9, _MAC_CTRL_TX_FLOW@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MAC_CTRL_TX_FLOW@GOTPAGEOFF]
Lloh17:
	adrp	x10, _MAC_CTRL_RX_FLOW@GOTPAGE
Lloh18:
	ldr	x10, [x10, _MAC_CTRL_RX_FLOW@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
Lloh20:
	ldr	w10, [x10]
	orr	w9, w10, w9
	orr	w8, w9, w8
Lloh21:
	adrp	x9, _MAC_CTRL_ADD_CRC@GOTPAGE
Lloh22:
	ldr	x9, [x9, _MAC_CTRL_ADD_CRC@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
Lloh24:
	adrp	x10, _MAC_CTRL_PAD@GOTPAGE
Lloh25:
	ldr	x10, [x10, _MAC_CTRL_PAD@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	orr	w8, w9, w8
	orr	w8, w8, w10
	ldr	w9, [x0, #16]
Lloh27:
	adrp	x10, _MAC_CTRL_PRMLEN_MASK@GOTPAGE
Lloh28:
	ldr	x10, [x10, _MAC_CTRL_PRMLEN_MASK@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x10]
Lloh30:
	adrp	x11, _MAC_CTRL_PRMLEN_SHIFT@GOTPAGE
Lloh31:
	ldr	x11, [x11, _MAC_CTRL_PRMLEN_SHIFT@GOTPAGEOFF]
	and	w9, w10, w9
Lloh32:
	ldr	w10, [x11]
	lsl	w9, w9, w10
	orr	w8, w9, w8
	str	w8, [sp, #12]
	ldr	w0, [x20, #4]
	add	x1, sp, #12
	bl	___atl2_vlan_mode
Lloh33:
	adrp	x8, _MAC_CTRL_BC_EN@GOTPAGE
Lloh34:
	ldr	x8, [x8, _MAC_CTRL_BC_EN@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	orr	w8, w9, w8
	ldr	w9, [x20]
Lloh36:
	adrp	x10, _IFF_PROMISC@GOTPAGE
Lloh37:
	ldr	x10, [x10, _IFF_PROMISC@GOTPAGEOFF]
Lloh38:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_2
; %bb.1:
Lloh39:
	adrp	x9, _MAC_CTRL_PROMIS_EN@GOTPAGE
Lloh40:
	ldr	x9, [x9, _MAC_CTRL_PROMIS_EN@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
Lloh41:
	adrp	x10, _IFF_ALLMULTI@GOTPAGE
Lloh42:
	ldr	x10, [x10, _IFF_ALLMULTI@GOTPAGEOFF]
Lloh43:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_5
; %bb.3:
Lloh44:
	adrp	x9, _MAC_CTRL_MC_ALL_EN@GOTPAGE
Lloh45:
	ldr	x9, [x9, _MAC_CTRL_MC_ALL_EN@GOTPAGEOFF]
LBB0_4:
	ldr	w9, [x9]
	orr	w8, w9, w8
LBB0_5:
	ldr	w9, [x19, #8]!
Lloh46:
	adrp	x10, _MAC_CTRL_HALF_LEFT_BUF_MASK@GOTPAGE
Lloh47:
	ldr	x10, [x10, _MAC_CTRL_HALF_LEFT_BUF_MASK@GOTPAGEOFF]
Lloh48:
	ldr	w10, [x10]
	and	w9, w10, w9
Lloh49:
	adrp	x10, _MAC_CTRL_HALF_LEFT_BUF_SHIFT@GOTPAGE
Lloh50:
	ldr	x10, [x10, _MAC_CTRL_HALF_LEFT_BUF_SHIFT@GOTPAGEOFF]
Lloh51:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w2, w8, w9
	str	w2, [sp, #12]
Lloh52:
	adrp	x8, _REG_MAC_CTRL@GOTPAGE
Lloh53:
	ldr	x8, [x8, _REG_MAC_CTRL@GOTPAGEOFF]
Lloh54:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ATL2_WRITE_REG
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.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	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_MAC_CTRL_TX_EN,4,2             ; @MAC_CTRL_TX_EN
	.comm	_MAC_CTRL_RX_EN,4,2             ; @MAC_CTRL_RX_EN
	.comm	_MAC_CTRL_MACLP_CLK_PHY,4,2     ; @MAC_CTRL_MACLP_CLK_PHY
	.comm	_FULL_DUPLEX,8,3                ; @FULL_DUPLEX
	.comm	_MAC_CTRL_DUPLX,4,2             ; @MAC_CTRL_DUPLX
	.comm	_MAC_CTRL_TX_FLOW,4,2           ; @MAC_CTRL_TX_FLOW
	.comm	_MAC_CTRL_RX_FLOW,4,2           ; @MAC_CTRL_RX_FLOW
	.comm	_MAC_CTRL_ADD_CRC,4,2           ; @MAC_CTRL_ADD_CRC
	.comm	_MAC_CTRL_PAD,4,2               ; @MAC_CTRL_PAD
	.comm	_MAC_CTRL_PRMLEN_MASK,4,2       ; @MAC_CTRL_PRMLEN_MASK
	.comm	_MAC_CTRL_PRMLEN_SHIFT,4,2      ; @MAC_CTRL_PRMLEN_SHIFT
	.comm	_MAC_CTRL_BC_EN,4,2             ; @MAC_CTRL_BC_EN
	.comm	_IFF_PROMISC,4,2                ; @IFF_PROMISC
	.comm	_MAC_CTRL_PROMIS_EN,4,2         ; @MAC_CTRL_PROMIS_EN
	.comm	_IFF_ALLMULTI,4,2               ; @IFF_ALLMULTI
	.comm	_MAC_CTRL_MC_ALL_EN,4,2         ; @MAC_CTRL_MC_ALL_EN
	.comm	_MAC_CTRL_HALF_LEFT_BUF_MASK,4,2 ; @MAC_CTRL_HALF_LEFT_BUF_MASK
	.comm	_MAC_CTRL_HALF_LEFT_BUF_SHIFT,4,2 ; @MAC_CTRL_HALF_LEFT_BUF_SHIFT
	.comm	_REG_MAC_CTRL,4,2               ; @REG_MAC_CTRL
	.no_dead_strip	_atl2_setup_mac_ctrl
.subsections_via_symbols
