	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_cmdbuf_wait
_via_cmdbuf_wait:                       ## @via_cmdbuf_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	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	24(%rdi), %r14
	movq	8(%rdi), %r12
	movq	16(%rdi), %r15
	movl	%esi, %eax
	leaq	(%rax,%r15), %rcx
	addq	$524288, %rcx                   ## imm = 0x80000
	addq	(%rdi), %r14
	movq	$-1000001, %r13                 ## imm = 0xFFF0BDBF
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rbx
	subq	%r14, %rbx
	incq	%r13
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpq	%rbx, %r15
	jge	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpq	%rbx, %rcx
	jl	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$1, %edi
	callq	_msleep
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	cmpq	%rbx, %r15
	jge	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpq	%rbx, %rcx
	jge	LBB0_1
	jmp	LBB0_8
LBB0_2:
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_DRM_ERROR
	movl	$-1, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"via_cmdbuf_wait timed out hw %x cur_addr %x next_addr %x\n"

	.no_dead_strip	_via_cmdbuf_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_cmdbuf_wait
_via_cmdbuf_wait:                       ; @via_cmdbuf_wait
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	ldp	x8, x22, [x0]
	ldp	x19, x9, [x0, #16]
	add	x10, x19, w1, uxtw
	add	x20, x10, #128, lsl #12         ; =524288
	add	x23, x9, x8
	mov	x24, #-16961
	movk	x24, #65520, lsl #16
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	cmp	x19, x21
	ccmp	x20, x21, #8, lt
	b.lt	LBB0_5
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	sub	x21, x8, x23
	adds	x24, x24, #1
	b.hs	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	x19, x21
	ccmp	x20, x21, #8, lt
	b.lt	LBB0_1
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #1
	bl	_msleep
	b	LBB0_1
LBB0_5:
	mov	w0, #0
	b	LBB0_7
LBB0_6:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x19
	mov	x3, x20
	bl	_DRM_ERROR
	mov	w0, #-1
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"via_cmdbuf_wait timed out hw %x cur_addr %x next_addr %x\n"

	.no_dead_strip	_via_cmdbuf_wait
.subsections_via_symbols
