	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vsc7385_detect
_vsc7385_detect:                        ## @vsc7385_detect
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	8(%rdi), %r14
	movq	_VSC73XX_BLOCK_SYSTEM@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_VSC73XX_ICPU_MBOX_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-36(%rbp), %r8
	xorl	%edx, %edx
	callq	_vsc7385_read
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_3:
	cmpl	$-1, -36(%rbp)
	jne	LBB0_6
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_dbg
	movq	(%r15), %rax
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	callq	*%rcx
LBB0_6:
	movl	(%r12), %esi
	movq	_VSC73XX_ICPU_CHIPID@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-36(%rbp), %r8
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_vsc7385_read
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
LBB0_2:
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_11:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	-36(%rbp), %eax
	movq	_VSC73XX_ICPU_CHIPID_ID_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%eax, %edx
	sarl	%cl, %edx
	movq	_VSC73XX_ICPU_CHIPID_ID_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %edx
	movl	%edx, %ecx
	andl	$-2, %ecx
	cmpl	$128, %ecx
	jne	LBB0_9
## %bb.10:
	movq	_VSC73XX_ICPU_CHIPID_REV_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movq	_VSC73XX_ICPU_CHIPID_REV_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %ecx
	callq	_dev_info
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_9:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_VSC73XX_BLOCK_SYSTEM,4,2       ## @VSC73XX_BLOCK_SYSTEM
	.comm	_VSC73XX_ICPU_MBOX_VAL,4,2      ## @VSC73XX_ICPU_MBOX_VAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to read mailbox, err=%d\n"

L_.str.1:                               ## @.str.1
	.asciz	"assert chip reset\n"

	.comm	_VSC73XX_ICPU_CHIPID,4,2        ## @VSC73XX_ICPU_CHIPID
L_.str.2:                               ## @.str.2
	.asciz	"unable to read chip id, err=%d\n"

	.comm	_VSC73XX_ICPU_CHIPID_ID_SHIFT,4,2 ## @VSC73XX_ICPU_CHIPID_ID_SHIFT
	.comm	_VSC73XX_ICPU_CHIPID_ID_MASK,4,2 ## @VSC73XX_ICPU_CHIPID_ID_MASK
L_.str.3:                               ## @.str.3
	.asciz	"unsupported chip, id=%04x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_VSC73XX_ICPU_CHIPID_REV_SHIFT,4,2 ## @VSC73XX_ICPU_CHIPID_REV_SHIFT
	.comm	_VSC73XX_ICPU_CHIPID_REV_MASK,4,2 ## @VSC73XX_ICPU_CHIPID_REV_MASK
L_.str.4:                               ## @.str.4
	.asciz	"VSC%04X (rev. %d) switch found\n"

	.no_dead_strip	_vsc7385_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vsc7385_detect
_vsc7385_detect:                        ; @vsc7385_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x0
	ldr	x19, [x0, #8]
Lloh0:
	adrp	x22, _VSC73XX_BLOCK_SYSTEM@GOTPAGE
Lloh1:
	ldr	x22, [x22, _VSC73XX_BLOCK_SYSTEM@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x8, _VSC73XX_ICPU_MBOX_VAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VSC73XX_ICPU_MBOX_VAL@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
	add	x4, sp, #12
	mov	w2, #0
	bl	_vsc7385_read
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_2:
	ldr	w8, [sp, #12]
	cmn	w8, #1
	b.ne	LBB0_5
; %bb.3:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	ldr	x8, [x20]
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.4:
	blr	x8
LBB0_5:
	ldr	w1, [x22]
Lloh9:
	adrp	x8, _VSC73XX_ICPU_CHIPID@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VSC73XX_ICPU_CHIPID@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	add	x4, sp, #12
	mov	x0, x20
	mov	w2, #0
	bl	_vsc7385_read
	cbz	w0, LBB0_9
; %bb.6:
	mov	x21, x0
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_7:
	mov	x0, x19
	mov	x2, x21
	bl	_dev_err
LBB0_8:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_9:
	ldr	w8, [sp, #12]
Lloh14:
	adrp	x9, _VSC73XX_ICPU_CHIPID_ID_SHIFT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _VSC73XX_ICPU_CHIPID_ID_SHIFT@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	asr	w9, w8, w9
Lloh17:
	adrp	x10, _VSC73XX_ICPU_CHIPID_ID_MASK@GOTPAGE
Lloh18:
	ldr	x10, [x10, _VSC73XX_ICPU_CHIPID_ID_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	and	w2, w9, w10
	and	w9, w2, #0xfffffffe
	cmp	w9, #128
	b.ne	LBB0_11
; %bb.10:
Lloh20:
	adrp	x9, _VSC73XX_ICPU_CHIPID_REV_SHIFT@GOTPAGE
Lloh21:
	ldr	x9, [x9, _VSC73XX_ICPU_CHIPID_REV_SHIFT@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	asr	w8, w8, w9
Lloh23:
	adrp	x9, _VSC73XX_ICPU_CHIPID_REV_MASK@GOTPAGE
Lloh24:
	ldr	x9, [x9, _VSC73XX_ICPU_CHIPID_REV_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	and	w3, w8, w9
Lloh26:
	adrp	x1, l_.str.4@PAGE
Lloh27:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_dev_info
	mov	w21, #0
	b	LBB0_8
LBB0_11:
Lloh28:
	adrp	x1, l_.str.3@PAGE
Lloh29:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh30:
	adrp	x8, _ENODEV@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_VSC73XX_BLOCK_SYSTEM,4,2       ; @VSC73XX_BLOCK_SYSTEM
	.comm	_VSC73XX_ICPU_MBOX_VAL,4,2      ; @VSC73XX_ICPU_MBOX_VAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to read mailbox, err=%d\n"

l_.str.1:                               ; @.str.1
	.asciz	"assert chip reset\n"

	.comm	_VSC73XX_ICPU_CHIPID,4,2        ; @VSC73XX_ICPU_CHIPID
l_.str.2:                               ; @.str.2
	.asciz	"unable to read chip id, err=%d\n"

	.comm	_VSC73XX_ICPU_CHIPID_ID_SHIFT,4,2 ; @VSC73XX_ICPU_CHIPID_ID_SHIFT
	.comm	_VSC73XX_ICPU_CHIPID_ID_MASK,4,2 ; @VSC73XX_ICPU_CHIPID_ID_MASK
l_.str.3:                               ; @.str.3
	.asciz	"unsupported chip, id=%04x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_VSC73XX_ICPU_CHIPID_REV_SHIFT,4,2 ; @VSC73XX_ICPU_CHIPID_REV_SHIFT
	.comm	_VSC73XX_ICPU_CHIPID_REV_MASK,4,2 ; @VSC73XX_ICPU_CHIPID_REV_MASK
l_.str.4:                               ; @.str.4
	.asciz	"VSC%04X (rev. %d) switch found\n"

	.no_dead_strip	_vsc7385_detect
.subsections_via_symbols
