	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bist_rd
_bist_rd:                               ## @bist_rd
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	$0, -28(%rbp)
	cmpl	$14, %edx
	ja	LBB0_2
## %bb.1:
	movl	$24583, %eax                    ## imm = 0x6007
	btl	%ebx, %eax
	jae	LBB0_2
LBB0_3:
	movzbl	%bl, %eax
	shll	$16, %eax
	movzbl	%r14b, %edx
	orl	%eax, %edx
	movq	_REG_RAM_BIST_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_vsc_write
	movl	$10, %edi
	callq	_udelay
	movq	_REG_RAM_BIST_RESULT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	movq	%r15, %rdi
	callq	_vsc_read
	movl	-28(%rbp), %esi
	testl	$512, %esi                      ## imm = 0x200
	jne	LBB0_4
## %bb.5:
	testl	$256, %esi                      ## imm = 0x100
	je	LBB0_8
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_7
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
LBB0_7:
	callq	_CH_ERR
LBB0_8:
	movzbl	-28(%rbp), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_CH_ERR
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No bist address: 0x%x\n"

	.comm	_REG_RAM_BIST_CMD,4,2           ## @REG_RAM_BIST_CMD
	.comm	_REG_RAM_BIST_RESULT,4,2        ## @REG_RAM_BIST_RESULT
L_.str.1:                               ## @.str.1
	.asciz	"Still in bist read: 0x%x\n"

L_.str.2:                               ## @.str.2
	.asciz	"bist read error: 0x%x\n"

	.no_dead_strip	_bist_rd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bist_rd
_bist_rd:                               ; @bist_rd
	.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, x2
	mov	x21, x1
	mov	x19, x0
	str	wzr, [sp, #12]
	cmp	w2, #14
	b.hi	LBB0_8
; %bb.1:
	mov	w8, #1
	lsl	w8, w8, w20
	mov	w9, #24583
	tst	w8, w9
	b.eq	LBB0_8
LBB0_2:
	and	w2, w21, #0xff
	bfi	w2, w20, #16, #8
Lloh0:
	adrp	x8, _REG_RAM_BIST_CMD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_RAM_BIST_CMD@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_vsc_write
	mov	w0, #10
	bl	_udelay
Lloh3:
	adrp	x8, _REG_RAM_BIST_RESULT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REG_RAM_BIST_RESULT@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_vsc_read
	ldr	w1, [sp, #12]
	tbnz	w1, #9, LBB0_5
; %bb.3:
	tbz	w1, #8, LBB0_7
; %bb.4:
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_6:
	bl	_CH_ERR
LBB0_7:
	ldrb	w0, [sp, #12]
	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_8:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_CH_ERR
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No bist address: 0x%x\n"

	.comm	_REG_RAM_BIST_CMD,4,2           ; @REG_RAM_BIST_CMD
	.comm	_REG_RAM_BIST_RESULT,4,2        ; @REG_RAM_BIST_RESULT
l_.str.1:                               ; @.str.1
	.asciz	"Still in bist read: 0x%x\n"

l_.str.2:                               ; @.str.2
	.asciz	"bist read error: 0x%x\n"

	.no_dead_strip	_bist_rd
.subsections_via_symbols
