	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_cmdbuf_size
_via_cmdbuf_size:                       ## @via_cmdbuf_size
	.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	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_LOCK_TEST_WITH_RETURN
	movq	(%rbx), %r15
	cmpq	$0, (%r15)
	je	LBB0_1
## %bb.2:
	movl	4(%r14), %eax
	cmpl	$128, %eax
	je	LBB0_8
## %bb.3:
	cmpl	$129, %eax
	jne	LBB0_15
## %bb.4:
	movl	$-1000000, %ebx                 ## imm = 0xFFF0BDC0
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_via_cmdbuf_lag
	movl	%eax, %r12d
	xorl	%eax, %eax
	cmpl	(%r14), %r12d
	jle	LBB0_17
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	incl	%ebx
	je	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$0, 8(%r14)
	jne	LBB0_5
	jmp	LBB0_17
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	movq	_EFAULT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_18
LBB0_8:
	movl	$-1000000, %ebx                 ## imm = 0xFFF0BDC0
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_via_cmdbuf_space
	movl	%eax, %r12d
	xorl	%eax, %eax
	cmpl	(%r14), %r12d
	jge	LBB0_17
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	incl	%ebx
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpl	$0, 8(%r14)
	jne	LBB0_9
	jmp	LBB0_17
LBB0_15:
	movl	(%r14), %r12d
	movq	_EFAULT@GOTPCREL(%rip), %rcx
	jmp	LBB0_16
LBB0_14:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_13
LBB0_12:
	leaq	L_.str.2(%rip), %rdi
LBB0_13:
	callq	_DRM_ERROR
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
LBB0_16:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_17:
	movl	%r12d, (%r14)
LBB0_18:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

L_.str.1:                               ## @.str.1
	.asciz	"called without initializing AGP ring buffer.\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.2:                               ## @.str.2
	.asciz	"VIA_CMDBUF_SPACE timed out.\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
L_.str.3:                               ## @.str.3
	.asciz	"VIA_CMDBUF_LAG timed out.\n"

	.no_dead_strip	_via_cmdbuf_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_cmdbuf_size
_via_cmdbuf_size:                       ; @via_cmdbuf_size
	.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, x2
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	mov	x0, x21
	mov	x1, x20
	bl	_LOCK_TEST_WITH_RETURN
	ldr	x21, [x21]
	ldr	x8, [x21]
	cbz	x8, LBB0_7
; %bb.1:
	ldr	w8, [x19, #4]
	cmp	w8, #128
	b.eq	LBB0_8
; %bb.2:
	cmp	w8, #129
	b.ne	LBB0_13
; %bb.3:
	mov	w22, #48576
	movk	w22, #65520, lsl #16
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_via_cmdbuf_lag
	mov	x20, x0
	ldr	w8, [x19]
	cmp	w0, w8
	b.le	LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	adds	w22, w22, #1
	b.hs	LBB0_14
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_4
	b	LBB0_12
LBB0_7:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
Lloh4:
	adrp	x8, _EFAULT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_19
LBB0_8:
	mov	w22, #48576
	movk	w22, #65520, lsl #16
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_via_cmdbuf_space
	mov	x20, x0
	ldr	w8, [x19]
	cmp	w0, w8
	b.ge	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	adds	w22, w22, #1
	b.hs	LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_9
LBB0_12:
	mov	w0, #0
	b	LBB0_18
LBB0_13:
	ldr	w20, [x19]
Lloh7:
	adrp	x8, _EFAULT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_17
LBB0_14:
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_16
LBB0_15:
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_16:
	bl	_DRM_ERROR
Lloh13:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_18:
	str	w20, [x19]
LBB0_19:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

l_.str.1:                               ; @.str.1
	.asciz	"called without initializing AGP ring buffer.\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.2:                               ; @.str.2
	.asciz	"VIA_CMDBUF_SPACE timed out.\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
l_.str.3:                               ; @.str.3
	.asciz	"VIA_CMDBUF_LAG timed out.\n"

	.no_dead_strip	_via_cmdbuf_size
.subsections_via_symbols
