	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bgmac_enable
_bgmac_enable:                          ## @bgmac_enable
	.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	%rdi, %r14
	movq	_BGMAC_FEAT_CMDCFG_SR_REV4@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rdi), %eax
	jne	LBB0_1
## %bb.2:
	movq	_BGMAC_CMDCFG_SR_REV0@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_BGMAC_CMDCFG_SR_REV4@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %r15d
	movq	_BGMAC_CMDCFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_bgmac_read
	movl	%eax, %ebx
	movq	_BGMAC_CMDCFG_TE@GOTPCREL(%rip), %r13
	movq	_BGMAC_CMDCFG_RE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	orl	(%r13), %esi
	notl	%esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	movl	$1, %ecx
	callq	_bgmac_cmdcfg_maskset
	movl	$2, %edi
	callq	_udelay
	orl	(%r13), %ebx
	orl	(%r12), %ebx
	movq	_BGMAC_CMDCFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_bgmac_write
	movq	_BGMAC_DEV_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_bgmac_read
	movl	%eax, %ebx
	movq	_BGMAC_DS_MM_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	_BGMAC_DS_MM_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %ebx
	movl	(%r14), %eax
	movq	_BGMAC_FEAT_CLKCTLST@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	andl	%eax, %ecx
	orl	%ebx, %ecx
	je	LBB0_7
## %bb.4:
	movq	_BCMA_CLKCTLST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BCMA_CLKCTLST_FORCEHT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_bgmac_set
	movl	(%r14), %eax
	testl	%eax, (%r15)
	jne	LBB0_7
## %bb.5:
	cmpl	$2, %ebx
	jne	LBB0_7
## %bb.6:
	movq	_BGMAC_CHIPCTL_1_RXC_DLL_BYPASS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$-1, %edx
	callq	_bgmac_cco_ctl_maskset
	movl	(%r14), %eax
LBB0_7:
	movq	_BGMAC_FEAT_FLW_CTRL1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_BGMAC_FEAT_FLW_CTRL2@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	%ecx, %edx
	testl	%eax, %edx
	je	LBB0_9
## %bb.8:
	testl	%eax, %ecx
	movl	$63636683, %eax                 ## imm = 0x3CB04CB
	movl	$2293985, %edx                  ## imm = 0x2300E1
	cmovel	%eax, %edx
	movq	_BGMAC_FLOW_CTL_THRESH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_bgmac_write
	movq	_BGMAC_PAUSE_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$163839, %edx                   ## imm = 0x27FFF
	callq	_bgmac_write
	movl	(%r14), %eax
LBB0_9:
	movq	_BGMAC_FEAT_SET_RXQ_CLK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_10
