	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ks8995_get_revision
_ks8995_get_revision:                   ## @ks8995_get_revision
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_KS8995_REG_ID0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_ks8995_read_reg
	testl	%eax, %eax
	je	LBB0_2
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_23
LBB0_2:
	movl	-36(%rbp), %ecx
	movq	16(%r14), %rax
	movl	(%rax), %edx
	cmpl	%edx, %ecx
	jne	LBB0_3
## %bb.4:
	cmpl	$128, %ecx
	je	LBB0_17
## %bb.5:
	cmpl	$129, %ecx
	jne	LBB0_20
## %bb.6:
	movq	_KS8995_REG_ID1@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	callq	_ks8995_read_reg
	testl	%eax, %eax
	jne	LBB0_1
## %bb.7:
	movl	-28(%rbp), %edi
	callq	_get_chip_id
	movq	_CHIPID_M@GOTPCREL(%rip), %r15
	cmpl	(%r15), %eax
	jne	LBB0_10
## %bb.8:
	movl	-28(%rbp), %edi
	callq	_get_chip_id
	movq	16(%r14), %rcx
	cmpl	4(%rcx), %eax
	je	LBB0_9
LBB0_10:
	movl	-28(%rbp), %edi
	callq	_get_chip_id
	cmpl	(%r15), %eax
	jne	LBB0_11
## %bb.15:
	movq	(%r14), %rdi
	movl	-28(%rbp), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	jmp	LBB0_21
LBB0_3:
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_22
LBB0_17:
	movq	_KS8995_REG_ID1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	callq	_ks8995_read_reg
	testl	%eax, %eax
	jne	LBB0_1
## %bb.18:
	movl	-28(%rbp), %edi
	callq	_get_chip_id
	movq	16(%r14), %rcx
	cmpl	4(%rcx), %eax
	jne	LBB0_19
