	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r300_emit_packet0
_r300_emit_packet0:                     ## @r300_emit_packet0
	.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	%rdx, %r13
	testl	%r13d, %r13d
	je	LBB0_1
## %bb.2:
	movl	%ecx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	leal	(,%r13,4), %r12d
	movl	(%rsi), %edi
	callq	_drm_buffer_unprocessed
	cmpl	%eax, %r12d
	jg	LBB0_3
## %bb.4:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rbx
	shrq	$24, %rbx
	andl	$-256, %ebx
	orl	%r15d, %ebx
	addl	%ebx, %r12d
	cmpl	$65536, %r12d                   ## imm = 0x10000
	jl	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	callq	_DRM_ERROR
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_1:
	xorl	%ebx, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	%ebx, %edi
	movl	%r13d, %esi
	callq	_r300_check_range
	testq	%rax, %rax
	je	LBB0_7
## %bb.9:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%r13, %rdx
	movl	%r15d, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_r300_emit_carefully_checked_packet0 ## TAILCALL
LBB0_7:
	leal	1(%r13), %edi
	callq	_BEGIN_RING
	leal	-1(%r13), %esi
	movl	%ebx, %edi
	callq	_CP_PACKET0
	movl	%eax, %edi
	callq	_OUT_RING
	movl	(%r14), %edi
	movl	%r13d, %esi
	callq	_OUT_RING_DRM_BUFFER
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_ADVANCE_RING
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_RING_LOCALS,4,2                ## @RING_LOCALS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No such registers in hardware reg=%04x sz=%d\n"

	.no_dead_strip	_r300_emit_packet0
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r300_emit_packet0
_r300_emit_packet0:                     ; @r300_emit_packet0
	.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
	mov	x19, x2
	cbz	w19, LBB0_8
; %bb.1:
	mov	x21, x3
	mov	x20, x1
	mov	x22, x0
	lsl	w24, w19, #2
	ldr	w0, [x1]
	bl	_drm_buffer_unprocessed
	cmp	w24, w0
	b.gt	LBB0_4
; %bb.2:
	lsr	x8, x19, #24
	and	w8, w8, #0xffffff00
	orr	w23, w8, w21
	add	w8, w23, w24
	cmp	w8, #16, lsl #12                ; =65536
	b.lt	LBB0_5
; %bb.3:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	mov	x2, x19
	bl	_DRM_ERROR
LBB0_4:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_5:
	mov	x0, x23
	mov	x1, x19
	bl	_r300_check_range
	cbz	x0, LBB0_7
; %bb.6:
	and	x3, x21, #0xffffffff
	mov	x0, x22
	mov	x1, x20
	mov	x2, x19
	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
	b	_r300_emit_carefully_checked_packet0
LBB0_7:
	add	w0, w19, #1
	bl	_BEGIN_RING
	sub	w1, w19, #1
	mov	x0, x23
	bl	_CP_PACKET0
	bl	_OUT_RING
	ldr	w0, [x20]
	mov	x1, x19
	bl	_OUT_RING_DRM_BUFFER
	bl	_ADVANCE_RING
LBB0_8:
	mov	w0, #0
LBB0_9:
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_RING_LOCALS,4,2                ; @RING_LOCALS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No such registers in hardware reg=%04x sz=%d\n"

	.no_dead_strip	_r300_emit_packet0
.subsections_via_symbols