## %bb.11:
	movq	_BGMAC_RXQ_CTL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_bgmac_read
	movq	_BGMAC_RXQ_CTL_MDP_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movq	%r14, %rdi
	callq	_bgmac_get_bus_clock
	cltq
	imulq	$1125899907, %rax, %rax         ## imm = 0x431BDE83
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$50, %rax
	addl	%ecx, %eax
	shll	$7, %eax
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	sarq	$38, %rcx
	shrq	$63, %rax
	leal	(%rcx,%rax), %edx
	addl	$-3, %edx
	movq	_BGMAC_RXQ_CTL_MDP_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edx
	orl	%ebx, %edx
	movl	(%r15), %esi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bgmac_write                    ## TAILCALL
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BGMAC_FEAT_CMDCFG_SR_REV4,4,2  ## @BGMAC_FEAT_CMDCFG_SR_REV4
	.comm	_BGMAC_CMDCFG_SR_REV4,4,2       ## @BGMAC_CMDCFG_SR_REV4
	.comm	_BGMAC_CMDCFG_SR_REV0,4,2       ## @BGMAC_CMDCFG_SR_REV0
	.comm	_BGMAC_CMDCFG,4,2               ## @BGMAC_CMDCFG
	.comm	_BGMAC_CMDCFG_TE,4,2            ## @BGMAC_CMDCFG_TE
	.comm	_BGMAC_CMDCFG_RE,4,2            ## @BGMAC_CMDCFG_RE
	.comm	_BGMAC_DEV_STATUS,4,2           ## @BGMAC_DEV_STATUS
	.comm	_BGMAC_DS_MM_MASK,4,2           ## @BGMAC_DS_MM_MASK
	.comm	_BGMAC_DS_MM_SHIFT,4,2          ## @BGMAC_DS_MM_SHIFT
	.comm	_BGMAC_FEAT_CLKCTLST,4,2        ## @BGMAC_FEAT_CLKCTLST
	.comm	_BCMA_CLKCTLST,4,2              ## @BCMA_CLKCTLST
	.comm	_BCMA_CLKCTLST_FORCEHT,4,2      ## @BCMA_CLKCTLST_FORCEHT
	.comm	_BGMAC_CHIPCTL_1_RXC_DLL_BYPASS,4,2 ## @BGMAC_CHIPCTL_1_RXC_DLL_BYPASS
	.comm	_BGMAC_FEAT_FLW_CTRL1,4,2       ## @BGMAC_FEAT_FLW_CTRL1
	.comm	_BGMAC_FEAT_FLW_CTRL2,4,2       ## @BGMAC_FEAT_FLW_CTRL2
	.comm	_BGMAC_FLOW_CTL_THRESH,4,2      ## @BGMAC_FLOW_CTL_THRESH
	.comm	_BGMAC_PAUSE_CTL,4,2            ## @BGMAC_PAUSE_CTL
	.comm	_BGMAC_FEAT_SET_RXQ_CLK,4,2     ## @BGMAC_FEAT_SET_RXQ_CLK
	.comm	_BGMAC_RXQ_CTL,4,2              ## @BGMAC_RXQ_CTL
	.comm	_BGMAC_RXQ_CTL_MDP_MASK,4,2     ## @BGMAC_RXQ_CTL_MDP_MASK
	.comm	_BGMAC_RXQ_CTL_MDP_SHIFT,4,2    ## @BGMAC_RXQ_CTL_MDP_SHIFT
	.no_dead_strip	_bgmac_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bgmac_enable
_bgmac_enable:                          ; @bgmac_enable
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _BGMAC_FEAT_CMDCFG_SR_REV4@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BGMAC_FEAT_CMDCFG_SR_REV4@GOTPAGEOFF]
	ldr	w9, [x0]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x10, _BGMAC_CMDCFG_SR_REV0@GOTPAGE
Lloh4:
	ldr	x10, [x10, _BGMAC_CMDCFG_SR_REV0@GOTPAGEOFF]
Lloh5:
	adrp	x11, _BGMAC_CMDCFG_SR_REV4@GOTPAGE
Lloh6:
	ldr	x11, [x11, _BGMAC_CMDCFG_SR_REV4@GOTPAGEOFF]
	tst	w8, w9
	csel	x8, x10, x11, eq
	ldr	w20, [x8]
Lloh7:
	adrp	x22, _BGMAC_CMDCFG@GOTPAGE
