	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fsl_sata_issue_recovery
_fsl_sata_issue_recovery:               ## @fsl_sata_issue_recovery
	.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	%rdi, %r12
	movq	_FSL_SATA_MAX_SLOTS@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	movq	8(%r12), %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rcx,%rbx,8)
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	cmpq	%rbx, %rax
	jne	LBB0_3
## %bb.5:
	movl	%eax, %ebx
	jmp	LBB0_6
LBB0_1:
	xorl	%ebx, %ebx
LBB0_6:
	xorl	%eax, %eax
	callq	_xpt_alloc_ccb_nowait
	testq	%rax, %rax
	je	LBB0_7
## %bb.14:
	movq	%rax, %r14
	movq	8(%r12), %rcx
	movl	%ebx, %eax
	movq	(%rcx,%rax,8), %rcx
	movups	8(%rcx), %xmm0
	movups	24(%rcx), %xmm1
	movups	%xmm0, (%r14)
	movq	40(%rcx), %rcx
	movq	%rcx, 32(%r14)
	movups	%xmm1, 16(%r14)
	movq	(%r14), %rcx
	movq	_XPT_ATA_IO@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_18
## %bb.15:
	movq	_RECOVERY_READ_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r14)
	movq	_CAM_DIR_IN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%r14)
	movl	$1000, 8(%r14)                  ## imm = 0x3E8
	movq	_M_FSL_SATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$512, %edi                      ## imm = 0x200
	callq	_malloc
	movq	%rax, 64(%r14)
	testq	%rax, %rax
	je	LBB0_16
## %bb.17:
	leaq	32(%r14), %rbx
	movl	$512, (%r14)                    ## imm = 0x200
	movq	%r14, %rdi
	addq	$8, %rdi
	movl	$56, %esi
	callq	_bzero
	movq	_CAM_ATAIO_48BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%r14)
	movabsq	$4294967343, %rax               ## imm = 0x10000002F
	movq	%rax, 8(%r14)
	movq	$0, 48(%r14)
	movl	$16, 16(%r14)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
	jmp	LBB0_19
LBB0_7:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_8
LBB0_18:
	movq	_RECOVERY_REQUEST_SENSE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r14, %rdi
	addq	$8, %rdi
	movl	%ecx, 32(%r14)
	movl	%ebx, 12(%r14)
	movq	_XPT_SCSI_IO@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%r14)
	movq	_CAM_DIR_IN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 24(%r14)
	movq	$0, 16(%r14)
	movl	$1000, 8(%r14)                  ## imm = 0x3E8
	movq	8(%r12), %rcx
	movq	(%rcx,%rax,8), %rdx
	addq	$4, %rdx
	movq	%rdx, 64(%r14)
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movl	$6, 4(%r14)
	movl	$56, %esi
	callq	_bzero
	movq	24(%r14), %rax
	movl	$3, (%rax)
	movl	(%r14), %ecx
	movl	%ecx, 16(%rax)
LBB0_19:
	movl	$1, (%r12)
	movl	4(%r12), %edi
	movl	$1, %esi
	callq	_xpt_freeze_simq
	movq	%r12, %rdi
	movq	%r14, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_fsl_sata_begin_transaction     ## TAILCALL
LBB0_16:
	movq	%r14, %rdi
	callq	_xpt_free_ccb
	leaq	L_.str.1(%rip), %rsi
