	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function idedisk_prepare_flush
_idedisk_prepare_flush:                 ## @idedisk_prepare_flush
	.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	%rsi, %r14
	movq	(%rdi), %r15
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kmalloc
	movq	%rax, %rbx
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_BUG_ON
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movl	8(%r15), %edi
	callq	_ata_id_flush_ext_enabled
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	cmpq	$268435455, (%r15)              ## imm = 0xFFFFFFF
	jbe	LBB0_3
## %bb.2:
	movq	_ATA_CMD_FLUSH_EXT@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_ATA_CMD_FLUSH@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_IDE_VALID_OUT_TF@GOTPCREL(%rip), %rax
	movq	_IDE_VALID_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, 16(%rbx)
	movq	_IDE_TFLAG_DYN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movq	_ATA_PROT_NODATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_REQ_TYPE_ATA_TASKFILE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movq	%rbx, (%r14)
	movq	%r14, (%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_ATA_CMD_FLUSH_EXT,4,2          ## @ATA_CMD_FLUSH_EXT
	.comm	_ATA_CMD_FLUSH,4,2              ## @ATA_CMD_FLUSH
	.comm	_IDE_VALID_OUT_TF,4,2           ## @IDE_VALID_OUT_TF
	.comm	_IDE_VALID_DEVICE,4,2           ## @IDE_VALID_DEVICE
	.comm	_IDE_TFLAG_DYN,4,2              ## @IDE_TFLAG_DYN
	.comm	_ATA_PROT_NODATA,4,2            ## @ATA_PROT_NODATA
	.comm	_REQ_TYPE_ATA_TASKFILE,4,2      ## @REQ_TYPE_ATA_TASKFILE
	.no_dead_strip	_idedisk_prepare_flush
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function idedisk_prepare_flush
_idedisk_prepare_flush:                 ; @idedisk_prepare_flush
	.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, x1
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kmalloc
	mov	x20, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_BUG_ON
	mov	x0, x20
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	ldr	w0, [x21, #8]
	bl	_ata_id_flush_ext_enabled
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x21]
	lsr	x8, x8, #28
	cbz	x8, LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _ATA_CMD_FLUSH_EXT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATA_CMD_FLUSH_EXT@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _ATA_CMD_FLUSH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ATA_CMD_FLUSH@GOTPAGEOFF]
LBB0_4:
Lloh7:
	adrp	x9, _IDE_VALID_OUT_TF@GOTPAGE
Lloh8:
	ldr	x9, [x9, _IDE_VALID_OUT_TF@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _IDE_VALID_DEVICE@GOTPAGE
Lloh11:
	ldr	x10, [x10, _IDE_VALID_DEVICE@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	orr	w9, w10, w9
	ldr	w8, [x8]
	stp	w9, w8, [x20, #16]
Lloh13:
	adrp	x8, _IDE_TFLAG_DYN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _IDE_TFLAG_DYN@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _ATA_PROT_NODATA@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ATA_PROT_NODATA@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #8]
Lloh19:
	adrp	x8, _REQ_TYPE_ATA_TASKFILE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _REQ_TYPE_ATA_TASKFILE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [x19, #8]
	str	x20, [x19]
	str	x19, [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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_ATA_CMD_FLUSH_EXT,4,2          ; @ATA_CMD_FLUSH_EXT
	.comm	_ATA_CMD_FLUSH,4,2              ; @ATA_CMD_FLUSH
	.comm	_IDE_VALID_OUT_TF,4,2           ; @IDE_VALID_OUT_TF
	.comm	_IDE_VALID_DEVICE,4,2           ; @IDE_VALID_DEVICE
	.comm	_IDE_TFLAG_DYN,4,2              ; @IDE_TFLAG_DYN
	.comm	_ATA_PROT_NODATA,4,2            ; @ATA_PROT_NODATA
	.comm	_REQ_TYPE_ATA_TASKFILE,4,2      ; @REQ_TYPE_ATA_TASKFILE
	.no_dead_strip	_idedisk_prepare_flush
.subsections_via_symbols