Lloh8:
	ldr	x22, [x22, _BGMAC_CMDCFG@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_bgmac_read
	mov	x21, x0
Lloh9:
	adrp	x23, _BGMAC_CMDCFG_TE@GOTPAGE
Lloh10:
	ldr	x23, [x23, _BGMAC_CMDCFG_TE@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh11:
	adrp	x24, _BGMAC_CMDCFG_RE@GOTPAGE
Lloh12:
	ldr	x24, [x24, _BGMAC_CMDCFG_RE@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w8, w9, w8
	mvn	w1, w8
	mov	x0, x19
	mov	x2, x20
	mov	w3, #1
	bl	_bgmac_cmdcfg_maskset
	mov	w0, #2
	bl	_udelay
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w8, w8, w21
	orr	w2, w8, w9
	ldr	w1, [x22]
	mov	x0, x19
	bl	_bgmac_write
Lloh13:
	adrp	x8, _BGMAC_DEV_STATUS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BGMAC_DEV_STATUS@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_bgmac_read
Lloh16:
	adrp	x8, _BGMAC_DS_MM_MASK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BGMAC_DS_MM_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh19:
	adrp	x9, _BGMAC_DS_MM_SHIFT@GOTPAGE
Lloh20:
	ldr	x9, [x9, _BGMAC_DS_MM_SHIFT@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	asr	w20, w8, w9
	ldr	w8, [x19]
Lloh22:
	adrp	x21, _BGMAC_FEAT_CLKCTLST@GOTPAGE
Lloh23:
	ldr	x21, [x21, _BGMAC_FEAT_CLKCTLST@GOTPAGEOFF]
	ldr	w9, [x21]
	and	w9, w9, w8
	orr	w9, w9, w20
	cbz	w9, LBB0_4
; %bb.1:
Lloh24:
	adrp	x8, _BCMA_CLKCTLST@GOTPAGE
Lloh25:
	ldr	x8, [x8, _BCMA_CLKCTLST@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x8, _BCMA_CLKCTLST_FORCEHT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _BCMA_CLKCTLST_FORCEHT@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_bgmac_set
	ldr	w8, [x19]
	ldr	w9, [x21]
	tst	w9, w8
	b.ne	LBB0_4
; %bb.2:
	cmp	w20, #2
	b.ne	LBB0_4
; %bb.3:
Lloh30:
	adrp	x8, _BGMAC_CHIPCTL_1_RXC_DLL_BYPASS@GOTPAGE
Lloh31:
	ldr	x8, [x8, _BGMAC_CHIPCTL_1_RXC_DLL_BYPASS@GOTPAGEOFF]
Lloh32:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w1, #1
	mov	w2, #-1
	bl	_bgmac_cco_ctl_maskset
	ldr	w8, [x19]
LBB0_4:
Lloh33:
	adrp	x9, _BGMAC_FEAT_FLW_CTRL1@GOTPAGE
Lloh34:
	ldr	x9, [x9, _BGMAC_FEAT_FLW_CTRL1@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
Lloh36:
	adrp	x10, _BGMAC_FEAT_FLW_CTRL2@GOTPAGE
Lloh37:
	ldr	x10, [x10, _BGMAC_FEAT_FLW_CTRL2@GOTPAGEOFF]
Lloh38:
	ldr	w10, [x10]
	orr	w10, w10, w9
	tst	w10, w8
	b.eq	LBB0_6
; %bb.5:
	tst	w9, w8
	mov	w8, #225
	movk	w8, #35, lsl #16
	mov	w9, #1227
	movk	w9, #971, lsl #16
	csel	w2, w9, w8, eq
Lloh39:
	adrp	x8, _BGMAC_FLOW_CTL_THRESH@GOTPAGE
Lloh40:
	ldr	x8, [x8, _BGMAC_FLOW_CTL_THRESH@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_bgmac_write
Lloh42:
	adrp	x8, _BGMAC_PAUSE_CTL@GOTPAGE
Lloh43:
	ldr	x8, [x8, _BGMAC_PAUSE_CTL@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #32767
	movk	w2, #2, lsl #16
	bl	_bgmac_write
	ldr	w8, [x19]
LBB0_6:
Lloh45:
	adrp	x9, _BGMAC_FEAT_SET_RXQ_CLK@GOTPAGE
Lloh46:
	ldr	x9, [x9, _BGMAC_FEAT_SET_RXQ_CLK@GOTPAGEOFF]
Lloh47:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
Lloh48:
	adrp	x20, _BGMAC_RXQ_CTL@GOTPAGE
Lloh49:
	ldr	x20, [x20, _BGMAC_RXQ_CTL@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_bgmac_read
Lloh50:
	adrp	x8, _BGMAC_RXQ_CTL_MDP_MASK@GOTPAGE
Lloh51:
	ldr	x8, [x8, _BGMAC_RXQ_CTL_MDP_MASK@GOTPAGEOFF]
Lloh52:
	ldr	w8, [x8]
	bic	w21, w0, w8
	mov	x0, x19
	bl	_bgmac_get_bus_clock
	mov	w8, #56963
	movk	w8, #17179, lsl #16
	smull	x8, w0, w8
	lsr	x9, x8, #63
	asr	x8, x8, #50
	add	w8, w8, w9
	lsl	w8, w8, #7
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	sub	w8, w8, #3
Lloh53:
	adrp	x9, _BGMAC_RXQ_CTL_MDP_SHIFT@GOTPAGE
Lloh54:
	ldr	x9, [x9, _BGMAC_RXQ_CTL_MDP_SHIFT@GOTPAGEOFF]
Lloh55:
	ldr	w9, [x9]
	lsl	w8, w8, w9
	orr	w2, w8, w21
	ldr	w1, [x20]
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_bgmac_write
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGot	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_BGMAC_FEAT_CMDCFG_SR_REV4,4,2  ; @BGMAC_FEAT_CMDCFG_SR_REV4
	.comm	_BGMAC_CMDCFG_SR_REV4,4,2       ; @BGMAC_CMDCFG_SR_REV4
	.comm	_BGMAC_CMDCFG_SR_REV0,4,2       ; @BGMAC_CMDCFG_SR_REV0
	.comm	_BGMAC_CMDCFG,4,2               ; @BGMAC_CMDCFG
	.comm	_BGMAC_CMDCFG_TE,4,2            ; @BGMAC_CMDCFG_TE
	.comm	_BGMAC_CMDCFG_RE,4,2            ; @BGMAC_CMDCFG_RE
	.comm	_BGMAC_DEV_STATUS,4,2           ; @BGMAC_DEV_STATUS
	.comm	_BGMAC_DS_MM_MASK,4,2           ; @BGMAC_DS_MM_MASK
	.comm	_BGMAC_DS_MM_SHIFT,4,2          ; @BGMAC_DS_MM_SHIFT
	.comm	_BGMAC_FEAT_CLKCTLST,4,2        ; @BGMAC_FEAT_CLKCTLST
	.comm	_BCMA_CLKCTLST,4,2              ; @BCMA_CLKCTLST
	.comm	_BCMA_CLKCTLST_FORCEHT,4,2      ; @BCMA_CLKCTLST_FORCEHT
	.comm	_BGMAC_CHIPCTL_1_RXC_DLL_BYPASS,4,2 ; @BGMAC_CHIPCTL_1_RXC_DLL_BYPASS
	.comm	_BGMAC_FEAT_FLW_CTRL1,4,2       ; @BGMAC_FEAT_FLW_CTRL1
	.comm	_BGMAC_FEAT_FLW_CTRL2,4,2       ; @BGMAC_FEAT_FLW_CTRL2
	.comm	_BGMAC_FLOW_CTL_THRESH,4,2      ; @BGMAC_FLOW_CTL_THRESH
	.comm	_BGMAC_PAUSE_CTL,4,2            ; @BGMAC_PAUSE_CTL
	.comm	_BGMAC_FEAT_SET_RXQ_CLK,4,2     ; @BGMAC_FEAT_SET_RXQ_CLK
	.comm	_BGMAC_RXQ_CTL,4,2              ; @BGMAC_RXQ_CTL
	.comm	_BGMAC_RXQ_CTL_MDP_MASK,4,2     ; @BGMAC_RXQ_CTL_MDP_MASK
	.comm	_BGMAC_RXQ_CTL_MDP_SHIFT,4,2    ; @BGMAC_RXQ_CTL_MDP_SHIFT
	.no_dead_strip	_bgmac_enable
.subsections_via_symbols
