	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vt6420_prereset
_vt6420_prereset:                       ## @vt6420_prereset
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rcx
	movq	_ATA_PFLAG_LOADING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.1:
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	_jiffies@GOTPCREL(%rip), %r15
	movslq	(%r15), %rax
	movq	_HZ@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	leaq	(%rcx,%rcx,4), %r12
	addq	%rax, %r12
	movq	_SCR_CONTROL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movl	$768, %edx                      ## imm = 0x300
	callq	_svia_scr_write
	movl	(%r14), %esi
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_svia_scr_read
	movq	_SCR_STATUS@GOTPCREL(%rip), %r14
	leaq	-44(%rbp), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdi
	movl	$200, %esi
	callq	_ata_msleep
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movq	%r13, %rdx
	callq	_svia_scr_read
	movl	-44(%rbp), %eax
	andl	$15, %eax
	cmpl	$1, %eax
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15), %edi
	movq	%r12, %rsi
	callq	_time_before
	testq	%rax, %rax
	jne	LBB0_2
LBB0_4:
	movl	(%r14), %esi
	leaq	-44(%rbp), %r12
	movq	%rbx, %rdi
	movq	%r12, %rdx
	callq	_svia_scr_read
	movq	_SCR_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_svia_scr_read
	movl	-44(%rbp), %r8d
	movl	%r8d, %r15d
	andl	$15, %r15d
	cmpl	$3, %r15d
	movq	_KERN_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rcx
	cmoveq	%rax, %rcx
	movl	-48(%rbp), %r9d
	leaq	L_.str(%rip), %rdx
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_ata_port_printk
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	callq	_svia_scr_read
	cmpl	$3, %r15d
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	jne	LBB0_5
LBB0_6:
	movq	%rbx, %rdi
	callq	_ata_sff_wait_ready
	jmp	LBB0_7
LBB0_5:
	movq	_ATA_EH_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 4(%r13)
LBB0_7:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,4,2                    ## @jiffies
	.comm	_HZ,4,2                         ## @HZ
	.comm	_ATA_PFLAG_LOADING,4,2          ## @ATA_PFLAG_LOADING
	.comm	_SCR_CONTROL,4,2                ## @SCR_CONTROL
	.comm	_SCR_STATUS,4,2                 ## @SCR_STATUS
	.comm	_KERN_INFO,4,2                  ## @KERN_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SATA link %s 1.5 Gbps (SStatus %X SControl %X)\n"

L_.str.1:                               ## @.str.1
	.asciz	"up"

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

	.comm	_ATA_EH_RESET,4,2               ## @ATA_EH_RESET
	.no_dead_strip	_vt6420_prereset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vt6420_prereset
_vt6420_prereset:                       ; @vt6420_prereset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x21, x0
	ldr	x19, [x0]
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _ATA_PFLAG_LOADING@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ATA_PFLAG_LOADING@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.1:
Lloh3:
	adrp	x25, _jiffies@GOTPAGE
Lloh4:
	ldr	x25, [x25, _jiffies@GOTPAGEOFF]
	ldrsw	x8, [x25]
Lloh5:
	adrp	x9, _HZ@GOTPAGE
Lloh6:
	ldr	x9, [x9, _HZ@GOTPAGEOFF]
Lloh7:
	ldrsw	x9, [x9]
	add	x9, x9, x9, lsl #2
	add	x22, x9, x8
Lloh8:
	adrp	x24, _SCR_CONTROL@GOTPAGE
Lloh9:
	ldr	x24, [x24, _SCR_CONTROL@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x21
	mov	w2, #768
	bl	_svia_scr_write
	ldr	w1, [x24]
	add	x2, sp, #8
	mov	x0, x21
	bl	_svia_scr_read
Lloh10:
	adrp	x23, _SCR_STATUS@GOTPAGE
Lloh11:
	ldr	x23, [x23, _SCR_STATUS@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21]
	mov	w1, #200
	bl	_ata_msleep
	ldr	w1, [x23]
	add	x2, sp, #12
	mov	x0, x21
	bl	_svia_scr_read
	ldr	w8, [sp, #12]
	and	w8, w8, #0xf
	cmp	w8, #1
	b.ne	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x25]
	mov	x1, x22
	bl	_time_before
	cbnz	x0, LBB0_2
LBB0_4:
	ldr	w1, [x23]
	add	x2, sp, #12
	mov	x0, x21
	bl	_svia_scr_read
	ldr	w1, [x24]
	add	x2, sp, #8
	mov	x0, x21
	bl	_svia_scr_read
	ldp	w5, w4, [sp, #8]
	and	w22, w4, #0xf
Lloh12:
	adrp	x8, _KERN_INFO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _KERN_INFO@GOTPAGEOFF]
Lloh14:
	adrp	x9, l_.str.2@PAGE
Lloh15:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x8, l_.str.1@PAGE
Lloh18:
	add	x8, x8, l_.str.1@PAGEOFF
	cmp	w22, #3
	csel	x3, x8, x9, eq
Lloh19:
	adrp	x2, l_.str@PAGE
Lloh20:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ata_port_printk
	ldr	w1, [x23]
	add	x2, sp, #12
	mov	x0, x21
	bl	_svia_scr_read
	cmp	w22, #3
	b.ne	LBB0_6
LBB0_5:
	mov	x0, x21
	mov	x1, x20
	bl	_ata_sff_wait_ready
	b	LBB0_7
LBB0_6:
Lloh21:
	adrp	x8, _ATA_EH_RESET@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ATA_EH_RESET@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	bic	w8, w9, w8
	str	w8, [x19, #4]
LBB0_7:
	mov	w0, #0
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh16
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,4,2                    ; @jiffies
	.comm	_HZ,4,2                         ; @HZ
	.comm	_ATA_PFLAG_LOADING,4,2          ; @ATA_PFLAG_LOADING
	.comm	_SCR_CONTROL,4,2                ; @SCR_CONTROL
	.comm	_SCR_STATUS,4,2                 ; @SCR_STATUS
	.comm	_KERN_INFO,4,2                  ; @KERN_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SATA link %s 1.5 Gbps (SStatus %X SControl %X)\n"

l_.str.1:                               ; @.str.1
	.asciz	"up"

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

	.comm	_ATA_EH_RESET,4,2               ; @ATA_EH_RESET
	.no_dead_strip	_vt6420_prereset
.subsections_via_symbols
