	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ide_disk_pre_reset
_ide_disk_pre_reset:                    ## @ide_disk_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
	movq	(%rdi), %rcx
	movq	_ATA_ID_CFS_ENABLE_2@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_IDE_SFLAG_SET_GEOMETRY@GOTPCREL(%rip), %rax
	movq	_IDE_SFLAG_RECALIBRATE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rax), %esi
	xorl	%eax, %eax
	testl	$1024, (%rcx,%rdx,4)            ## imm = 0x400
	cmovel	%esi, %eax
	movl	%eax, 8(%rdi)
	movq	$0, 16(%rdi)
	movq	_IDE_DFLAG_PARKED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	24(%rdi), %ecx
	movl	%ecx, 24(%rdi)
	movq	_IDE_DFLAG_KEEP_SETTINGS@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	jne	LBB0_3
## %bb.1:
	movq	_IDE_DFLAG_USING_DMA@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	jne	LBB0_3
## %bb.2:
	movq	$0, 32(%rdi)
LBB0_3:
	cmpq	$0, 32(%rdi)
	je	LBB0_5
## %bb.4:
	movq	_IDE_SFLAG_SET_MULTMODE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 8(%rdi)
LBB0_5:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_ID_CFS_ENABLE_2,8,3        ## @ATA_ID_CFS_ENABLE_2
	.comm	_IDE_SFLAG_SET_GEOMETRY,4,2     ## @IDE_SFLAG_SET_GEOMETRY
	.comm	_IDE_SFLAG_RECALIBRATE,4,2      ## @IDE_SFLAG_RECALIBRATE
	.comm	_IDE_DFLAG_PARKED,4,2           ## @IDE_DFLAG_PARKED
	.comm	_IDE_DFLAG_KEEP_SETTINGS,4,2    ## @IDE_DFLAG_KEEP_SETTINGS
	.comm	_IDE_DFLAG_USING_DMA,4,2        ## @IDE_DFLAG_USING_DMA
	.comm	_IDE_SFLAG_SET_MULTMODE,4,2     ## @IDE_SFLAG_SET_MULTMODE
	.no_dead_strip	_ide_disk_pre_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ide_disk_pre_reset
_ide_disk_pre_reset:                    ; @ide_disk_pre_reset
	.cfi_startproc
; %bb.0:
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _ATA_ID_CFS_ENABLE_2@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ATA_ID_CFS_ENABLE_2@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
Lloh3:
	adrp	x9, _IDE_SFLAG_SET_GEOMETRY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IDE_SFLAG_SET_GEOMETRY@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _IDE_SFLAG_RECALIBRATE@GOTPAGE
Lloh7:
	ldr	x10, [x10, _IDE_SFLAG_RECALIBRATE@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w8, #0x400
	csel	w8, w9, wzr, eq
	str	w8, [x0, #8]
	str	xzr, [x0, #16]
Lloh9:
	adrp	x9, _IDE_DFLAG_PARKED@GOTPAGE
Lloh10:
	ldr	x9, [x9, _IDE_DFLAG_PARKED@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	ldr	w10, [x0, #24]
	bic	w9, w10, w9
	str	w9, [x0, #24]
Lloh12:
	adrp	x10, _IDE_DFLAG_KEEP_SETTINGS@GOTPAGE
Lloh13:
	ldr	x10, [x10, _IDE_DFLAG_KEEP_SETTINGS@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	tst	w10, w9
	b.ne	LBB0_3
; %bb.1:
Lloh15:
	adrp	x10, _IDE_DFLAG_USING_DMA@GOTPAGE
Lloh16:
	ldr	x10, [x10, _IDE_DFLAG_USING_DMA@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	tst	w10, w9
	b.ne	LBB0_3
; %bb.2:
	str	xzr, [x0, #32]
LBB0_3:
	ldr	x9, [x0, #32]
	cbz	x9, LBB0_5
; %bb.4:
Lloh18:
	adrp	x9, _IDE_SFLAG_SET_MULTMODE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _IDE_SFLAG_SET_MULTMODE@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x0, #8]
LBB0_5:
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_ID_CFS_ENABLE_2,8,3        ; @ATA_ID_CFS_ENABLE_2
	.comm	_IDE_SFLAG_SET_GEOMETRY,4,2     ; @IDE_SFLAG_SET_GEOMETRY
	.comm	_IDE_SFLAG_RECALIBRATE,4,2      ; @IDE_SFLAG_RECALIBRATE
	.comm	_IDE_DFLAG_PARKED,4,2           ; @IDE_DFLAG_PARKED
	.comm	_IDE_DFLAG_KEEP_SETTINGS,4,2    ; @IDE_DFLAG_KEEP_SETTINGS
	.comm	_IDE_DFLAG_USING_DMA,4,2        ; @IDE_DFLAG_USING_DMA
	.comm	_IDE_SFLAG_SET_MULTMODE,4,2     ; @IDE_SFLAG_SET_MULTMODE
	.no_dead_strip	_ide_disk_pre_reset
.subsections_via_symbols
