	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bgmac_miiconfig
_bgmac_miiconfig:                       ## @bgmac_miiconfig
	.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
	movl	(%rdi), %eax
	movq	_BGMAC_FEAT_FORCE_SPEED_2500@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.1:
	movq	_BGMAC_FEAT_IDM_MASK@GOTPCREL(%rip), %rcx
	movq	_SPEED_2500@GOTPCREL(%rip), %r15
	testl	%eax, (%rcx)
	jne	LBB0_5
## %bb.2:
	movq	_BCMA_IOCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_bgmac_idm_read
	movq	_BGMAC_BCMA_IOCTL_SW_CLKEN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	orl	$64, %eax
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_bgmac_idm_write
	jmp	LBB0_5
LBB0_3:
	movq	_BGMAC_DEV_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_bgmac_read
	movq	_BGMAC_DS_MM_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_BGMAC_DS_MM_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	cmpl	$1, %eax
	ja	LBB0_6
## %bb.4:
	movq	_SPEED_100@GOTPCREL(%rip), %r15
LBB0_5:
	movl	(%r15), %eax
	movl	%eax, 16(%rbx)
	movq	_DUPLEX_FULL@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bgmac_mac_speed                ## TAILCALL
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BGMAC_FEAT_FORCE_SPEED_2500,4,2 ## @BGMAC_FEAT_FORCE_SPEED_2500
	.comm	_BGMAC_FEAT_IDM_MASK,4,2        ## @BGMAC_FEAT_IDM_MASK
	.comm	_BCMA_IOCTL,4,2                 ## @BCMA_IOCTL
	.comm	_BGMAC_BCMA_IOCTL_SW_CLKEN,4,2  ## @BGMAC_BCMA_IOCTL_SW_CLKEN
	.comm	_SPEED_2500,4,2                 ## @SPEED_2500
	.comm	_DUPLEX_FULL,8,3                ## @DUPLEX_FULL
	.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	_SPEED_100,4,2                  ## @SPEED_100
	.no_dead_strip	_bgmac_miiconfig
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bgmac_miiconfig
_bgmac_miiconfig:                       ; @bgmac_miiconfig
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _BGMAC_FEAT_FORCE_SPEED_2500@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BGMAC_FEAT_FORCE_SPEED_2500@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
Lloh3:
	adrp	x9, _BGMAC_FEAT_IDM_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BGMAC_FEAT_IDM_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _BCMA_IOCTL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BCMA_IOCTL@GOTPAGEOFF]
Lloh8:
	ldr	w20, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_bgmac_idm_read
Lloh9:
	adrp	x8, _BGMAC_BCMA_IOCTL_SW_CLKEN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BGMAC_BCMA_IOCTL_SW_CLKEN@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	orr	w8, w0, w8
	orr	w2, w8, #0x40
	mov	x0, x19
	mov	x1, x20
	bl	_bgmac_idm_write
LBB0_3:
Lloh12:
	adrp	x8, _SPEED_2500@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SPEED_2500@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
Lloh14:
	adrp	x8, _BGMAC_DEV_STATUS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BGMAC_DEV_STATUS@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_bgmac_read
Lloh17:
	adrp	x8, _BGMAC_DS_MM_MASK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BGMAC_DS_MM_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh20:
	adrp	x9, _BGMAC_DS_MM_SHIFT@GOTPAGE
Lloh21:
	ldr	x9, [x9, _BGMAC_DS_MM_SHIFT@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	asr	w8, w8, w9
	cmp	w8, #1
	b.hi	LBB0_7
; %bb.5:
Lloh23:
	adrp	x8, _SPEED_100@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SPEED_100@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	str	w8, [x19, #16]
Lloh25:
	adrp	x8, _DUPLEX_FULL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _DUPLEX_FULL@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	str	x8, [x19, #8]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_bgmac_mac_speed
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_BGMAC_FEAT_FORCE_SPEED_2500,4,2 ; @BGMAC_FEAT_FORCE_SPEED_2500
	.comm	_BGMAC_FEAT_IDM_MASK,4,2        ; @BGMAC_FEAT_IDM_MASK
	.comm	_BCMA_IOCTL,4,2                 ; @BCMA_IOCTL
	.comm	_BGMAC_BCMA_IOCTL_SW_CLKEN,4,2  ; @BGMAC_BCMA_IOCTL_SW_CLKEN
	.comm	_SPEED_2500,4,2                 ; @SPEED_2500
	.comm	_DUPLEX_FULL,8,3                ; @DUPLEX_FULL
	.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	_SPEED_100,4,2                  ; @SPEED_100
	.no_dead_strip	_bgmac_miiconfig
.subsections_via_symbols
