	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bgmac_enet_probe               ## -- Begin function bgmac_enet_probe
	.p2align	4, 0x90
_bgmac_enet_probe:                      ## @bgmac_enet_probe
	.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	16(%rdi), %r14
	callq	_bgmac_chip_intrs_off
	movl	28(%rbx), %eax
	movl	%eax, 20(%r14)
	movl	8(%rbx), %esi
	movq	%r14, %rdi
	callq	_SET_NETDEV_DEV
	movl	8(%rbx), %edi
	movq	%rbx, %rsi
	callq	_dev_set_drvdata
	movl	16(%r14), %edi
	callq	_is_valid_ether_addr
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movl	8(%rbx), %edi
	movl	16(%r14), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movq	%r14, %rdi
	callq	_eth_hw_addr_random
	movl	8(%rbx), %edi
	movl	16(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_warn
LBB0_2:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_bgmac_clk_enable
	movl	(%rbx), %eax
	movq	_BGMAC_FEAT_IDM_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_5
## %bb.3:
	movq	_BGMAC_FEAT_IRQ_ID_OOB_6@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:
	movq	_BCMA_OOB_SEL_OUT_A30@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$134, %edx
	callq	_bgmac_idm_write
LBB0_5:
	movq	%rbx, %rdi
	callq	_bgmac_chip_reset
	movq	%rbx, %rdi
	callq	_bgmac_dma_alloc
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r15d
	movl	8(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_14
LBB0_7:
	movq	_BGMAC_IS_ERRMASK@GOTPCREL(%rip), %rax
	movq	_BGMAC_IS_RX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_BGMAC_IS_TX_MASK@GOTPCREL(%rip), %r15
	orl	(%r15), %ecx
	movl	%ecx, 4(%rbx)
	leaq	L_.str.3(%rip), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_bcm47xx_nvram_getenv
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	movl	(%r15), %eax
	notl	%eax
	andl	%eax, 4(%rbx)
LBB0_9:
	leaq	24(%rbx), %rsi
	movq	_bgmac_poll@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_BGMAC_WEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_netif_napi_add
	movq	%rbx, %rdi
	callq	_bgmac_phy_connect
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %r15d
	movl	8(%rbx), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_13
LBB0_11:
	movq	_NETIF_F_SG@GOTPCREL(%rip), %rax
	movq	_NETIF_F_IP_CSUM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_NETIF_F_IPV6_CSUM@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, (%r14)
	movl	%ecx, 4(%r14)
	movl	%ecx, 8(%r14)
	movq	16(%rbx), %rdi
	callq	_register_netdev
	testl	%eax, %eax
	je	LBB0_15
## %bb.12:
	movl	%eax, %r15d
	movl	8(%rbx), %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movl	12(%r14), %edi
	callq	_phy_disconnect
LBB0_13:
	movq	%rbx, %rdi
	callq	_bgmac_dma_free
LBB0_14:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	%r14, %rdi
	callq	_netif_carrier_off
	xorl	%r15d, %r15d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid MAC addr: %pM\n"

L_.str.1:                               ## @.str.1
	.asciz	"Using random MAC: %pM\n"

	.comm	_BGMAC_FEAT_IDM_MASK,4,2        ## @BGMAC_FEAT_IDM_MASK
	.comm	_BGMAC_FEAT_IRQ_ID_OOB_6,4,2    ## @BGMAC_FEAT_IRQ_ID_OOB_6
	.comm	_BCMA_OOB_SEL_OUT_A30,4,2       ## @BCMA_OOB_SEL_OUT_A30
L_.str.2:                               ## @.str.2
	.asciz	"Unable to alloc memory for DMA\n"

	.comm	_BGMAC_IS_ERRMASK,4,2           ## @BGMAC_IS_ERRMASK
	.comm	_BGMAC_IS_RX,4,2                ## @BGMAC_IS_RX
	.comm	_BGMAC_IS_TX_MASK,4,2           ## @BGMAC_IS_TX_MASK
L_.str.3:                               ## @.str.3
	.asciz	"et0_no_txint"

	.comm	_bgmac_poll,4,2                 ## @bgmac_poll
	.comm	_BGMAC_WEIGHT,4,2               ## @BGMAC_WEIGHT
L_.str.4:                               ## @.str.4
	.asciz	"Cannot connect to phy\n"

	.comm	_NETIF_F_SG,4,2                 ## @NETIF_F_SG
	.comm	_NETIF_F_IP_CSUM,4,2            ## @NETIF_F_IP_CSUM
	.comm	_NETIF_F_IPV6_CSUM,4,2          ## @NETIF_F_IPV6_CSUM
L_.str.5:                               ## @.str.5
	.asciz	"Cannot register net device\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bgmac_enet_probe               ; -- Begin function bgmac_enet_probe
	.p2align	2
_bgmac_enet_probe:                      ; @bgmac_enet_probe
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	ldr	x20, [x0, #16]
	bl	_bgmac_chip_intrs_off
	ldr	w8, [x19, #28]
	str	w8, [x20, #20]
	ldr	w1, [x19, #8]
	mov	x0, x20
	bl	_SET_NETDEV_DEV
	ldr	w0, [x19, #8]
	mov	x1, x19
	bl	_dev_set_drvdata
	ldr	w0, [x20, #16]
	bl	_is_valid_ether_addr
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #8]
	ldr	w8, [x20, #16]
	str	x8, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x0, x20
	bl	_eth_hw_addr_random
	ldr	w0, [x19, #8]
	ldr	w2, [x20, #16]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
LBB0_2:
	mov	x0, x19
	mov	w1, #0
	bl	_bgmac_clk_enable
	ldr	w8, [x19]
Lloh4:
	adrp	x9, _BGMAC_FEAT_IDM_MASK@GOTPAGE
Lloh5:
	ldr	x9, [x9, _BGMAC_FEAT_IDM_MASK@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_5
; %bb.3:
Lloh7:
	adrp	x9, _BGMAC_FEAT_IRQ_ID_OOB_6@GOTPAGE
Lloh8:
	ldr	x9, [x9, _BGMAC_FEAT_IRQ_ID_OOB_6@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
Lloh10:
	adrp	x8, _BCMA_OOB_SEL_OUT_A30@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BCMA_OOB_SEL_OUT_A30@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #134
	bl	_bgmac_idm_write
LBB0_5:
	mov	x0, x19
	bl	_bgmac_chip_reset
	mov	x0, x19
	bl	_bgmac_dma_alloc
	cbz	w0, LBB0_7
; %bb.6:
	mov	x21, x0
	ldr	w0, [x19, #8]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	b	LBB0_14
LBB0_7:
Lloh15:
	adrp	x8, _BGMAC_IS_ERRMASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BGMAC_IS_ERRMASK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _BGMAC_IS_RX@GOTPAGE
Lloh19:
	ldr	x9, [x9, _BGMAC_IS_RX@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh21:
	adrp	x21, _BGMAC_IS_TX_MASK@GOTPAGE
Lloh22:
	ldr	x21, [x21, _BGMAC_IS_TX_MASK@GOTPAGEOFF]
	ldr	w9, [x21]
	orr	w8, w8, w9
	str	w8, [x19, #4]
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, #0
	mov	w2, #0
	bl	_bcm47xx_nvram_getenv
	cbnz	x0, LBB0_9
; %bb.8:
	ldr	w8, [x21]
	ldr	w9, [x19, #4]
	bic	w8, w9, w8
	str	w8, [x19, #4]
LBB0_9:
	add	x1, x19, #24
Lloh25:
	adrp	x8, _bgmac_poll@GOTPAGE
Lloh26:
	ldr	x8, [x8, _bgmac_poll@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
Lloh28:
	adrp	x8, _BGMAC_WEIGHT@GOTPAGE
Lloh29:
	ldr	x8, [x8, _BGMAC_WEIGHT@GOTPAGEOFF]
Lloh30:
	ldr	w3, [x8]
	mov	x0, x20
	bl	_netif_napi_add
	mov	x0, x19
	bl	_bgmac_phy_connect
	cbz	w0, LBB0_11
; %bb.10:
	mov	x21, x0
	ldr	w0, [x19, #8]
Lloh31:
	adrp	x1, l_.str.4@PAGE
Lloh32:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
	b	LBB0_13
LBB0_11:
Lloh33:
	adrp	x8, _NETIF_F_SG@GOTPAGE
Lloh34:
	ldr	x8, [x8, _NETIF_F_SG@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
Lloh36:
	adrp	x9, _NETIF_F_IP_CSUM@GOTPAGE
Lloh37:
	ldr	x9, [x9, _NETIF_F_IP_CSUM@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh39:
	adrp	x9, _NETIF_F_IPV6_CSUM@GOTPAGE
Lloh40:
	ldr	x9, [x9, _NETIF_F_IPV6_CSUM@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	orr	w8, w8, w9
	stp	w8, w8, [x20]
	str	w8, [x20, #8]
	ldr	x0, [x19, #16]
	bl	_register_netdev
	mov	x21, x0
	cbz	w0, LBB0_15
; %bb.12:
	ldr	w0, [x19, #8]
Lloh42:
	adrp	x1, l_.str.5@PAGE
Lloh43:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_err
	ldr	w0, [x20, #12]
	bl	_phy_disconnect
LBB0_13:
	mov	x0, x19
	bl	_bgmac_dma_free
LBB0_14:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_15:
	mov	x0, x20
	bl	_netif_carrier_off
	b	LBB0_14
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid MAC addr: %pM\n"

l_.str.1:                               ; @.str.1
	.asciz	"Using random MAC: %pM\n"

	.comm	_BGMAC_FEAT_IDM_MASK,4,2        ; @BGMAC_FEAT_IDM_MASK
	.comm	_BGMAC_FEAT_IRQ_ID_OOB_6,4,2    ; @BGMAC_FEAT_IRQ_ID_OOB_6
	.comm	_BCMA_OOB_SEL_OUT_A30,4,2       ; @BCMA_OOB_SEL_OUT_A30
l_.str.2:                               ; @.str.2
	.asciz	"Unable to alloc memory for DMA\n"

	.comm	_BGMAC_IS_ERRMASK,4,2           ; @BGMAC_IS_ERRMASK
	.comm	_BGMAC_IS_RX,4,2                ; @BGMAC_IS_RX
	.comm	_BGMAC_IS_TX_MASK,4,2           ; @BGMAC_IS_TX_MASK
l_.str.3:                               ; @.str.3
	.asciz	"et0_no_txint"

	.comm	_bgmac_poll,4,2                 ; @bgmac_poll
	.comm	_BGMAC_WEIGHT,4,2               ; @BGMAC_WEIGHT
l_.str.4:                               ; @.str.4
	.asciz	"Cannot connect to phy\n"

	.comm	_NETIF_F_SG,4,2                 ; @NETIF_F_SG
	.comm	_NETIF_F_IP_CSUM,4,2            ; @NETIF_F_IP_CSUM
	.comm	_NETIF_F_IPV6_CSUM,4,2          ; @NETIF_F_IPV6_CSUM
l_.str.5:                               ; @.str.5
	.asciz	"Cannot register net device\n"

.subsections_via_symbols
