	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ql_finish_auto_neg
_ql_finish_auto_neg:                    ## @ql_finish_auto_neg
	.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, %rbx
	movq	_QL_PHY_GIO_SEM_MASK@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_QL_RESOURCE_BITS_BASE_CODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%rdi), %eax
	shll	$8, %eax
	shll	$7, %edx
	orl	%eax, %edx
	callq	_ql_sem_spinlock
	movq	%rax, %rcx
	movl	$-1, %eax
	testq	%rcx, %rcx
	jne	LBB0_8
## %bb.1:
	movq	%rbx, %rdi
	callq	_ql_auto_neg_error
	movl	%eax, %r14d
	movq	_QL_LINK_MASTER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%rbx), %rsi
	callq	_test_bit
	testl	%r14d, %r14d
	je	LBB0_2
## %bb.6:
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	movq	_link@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_KERN_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	4(%rbx), %ecx
	leaq	L_.str.5(%rip), %r8
	movq	%rbx, %rdi
	callq	_netif_printk
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_ql_sem_unlock
	movq	%rbx, %rdi
	callq	_ql_port_start
	movq	%rax, %rcx
	xorl	%eax, %eax
	negq	%rcx
	sbbl	%eax, %eax
	jmp	LBB0_8
LBB0_2:
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_link@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_KERN_DEBUG@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movl	4(%rbx), %ecx
	leaq	L_.str(%rip), %r8
	movq	%rbx, %rdi
	callq	_netif_printk
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_ql_mac_cfg_soft_reset
	movq	%rbx, %rdi
	callq	_ql_get_link_speed
	movq	_SPEED_1000@GOTPCREL(%rip), %rcx
	xorl	%esi, %esi
	cmpq	(%rcx), %rax
	sete	%sil
	movq	%rbx, %rdi
	callq	_ql_mac_cfg_gig
	movq	%rbx, %rdi
	callq	_ql_is_link_full_dup
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_ql_mac_cfg_full_dup
	movq	%rbx, %rdi
	callq	_ql_is_neg_pause
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_ql_mac_cfg_pause
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_ql_mac_cfg_soft_reset
	movl	(%r14), %esi
	movl	(%r15), %edx
	movl	4(%rbx), %ecx
	leaq	L_.str.1(%rip), %r8
	movq	%rbx, %rdi
	callq	_netif_printk
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_ql_mac_enable
LBB0_4:
	movq	_LS_UP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movl	4(%rbx), %edi
	callq	_netif_start_queue
	movl	4(%rbx), %edi
	callq	_netif_carrier_on
	movq	_link@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	4(%rbx), %r15d
	movq	%rbx, %rdi
	callq	_ql_get_link_speed
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_ql_is_link_full_dup
	testq	%rax, %rax
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.3(%rip), %r9
	cmoveq	%rax, %r9
	leaq	L_.str.2(%rip), %rcx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	movq	%r12, %r8
	callq	_netif_info
LBB0_5:
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_ql_sem_unlock
	xorl	%eax, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_QL_PHY_GIO_SEM_MASK,4,2        ## @QL_PHY_GIO_SEM_MASK
	.comm	_QL_RESOURCE_BITS_BASE_CODE,4,2 ## @QL_RESOURCE_BITS_BASE_CODE
	.comm	_QL_LINK_MASTER,4,2             ## @QL_LINK_MASTER
	.comm	_link,4,2                       ## @link
	.comm	_KERN_DEBUG,4,2                 ## @KERN_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Configuring link\n"

	.comm	_SPEED_1000,8,3                 ## @SPEED_1000
L_.str.1:                               ## @.str.1
	.asciz	"Enabling mac\n"

	.comm	_LS_UP,4,2                      ## @LS_UP
L_.str.2:                               ## @.str.2
	.asciz	"Link is up at %d Mbps, %s duplex\n"

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

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

L_.str.5:                               ## @.str.5
	.asciz	"Remote error detected. Calling ql_port_start()\n"

	.no_dead_strip	_ql_finish_auto_neg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ql_finish_auto_neg
_ql_finish_auto_neg:                    ; @ql_finish_auto_neg
	.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, x0
Lloh0:
	adrp	x23, _QL_PHY_GIO_SEM_MASK@GOTPAGE
Lloh1:
	ldr	x23, [x23, _QL_PHY_GIO_SEM_MASK@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh2:
	adrp	x8, _QL_RESOURCE_BITS_BASE_CODE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _QL_RESOURCE_BITS_BASE_CODE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x0]
	lsl	w9, w9, #8
	orr	w2, w9, w8, lsl #7
	bl	_ql_sem_spinlock
	cbz	x0, LBB0_2
; %bb.1:
	mov	w0, #-1
	b	LBB0_9
LBB0_2:
	mov	x0, x19
	bl	_ql_auto_neg_error
	mov	x20, x0
Lloh5:
	adrp	x8, _QL_LINK_MASTER@GOTPAGE