LBB0_8:
	movl	16(%r12), %edi
	callq	_device_printf
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_13
## %bb.9:
	xorl	%ebx, %ebx
	movq	_CAM_STATUS_MASK@GOTPCREL(%rip), %r14
	movq	_CAM_RESRC_UNAVAIL@GOTPCREL(%rip), %r13
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_13
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rcx
	movq	(%rcx,%rbx,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	(%r14), %rax
	notq	%rax
	andq	24(%rsi), %rax
	orq	(%r13), %rax
	movq	%rax, 24(%rsi)
	movq	%r12, %rdi
	callq	_fsl_sata_done
	movq	8(%r12), %rax
	movq	$0, (%rax,%rbx,8)
	decl	20(%r12)
	movl	(%r15), %eax
	jmp	LBB0_12
LBB0_13:
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_fsl_sata_reset                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FSL_SATA_MAX_SLOTS,4,2         ## @FSL_SATA_MAX_SLOTS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to allocate recovery command\n"

	.comm	_CAM_STATUS_MASK,8,3            ## @CAM_STATUS_MASK
	.comm	_CAM_RESRC_UNAVAIL,8,3          ## @CAM_RESRC_UNAVAIL
	.comm	_XPT_ATA_IO,8,3                 ## @XPT_ATA_IO
	.comm	_RECOVERY_READ_LOG,4,2          ## @RECOVERY_READ_LOG
	.comm	_CAM_DIR_IN,8,3                 ## @CAM_DIR_IN
	.comm	_M_FSL_SATA,4,2                 ## @M_FSL_SATA
	.comm	_M_NOWAIT,4,2                   ## @M_NOWAIT
L_.str.1:                               ## @.str.1
	.asciz	"Unable to allocate memory for READ LOG command\n"

	.comm	_CAM_ATAIO_48BIT,4,2            ## @CAM_ATAIO_48BIT
	.comm	_RECOVERY_REQUEST_SENSE,4,2     ## @RECOVERY_REQUEST_SENSE
	.comm	_XPT_SCSI_IO,8,3                ## @XPT_SCSI_IO
	.no_dead_strip	_fsl_sata_issue_recovery
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function fsl_sata_issue_recovery
lCPI0_0:
	.long	6                               ; 0x6
	.long	1000                            ; 0x3e8
lCPI0_1:
	.long	47                              ; 0x2f
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_fsl_sata_issue_recovery:               ; @fsl_sata_issue_recovery
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
Lloh0:
	adrp	x21, _FSL_SATA_MAX_SLOTS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _FSL_SATA_MAX_SLOTS@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x22, #0
	ldr	x9, [x19, #8]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9, x22, lsl #3]
	cbnz	x10, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x22, x22, #1
	cmp	x8, x22
	b.ne	LBB0_2
; %bb.4:
	mov	x22, x8
LBB0_5:
	bl	_xpt_alloc_ccb_nowait
	cbz	x0, LBB0_10
LBB0_6:
	mov	x20, x0
	ldr	x8, [x19, #8]
	ldr	x8, [x8, w22, uxtw #3]
	ldur	q0, [x8, #24]
	ldr	x9, [x8, #40]
	ldur	q1, [x8, #8]
	str	x9, [x0, #32]
	stp	q1, q0, [x0]
	ldr	x8, [x0]
Lloh2:
	adrp	x9, _XPT_ATA_IO@GOTPAGE
Lloh3:
	ldr	x9, [x9, _XPT_ATA_IO@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.7:
Lloh5:
	adrp	x8, _RECOVERY_READ_LOG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RECOVERY_READ_LOG@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	mov	x22, x20
	str	w8, [x22, #32]!
Lloh8:
	adrp	x8, _CAM_DIR_IN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CAM_DIR_IN@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	stur	x8, [x22, #-8]
	mov	w8, #1000
	stur	w8, [x22, #-24]
Lloh11:
	adrp	x8, _M_FSL_SATA@GOTPAGE
Lloh12:
	ldr	x8, [x8, _M_FSL_SATA@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _M_NOWAIT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _M_NOWAIT@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	w23, #512
	mov	w0, #512
	bl	_malloc
	str	x0, [x22, #32]
	cbz	x0, LBB0_13
; %bb.8:
	str	w23, [x20]
	add	x0, x20, #8
	mov	w1, #56
	bl	_bzero
Lloh17:
	adrp	x8, _CAM_ATAIO_48BIT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CAM_ATAIO_48BIT@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x20, #56]
Lloh20:
	adrp	x8, lCPI0_1@PAGE
Lloh21:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	str	d0, [x20, #8]
	str	xzr, [x20, #48]
	mov	w8, #16
	str	w8, [x20, #16]
	stp	xzr, xzr, [x22]
	b	LBB0_12
LBB0_9:
	mov	w22, #0
	bl	_xpt_alloc_ccb_nowait
	cbnz	x0, LBB0_6
LBB0_10:
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_14
LBB0_11:
	mov	w8, w22
Lloh24:
	adrp	x9, _RECOVERY_REQUEST_SENSE@GOTPAGE
Lloh25:
	ldr	x9, [x9, _RECOVERY_REQUEST_SENSE@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	add	x0, x20, #8
	str	w9, [x20, #32]
	str	w22, [x20, #12]
Lloh27:
	adrp	x9, _XPT_SCSI_IO@GOTPAGE
Lloh28:
	ldr	x9, [x9, _XPT_SCSI_IO@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	str	x9, [x20]
Lloh30:
	adrp	x9, _CAM_DIR_IN@GOTPAGE
Lloh31:
	ldr	x9, [x9, _CAM_DIR_IN@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	stp	xzr, x9, [x20, #16]
Lloh33:
	adrp	x9, lCPI0_0@PAGE
Lloh34:
	ldr	d0, [x9, lCPI0_0@PAGEOFF]
	stur	d0, [x20, #4]
	ldr	x9, [x19, #8]
	lsl	x8, x8, #3
	ldr	x10, [x9, x8]
	add	x10, x10, #4
	str	x10, [x20, #64]
	ldr	x8, [x9, x8]
	ldr	w8, [x8]
	str	w8, [x20]
	mov	w1, #56
	bl	_bzero
	ldr	x8, [x20, #24]
	mov	w9, #3
	str	w9, [x8]
	ldr	w9, [x20]
	str	w9, [x8, #16]
LBB0_12:
	mov	w8, #1
	str	w8, [x19]
	ldr	w0, [x19, #4]
	mov	w1, #1
	bl	_xpt_freeze_simq
	mov	x0, x19
	mov	x1, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_fsl_sata_begin_transaction
LBB0_13:
	mov	x0, x20
	bl	_xpt_free_ccb
Lloh35:
	adrp	x1, l_.str.1@PAGE
Lloh36:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_14:
	ldr	w0, [x19, #16]
	bl	_device_printf
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.15:
	mov	x20, #0
Lloh37:
	adrp	x22, _CAM_STATUS_MASK@GOTPAGE
Lloh38:
	ldr	x22, [x22, _CAM_STATUS_MASK@GOTPAGEOFF]
Lloh39:
	adrp	x23, _CAM_RESRC_UNAVAIL@GOTPAGE
Lloh40:
	ldr	x23, [x23, _CAM_RESRC_UNAVAIL@GOTPAGEOFF]
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	add	x20, x20, #1
	cmp	x20, w8, sxtw
	b.ge	LBB0_19
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #8]
	ldr	x1, [x9, x20, lsl #3]
	cbz	x1, LBB0_16
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	ldr	x8, [x22]
	ldr	x9, [x1, #24]
	bic	x8, x9, x8
	ldr	x9, [x23]
	orr	x8, x9, x8
	str	x8, [x1, #24]
	mov	x0, x19
	bl	_fsl_sata_done
	ldr	x8, [x19, #8]
	str	xzr, [x8, x20, lsl #3]
	ldr	w8, [x19, #20]
	sub	w8, w8, #1
	str	w8, [x19, #20]
	ldr	w8, [x21]
	b	LBB0_16
LBB0_19:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_fsl_sata_reset
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdr	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdr	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_FSL_SATA_MAX_SLOTS,4,2         ; @FSL_SATA_MAX_SLOTS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to allocate recovery command\n"

	.comm	_CAM_STATUS_MASK,8,3            ; @CAM_STATUS_MASK
	.comm	_CAM_RESRC_UNAVAIL,8,3          ; @CAM_RESRC_UNAVAIL
	.comm	_XPT_ATA_IO,8,3                 ; @XPT_ATA_IO
	.comm	_RECOVERY_READ_LOG,4,2          ; @RECOVERY_READ_LOG
	.comm	_CAM_DIR_IN,8,3                 ; @CAM_DIR_IN
	.comm	_M_FSL_SATA,4,2                 ; @M_FSL_SATA
	.comm	_M_NOWAIT,4,2                   ; @M_NOWAIT
l_.str.1:                               ; @.str.1
	.asciz	"Unable to allocate memory for READ LOG command\n"

	.comm	_CAM_ATAIO_48BIT,4,2            ; @CAM_ATAIO_48BIT
	.comm	_RECOVERY_REQUEST_SENSE,4,2     ; @RECOVERY_REQUEST_SENSE
	.comm	_XPT_SCSI_IO,8,3                ; @XPT_SCSI_IO
	.no_dead_strip	_fsl_sata_issue_recovery
.subsections_via_symbols
