	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ip17xx_get_port_status
_ip17xx_get_port_status:                ## @ip17xx_get_port_status
	.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	%rdx, %r14
	movq	%rdi, %rbx
	callq	_get_state
	movq	%rax, %r15
	movl	(%r14), %r12d
	movq	(%rax), %r13
	movq	8(%rax), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_3
## %bb.1:
	movups	L_.str(%rip), %xmm0
	movups	%xmm0, (%r13)
	movabsq	$32776920246547824, %rax        ## imm = 0x74726F70207570
	movq	%rax, 15(%r13)
LBB0_2:
	movq	%r13, 8(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_3:
	testl	%r12d, %r12d
	js	LBB0_10
## %bb.4:
	cmpl	(%rbx), %r12d
	jge	LBB0_10
## %bb.5:
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movl	%r12d, %esi
	xorl	%edx, %edx
	callq	_ip_phy_read
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	$1, %edx
	callq	_ip_phy_read
	movq	%r15, %rdi
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r12d, %esi
	movl	%eax, %r12d
	movl	$18, %edx
	callq	_ip_phy_read
	testl	%r15d, %r15d
	js	LBB0_11
## %bb.6:
	testl	%r12d, %r12d
	js	LBB0_11
## %bb.7:
	testl	%eax, %eax
	js	LBB0_11
## %bb.8:
	testb	$4, %r12b
	jne	LBB0_14
## %bb.9:
	movb	$0, 4(%r13)
	movl	$1853321060, (%r13)             ## imm = 0x6E776F64
	movl	$4, %ebx
	jmp	LBB0_15
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_11:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_12:
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	testl	$2048, %eax                     ## imm = 0x800
	movl	$10, %ecx
	movl	$100, %edx
	cmovel	%ecx, %edx
	testl	$1024, %eax                     ## imm = 0x400
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.2(%rip), %rcx
	cmoveq	%rax, %rcx
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_sprintf
	movl	%eax, %ebx
LBB0_15:
	movslq	%ebx, %rdi
	addq	%r13, %rdi
	testl	$4096, %r15d                    ## imm = 0x1000
	jne	LBB0_17
## %bb.16:
	testl	$8192, %r15d                    ## imm = 0x2000
	movl	$10, %eax
	movl	$100, %edx
	cmovel	%eax, %edx
	leaq	L_.str.7(%rip), %rsi
	xorl	%eax, %eax
	callq	_sprintf
	addl	%ebx, %eax
	jmp	LBB0_19
LBB0_17:
	movups	L_.str.5(%rip), %xmm0
	movups	%xmm0, (%rdi)
	movb	$0, 16(%rdi)
	leal	16(%rbx), %eax
	testb	$32, %r12b
	jne	LBB0_19
## %bb.18:
	cltq
	movabsq	$11667413505566575, %rcx        ## imm = 0x2973736572676F
	movq	%rcx, 7(%r13,%rax)
	movabsq	$8030604370148665376, %rcx      ## imm = 0x6F7270206E692820
	movq	%rcx, (%r13,%rax)
	addl	$30, %ebx
	movl	%ebx, %eax
LBB0_19:
	cltq
	movb	$0, (%r13,%rax)
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"up, 100 Mbps, cpu port"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"up, %d Mbps, %s duplex"

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

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

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

L_.str.5:                               ## @.str.5
	.asciz	", auto-negotiate"

L_.str.6:                               ## @.str.6
	.asciz	" (in progress)"

L_.str.7:                               ## @.str.7
	.asciz	", fixed speed (%d)"

	.no_dead_strip	_ip17xx_get_port_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ip17xx_get_port_status
_ip17xx_get_port_status:                ; @ip17xx_get_port_status
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x2
	mov	x21, x0
	bl	_get_state
	ldr	w23, [x19]
	ldp	x20, x8, [x0]
	ldr	w8, [x8]
	cmp	w23, w8
	b.ne	LBB0_3
; %bb.1:
	mov	w0, #0
Lloh0:
	adrp	x8, l_.str@PAGE
Lloh1:
	add	x8, x8, l_.str@PAGEOFF
	ldr	q0, [x8]
	ldur	x8, [x8, #15]
	stur	x8, [x20, #15]
	str	q0, [x20]
LBB0_2:
	str	x20, [x19, #8]
	b	LBB0_13
LBB0_3:
	tbnz	w23, #31, LBB0_10
; %bb.4:
	ldr	w8, [x21]
	cmp	w23, w8
	b.ge	LBB0_10
; %bb.5:
	mov	x24, x0
	mov	x1, x23
	mov	w2, #0
	bl	_ip_phy_read
	mov	x21, x0
	mov	x0, x24
	mov	x1, x23
	mov	w2, #1
	bl	_ip_phy_read
	mov	x22, x0
	mov	x0, x24
	mov	x1, x23
	mov	w2, #18
	bl	_ip_phy_read
	tbnz	w21, #31, LBB0_11
; %bb.6:
	tbnz	w22, #31, LBB0_11
; %bb.7:
	tbnz	w0, #31, LBB0_11
; %bb.8:
	tbnz	w22, #2, LBB0_14
; %bb.9:
	strb	wzr, [x20, #4]
	mov	w8, #28516
	movk	w8, #28279, lsl #16
	str	w8, [x20]
	mov	w0, #4
	b	LBB0_15
LBB0_10:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh4:
	adrp	x8, _EIO@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_14:
Lloh6:
	adrp	x8, l_.str.2@PAGE
Lloh7:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh8:
	adrp	x9, l_.str.3@PAGE
Lloh9:
	add	x9, x9, l_.str.3@PAGEOFF
	tst	w0, #0x400
	csel	x8, x9, x8, eq
	tst	w0, #0x800
	mov	w9, #100
	mov	w10, #10
	csel	x9, x10, x9, eq
	stp	x9, x8, [sp]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_sprintf
                                        ; kill: def $w0 killed $w0 def $x0
LBB0_15:
	sxtw	x23, w0
	add	x0, x20, x23
	tbnz	w21, #12, LBB0_17
; %bb.16:
	tst	w21, #0x2000
	mov	w8, #100
	mov	w9, #10
	csel	x8, x9, x8, eq
	str	x8, [sp]
Lloh12:
	adrp	x1, l_.str.7@PAGE
Lloh13:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_sprintf
	add	w8, w0, w23
	b	LBB0_19
LBB0_17:
	strb	wzr, [x0, #16]
Lloh14:
	adrp	x8, l_.str.5@PAGE
Lloh15:
	add	x8, x8, l_.str.5@PAGEOFF
Lloh16:
	ldr	q0, [x8]
	str	q0, [x0]
	add	x8, x23, #16
	tbnz	w22, #5, LBB0_19
; %bb.18:
Lloh17:
	adrp	x9, l_.str.6@PAGE
Lloh18:
	add	x9, x9, l_.str.6@PAGEOFF
	add	x8, x20, x8
	ldr	x10, [x9]
	ldur	x9, [x9, #7]
	stur	x9, [x8, #7]
	str	x10, [x8]
	add	w8, w23, #30
LBB0_19:
	mov	w0, #0
	strb	wzr, [x20, w8, sxtw]
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAddLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"up, 100 Mbps, cpu port"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"up, %d Mbps, %s duplex"

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

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

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

l_.str.5:                               ; @.str.5
	.asciz	", auto-negotiate"

l_.str.6:                               ; @.str.6
	.asciz	" (in progress)"

l_.str.7:                               ; @.str.7
	.asciz	", fixed speed (%d)"

	.no_dead_strip	_ip17xx_get_port_status
.subsections_via_symbols
