	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bgx_lmac_disable
_bgx_lmac_disable:                      ## @bgx_lmac_disable
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %r15
	leaq	(%rsi,%rsi,4), %r12
	cmpq	$0, 24(%r15,%r12,8)
	je	LBB0_2
## %bb.1:
	leaq	(%r15,%r12,8), %r13
	addq	$24, %r13
	leaq	(%r15,%r12,8), %rdi
	addq	$32, %rdi
	callq	_cancel_delayed_work_sync
	movq	(%r13), %rdi
	callq	_destroy_workqueue
LBB0_2:
	movq	_BGX_CMRX_CFG@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_bgx_reg_read
	movq	_CMR_PKT_RX_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_bgx_reg_write
	movq	_BGX_CMRX_RX_FIFO_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$8191, %ecx                     ## imm = 0x1FFF
	movl	$1, %r8d
	callq	_bgx_poll_reg
	movq	_BGX_CMRX_TX_FIFO_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$16383, %ecx                    ## imm = 0x3FFF
	movl	$1, %r8d
	callq	_bgx_poll_reg
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_bgx_reg_read
	movq	_CMR_PKT_TX_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_bgx_reg_write
	cmpl	$0, 20(%r15,%r12,8)
	movq	_BGX_GMP_PCS_MRX_CTL@GOTPCREL(%rip), %rax
	cmoveq	_BGX_SPUX_CONTROL1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PCS_MRX_CTL_PWR_DN@GOTPCREL(%rip), %rax
	cmoveq	_SPU_CTL_LOW_POWER@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_bgx_reg_modify
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_bgx_reg_read
	movq	_CMR_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_bgx_reg_write
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_bgx_flush_dmac_cam_filter
	movl	16(%r15,%r12,8), %edi
	callq	_kfree
	movq	(%r15,%r12,8), %rax
	movq	_BGX_MODE_XFI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.3:
	movq	_BGX_MODE_XLAUI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.4:
	movq	_BGX_MODE_40G_KR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.5:
	movq	_BGX_MODE_10G_KR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.6:
	movq	8(%r15,%r12,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.7:
	callq	_phy_disconnect
LBB0_8:
	movq	$0, 8(%r15,%r12,8)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BGX_CMRX_CFG,4,2               ## @BGX_CMRX_CFG
	.comm	_CMR_PKT_RX_EN,4,2              ## @CMR_PKT_RX_EN
	.comm	_BGX_CMRX_RX_FIFO_LEN,4,2       ## @BGX_CMRX_RX_FIFO_LEN
	.comm	_BGX_CMRX_TX_FIFO_LEN,4,2       ## @BGX_CMRX_TX_FIFO_LEN
	.comm	_CMR_PKT_TX_EN,4,2              ## @CMR_PKT_TX_EN
	.comm	_BGX_SPUX_CONTROL1,4,2          ## @BGX_SPUX_CONTROL1
	.comm	_SPU_CTL_LOW_POWER,4,2          ## @SPU_CTL_LOW_POWER
	.comm	_BGX_GMP_PCS_MRX_CTL,4,2        ## @BGX_GMP_PCS_MRX_CTL
	.comm	_PCS_MRX_CTL_PWR_DN,4,2         ## @PCS_MRX_CTL_PWR_DN
	.comm	_CMR_EN,4,2                     ## @CMR_EN
	.comm	_BGX_MODE_XFI,8,3               ## @BGX_MODE_XFI
	.comm	_BGX_MODE_XLAUI,8,3             ## @BGX_MODE_XLAUI
	.comm	_BGX_MODE_40G_KR,8,3            ## @BGX_MODE_40G_KR
	.comm	_BGX_MODE_10G_KR,8,3            ## @BGX_MODE_10G_KR
	.no_dead_strip	_bgx_lmac_disable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bgx_lmac_disable
_bgx_lmac_disable:                      ; @bgx_lmac_disable
	.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, x1
	mov	x20, x0
	ldr	x21, [x0]
	mov	w8, #40
	madd	x22, x1, x8, x21
	ldr	x8, [x22, #24]!
	cbz	x8, LBB0_2
; %bb.1:
	mov	w8, #40
	madd	x8, x19, x8, x21
	add	x0, x8, #32
	bl	_cancel_delayed_work_sync
	ldr	x0, [x22]
	bl	_destroy_workqueue
LBB0_2:
Lloh0:
	adrp	x22, _BGX_CMRX_CFG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _BGX_CMRX_CFG@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_bgx_reg_read
Lloh2:
	adrp	x8, _CMR_PKT_RX_EN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CMR_PKT_RX_EN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	bic	w3, w0, w8
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_bgx_reg_write
Lloh5:
	adrp	x8, _BGX_CMRX_RX_FIFO_LEN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BGX_CMRX_RX_FIFO_LEN@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	mov	w3, #8191
	mov	w4, #1
	bl	_bgx_poll_reg
Lloh8:
	adrp	x8, _BGX_CMRX_TX_FIFO_LEN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BGX_CMRX_TX_FIFO_LEN@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	mov	w3, #16383
	mov	w4, #1
	bl	_bgx_poll_reg
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_bgx_reg_read
Lloh11:
	adrp	x8, _CMR_PKT_TX_EN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CMR_PKT_TX_EN@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	bic	w3, w0, w8
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_bgx_reg_write
	mov	w8, #40
	madd	x23, x19, x8, x21
Lloh14:
	adrp	x8, _BGX_SPUX_CONTROL1@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BGX_SPUX_CONTROL1@GOTPAGEOFF]
	ldr	w9, [x23, #20]
Lloh16:
	adrp	x10, _BGX_GMP_PCS_MRX_CTL@GOTPAGE
Lloh17:
	ldr	x10, [x10, _BGX_GMP_PCS_MRX_CTL@GOTPAGEOFF]
	cmp	w9, #0
	csel	x8, x8, x10, eq
	ldr	w2, [x8]
Lloh18:
	adrp	x8, _SPU_CTL_LOW_POWER@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SPU_CTL_LOW_POWER@GOTPAGEOFF]
Lloh20:
	adrp	x9, _PCS_MRX_CTL_PWR_DN@GOTPAGE
Lloh21:
	ldr	x9, [x9, _PCS_MRX_CTL_PWR_DN@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_bgx_reg_modify
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_bgx_reg_read
Lloh22:
	adrp	x8, _CMR_EN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CMR_EN@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	bic	w3, w0, w8
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_bgx_reg_write
	mov	x0, x20
	mov	x1, x19
	bl	_bgx_flush_dmac_cam_filter
	ldr	w0, [x23, #16]
	bl	_kfree
	ldr	x8, [x23]
Lloh25:
	adrp	x9, _BGX_MODE_XFI@GOTPAGE
Lloh26:
	ldr	x9, [x9, _BGX_MODE_XFI@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.3:
Lloh28:
	adrp	x9, _BGX_MODE_XLAUI@GOTPAGE
Lloh29:
	ldr	x9, [x9, _BGX_MODE_XLAUI@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.4:
Lloh31:
	adrp	x9, _BGX_MODE_40G_KR@GOTPAGE
Lloh32:
	ldr	x9, [x9, _BGX_MODE_40G_KR@GOTPAGEOFF]
Lloh33:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.5:
Lloh34:
	adrp	x9, _BGX_MODE_10G_KR@GOTPAGE
Lloh35:
	ldr	x9, [x9, _BGX_MODE_10G_KR@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.6:
	mov	w8, #40
	madd	x8, x19, x8, x21
	ldr	x0, [x8, #8]
	cbz	x0, LBB0_8
; %bb.7:
	bl	_phy_disconnect
LBB0_8:
	mov	w8, #40
	madd	x8, x19, x8, x21
	str	xzr, [x8, #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 AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_BGX_CMRX_CFG,4,2               ; @BGX_CMRX_CFG
	.comm	_CMR_PKT_RX_EN,4,2              ; @CMR_PKT_RX_EN
	.comm	_BGX_CMRX_RX_FIFO_LEN,4,2       ; @BGX_CMRX_RX_FIFO_LEN
	.comm	_BGX_CMRX_TX_FIFO_LEN,4,2       ; @BGX_CMRX_TX_FIFO_LEN
	.comm	_CMR_PKT_TX_EN,4,2              ; @CMR_PKT_TX_EN
	.comm	_BGX_SPUX_CONTROL1,4,2          ; @BGX_SPUX_CONTROL1
	.comm	_SPU_CTL_LOW_POWER,4,2          ; @SPU_CTL_LOW_POWER
	.comm	_BGX_GMP_PCS_MRX_CTL,4,2        ; @BGX_GMP_PCS_MRX_CTL
	.comm	_PCS_MRX_CTL_PWR_DN,4,2         ; @PCS_MRX_CTL_PWR_DN
	.comm	_CMR_EN,4,2                     ; @CMR_EN
	.comm	_BGX_MODE_XFI,8,3               ; @BGX_MODE_XFI
	.comm	_BGX_MODE_XLAUI,8,3             ; @BGX_MODE_XLAUI
	.comm	_BGX_MODE_40G_KR,8,3            ; @BGX_MODE_40G_KR
	.comm	_BGX_MODE_10G_KR,8,3            ; @BGX_MODE_10G_KR
	.no_dead_strip	_bgx_lmac_disable
.subsections_via_symbols
