	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bfin_softreset
_bfin_softreset:                        ## @bfin_softreset
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	(%rdi), %r12
	movq	_ATA_FLAG_SLAVE_POSS@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	(%r12), %r13d
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_bfin_devchk
	xorl	%ebx, %ebx
	testq	%rax, %rax
	setne	%bl
	andl	%r15d, %r13d
	je	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_bfin_devchk
	leal	2(%rbx), %ecx
	testq	%rax, %rax
	cmovel	%ebx, %ecx
	movl	%ecx, %ebx
LBB0_2:
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_bfin_dev_select
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_bfin_bus_softreset
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	_KERN_ERR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	movl	%eax, %ecx
	callq	_ata_port_printk
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_7
LBB0_4:
	movq	8(%r12), %rdi
	movl	%ebx, %esi
	andl	$1, %esi
	leaq	-44(%rbp), %rdx
	callq	_ata_sff_dev_classify
	movl	%eax, (%r14)
	testl	%r13d, %r13d
	je	LBB0_7
## %bb.5:
	cmpl	$129, -44(%rbp)
	je	LBB0_7
## %bb.6:
	movq	8(%r12), %rdi
	addq	$4, %rdi
	andl	$-2, %ebx
	leaq	-44(%rbp), %rdx
	movl	%ebx, %esi
	callq	_ata_sff_dev_classify
	movl	%eax, 4(%r14)
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_FLAG_SLAVE_POSS,4,2        ## @ATA_FLAG_SLAVE_POSS
	.comm	_KERN_ERR,4,2                   ## @KERN_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SRST failed (err_mask=0x%x)\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_bfin_softreset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bfin_softreset
_bfin_softreset:                        ; @bfin_softreset
	.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	x19, x1
	ldr	x20, [x0]
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _ATA_FLAG_SLAVE_POSS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ATA_FLAG_SLAVE_POSS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w22, w9, w8
	mov	x0, x20
	mov	w1, #0
	bl	_bfin_devchk
	cmp	x0, #0
	cset	w21, ne
	cbz	w22, LBB0_2
; %bb.1:
	mov	x0, x20
	mov	w1, #1
	bl	_bfin_devchk
	orr	w8, w21, #0x2
	cmp	x0, #0
	csel	w21, w21, w8, eq
LBB0_2:
	mov	x0, x20
	mov	w1, #0
	bl	_bfin_dev_select
	mov	x0, x20
	mov	x1, x21
	bl	_bfin_bus_softreset
	cbz	w0, LBB0_4
; %bb.3:
	mov	x3, x0
Lloh3:
	adrp	x8, _KERN_ERR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _KERN_ERR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_ata_port_printk
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_4:
	ldr	x0, [x20, #8]
	and	w1, w21, #0x1
	add	x2, sp, #12
	bl	_ata_sff_dev_classify
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19]
	cbz	w22, LBB0_7
; %bb.5:
	ldr	w8, [sp, #12]
	cmp	w8, #129
	b.eq	LBB0_7
; %bb.6:
	ldr	x8, [x20, #8]
	add	x0, x8, #4
	and	w1, w21, #0x2
	add	x2, sp, #12
	bl	_ata_sff_dev_classify
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19, #4]
LBB0_7:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_FLAG_SLAVE_POSS,4,2        ; @ATA_FLAG_SLAVE_POSS
	.comm	_KERN_ERR,4,2                   ; @KERN_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SRST failed (err_mask=0x%x)\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_bfin_softreset
.subsections_via_symbols
