	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_cp_vertex2
_radeon_cp_vertex2:                     ## @radeon_cp_vertex2
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r13
	movq	(%rdi), %r12
	movq	8(%rdi), %r15
	movq	(%rdx), %rax
	movq	(%rax), %rbx
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rsi
	callq	_LOCK_TEST_WITH_RETURN
	movq	(%rbx), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_DRM_CURRENTPID@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	(%r13), %rdx
	movq	16(%r13), %rcx
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movq	(%r13), %rsi
	movq	(%r12), %rdx
	cmpq	%rdx, %rsi
	jae	LBB0_3
## %bb.1:
	movq	%r15, %rdi
	callq	_RING_SPACE_TEST_WITH_RETURN
	movq	%r15, %rdi
	callq	_VB_AGE_TEST_WITH_RETURN
	movq	8(%r12), %rax
	movq	(%r13), %rsi
	movq	(%rax,%rsi,8), %rdi
	movq	8(%rdi), %rdx
	cmpq	%r14, %rdx
	je	LBB0_7
## %bb.2:
	movl	(%rbx), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_4
LBB0_3:
	decq	%rdx
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_5:
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r15, -136(%rbp)                ## 8-byte Spill
	cmpq	$0, (%rdi)
	je	LBB0_9
## %bb.8:
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_4
LBB0_9:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movq	_RADEON_NR_SAREA_CLIPRECTS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_11
## %bb.10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_5
LBB0_11:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	cmpl	$0, 8(%r13)
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	jle	LBB0_24
## %bb.12:
	movb	$-1, -41(%rbp)                  ## 1-byte Folded Spill
	xorl	%ebx, %ebx
	leaq	-160(%rbp), %r14
	xorl	%r12d, %r12d
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_14 Depth=1
	incq	%r12
	movslq	8(%r13), %rax
	addq	$4, %rbx
	cmpq	%rax, %r12
	jge	LBB0_24
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r13), %rsi
	addq	%rbx, %rsi
	leaq	-128(%rbp), %rdi
	movl	$24, %edx
	callq	_DRM_COPY_FROM_USER
	testq	%rax, %rax
	jne	LBB0_28
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movzbl	-128(%rbp), %esi
	cmpb	-41(%rbp), %sil                 ## 1-byte Folded Reload
	je	LBB0_19
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	shlq	$2, %rsi
	addq	24(%r13), %rsi
	movq	%r14, %r15
	movq	%r14, %rdi
	movl	$24, %edx
	callq	_DRM_COPY_FROM_USER
	testq	%rax, %rax
	jne	LBB0_28
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	-136(%rbp), %rdi                ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_radeon_emit_state2
	testq	%rax, %rax
	jne	LBB0_29
## %bb.18:                              ##   in Loop: Header=BB0_14 Depth=1
	movzbl	-128(%rbp), %eax
	movb	%al, -41(%rbp)                  ## 1-byte Spill
	movq	-72(%rbp), %r15                 ## 8-byte Reload
LBB0_19:                                ##   in Loop: Header=BB0_14 Depth=1
	movl	-108(%rbp), %eax
	movl	%eax, -84(%rbp)
	movl	-124(%rbp), %ecx
	movl	-120(%rbp), %eax
	movl	%ecx, -104(%rbp)
	movq	-116(%rbp), %rdx
	movq	%rdx, -92(%rbp)
	movq	_RADEON_PRIM_WALK_IND@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_14 Depth=1
	shll	$6, %eax
	movl	%eax, -100(%rbp)
	movq	_RADEON_MAX_VB_VERTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	movq	%r15, %rdi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	leaq	-104(%rbp), %rcx
	callq	_radeon_cp_dispatch_indices
	jmp	LBB0_22
LBB0_21:                                ##   in Loop: Header=BB0_14 Depth=1
	movl	%eax, -96(%rbp)
	movl	$0, -100(%rbp)
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	leaq	-104(%rbp), %rcx
	callq	_radeon_cp_dispatch_vertex
LBB0_22:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	cmpl	$1, (%rax)
	jne	LBB0_13
## %bb.23:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	$0, (%rax)
	jmp	LBB0_13
LBB0_24:
	cmpq	$0, 16(%r13)
	je	LBB0_26
## %bb.25:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	movq	%r15, %rdi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_radeon_cp_discard_buffer
LBB0_26:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_COMMIT_RING
	jmp	LBB0_6
LBB0_28:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_30
LBB0_29:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_30:
	movl	(%rax), %ebx
	negl	%ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pid=%d index=%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
L_.str.2:                               ## @.str.2
	.asciz	"process %d using buffer owned by %p\n"

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

	.comm	_RADEON_NR_SAREA_CLIPRECTS,4,2  ## @RADEON_NR_SAREA_CLIPRECTS
	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.4:                               ## @.str.4
	.asciz	"radeon_emit_state2 failed\n"

	.comm	_RADEON_PRIM_WALK_IND,4,2       ## @RADEON_PRIM_WALK_IND
	.comm	_RADEON_MAX_VB_VERTS,4,2        ## @RADEON_MAX_VB_VERTS
	.no_dead_strip	_radeon_cp_vertex2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_cp_vertex2
