	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lan9303_check_device
_lan9303_check_device:                  ## @lan9303_check_device
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	8(%rdi), %edi
	movq	_LAN9303_CHIP_REV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	callq	_lan9303_read
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	cmpl	$0, 4(%r14)
	jne	LBB0_10
## %bb.2:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	jmp	LBB0_10
LBB0_3:
	movswl	-18(%rbp), %edx
	movq	_LAN9303_CHIP_ID@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_4
## %bb.5:
	movq	%r14, %rdi
	callq	_lan9303_disable_processing
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
LBB0_7:
	movl	(%r14), %edi
	movzwl	-20(%rbp), %edx
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_info
	movq	%r14, %rdi
	callq	_lan9303_detect_phy_setup
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.5(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_10
LBB0_4:
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_8:
	xorl	%ebx, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LAN9303_CHIP_REV,4,2           ## @LAN9303_CHIP_REV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read chip revision register: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"hint: maybe failed due to missing reset GPIO\n"

	.comm	_LAN9303_CHIP_ID,4,2            ## @LAN9303_CHIP_ID
L_.str.2:                               ## @.str.2
	.asciz	"expecting LAN9303 chip, but found: %X\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.3:                               ## @.str.3
	.asciz	"failed to disable switching %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"Found LAN9303 rev. %u\n"

L_.str.5:                               ## @.str.5
	.asciz	"failed to discover phy bootstrap setup: %d\n"

	.no_dead_strip	_lan9303_check_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lan9303_check_device
_lan9303_check_device:                  ; @lan9303_check_device
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	w0, [x0, #8]
Lloh0:
	adrp	x8, _LAN9303_CHIP_REV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LAN9303_CHIP_REV@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_lan9303_read
	cbz	w0, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	w0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
	ldr	w8, [x19, #4]
	cbnz	w8, LBB0_9
; %bb.2:
	ldr	w0, [x19]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	b	LBB0_9
LBB0_3:
	ldrsh	w2, [sp, #14]
Lloh7:
	adrp	x8, _LAN9303_CHIP_ID@GOTPAGE
Lloh8:
	ldr	x8, [x8, _LAN9303_CHIP_ID@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w2, w8
	b.ne	LBB0_8
; %bb.4:
	mov	x0, x19
	bl	_lan9303_disable_processing
	cbz	w0, LBB0_6
; %bb.5:
	mov	x2, x0
	ldr	w0, [x19]
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_warn
LBB0_6:
	ldr	w0, [x19]
	ldrh	w2, [sp, #12]
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_info
	mov	x0, x19
	bl	_lan9303_detect_phy_setup
	mov	x20, x0
	cbz	w0, LBB0_9
; %bb.7:
	ldr	w0, [x19]
Lloh14:
	adrp	x1, l_.str.5@PAGE
Lloh15:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x2, x20
	bl	_dev_err
	b	LBB0_9
LBB0_8:
	ldr	w0, [x19]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh18:
	adrp	x8, _ENODEV@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_LAN9303_CHIP_REV,4,2           ; @LAN9303_CHIP_REV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read chip revision register: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"hint: maybe failed due to missing reset GPIO\n"

	.comm	_LAN9303_CHIP_ID,4,2            ; @LAN9303_CHIP_ID
l_.str.2:                               ; @.str.2
	.asciz	"expecting LAN9303 chip, but found: %X\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.3:                               ; @.str.3
	.asciz	"failed to disable switching %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"Found LAN9303 rev. %u\n"

l_.str.5:                               ; @.str.5
	.asciz	"failed to discover phy bootstrap setup: %d\n"

	.no_dead_strip	_lan9303_check_device
.subsections_via_symbols
