	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_cp_vertex
_radeon_cp_vertex:                      ## @radeon_cp_vertex
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	(%rdi), %r12
	movq	8(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdx), %rax
	movq	(%rax), %rbx
	movq	%rdx, %rsi
	callq	_LOCK_TEST_WITH_RETURN
	movq	(%rbx), %rbx
	movq	_DRM_CURRENTPID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	24(%r13), %rcx
	movq	(%r13), %rdx
	movq	16(%r13), %r8
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movq	(%r13), %rsi
	movq	(%r12), %rdx
	cmpq	%rdx, %rsi
	jae	LBB0_1
## %bb.2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	8(%r13), %rsi
	testq	%rsi, %rsi
	js	LBB0_4
## %bb.3:
	movq	_RADEON_PRIM_TYPE_3VRT_LINE_LIST@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jg	LBB0_4
## %bb.7:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_RING_SPACE_TEST_WITH_RETURN
	movq	%rbx, %rdi
	callq	_VB_AGE_TEST_WITH_RETURN
	movq	8(%r12), %rax
	movq	(%r13), %rsi
	movq	(%rax,%rsi,8), %rbx
	movq	16(%rbx), %rdx
	cmpq	%r15, %rdx
	je	LBB0_9
## %bb.8:
	movq	_DRM_CURRENTPID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_6
LBB0_1:
	decq	%rdx
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_6
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
LBB0_5:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	cmpq	$0, 8(%rbx)
	je	LBB0_11
## %bb.10:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_5
LBB0_11:
	movq	24(%r13), %rax
	testq	%rax, %rax
	je	LBB0_17
## %bb.12:
	movq	%rax, (%rbx)
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movl	(%r12), %r8d
	movq	_RADEON_UPLOAD_CLIPRECTS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	testl	%ecx, %r8d
	je	LBB0_16
## %bb.13:
	leaq	12(%r12), %rdx
	movl	8(%r12), %ecx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_radeon_emit_state
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	leaq	L_.str.5(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_6
LBB0_15:
	movq	_RADEON_UPLOAD_TEX0IMAGES@GOTPCREL(%rip), %rax
	movq	_RADEON_UPLOAD_TEX1IMAGES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_RADEON_UPLOAD_TEX2IMAGES@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_RADEON_REQUIRE_QUIESCENCE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, (%r12)
	movq	24(%r13), %rax
LBB0_16:
	movq	$0, -64(%rbp)
	movq	%rax, -72(%rbp)
	movq	8(%r13), %rcx
	movq	%rcx, -96(%rbp)
	movq	%rax, -80(%rbp)
	movl	4(%r12), %eax
	movl	%eax, -88(%rbp)
	leaq	-96(%rbp), %rcx
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_radeon_cp_dispatch_vertex
LBB0_17:
	cmpq	$0, 16(%r13)
	je	LBB0_19
## %bb.18:
	movq	(%r15), %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_radeon_cp_discard_buffer
LBB0_19:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_COMMIT_RING
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pid=%d index=%d count=%d discard=%d\n"

	.comm	_DRM_CURRENTPID,4,2             ## @DRM_CURRENTPID
L_.str.1:                               ## @.str.1
	.asciz	"buffer index %d (of %d max)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RADEON_PRIM_TYPE_3VRT_LINE_LIST,8,3 ## @RADEON_PRIM_TYPE_3VRT_LINE_LIST
L_.str.2:                               ## @.str.2
	.asciz	"buffer prim %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"process %d using buffer owned by %p\n"

L_.str.4:                               ## @.str.4
	.asciz	"sending pending buffer %d\n"

	.comm	_RADEON_UPLOAD_CLIPRECTS,4,2    ## @RADEON_UPLOAD_CLIPRECTS
L_.str.5:                               ## @.str.5
	.asciz	"radeon_emit_state failed\n"

	.comm	_RADEON_UPLOAD_TEX0IMAGES,4,2   ## @RADEON_UPLOAD_TEX0IMAGES
	.comm	_RADEON_UPLOAD_TEX1IMAGES,4,2   ## @RADEON_UPLOAD_TEX1IMAGES
	.comm	_RADEON_UPLOAD_TEX2IMAGES,4,2   ## @RADEON_UPLOAD_TEX2IMAGES
	.comm	_RADEON_REQUIRE_QUIESCENCE,4,2  ## @RADEON_REQUIRE_QUIESCENCE
	.no_dead_strip	_radeon_cp_vertex
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_cp_vertex
_radeon_cp_vertex:                      ; @radeon_cp_vertex
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x2]
	ldr	x24, [x8]
	ldp	x22, x23, [x0]
	mov	x1, x2
	bl	_LOCK_TEST_WITH_RETURN
	ldr	x24, [x24]
Lloh0:
	adrp	x25, _DRM_CURRENTPID@GOTPAGE