_radeon_cp_vertex2:                     ; @radeon_cp_vertex2
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x28, x27, [sp, #96]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x2]
	ldr	x24, [x8]
	ldp	x23, x22, [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]
	ldr	x3, [x21, #16]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	ldr	x8, [x21]
	ldr	x9, [x23]
	cmp	x8, x9
	b.hs	LBB0_3
; %bb.1:
	mov	x0, x22
	bl	_RING_SPACE_TEST_WITH_RETURN
	mov	x0, x22
	bl	_VB_AGE_TEST_WITH_RETURN
	ldr	x9, [x23, #8]
	ldr	x8, [x21]
	ldr	x23, [x9, x8, lsl #3]
	ldr	x9, [x23, #8]
	cmp	x9, x20
	b.eq	LBB0_8
; %bb.2:
	ldr	w8, [x25]
	stp	x8, x9, [sp]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_3:
	sub	x9, x9, #1
	stp	x8, x9, [sp]
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_4:
	bl	_DRM_ERROR
LBB0_5:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
LBB0_8:
	ldr	x9, [x23]
	cbz	x9, LBB0_10
; %bb.9:
	str	x8, [sp]
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_4
LBB0_10:
	ldr	w8, [x24]
Lloh12:
	adrp	x9, _RADEON_NR_SAREA_CLIPRECTS@GOTPAGE
Lloh13:
	ldr	x9, [x9, _RADEON_NR_SAREA_CLIPRECTS@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w9
	b.gt	LBB0_5
; %bb.11:
	ldr	w8, [x21, #8]
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.12:
	mov	x25, #0
	mov	x26, #0
	mov	w27, #255
Lloh15:
	adrp	x28, _RADEON_PRIM_WALK_IND@GOTPAGE
Lloh16:
	ldr	x28, [x28, _RADEON_PRIM_WALK_IND@GOTPAGEOFF]
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x26, x26, #1
	ldrsw	x8, [x21, #8]
	add	x25, x25, #4
	cmp	x26, x8
	b.ge	LBB0_24
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #32]
	add	x1, x8, x25
	add	x0, sp, #72
	mov	w2, #24
	bl	_DRM_COPY_FROM_USER
	cbnz	x0, LBB0_27
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldrb	w8, [sp, #72]
	cmp	w8, w27
	b.eq	LBB0_19
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x9, [x21, #24]
	add	x1, x9, x8, lsl #2
	add	x0, sp, #24
	mov	w2, #24
	bl	_DRM_COPY_FROM_USER
	cbnz	x0, LBB0_27
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	add	x2, sp, #24
	mov	x0, x22
	mov	x1, x20
	bl	_radeon_emit_state2
	cbnz	x0, LBB0_28
; %bb.18:                               ;   in Loop: Header=BB0_14 Depth=1
	ldrb	w27, [sp, #72]
LBB0_19:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [sp, #92]
	str	w8, [sp, #68]
	ldp	w9, w8, [sp, #76]
	str	w9, [sp, #48]
	ldur	d0, [sp, #84]
	stur	d0, [sp, #60]
	ldr	w10, [x28]
	tst	w10, w9
	b.eq	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_14 Depth=1
	lsl	w8, w8, #6
Lloh17:
	adrp	x9, _RADEON_MAX_VB_VERTS@GOTPAGE
Lloh18:
	ldr	x9, [x9, _RADEON_MAX_VB_VERTS@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #52]
	ldr	x1, [x20]
	add	x3, sp, #48
	mov	x0, x19
	mov	x2, x23
	bl	_radeon_cp_dispatch_indices
	b	LBB0_22
LBB0_21:                                ;   in Loop: Header=BB0_14 Depth=1
	stp	wzr, w8, [sp, #52]
	add	x3, sp, #48
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	bl	_radeon_cp_dispatch_vertex
LBB0_22:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x24]
	cmp	w8, #1
	b.ne	LBB0_13
; %bb.23:                               ;   in Loop: Header=BB0_14 Depth=1
	str	wzr, [x24]
	b	LBB0_13
LBB0_24:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_26
; %bb.25:
	ldr	x1, [x20]
	mov	x0, x19
	mov	x2, x23
	bl	_radeon_cp_discard_buffer
LBB0_26:
	bl	_COMMIT_RING
	mov	w0, #0
	b	LBB0_7
LBB0_27:
Lloh20:
	adrp	x8, _EFAULT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_6
LBB0_28:
Lloh22:
	adrp	x0, l_.str.4@PAGE
Lloh23:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_4
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pid=%d index=%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
l_.str.2:                               ; @.str.2
	.asciz	"process %d using buffer owned by %p\n"

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

	.comm	_RADEON_NR_SAREA_CLIPRECTS,4,2  ; @RADEON_NR_SAREA_CLIPRECTS
	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.4:                               ; @.str.4
	.asciz	"radeon_emit_state2 failed\n"

	.comm	_RADEON_PRIM_WALK_IND,4,2       ; @RADEON_PRIM_WALK_IND
	.comm	_RADEON_MAX_VB_VERTS,4,2        ; @RADEON_MAX_VB_VERTS
	.no_dead_strip	_radeon_cp_vertex2
.subsections_via_symbols
