	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_savage_dma_wait                ## -- Begin function savage_dma_wait
	.p2align	4, 0x90
_savage_dma_wait:                       ## @savage_dma_wait
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	leaq	32(%rdi), %rax
	cmpq	%rax, 40(%rdi)
	je	LBB0_9
## %bb.1:
	movl	%esi, %r14d
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_UPDATE_EVENT_COUNTER
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movzwl	4(%rax), %eax
	jmp	LBB0_4
LBB0_3:
	movq	_SAVAGE_STATUS_WORD1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SAVAGE_READ
LBB0_4:
	movzwl	%ax, %eax
	movl	8(%rbx), %esi
	xorl	%ecx, %ecx
	cmpl	12(%rbx), %eax
	setg	%cl
	subl	%ecx, %esi
	movq	24(%rbx), %rcx
	movl	%r14d, %edx
	cmpl	%esi, (%rcx,%rdx,8)
	jbe	LBB0_6
## %bb.5:
	movl	4(%rcx,%rdx,8), %esi
	jmp	LBB0_8
LBB0_6:
	jne	LBB0_9
## %bb.7:
	movl	4(%rcx,%rdx,8), %esi
	cmpl	%eax, %esi
	jle	LBB0_9
LBB0_8:
	movq	%rbx, %rdi
	callq	*16(%rbx)
	testq	%rax, %rax
	js	LBB0_10
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_10:
	leaq	L_.str(%rip), %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_DRM_ERROR                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SAVAGE_STATUS_WORD1,4,2        ## @SAVAGE_STATUS_WORD1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wait_evnt failed!\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_savage_dma_wait                ; -- Begin function savage_dma_wait
	.p2align	2
_savage_dma_wait:                       ; @savage_dma_wait
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x0, #40]
	add	x9, x0, #32
	cmp	x8, x9
	b.eq	LBB0_9
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	bl	_UPDATE_EVENT_COUNTER
	ldr	x8, [x19]
	cbz	x8, LBB0_3
; %bb.2:
	ldrh	w0, [x8, #4]
	b	LBB0_4
LBB0_3:
Lloh0:
	adrp	x8, _SAVAGE_STATUS_WORD1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SAVAGE_STATUS_WORD1@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_SAVAGE_READ
LBB0_4:
	and	w8, w0, #0xffff
	ldp	w11, w9, [x19, #8]
	cmp	w8, w9
	cset	w12, gt
	ldr	x9, [x19, #24]
	mov	w10, w20
	lsl	x13, x10, #3
	ldr	w13, [x9, x13]
	sub	w11, w11, w12
	cmp	w13, w11
	b.ls	LBB0_6
; %bb.5:
	add	x8, x9, x10, lsl #3
	ldr	w1, [x8, #4]
	b	LBB0_8
LBB0_6:
	b.ne	LBB0_9
; %bb.7:
	add	x9, x9, x10, lsl #3
	ldr	w1, [x9, #4]
	cmp	w1, w8
	b.le	LBB0_9
LBB0_8:
	ldr	x8, [x19, #16]
	mov	x0, x19
	blr	x8
	tbnz	x0, #63, LBB0_10
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_10:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_DRM_ERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_SAVAGE_STATUS_WORD1,4,2        ; @SAVAGE_STATUS_WORD1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wait_evnt failed!\n"

.subsections_via_symbols