Lloh1:
	ldr	x25, [x25, _DRM_CURRENTPID@GOTPAGEOFF]
	ldr	w1, [x25]
	ldr	x2, [x21]
	ldp	x4, x3, [x21, #16]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	ldr	x8, [x21]
	ldr	x9, [x22]
	cmp	x8, x9
	b.hs	LBB0_5
; %bb.1:
	ldr	x8, [x21, #8]
	tbnz	x8, #63, LBB0_6
; %bb.2:
Lloh4:
	adrp	x9, _RADEON_PRIM_TYPE_3VRT_LINE_LIST@GOTPAGE
Lloh5:
	ldr	x9, [x9, _RADEON_PRIM_TYPE_3VRT_LINE_LIST@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.gt	LBB0_6
; %bb.3:
	mov	x0, x23
	bl	_RING_SPACE_TEST_WITH_RETURN
	mov	x0, x23
	bl	_VB_AGE_TEST_WITH_RETURN
	ldr	x9, [x22, #8]
	ldr	x8, [x21]
	ldr	x22, [x9, x8, lsl #3]
	ldr	x9, [x22, #16]
	cmp	x9, x20
	b.eq	LBB0_9
; %bb.4:
	ldr	w8, [x25]
	stp	x8, x9, [sp]
Lloh7:
	adrp	x0, l_.str.3@PAGE
Lloh8:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_7
LBB0_5:
	sub	x9, x9, #1
	stp	x8, x9, [sp]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_6:
	str	x8, [sp]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_7:
	bl	_DRM_ERROR
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_9:
	ldr	x9, [x22, #8]
	cbz	x9, LBB0_11
; %bb.10:
	str	x8, [sp]
Lloh16:
	adrp	x0, l_.str.4@PAGE
Lloh17:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_7
LBB0_11:
	ldr	x8, [x21, #24]
	cbz	x8, LBB0_17
; %bb.12:
	str	x8, [x22]
	ldr	w4, [x24]
Lloh18:
	adrp	x9, _RADEON_UPLOAD_CLIPRECTS@GOTPAGE
Lloh19:
	ldr	x9, [x9, _RADEON_UPLOAD_CLIPRECTS@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	bics	wzr, w4, w9
	b.eq	LBB0_16
; %bb.13:
	add	x2, x24, #12
	ldr	w3, [x24, #8]
	mov	x0, x23
	mov	x1, x20
	bl	_radeon_emit_state
	cbz	x0, LBB0_15
; %bb.14:
Lloh21:
	adrp	x0, l_.str.5@PAGE
Lloh22:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_7
LBB0_15:
Lloh23:
	adrp	x8, _RADEON_UPLOAD_TEX0IMAGES@GOTPAGE
Lloh24:
	ldr	x8, [x8, _RADEON_UPLOAD_TEX0IMAGES@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _RADEON_UPLOAD_TEX1IMAGES@GOTPAGE
Lloh27:
	ldr	x9, [x9, _RADEON_UPLOAD_TEX1IMAGES@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh29:
	adrp	x9, _RADEON_UPLOAD_TEX2IMAGES@GOTPAGE
Lloh30:
	ldr	x9, [x9, _RADEON_UPLOAD_TEX2IMAGES@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh32:
	adrp	x9, _RADEON_REQUIRE_QUIESCENCE@GOTPAGE
Lloh33:
	ldr	x9, [x9, _RADEON_REQUIRE_QUIESCENCE@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x24]
	bic	w8, w9, w8
	str	w8, [x24]
	ldr	x8, [x21, #24]
LBB0_16:
	stp	x8, xzr, [sp, #48]
	ldr	x9, [x21, #8]
	str	x9, [sp, #24]
	str	x8, [sp, #40]
	ldr	w8, [x24, #4]
	str	w8, [sp, #32]
	add	x3, sp, #24
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_radeon_cp_dispatch_vertex
LBB0_17:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_19
; %bb.18:
	ldr	x1, [x20]
	mov	x0, x19
	mov	x2, x22
	bl	_radeon_cp_discard_buffer
LBB0_19:
	bl	_COMMIT_RING
	mov	w0, #0
	b	LBB0_8
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pid=%d index=%d count=%d discard=%d\n"

	.comm	_DRM_CURRENTPID,4,2             ; @DRM_CURRENTPID
l_.str.1:                               ; @.str.1
	.asciz	"buffer index %d (of %d max)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RADEON_PRIM_TYPE_3VRT_LINE_LIST,8,3 ; @RADEON_PRIM_TYPE_3VRT_LINE_LIST
l_.str.2:                               ; @.str.2
	.asciz	"buffer prim %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"process %d using buffer owned by %p\n"

l_.str.4:                               ; @.str.4
	.asciz	"sending pending buffer %d\n"

	.comm	_RADEON_UPLOAD_CLIPRECTS,4,2    ; @RADEON_UPLOAD_CLIPRECTS
l_.str.5:                               ; @.str.5
	.asciz	"radeon_emit_state failed\n"

	.comm	_RADEON_UPLOAD_TEX0IMAGES,4,2   ; @RADEON_UPLOAD_TEX0IMAGES
	.comm	_RADEON_UPLOAD_TEX1IMAGES,4,2   ; @RADEON_UPLOAD_TEX1IMAGES
	.comm	_RADEON_UPLOAD_TEX2IMAGES,4,2   ; @RADEON_UPLOAD_TEX2IMAGES
	.comm	_RADEON_REQUIRE_QUIESCENCE,4,2  ; @RADEON_REQUIRE_QUIESCENCE
	.no_dead_strip	_radeon_cp_vertex
.subsections_via_symbols
