	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pre_reset
_pre_reset:                             ## @pre_reset
	.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
	movq	(%rdi), %rax
	movq	40(%rdi), %rcx
	movq	(%rcx), %r14
	movq	_ide_disk@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_ide_disk_pre_reset
	movl	8(%rbx), %eax
	jmp	LBB0_3
LBB0_2:
	movq	_IDE_DFLAG_POST_RESET@GOTPCREL(%rip), %rcx
	movl	8(%rbx), %eax
	orl	(%rcx), %eax
	movl	%eax, 8(%rbx)
LBB0_3:
	movq	_IDE_DFLAG_USING_DMA@GOTPCREL(%rip), %r15
	testl	%eax, (%r15)
	je	LBB0_7
## %bb.4:
	cmpq	$0, 32(%rbx)
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_ide_check_dma_crc
	jmp	LBB0_7
LBB0_6:
	movq	%rbx, %rdi
	callq	_ide_dma_off
LBB0_7:
	movl	8(%rbx), %eax
	movq	_IDE_DFLAG_KEEP_SETTINGS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.10:
	testq	%r14, %r14
	je	LBB0_13
## %bb.11:
	movq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	%rbx, %rdi
	callq	*%rax
LBB0_13:
	movl	12(%rbx), %eax
	cmpl	$255, %eax
	je	LBB0_15
## %bb.14:
	movl	%eax, 16(%rbx)
LBB0_15:
	movl	$255, 12(%rbx)
	jmp	LBB0_16
LBB0_8:
	testl	%eax, (%r15)
	jne	LBB0_16
## %bb.9:
	movq	_IDE_DFLAG_UNMASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, %eax
	movl	%eax, 8(%rbx)
	movq	$0, 24(%rbx)
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ide_disk,8,3                   ## @ide_disk
	.comm	_IDE_DFLAG_POST_RESET,4,2       ## @IDE_DFLAG_POST_RESET
	.comm	_IDE_DFLAG_USING_DMA,4,2        ## @IDE_DFLAG_USING_DMA
	.comm	_IDE_DFLAG_KEEP_SETTINGS,4,2    ## @IDE_DFLAG_KEEP_SETTINGS
	.comm	_IDE_DFLAG_UNMASK,4,2           ## @IDE_DFLAG_UNMASK
	.no_dead_strip	_pre_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pre_reset
_pre_reset:                             ; @pre_reset
	.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, #40]
	ldr	x20, [x8]
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _ide_disk@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ide_disk@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_ide_disk_pre_reset
	ldr	w8, [x19, #8]
	b	LBB0_3
LBB0_2:
Lloh3:
	adrp	x8, _IDE_DFLAG_POST_RESET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IDE_DFLAG_POST_RESET@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
	str	w8, [x19, #8]
LBB0_3:
Lloh6:
	adrp	x21, _IDE_DFLAG_USING_DMA@GOTPAGE
Lloh7:
	ldr	x21, [x21, _IDE_DFLAG_USING_DMA@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.4:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_ide_check_dma_crc
	b	LBB0_7
LBB0_6:
	mov	x0, x19
	bl	_ide_dma_off
LBB0_7:
	ldr	w8, [x19, #8]
Lloh8:
	adrp	x9, _IDE_DFLAG_KEEP_SETTINGS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IDE_DFLAG_KEEP_SETTINGS@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.8:
	cbz	x20, LBB0_11
; %bb.9:
	ldr	x8, [x20]
	cbz	x8, LBB0_11
; %bb.10:
	mov	x0, x19
	blr	x8
LBB0_11:
	ldr	w8, [x19, #12]
	cmp	w8, #255
	b.eq	LBB0_13
; %bb.12:
	str	w8, [x19, #16]
LBB0_13:
	mov	w8, #255
	str	w8, [x19, #12]
	b	LBB0_16
LBB0_14:
	ldr	w9, [x21]
	tst	w9, w8
	b.ne	LBB0_16
; %bb.15:
Lloh11:
	adrp	x9, _IDE_DFLAG_UNMASK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _IDE_DFLAG_UNMASK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	bic	w8, w8, w9
	str	w8, [x19, #8]
	str	xzr, [x19, #24]
LBB0_16:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ide_disk,8,3                   ; @ide_disk
	.comm	_IDE_DFLAG_POST_RESET,4,2       ; @IDE_DFLAG_POST_RESET
	.comm	_IDE_DFLAG_USING_DMA,4,2        ; @IDE_DFLAG_USING_DMA
	.comm	_IDE_DFLAG_KEEP_SETTINGS,4,2    ; @IDE_DFLAG_KEEP_SETTINGS
	.comm	_IDE_DFLAG_UNMASK,4,2           ; @IDE_DFLAG_UNMASK
	.no_dead_strip	_pre_reset
.subsections_via_symbols
