	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bgx_lmac_rx_tx_enable          ## -- Begin function bgx_lmac_rx_tx_enable
	.p2align	4, 0x90
_bgx_lmac_rx_tx_enable:                 ## @bgx_lmac_rx_tx_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
	movl	%ecx, %r14d
	movl	%edx, %r15d
	callq	_get_bgx
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %rbx
	movq	8(%rax), %r12
	movq	_BGX_CMRX_CFG@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%rax, %rdi
	movl	%r15d, %esi
	callq	_bgx_reg_read
	movq	_CMR_PKT_RX_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_CMR_PKT_TX_EN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%r14d, %r14d
	je	LBB0_3
## %bb.2:
	orl	%eax, %ecx
	orl	%edx, %ecx
	jmp	LBB0_4
LBB0_3:
	orl	%ecx, %edx
	notl	%edx
	andl	%edx, %eax
	movl	%eax, %ecx
LBB0_4:
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_bgx_reg_write
	cmpq	$0, (%rbx)
	je	LBB0_9
## %bb.5:
	movslq	%r15d, %rax
	testl	%r14d, %r14d
	je	LBB0_6
## %bb.7:
	movl	4(%r12,%rax,8), %edi
	jmp	LBB0_8
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%edi, %edi
LBB0_8:
	movl	(%r12,%rax,8), %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_xcv_setup_link                 ## TAILCALL
	.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	_CMR_PKT_TX_EN,4,2              ## @CMR_PKT_TX_EN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bgx_lmac_rx_tx_enable          ; -- Begin function bgx_lmac_rx_tx_enable
	.p2align	2
_bgx_lmac_rx_tx_enable:                 ; @bgx_lmac_rx_tx_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, x3
	mov	x20, x2
	bl	_get_bgx
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
	ldr	x22, [x0, #8]
Lloh0:
	adrp	x23, _BGX_CMRX_CFG@GOTPAGE
Lloh1:
	ldr	x23, [x23, _BGX_CMRX_CFG@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x1, x20
	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]
Lloh5:
	adrp	x9, _CMR_PKT_TX_EN@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CMR_PKT_TX_EN@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w10, w9, w8
	bic	w10, w0, w10
	orr	w8, w8, w0
	orr	w8, w8, w9
	cmp	w19, #0
	csel	w3, w10, w8, eq
	ldr	w2, [x23]
	mov	x0, x21
	mov	x1, x20
	bl	_bgx_reg_write
	ldr	x8, [x21]
	cbz	x8, LBB0_4
; %bb.2:
	sxtw	x8, w20
	cbz	w19, LBB0_5
; %bb.3:
	add	x9, x22, x8, lsl #3
	ldr	w0, [x9, #4]
	b	LBB0_6
LBB0_4:
	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
LBB0_5:
	mov	w0, #0
LBB0_6:
	lsl	x8, x8, #3
	ldr	w1, [x22, x8]
	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	_xcv_setup_link
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.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	_CMR_PKT_TX_EN,4,2              ; @CMR_PKT_TX_EN
.subsections_via_symbols
