	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tulip_check_duplex             ## -- Begin function tulip_check_duplex
	.p2align	4, 0x90
_tulip_check_duplex:                    ## @tulip_check_duplex
	.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
	callq	_netdev_priv
	movq	%rax, %r13
	movq	16(%rax), %rax
	movl	(%rax), %esi
	movq	_MII_BMSR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_tulip_mdio_read
	movq	%rax, %rbx
	movq	16(%r13), %rax
	movl	(%rax), %esi
	movq	_MII_LPA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_tulip_mdio_read
	movq	%rax, %r15
	movq	_tulip_debug@GOTPCREL(%rip), %rax
	cmpl	$2, (%rax)
	jl	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_dev_info
LBB0_2:
	movl	$-2, %r12d
	cmpl	$65535, %ebx                    ## imm = 0xFFFF
	je	LBB0_10
## %bb.3:
	movq	_BMSR_LSTATUS@GOTPCREL(%rip), %r12
	testl	%ebx, (%r12)
	jne	LBB0_7
## %bb.4:
	movq	16(%r13), %rax
	movl	(%rax), %esi
	movq	_MII_BMSR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_tulip_mdio_read
	testl	%eax, (%r12)
	je	LBB0_5
LBB0_7:
	movq	(%r13), %rax
	movl	(%rax), %ebx
	andl	%r15d, %ebx
	movl	32(%r13), %edi
	movl	%ebx, %esi
	callq	_mii_duplex
	movq	%rax, 24(%r13)
	movl	8(%r13), %edx
	movq	_LPA_100@GOTPCREL(%rip), %rcx
	movq	_TxThreshold@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	%esi, %edi
	notl	%edi
	andl	%edx, %edi
	orl	%edx, %esi
	testl	%ebx, (%rcx)
	cmovnel	%edi, %esi
	movq	_FullDuplex@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edi
	orl	%esi, %edi
	notl	%ecx
	andl	%esi, %ecx
	testq	%rax, %rax
	cmovnel	%edi, %ecx
	xorl	%r12d, %r12d
	cmpl	%edx, %ecx
	je	LBB0_10
## %bb.8:
	movl	%ecx, 8(%r13)
	movq	%r13, %rdi
	callq	_tulip_restart_rxtx
	movl	$1, %r12d
	movq	_tulip_debug@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_10
## %bb.9:
	cmpq	$0, 24(%r13)
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.3(%rip), %rdx
	cmoveq	%rax, %rdx
	movq	16(%r13), %rax
	movl	(%rax), %ecx
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_dev_info
	jmp	LBB0_10
LBB0_5:
	movl	$-1, %r12d
	movq	_tulip_debug@GOTPCREL(%rip), %rcx
	cmpl	$2, (%rcx)
	jl	LBB0_10
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_info
LBB0_10:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_BMSR,4,2                   ## @MII_BMSR
	.comm	_MII_LPA,4,2                    ## @MII_LPA
	.comm	_tulip_debug,4,2                ## @tulip_debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MII status %04x, Link partner report %04x\n"

	.comm	_BMSR_LSTATUS,4,2               ## @BMSR_LSTATUS
L_.str.1:                               ## @.str.1
	.asciz	"No link beat on the MII interface, status %04x\n"

	.comm	_LPA_100,4,2                    ## @LPA_100
	.comm	_TxThreshold,4,2                ## @TxThreshold
	.comm	_FullDuplex,4,2                 ## @FullDuplex
L_.str.2:                               ## @.str.2
	.asciz	"Setting %s-duplex based on MII#%d link partner capability of %04x\n"

L_.str.3:                               ## @.str.3
	.asciz	"full"

L_.str.4:                               ## @.str.4
	.asciz	"half"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tulip_check_duplex             ; -- Begin function tulip_check_duplex
	.p2align	2
