	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smsc911x_phy_check_loopbackpkt
_smsc911x_phy_check_loopbackpkt:        ## @smsc911x_phy_check_loopbackpkt
	.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, %r12
	movq	_MIN_PACKET_SIZE@GOTPCREL(%rip), %r14
	xorl	%r13d, %r13d
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	leaq	L_.str(%rip), %rdx
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	callq	_SMSC_WARN
LBB0_23:                                ##   in Loop: Header=BB0_1 Depth=1
	incl	%r13d
	cmpl	$10, %r13d
	je	LBB0_24
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
                                        ##     Child Loop BB0_9 Depth 2
                                        ##     Child Loop BB0_19 Depth 2
	movq	(%r12), %rdi
	movl	(%r14), %edx
	xorl	%esi, %esi
	callq	_memset
	movl	8(%r12), %edx
	andl	$3, %edx
	shll	$16, %edx
	movq	_TX_CMD_A_LAST_SEG_@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_TX_CMD_A_FIRST_SEG_@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%r14), %ecx
	orl	%ecx, %edx
	orl	%eax, %edx
	movl	%ecx, %r15d
	shll	$16, %r15d
	orl	%ecx, %r15d
	movq	_TX_DATA_FIFO@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_smsc911x_reg_write
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_smsc911x_reg_write
	movq	8(%r12), %rax
	movq	16(%r12), %rcx
	movl	(%r14), %edx
	movslq	%eax, %rsi
	andl	$3, %eax
	addl	%eax, %edx
	addl	$3, %edx
	sarl	$2, %edx
	andq	$-4, %rsi
	movq	%r12, %rdi
	callq	*8(%rcx)
	movl	$-60, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	$5, %edi
	callq	_udelay
	movq	%r12, %rdi
	callq	_smsc911x_tx_get_txstatus
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=2
	incl	%ebx
	testl	%eax, %eax
	je	LBB0_2
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	testl	%eax, %eax
	je	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_TX_STS_ES_@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.26:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rbx
	movl	$-60, %r14d
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	$5, %edi
	callq	_udelay
	movq	%r12, %rdi
	callq	_smsc911x_rx_get_rxstatus
	movl	%eax, %r15d
	testl	%r14d, %r14d
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=2
	incl	%r14d
	testl	%r15d, %r15d
	je	LBB0_9
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	testl	%r15d, %r15d
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_RX_STS_ES_@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	movq	%rbx, %r14
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	leaq	L_.str.3(%rip), %rdx
	jmp	LBB0_6
LBB0_12:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	leaq	L_.str.2(%rip), %rdx
	xorl	%eax, %eax
	callq	_SMSC_WARN
	movq	%rbx, %r14
	jmp	LBB0_23
LBB0_15:                                ##   in Loop: Header=BB0_1 Depth=1
	shrl	$16, %r15d
	andl	$16383, %r15d                   ## imm = 0x3FFF
	movq	(%r12), %rax
	movq	16(%r12), %rcx
	movslq	%eax, %rsi
	andl	$3, %eax
	leal	(%r15,%rax), %edx
	addl	$3, %edx
	shrl	$2, %edx
	movq	%r12, %rdi
	callq	*(%rcx)
	movl	(%r14), %eax
	leal	4(%rax), %ecx
	cmpl	%ecx, %r15d
	jne	LBB0_22
## %bb.16:                              ##   in Loop: Header=BB0_1 Depth=1
	testq	%rax, %rax
	je	LBB0_21
## %bb.17:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r12), %rcx
	movq	8(%r12), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_19:                                ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rdx,%rsi,8), %rdi
	cmpq	(%rcx,%rsi,8), %rdi
	jne	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_19 Depth=2
	incq	%rsi
	cmpq	%rsi, %rax
	jne	LBB0_19
	jmp	LBB0_21
LBB0_22:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	leaq	L_.str.4(%rip), %rdx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_SMSC_WARN
	jmp	LBB0_23
LBB0_20:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	leaq	L_.str.6(%rip), %rdx
	jmp	LBB0_6
LBB0_24:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_25
LBB0_21:
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.5(%rip), %rdx
	movq	%r12, %rdi
	callq	_SMSC_TRACE
	xorl	%eax, %eax
