	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_scsi_slave_destroy         ## -- Begin function ata_scsi_slave_destroy
	.p2align	4, 0x90
_ata_scsi_slave_destroy:                ## @ata_scsi_slave_destroy
	.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
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	callq	_ata_shost_to_port
	movq	%rax, %r14
	movq	8(%rax), %rax
	cmpl	$0, (%rax)
	je	LBB0_5
## %bb.1:
	movq	(%rbx), %r15
	movl	(%r14), %edi
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	___ata_scsi_find_dev
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	cmpq	$0, 8(%rax)
	je	LBB0_4
## %bb.3:
	movq	$0, 8(%rax)
	movq	_ATA_DFLAG_DETACH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, (%rax)
	movq	%r14, %rdi
	callq	_ata_port_schedule_eh
LBB0_4:
	movl	(%r14), %edi
	callq	_spin_unlock_irqrestore
	movq	8(%r15), %rdi
	callq	_kfree
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r15)
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_DFLAG_DETACH,4,2           ## @ATA_DFLAG_DETACH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_scsi_slave_destroy         ; -- Begin function ata_scsi_slave_destroy
	.p2align	2
_ata_scsi_slave_destroy:                ; @ata_scsi_slave_destroy
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	w0, [x0, #8]
	bl	_ata_shost_to_port
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
	cbz	w8, LBB0_5
; %bb.1:
	mov	x19, x0
	ldr	x21, [x20]
	ldr	w0, [x0]
	bl	_spin_lock_irqsave
	mov	x0, x19
	mov	x1, x20
	bl	___ata_scsi_find_dev
	cbz	x0, LBB0_4
; %bb.2:
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_4
; %bb.3:
	str	xzr, [x0, #8]
Lloh0:
	adrp	x8, _ATA_DFLAG_DETACH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATA_DFLAG_DETACH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x0]
	orr	w8, w9, w8
	str	w8, [x0]
	mov	x0, x19
	bl	_ata_port_schedule_eh
LBB0_4:
	ldr	w0, [x19]
	bl	_spin_unlock_irqrestore
	ldr	x0, [x21, #8]
	bl	_kfree
	stp	xzr, xzr, [x21]
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_DFLAG_DETACH,4,2           ; @ATA_DFLAG_DETACH
.subsections_via_symbols