_tulip_check_duplex:                    ; @tulip_check_duplex
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	bl	_netdev_priv
	mov	x20, x0
	ldr	x8, [x0, #16]
	ldr	w1, [x8]
Lloh0:
	adrp	x24, _MII_BMSR@GOTPAGE
Lloh1:
	ldr	x24, [x24, _MII_BMSR@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x0, x19
	bl	_tulip_mdio_read
	mov	x22, x0
	ldr	x8, [x20, #16]
	ldr	w1, [x8]
Lloh2:
	adrp	x8, _MII_LPA@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MII_LPA@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_tulip_mdio_read
	mov	x21, x0
Lloh5:
	adrp	x23, _tulip_debug@GOTPAGE
Lloh6:
	ldr	x23, [x23, _tulip_debug@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #2
	b.lt	LBB0_2
; %bb.1:
	mov	x8, x21
	mov	x9, x22
	stp	x9, x8, [sp]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_info
LBB0_2:
	mov	w8, #65535
	cmp	w22, w8
	b.ne	LBB0_4
; %bb.3:
	mov	w0, #-2
	b	LBB0_14
LBB0_4:
Lloh9:
	adrp	x25, _BMSR_LSTATUS@GOTPAGE
Lloh10:
	ldr	x25, [x25, _BMSR_LSTATUS@GOTPAGEOFF]
	ldr	w8, [x25]
	tst	w8, w22
	b.ne	LBB0_6
; %bb.5:
	ldr	x8, [x20, #16]
	ldr	w1, [x8]
	ldr	w2, [x24]
	mov	x0, x19
	bl	_tulip_mdio_read
	ldr	w8, [x25]
	tst	w8, w0
	b.eq	LBB0_11
LBB0_6:
	ldr	x8, [x20]
	ldr	w8, [x8]
	and	w22, w8, w21
	ldr	w0, [x20, #32]
	mov	x1, x22
	bl	_mii_duplex
	str	x0, [x20, #24]
	ldr	w9, [x20, #8]
Lloh11:
	adrp	x8, _LPA_100@GOTPAGE
Lloh12:
	ldr	x8, [x8, _LPA_100@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x10, _TxThreshold@GOTPAGE
Lloh15:
	ldr	x10, [x10, _TxThreshold@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	bic	w11, w9, w10
	orr	w10, w10, w9
	tst	w8, w22
	csel	w8, w10, w11, eq
Lloh17:
	adrp	x10, _FullDuplex@GOTPAGE
Lloh18:
	ldr	x10, [x10, _FullDuplex@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	orr	w11, w10, w8
	bic	w8, w8, w10
	cmp	x0, #0
	csel	w8, w8, w11, eq
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.7:
	mov	w0, #0
	b	LBB0_14
LBB0_8:
	str	w8, [x20, #8]
	mov	x0, x20
	bl	_tulip_restart_rxtx
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.9:
Lloh20:
	adrp	x8, l_.str.3@PAGE
Lloh21:
	add	x8, x8, l_.str.3@PAGEOFF
Lloh22:
	adrp	x9, l_.str.4@PAGE
Lloh23:
	add	x9, x9, l_.str.4@PAGEOFF
	ldp	x11, x10, [x20, #16]
	cmp	x10, #0
	csel	x8, x9, x8, eq
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	ldr	w9, [x11]
	stp	x9, x21, [sp, #8]
	str	x8, [sp]
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_info
LBB0_10:
	mov	w0, #1
	b	LBB0_14
LBB0_11:
	ldr	w8, [x23]
	cmp	w8, #2
	b.lt	LBB0_13
; %bb.12:
                                        ; kill: def $w0 killed $w0 killed $x0 def $x0
	str	x0, [sp]
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_info
LBB0_13:
	mov	w0, #-1
LBB0_14:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_BMSR,4,2                   ; @MII_BMSR
	.comm	_MII_LPA,4,2                    ; @MII_LPA
	.comm	_tulip_debug,4,2                ; @tulip_debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MII status %04x, Link partner report %04x\n"

	.comm	_BMSR_LSTATUS,4,2               ; @BMSR_LSTATUS
l_.str.1:                               ; @.str.1
	.asciz	"No link beat on the MII interface, status %04x\n"

	.comm	_LPA_100,4,2                    ; @LPA_100
	.comm	_TxThreshold,4,2                ; @TxThreshold
	.comm	_FullDuplex,4,2                 ; @FullDuplex
l_.str.2:                               ; @.str.2
	.asciz	"Setting %s-duplex based on MII#%d link partner capability of %04x\n"

l_.str.3:                               ; @.str.3
	.asciz	"full"

l_.str.4:                               ; @.str.4
	.asciz	"half"

.subsections_via_symbols