LBB0_25:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MIN_PACKET_SIZE,4,2            ## @MIN_PACKET_SIZE
	.comm	_TX_CMD_A_FIRST_SEG_,4,2        ## @TX_CMD_A_FIRST_SEG_
	.comm	_TX_CMD_A_LAST_SEG_,4,2         ## @TX_CMD_A_LAST_SEG_
	.comm	_TX_DATA_FIFO,4,2               ## @TX_DATA_FIFO
	.comm	_hw,4,2                         ## @hw
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to transmit during loopback test"

	.comm	_TX_STS_ES_,4,2                 ## @TX_STS_ES_
L_.str.1:                               ## @.str.1
	.asciz	"Transmit encountered errors during loopback test"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to receive during loopback test"

	.comm	_RX_STS_ES_,4,2                 ## @RX_STS_ES_
L_.str.3:                               ## @.str.3
	.asciz	"Receive encountered errors during loopback test"

L_.str.4:                               ## @.str.4
	.asciz	"Unexpected packet size during loop back test, size=%d, will retry"

L_.str.5:                               ## @.str.5
	.asciz	"Successfully verified loopback packet"

L_.str.6:                               ## @.str.6
	.asciz	"Data mismatch during loop back test, will retry"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_smsc911x_phy_check_loopbackpkt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smsc911x_phy_check_loopbackpkt
_smsc911x_phy_check_loopbackpkt:        ; @smsc911x_phy_check_loopbackpkt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	mov	w27, #0
Lloh0:
	adrp	x28, _MIN_PACKET_SIZE@GOTPAGE
Lloh1:
	ldr	x28, [x28, _MIN_PACKET_SIZE@GOTPAGEOFF]
Lloh2:
	adrp	x22, _TX_CMD_A_FIRST_SEG_@GOTPAGE
Lloh3:
	ldr	x22, [x22, _TX_CMD_A_FIRST_SEG_@GOTPAGEOFF]
Lloh4:
	adrp	x23, _TX_CMD_A_LAST_SEG_@GOTPAGE
Lloh5:
	ldr	x23, [x23, _TX_CMD_A_LAST_SEG_@GOTPAGEOFF]
Lloh6:
	adrp	x21, _TX_DATA_FIFO@GOTPAGE
Lloh7:
	ldr	x21, [x21, _TX_DATA_FIFO@GOTPAGEOFF]
Lloh8:
	adrp	x24, _hw@GOTPAGE
Lloh9:
	ldr	x24, [x24, _hw@GOTPAGEOFF]
Lloh10:
	adrp	x20, _TX_STS_ES_@GOTPAGE
Lloh11:
	ldr	x20, [x20, _TX_STS_ES_@GOTPAGEOFF]
Lloh12:
	adrp	x25, l_.str.1@PAGE