LBB0_9:
	movl	-28(%rbp), %edi
	callq	_get_chip_rev
	movq	%rax, 8(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_24
LBB0_20:
	movq	(%r14), %rdi
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%ecx, %edx
LBB0_21:
	xorl	%eax, %eax
	callq	_dev_err
LBB0_22:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_23:
	subl	(%rax), %ebx
LBB0_24:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	(%r14), %rdi
	movl	-28(%rbp), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	jmp	LBB0_21
LBB0_11:
	movl	(%rbx), %esi
	leaq	-32(%rbp), %rdx
	movq	%r14, %rdi
	callq	_ks8995_read_reg
	testl	%eax, %eax
	jne	LBB0_1
## %bb.12:
	xorl	%ebx, %ebx
	testb	$-128, -32(%rbp)
	je	LBB0_24
## %bb.13:
	movq	16(%r14), %rax
	movl	4(%rax), %eax
	movq	_KSZ8864_CHIP_ID@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_24
## %bb.14:
	movl	-28(%rbp), %edi
	callq	_get_chip_rev
	movq	%rax, 8(%r14)
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_KS8995_REG_ID0,4,2             ## @KS8995_REG_ID0
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"chip family id mismatch: expected 0x%02x but 0x%02x read\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_KS8995_REG_ID1,4,2             ## @KS8995_REG_ID1
	.comm	_CHIPID_M,4,2                   ## @CHIPID_M
	.comm	_KSZ8864_CHIP_ID,4,2            ## @KSZ8864_CHIP_ID
L_.str.1:                               ## @.str.1
	.asciz	"unsupported chip id for KS8995 family: 0x%02x\n"

L_.str.2:                               ## @.str.2
	.asciz	"unsupported chip id for KSZ8795 family: 0x%02x\n"

L_.str.3:                               ## @.str.3
	.asciz	"unsupported family id: 0x%02x\n"

	.no_dead_strip	_ks8995_get_revision
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ks8995_get_revision
_ks8995_get_revision:                   ; @ks8995_get_revision
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
Lloh0:
	adrp	x8, _KS8995_REG_ID0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KS8995_REG_ID0@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #28
	bl	_ks8995_read_reg
	cbz	w0, LBB0_2
LBB0_1:
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_16
LBB0_2:
	ldr	w2, [sp, #28]
	ldr	x8, [x19, #16]
	ldr	w8, [x8]
	cmp	w2, w8
	b.ne	LBB0_10
; %bb.3:
	cmp	w2, #128
	b.eq	LBB0_11
; %bb.4:
	cmp	w2, #129
	b.ne	LBB0_14
; %bb.5:
Lloh5:
	adrp	x20, _KS8995_REG_ID1@GOTPAGE
Lloh6:
	ldr	x20, [x20, _KS8995_REG_ID1@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #24
	mov	x0, x19
	bl	_ks8995_read_reg
	cbnz	w0, LBB0_1
; %bb.6:
	ldr	w0, [sp, #24]
	bl	_get_chip_id
Lloh7:
	adrp	x21, _CHIPID_M@GOTPAGE
Lloh8:
	ldr	x21, [x21, _CHIPID_M@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_8
; %bb.7:
	ldr	w0, [sp, #24]
	bl	_get_chip_id
	ldr	x8, [x19, #16]
	ldr	w8, [x8, #4]
	cmp	w0, w8
	b.eq	LBB0_13
LBB0_8:
	ldr	w0, [sp, #24]
	bl	_get_chip_id
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_19
; %bb.9:
	ldr	x0, [x19]
	ldr	w2, [sp, #24]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_15
LBB0_10:
	ldr	x0, [x19]
	str	x2, [sp]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x8
	b	LBB0_15
LBB0_11:
Lloh13:
	adrp	x8, _KS8995_REG_ID1@GOTPAGE
Lloh14:
	ldr	x8, [x8, _KS8995_REG_ID1@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	add	x2, sp, #24
	mov	x0, x19
	bl	_ks8995_read_reg
	cbnz	w0, LBB0_1
; %bb.12:
	ldr	w0, [sp, #24]
	bl	_get_chip_id
	ldr	x8, [x19, #16]
	ldr	w8, [x8, #4]
	cmp	w0, w8
	b.ne	LBB0_18
LBB0_13:
	ldr	w0, [sp, #24]
	bl	_get_chip_rev
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19, #8]
	b	LBB0_17
LBB0_14:
	ldr	x0, [x19]
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
                                        ; kill: def $w2 killed $w2 killed $x2
LBB0_15:
	bl	_dev_err
Lloh18:
	adrp	x8, _ENODEV@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	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
	add	sp, sp, #80
	ret
LBB0_18:
	ldr	x0, [x19]
	ldr	w2, [sp, #24]
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_15
LBB0_19:
	ldr	w1, [x20]
	add	x2, sp, #20
	mov	x0, x19
	bl	_ks8995_read_reg
	cbnz	w0, LBB0_1
; %bb.20:
	ldrb	w8, [sp, #20]
	tbz	w8, #7, LBB0_22
; %bb.21:
	ldr	x8, [x19, #16]
	ldr	w8, [x8, #4]
Lloh22:
	adrp	x9, _KSZ8864_CHIP_ID@GOTPAGE
Lloh23:
	ldr	x9, [x9, _KSZ8864_CHIP_ID@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_13
LBB0_22:
	mov	w0, #0
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_KS8995_REG_ID0,4,2             ; @KS8995_REG_ID0
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"chip family id mismatch: expected 0x%02x but 0x%02x read\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_KS8995_REG_ID1,4,2             ; @KS8995_REG_ID1
	.comm	_CHIPID_M,4,2                   ; @CHIPID_M
	.comm	_KSZ8864_CHIP_ID,4,2            ; @KSZ8864_CHIP_ID
l_.str.1:                               ; @.str.1
	.asciz	"unsupported chip id for KS8995 family: 0x%02x\n"

l_.str.2:                               ; @.str.2
	.asciz	"unsupported chip id for KSZ8795 family: 0x%02x\n"

l_.str.3:                               ; @.str.3
	.asciz	"unsupported family id: 0x%02x\n"

	.no_dead_strip	_ks8995_get_revision
.subsections_via_symbols
