	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ide_pci_remove                 ## -- Begin function ide_pci_remove
	.p2align	4, 0x90
_ide_pci_remove:                        ## @ide_pci_remove
	.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, %r14
	callq	_pci_get_drvdata
	movq	%rax, %r12
	movq	8(%rax), %rax
	movq	8(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	callq	_to_pci_dev
	movq	%rax, %r15
	jmp	LBB0_3
LBB0_1:
	xorl	%r15d, %r15d
LBB0_3:
	movl	(%r12), %eax
	movq	_IDE_HFLAG_SINGLE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	movl	$15, %ecx
	movl	$3, %ebx
	cmovel	%ecx, %ebx
	movq	_IDE_HFLAG_NO_DMA@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_7
## %bb.4:
	movq	_IDE_HFLAG_CS5520@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	orl	$4, %ebx
	jmp	LBB0_7
LBB0_6:
	orl	$16, %ebx
LBB0_7:
	movq	%r12, %rdi
	callq	_ide_host_remove
	testq	%r15, %r15
	je	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_pci_release_selected_regions
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_pci_release_selected_regions
	movq	%r15, %rdi
	callq	_pci_disable_device
	jmp	LBB0_10
LBB0_9:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_pci_release_selected_regions
LBB0_10:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pci_disable_device             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_IDE_HFLAG_SINGLE,4,2           ## @IDE_HFLAG_SINGLE
	.comm	_IDE_HFLAG_NO_DMA,4,2           ## @IDE_HFLAG_NO_DMA
	.comm	_IDE_HFLAG_CS5520,4,2           ## @IDE_HFLAG_CS5520
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ide_pci_remove                 ; -- Begin function ide_pci_remove
	.p2align	2
_ide_pci_remove:                        ; @ide_pci_remove
	.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
	bl	_pci_get_drvdata
	mov	x21, x0
	ldr	x8, [x0, #8]
	ldr	x0, [x8, #8]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_to_pci_dev
	mov	x20, x0
	b	LBB0_3
LBB0_2:
	mov	x20, #0
LBB0_3:
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _IDE_HFLAG_SINGLE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IDE_HFLAG_SINGLE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	mov	w9, #3
	mov	w10, #15
	csel	w22, w10, w9, eq
Lloh3:
	adrp	x9, _IDE_HFLAG_NO_DMA@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IDE_HFLAG_NO_DMA@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_5
; %bb.4:
Lloh6:
	adrp	x9, _IDE_HFLAG_CS5520@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IDE_HFLAG_CS5520@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	orr	w8, w22, #0x10
	orr	w9, w22, #0x4
	csel	w22, w8, w9, eq
LBB0_5:
	mov	x0, x21
	bl	_ide_host_remove
	cbz	x20, LBB0_7
; %bb.6:
	mov	x0, x20
	mov	x1, x22
	bl	_pci_release_selected_regions
	mov	x0, x19
	mov	x1, x22
	bl	_pci_release_selected_regions
	mov	x0, x20
	bl	_pci_disable_device
	b	LBB0_8
LBB0_7:
	mov	x0, x19
	mov	x1, x22
	bl	_pci_release_selected_regions
LBB0_8:
	mov	x0, x19
	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	_pci_disable_device
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_IDE_HFLAG_SINGLE,4,2           ; @IDE_HFLAG_SINGLE
	.comm	_IDE_HFLAG_NO_DMA,4,2           ; @IDE_HFLAG_NO_DMA
	.comm	_IDE_HFLAG_CS5520,4,2           ; @IDE_HFLAG_CS5520
.subsections_via_symbols
