	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i596_cleanup_cmd
_i596_cleanup_cmd:                      ## @i596_cleanup_cmd
	.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	%rsi, %r15
	movq	%rdi, %r14
	movq	16(%rsi), %rbx
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.1:
	movq	_I596_NULL@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rax
	movq	%rax, 16(%r15)
	decl	8(%r15)
	movl	16(%rbx), %edi
	callq	_SWAP16
	movq	$0, 8(%rbx)
	movq	(%r12), %rax
	movq	%rax, (%rbx)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	$24, %edx
	callq	_DMA_WBACK_INV
	movq	16(%r15), %rbx
	testq	%rbx, %rbx
	jne	LBB0_2
LBB0_3:
	movq	(%r15), %rsi
	leaq	L_.str(%rip), %rcx
	movq	%r14, %rdi
	movl	$100, %edx
	callq	_wait_cmd
	movq	_I596_NULL@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r15), %rsi
	movq	%rax, (%rsi)
	movq	%r14, %rdi
	movl	$4, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DMA_WBACK                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_I596_NULL,8,3                  ## @I596_NULL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i596_cleanup_cmd timed out"

	.no_dead_strip	_i596_cleanup_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i596_cleanup_cmd
_i596_cleanup_cmd:                      ; @i596_cleanup_cmd
	.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	x20, x1
	mov	x19, x0
	ldr	x21, [x1, #16]
Lloh0:
	adrp	x22, _I596_NULL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _I596_NULL@GOTPAGEOFF]
	cbz	x21, LBB0_2
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	str	x8, [x20, #16]
	ldr	w8, [x20, #8]
	sub	w8, w8, #1
	str	w8, [x20, #8]
	ldr	w0, [x21, #16]
	bl	_SWAP16
	ldr	x8, [x22]
	stp	x8, xzr, [x21]
	mov	x0, x19
	mov	x1, x21
	mov	w2, #24
	bl	_DMA_WBACK_INV
	ldr	x21, [x20, #16]
	cbnz	x21, LBB0_1
LBB0_2:
	ldr	x1, [x20]
Lloh2:
	adrp	x3, l_.str@PAGE
Lloh3:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	mov	w2, #100
	bl	_wait_cmd
	ldr	x8, [x22]
	ldr	x1, [x20]
	str	x8, [x1]
	mov	x0, x19
	mov	w2, #4
	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	_DMA_WBACK
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_I596_NULL,8,3                  ; @I596_NULL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i596_cleanup_cmd timed out"

	.no_dead_strip	_i596_cleanup_cmd
.subsections_via_symbols
