	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_eh_detach_dev              ## -- Begin function ata_eh_detach_dev
	.p2align	4, 0x90
_ata_eh_detach_dev:                     ## @ata_eh_detach_dev
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %r14
	movq	32(%r14), %r15
	callq	_ata_dev_disable
	movl	(%r15), %edi
	callq	_spin_lock_irqsave
	movq	_ATA_DFLAG_DETACH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 8(%rbx)
	movq	%rbx, %rdi
	callq	_ata_scsi_offline_dev
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ATA_DFLAG_DETACHED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%rbx)
	movq	_ATA_PFLAG_SCSI_HOTPLUG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%r15)
LBB0_2:
	leaq	24(%r14), %rdx
	movq	_ATA_EH_PERDEV_MASK@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ata_eh_clear_action
	leaq	16(%r14), %rdx
	movl	(%r12), %ecx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ata_eh_clear_action
	movq	8(%r14), %rax
	movq	(%rbx), %rcx
	movq	$0, (%rax,%rcx,8)
	movb	(%rbx), %cl
	movl	$-2, %eax
	roll	%cl, %eax
	andl	%eax, (%r14)
	movl	(%r15), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_DFLAG_DETACH,4,2           ## @ATA_DFLAG_DETACH
	.comm	_ATA_DFLAG_DETACHED,4,2         ## @ATA_DFLAG_DETACHED
	.comm	_ATA_PFLAG_SCSI_HOTPLUG,4,2     ## @ATA_PFLAG_SCSI_HOTPLUG
	.comm	_ATA_EH_PERDEV_MASK,4,2         ## @ATA_EH_PERDEV_MASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_eh_detach_dev              ; -- Begin function ata_eh_detach_dev
	.p2align	2
_ata_eh_detach_dev:                     ; @ata_eh_detach_dev
	.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	x19, [x0, #16]
	ldr	x21, [x19, #32]
	bl	_ata_dev_disable
	ldr	w0, [x21]
	bl	_spin_lock_irqsave
Lloh0:
	adrp	x8, _ATA_DFLAG_DETACH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATA_DFLAG_DETACH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x20, #8]
	bic	w8, w9, w8
	str	w8, [x20, #8]
	mov	x0, x20
	bl	_ata_scsi_offline_dev
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ATA_DFLAG_DETACHED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATA_DFLAG_DETACHED@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x20, #8]
	orr	w8, w9, w8
	str	w8, [x20, #8]
Lloh6:
	adrp	x8, _ATA_PFLAG_SCSI_HOTPLUG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ATA_PFLAG_SCSI_HOTPLUG@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x21, #4]
	orr	w8, w9, w8
	str	w8, [x21, #4]
LBB0_2:
	add	x2, x19, #24
Lloh9:
	adrp	x22, _ATA_EH_PERDEV_MASK@GOTPAGE
Lloh10:
	ldr	x22, [x22, _ATA_EH_PERDEV_MASK@GOTPAGEOFF]
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x20
	bl	_ata_eh_clear_action
	add	x2, x19, #16
	ldr	w3, [x22]
	mov	x0, x19
	mov	x1, x20
	bl	_ata_eh_clear_action
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	str	xzr, [x8, x9, lsl #3]
	ldr	w8, [x20]
	mov	w9, #1
	lsl	w8, w9, w8
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	ldr	w0, [x21]
	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
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_DFLAG_DETACH,4,2           ; @ATA_DFLAG_DETACH
	.comm	_ATA_DFLAG_DETACHED,4,2         ; @ATA_DFLAG_DETACHED
	.comm	_ATA_PFLAG_SCSI_HOTPLUG,4,2     ; @ATA_PFLAG_SCSI_HOTPLUG
	.comm	_ATA_EH_PERDEV_MASK,4,2         ; @ATA_EH_PERDEV_MASK
.subsections_via_symbols