Lloh6:
	ldr	x8, [x8, _QL_LINK_MASTER@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x1, x19, #8
	bl	_test_bit
	cbz	w20, LBB0_5
; %bb.3:
	cbz	x0, LBB0_8
; %bb.4:
Lloh8:
	adrp	x8, _link@GOTPAGE
Lloh9:
	ldr	x8, [x8, _link@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _KERN_DEBUG@GOTPAGE
Lloh12:
	ldr	x8, [x8, _KERN_DEBUG@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	ldr	w3, [x19, #4]
Lloh14:
	adrp	x4, l_.str.5@PAGE
Lloh15:
	add	x4, x4, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_netif_printk
	ldr	w1, [x23]
	mov	x0, x19
	bl	_ql_sem_unlock
	mov	x0, x19
	bl	_ql_port_start
	cmp	x0, #0
	csetm	w0, ne
	b	LBB0_9
LBB0_5:
	cbz	x0, LBB0_7
; %bb.6:
Lloh16:
	adrp	x20, _link@GOTPAGE
Lloh17:
	ldr	x20, [x20, _link@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh18:
	adrp	x21, _KERN_DEBUG@GOTPAGE
Lloh19:
	ldr	x21, [x21, _KERN_DEBUG@GOTPAGEOFF]
	ldr	w2, [x21]
	ldr	w3, [x19, #4]
Lloh20:
	adrp	x4, l_.str@PAGE
Lloh21:
	add	x4, x4, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netif_printk
	mov	x0, x19
	mov	w1, #1
	bl	_ql_mac_cfg_soft_reset
	mov	x0, x19
	bl	_ql_get_link_speed
Lloh22:
	adrp	x8, _SPEED_1000@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SPEED_1000@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w1, eq
	mov	x0, x19
	bl	_ql_mac_cfg_gig
	mov	x0, x19
	bl	_ql_is_link_full_dup
	mov	x1, x0
	mov	x0, x19
	bl	_ql_mac_cfg_full_dup
	mov	x0, x19
	bl	_ql_is_neg_pause
	mov	x1, x0
	mov	x0, x19
	bl	_ql_mac_cfg_pause
	mov	x0, x19
	mov	w1, #0
	bl	_ql_mac_cfg_soft_reset
	ldr	w1, [x20]
	ldr	w2, [x21]
	ldr	w3, [x19, #4]
Lloh25:
	adrp	x4, l_.str.1@PAGE
Lloh26:
	add	x4, x4, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_netif_printk
	mov	x0, x19
	mov	w1, #1
	bl	_ql_mac_enable
LBB0_7:
Lloh27:
	adrp	x8, _LS_UP@GOTPAGE
Lloh28:
	ldr	x8, [x8, _LS_UP@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	str	w8, [x19, #12]
	ldr	w0, [x19, #4]
	bl	_netif_start_queue
	ldr	w0, [x19, #4]
	bl	_netif_carrier_on
Lloh30:
	adrp	x8, _link@GOTPAGE
Lloh31:
	ldr	x8, [x8, _link@GOTPAGEOFF]
Lloh32:
	ldr	w20, [x8]
	ldr	w21, [x19, #4]
	mov	x0, x19
	bl	_ql_get_link_speed
	mov	x22, x0
	mov	x0, x19
	bl	_ql_is_link_full_dup
Lloh33:
	adrp	x8, l_.str.3@PAGE
Lloh34:
	add	x8, x8, l_.str.3@PAGEOFF
Lloh35:
	adrp	x9, l_.str.4@PAGE
Lloh36:
	add	x9, x9, l_.str.4@PAGEOFF
	cmp	x0, #0
	csel	x5, x9, x8, eq
Lloh37:
	adrp	x3, l_.str.2@PAGE
Lloh38:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	mov	x4, x22
	bl	_netif_info
LBB0_8:
	ldr	w1, [x23]
	mov	x0, x19
	bl	_ql_sem_unlock
	mov	w0, #0
LBB0_9:
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_QL_PHY_GIO_SEM_MASK,4,2        ; @QL_PHY_GIO_SEM_MASK
	.comm	_QL_RESOURCE_BITS_BASE_CODE,4,2 ; @QL_RESOURCE_BITS_BASE_CODE
	.comm	_QL_LINK_MASTER,4,2             ; @QL_LINK_MASTER
	.comm	_link,4,2                       ; @link
	.comm	_KERN_DEBUG,4,2                 ; @KERN_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Configuring link\n"

	.comm	_SPEED_1000,8,3                 ; @SPEED_1000
l_.str.1:                               ; @.str.1
	.asciz	"Enabling mac\n"

	.comm	_LS_UP,4,2                      ; @LS_UP
l_.str.2:                               ; @.str.2
	.asciz	"Link is up at %d Mbps, %s duplex\n"

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

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

l_.str.5:                               ; @.str.5
	.asciz	"Remote error detected. Calling ql_port_start()\n"

	.no_dead_strip	_ql_finish_auto_neg
.subsections_via_symbols
