	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ata_scsi_remove_dev
_ata_scsi_remove_dev:                   ## @ata_scsi_remove_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	(%rax), %r15
	movq	(%r15), %rdi
	callq	_mutex_lock
	movl	8(%r15), %edi
	callq	_spin_lock_irqsave
	movq	(%r14), %rbx
	movq	$0, (%r14)
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.1:
	movq	%rbx, %rdi
	callq	_scsi_device_get
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movl	$1, %edi
	callq	_WARN_ON
LBB0_4:
	xorl	%ebx, %ebx
	jmp	LBB0_5
LBB0_2:
	movq	_SDEV_OFFLINE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_scsi_device_set_state
LBB0_5:
	movl	8(%r15), %edi
	callq	_spin_unlock_irqrestore
	movq	(%r15), %rdi
	callq	_mutex_unlock
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.7:
	movq	_KERN_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%rbx, %rdi
	callq	_dev_name
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %ecx
	callq	_ata_dev_printk
	movq	%rbx, %rdi
	callq	_scsi_remove_device
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_scsi_device_put                ## TAILCALL
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDEV_OFFLINE,4,2               ## @SDEV_OFFLINE
	.comm	_KERN_INFO,4,2                  ## @KERN_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"detaching (SCSI %s)\n"

	.no_dead_strip	_ata_scsi_remove_dev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ata_scsi_remove_dev
_ata_scsi_remove_dev:                   ; @ata_scsi_remove_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	x19, x0
	ldr	x8, [x0, #8]
	ldr	x21, [x8]
	ldr	x0, [x21]
	bl	_mutex_lock
	ldr	w0, [x21, #8]
	bl	_spin_lock_irqsave
	ldr	x20, [x19]
	str	xzr, [x19]
	cbz	x20, LBB0_4
; %bb.1:
	mov	x0, x20
	bl	_scsi_device_get
	cbz	x0, LBB0_3
; %bb.2:
	mov	w0, #1
	bl	_WARN_ON
	mov	x20, #0
	b	LBB0_4
LBB0_3:
Lloh0:
	adrp	x8, _SDEV_OFFLINE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SDEV_OFFLINE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_scsi_device_set_state
LBB0_4:
	ldr	w0, [x21, #8]
	bl	_spin_unlock_irqrestore
	ldr	x0, [x21]
	bl	_mutex_unlock
	cbz	x20, LBB0_6
; %bb.5:
Lloh3:
	adrp	x8, _KERN_INFO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _KERN_INFO@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	mov	x0, x20
	bl	_dev_name
	mov	x3, x0
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x1, x21
	bl	_ata_dev_printk
	mov	x0, x20
	bl	_scsi_remove_device
	mov	x0, x20
	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	_scsi_device_put
LBB0_6:
	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
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SDEV_OFFLINE,4,2               ; @SDEV_OFFLINE
	.comm	_KERN_INFO,4,2                  ; @KERN_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"detaching (SCSI %s)\n"

	.no_dead_strip	_ata_scsi_remove_dev
.subsections_via_symbols