Lloh13:
	add	x25, x25, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x24]
	mov	x0, x19
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	bl	_SMSC_WARN
	add	w27, w27, #1
	cmp	w27, #10
	b.eq	LBB0_23
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
                                        ;     Child Loop BB0_10 Depth 2
                                        ;     Child Loop BB0_19 Depth 2
	ldr	x0, [x19]
	ldr	w2, [x28]
	mov	w1, #0
	bl	_memset
	ldr	w8, [x19, #8]
	ubfiz	w8, w8, #16, #2
	ldr	w9, [x22]
	ldr	w10, [x23]
	orr	w9, w10, w9
	ldr	w10, [x28]
	orr	w9, w9, w10
	orr	w2, w9, w8
	orr	w26, w10, w10, lsl #16
	ldr	w1, [x21]
	mov	x0, x19
	bl	_smsc911x_reg_write
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, x26
	bl	_smsc911x_reg_write
	ldr	w8, [x28]
	ldp	x9, x10, [x19, #8]
	and	w11, w9, #0x3
	add	w8, w8, w11
	add	w8, w8, #3
	asr	w2, w8, #2
	ldr	x8, [x10, #8]
	sxtw	x9, w9
	and	x1, x9, #0xfffffffffffffffc
	mov	x0, x19
	blr	x8
	mov	w26, #-60
LBB0_4:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	w0, #5
	bl	_udelay
	mov	x0, x19
	bl	_smsc911x_tx_get_txstatus
	cbz	w26, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	add	w26, w26, #1
	cbz	w0, LBB0_4
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	cbz	w0, LBB0_1
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x24]
	mov	x0, x19
	mov	x2, x25
	b	LBB0_2
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w26, #-60
LBB0_10:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	w0, #5
	bl	_udelay
	mov	x0, x19
	bl	_smsc911x_rx_get_rxstatus
	cbz	w26, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	add	w26, w26, #1
	cbz	w0, LBB0_10
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	cbz	w0, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh16:
	adrp	x8, _RX_STS_ES_@GOTPAGE
Lloh17:
	ldr	x8, [x8, _RX_STS_ES_@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x24]
	mov	x0, x19
Lloh19:
	adrp	x2, l_.str.3@PAGE
Lloh20:
	add	x2, x2, l_.str.3@PAGEOFF
	b	LBB0_2
LBB0_15:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x24]
	mov	x0, x19
Lloh21:
	adrp	x2, l_.str.2@PAGE
Lloh22:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_2
LBB0_16:                                ;   in Loop: Header=BB0_3 Depth=1
	ubfx	w26, w0, #16, #14
	ldr	x8, [x19]
	and	w9, w8, #0x3
	add	w9, w26, w9
	add	w9, w9, #3
	lsr	w2, w9, #2
	ldr	x9, [x19, #16]
	ldr	x9, [x9]
	sxtw	x1, w8
	mov	x0, x19
	blr	x9
	ldr	w8, [x28]
	add	w9, w8, #4
	cmp	w26, w9
	b.ne	LBB0_21
; %bb.17:                               ;   in Loop: Header=BB0_3 Depth=1
	cbz	w8, LBB0_24
; %bb.18:                               ;   in Loop: Header=BB0_3 Depth=1
	ldp	x10, x9, [x19]
LBB0_19:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x11, [x9]
	ldr	x12, [x10]
	cmp	x11, x12
	b.ne	LBB0_22
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=2
	add	x9, x9, #8
	add	x10, x10, #8
	subs	x8, x8, #1
	b.ne	LBB0_19
	b	LBB0_24
LBB0_21:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x24]
	str	x26, [sp]
	mov	x0, x19
Lloh23:
	adrp	x2, l_.str.4@PAGE
Lloh24:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_2
LBB0_22:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x24]
	mov	x0, x19
Lloh25:
	adrp	x2, l_.str.6@PAGE
Lloh26:
	add	x2, x2, l_.str.6@PAGEOFF
	b	LBB0_2
LBB0_23:
Lloh27:
	adrp	x8, _EIO@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_25
LBB0_24:
	ldr	w1, [x24]
Lloh30:
	adrp	x2, l_.str.5@PAGE
Lloh31:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_SMSC_TRACE
	mov	w0, #0
LBB0_25:
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_MIN_PACKET_SIZE,4,2            ; @MIN_PACKET_SIZE
	.comm	_TX_CMD_A_FIRST_SEG_,4,2        ; @TX_CMD_A_FIRST_SEG_
	.comm	_TX_CMD_A_LAST_SEG_,4,2         ; @TX_CMD_A_LAST_SEG_
	.comm	_TX_DATA_FIFO,4,2               ; @TX_DATA_FIFO
	.comm	_hw,4,2                         ; @hw
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to transmit during loopback test"

	.comm	_TX_STS_ES_,4,2                 ; @TX_STS_ES_
l_.str.1:                               ; @.str.1
	.asciz	"Transmit encountered errors during loopback test"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to receive during loopback test"

	.comm	_RX_STS_ES_,4,2                 ; @RX_STS_ES_
l_.str.3:                               ; @.str.3
	.asciz	"Receive encountered errors during loopback test"

l_.str.4:                               ; @.str.4
	.asciz	"Unexpected packet size during loop back test, size=%d, will retry"

l_.str.5:                               ; @.str.5
	.asciz	"Successfully verified loopback packet"

l_.str.6:                               ; @.str.6
	.asciz	"Data mismatch during loop back test, will retry"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_smsc911x_phy_check_loopbackpkt
.subsections_via_symbols
