	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r300_emit_draw_indx_2
_r300_emit_draw_indx_2:                 ## @r300_emit_draw_indx_2
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r13
	movl	(%rsi), %edi
	xorl	%esi, %esi
	callq	_drm_buffer_pointer_to_dword
	movq	%rax, %rbx
	movl	(%r14), %edi
	movl	$1, %esi
	callq	_drm_buffer_pointer_to_dword
	movq	_RADEON_CP_PACKET_COUNT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	andl	(%rbx), %r15d
	movl	(%rax), %eax
	movl	%eax, %r12d
	sarl	$16, %r12d
	movq	_R300_VAP_VF_CNTL__INDEX_SIZE_32bit@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_2
## %bb.1:
	movl	%r12d, %eax
	incl	%eax
	shrl	$31, %eax
	addl	%eax, %r12d
	incl	%r12d
	sarl	%r12d
LBB0_2:
	movl	%r15d, %ebx
	sarl	$16, %ebx
	cmpl	$65536, %r15d                   ## imm = 0x10000
	jb	LBB0_5
## %bb.3:
	cmpl	%r12d, %ebx
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	xorl	%r13d, %r13d
	movl	%ebx, %esi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_5:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	addl	$2, %ebx
	movl	%ebx, %edi
	callq	_BEGIN_RING
	movl	(%r14), %edi
	movl	%ebx, %esi
	callq	_OUT_RING_DRM_BUFFER
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_ADVANCE_RING
	cmpl	$65535, %r15d                   ## imm = 0xFFFF
	ja	LBB0_19
## %bb.6:
	movl	(%r14), %edi
	callq	_drm_buffer_unprocessed
	cmpl	$31, %eax
	ja	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_16
LBB0_8:
	movl	(%r14), %edi
	leaq	-72(%rbp), %rdx
	movl	$16, %esi
	callq	_drm_buffer_read_object
	movq	%rax, %r13
	movl	(%r14), %edi
	xorl	%esi, %esi
	callq	_drm_buffer_pointer_to_dword
	movq	%rax, %rbx
	movl	(%r14), %edi
	movl	$1, %esi
	callq	_drm_buffer_pointer_to_dword
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%r14), %edi
	movl	$2, %esi
	callq	_drm_buffer_pointer_to_dword
	movq	%rax, %r15
	movl	(%r14), %edi
	movl	$3, %esi
	callq	_drm_buffer_pointer_to_dword
	movq	8(%r13), %rdx
	movq	_R300_CMD_PACKET3@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_15
## %bb.9:
	movq	(%r13), %rdx
	movq	_R300_CMD_PACKET3_RAW@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_15
## %bb.10:
	movl	(%rbx), %ebx
	movq	_RADEON_CP_INDX_BUFFER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	$2, %esi
	movq	%rax, %r13
	callq	_CP_PACKET3
	cmpl	%eax, %ebx
	jne	LBB0_15
## %bb.11:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	movl	%esi, %eax
	andl	$-2147418113, %eax              ## imm = 0x8000FFFF
	cmpl	$-2147481584, %eax              ## imm = 0x80000810
	jne	LBB0_20
## %bb.12:
	movl	(%r15), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_radeon_check_offset
	testl	%eax, %eax
	je	LBB0_21
## %bb.13:
	movl	(%r13), %esi
	cmpl	%r12d, %esi
	jne	LBB0_23
## %bb.14:
	movl	$4, %edi
	callq	_BEGIN_RING
	movl	(%r14), %edi
	movl	$4, %esi
	callq	_OUT_RING_DRM_BUFFER
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_ADVANCE_RING
	jmp	LBB0_19
LBB0_15:
	leaq	L_.str.2(%rip), %rdi
LBB0_16:
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_17:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
LBB0_18:
	subl	(%rax), %r13d
LBB0_19:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_22
LBB0_21:
	movl	(%r15), %esi
	leaq	L_.str.4(%rip), %rdi
LBB0_22:
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_17
LBB0_23:
	leaq	L_.str.5(%rip), %rdi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_RING_LOCALS,4,2                ## @RING_LOCALS
	.comm	_RADEON_CP_PACKET_COUNT_MASK,4,2 ## @RADEON_CP_PACKET_COUNT_MASK
	.comm	_R300_VAP_VF_CNTL__INDEX_SIZE_32bit,4,2 ## @R300_VAP_VF_CNTL__INDEX_SIZE_32bit
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"3D_DRAW_INDX_2: packet size %i, expected %i\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"3D_DRAW_INDX_2: expect subsequent INDX_BUFFER, but stream is too short.\n"

	.comm	_R300_CMD_PACKET3,8,3           ## @R300_CMD_PACKET3
	.comm	_R300_CMD_PACKET3_RAW,8,3       ## @R300_CMD_PACKET3_RAW
	.comm	_RADEON_CP_INDX_BUFFER,4,2      ## @RADEON_CP_INDX_BUFFER
L_.str.2:                               ## @.str.2
	.asciz	"3D_DRAW_INDX_2: expect subsequent INDX_BUFFER.\n"

L_.str.3:                               ## @.str.3
	.asciz	"Invalid indx_buffer reg address %08X\n"

L_.str.4:                               ## @.str.4
	.asciz	"Invalid indx_buffer offset is %08X\n"

L_.str.5:                               ## @.str.5
	.asciz	"INDX_BUFFER: buffer size %i, expected %i\n"

	.no_dead_strip	_r300_emit_draw_indx_2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r300_emit_draw_indx_2
_r300_emit_draw_indx_2:                 ; @r300_emit_draw_indx_2
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x1
	mov	x20, x0
	ldr	w0, [x1]
	mov	w1, #0
	bl	_drm_buffer_pointer_to_dword
	mov	x21, x0
	ldr	w0, [x19]
	mov	w1, #1
	bl	_drm_buffer_pointer_to_dword
Lloh0:
	adrp	x8, _RADEON_CP_PACKET_COUNT_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RADEON_CP_PACKET_COUNT_MASK@GOTPAGEOFF]
	ldr	w9, [x21]
Lloh2:
	ldr	w8, [x8]
	and	w22, w8, w9
	asr	w8, w22, #16
	ldr	w9, [x0]
	asr	w10, w9, #16
Lloh3:
	adrp	x11, _R300_VAP_VF_CNTL__INDEX_SIZE_32bit@GOTPAGE
Lloh4:
	ldr	x11, [x11, _R300_VAP_VF_CNTL__INDEX_SIZE_32bit@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	add	w12, w10, #1
	add	w13, w10, #2
	cmp	w12, #0
	csinc	w12, w13, w10, lt
	asr	w12, w12, #1
	tst	w11, w9
	csel	w26, w10, w12, ne
	cmp	w22, #16, lsl #12               ; =65536
	ccmp	w8, w26, #4, hs
	b.ne	LBB0_4
; %bb.1:
	add	w21, w8, #2
	mov	x0, x21
	bl	_BEGIN_RING
	ldr	w0, [x19]
	mov	x1, x21
	bl	_OUT_RING_DRM_BUFFER
	bl	_ADVANCE_RING
	lsr	w8, w22, #16
	cbnz	w8, LBB0_13
; %bb.2:
	ldr	w0, [x19]
	bl	_drm_buffer_unprocessed
	cmp	w0, #31
	b.hi	LBB0_6
; %bb.3:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_4:
	stp	x8, x26, [sp]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
LBB0_5:
	bl	_DRM_ERROR
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_6:
	ldr	w0, [x19]
	add	x2, sp, #16
	mov	w1, #16
	bl	_drm_buffer_read_object
	mov	x24, x0
	ldr	w0, [x19]
	mov	w1, #0
	bl	_drm_buffer_pointer_to_dword
	mov	x25, x0
	ldr	w0, [x19]
	mov	w1, #1
	bl	_drm_buffer_pointer_to_dword
	mov	x23, x0
	ldr	w0, [x19]
	mov	w1, #2
	bl	_drm_buffer_pointer_to_dword
	mov	x21, x0
	ldr	w0, [x19]
	mov	w1, #3
	bl	_drm_buffer_pointer_to_dword
	ldr	x8, [x24, #8]
Lloh13:
	adrp	x9, _R300_CMD_PACKET3@GOTPAGE
Lloh14:
	ldr	x9, [x9, _R300_CMD_PACKET3@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.7:
	ldr	x8, [x24]
Lloh16:
	adrp	x9, _R300_CMD_PACKET3_RAW@GOTPAGE
Lloh17:
	ldr	x9, [x9, _R300_CMD_PACKET3_RAW@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.8:
	mov	x22, x0
	ldr	w24, [x25]
Lloh19:
	adrp	x8, _RADEON_CP_INDX_BUFFER@GOTPAGE
Lloh20:
	ldr	x8, [x8, _RADEON_CP_INDX_BUFFER@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	w1, #2
	bl	_CP_PACKET3
	cmp	w24, w0
	b.ne	LBB0_15
; %bb.9:
	ldr	w8, [x23]
	and	w9, w8, #0x8000ffff
	mov	w10, #2064
	movk	w10, #32768, lsl #16
	cmp	w9, w10
	b.ne	LBB0_16
; %bb.10:
	ldr	w1, [x21]
	mov	x0, x20
	bl	_radeon_check_offset
	cbz	w0, LBB0_17
; %bb.11:
	ldr	w8, [x22]
	cmp	w8, w26
	b.ne	LBB0_18
; %bb.12:
	mov	w0, #4
	bl	_BEGIN_RING
	ldr	w0, [x19]
	mov	w1, #4
	bl	_OUT_RING_DRM_BUFFER
	bl	_ADVANCE_RING
LBB0_13:
	mov	w0, #0
LBB0_14:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_15:
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_16:
	str	x8, [sp]
Lloh24:
	adrp	x0, l_.str.3@PAGE
Lloh25:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_5
LBB0_17:
	ldr	w8, [x21]
	str	x8, [sp]
Lloh26:
	adrp	x0, l_.str.4@PAGE
Lloh27:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_5
LBB0_18:
                                        ; kill: def $w26 killed $w26 killed $x26 def $x26
	stp	x8, x26, [sp]
Lloh28:
	adrp	x0, l_.str.5@PAGE
Lloh29:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_RING_LOCALS,4,2                ; @RING_LOCALS
	.comm	_RADEON_CP_PACKET_COUNT_MASK,4,2 ; @RADEON_CP_PACKET_COUNT_MASK
	.comm	_R300_VAP_VF_CNTL__INDEX_SIZE_32bit,4,2 ; @R300_VAP_VF_CNTL__INDEX_SIZE_32bit
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"3D_DRAW_INDX_2: packet size %i, expected %i\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"3D_DRAW_INDX_2: expect subsequent INDX_BUFFER, but stream is too short.\n"

	.comm	_R300_CMD_PACKET3,8,3           ; @R300_CMD_PACKET3
	.comm	_R300_CMD_PACKET3_RAW,8,3       ; @R300_CMD_PACKET3_RAW
	.comm	_RADEON_CP_INDX_BUFFER,4,2      ; @RADEON_CP_INDX_BUFFER
l_.str.2:                               ; @.str.2
	.asciz	"3D_DRAW_INDX_2: expect subsequent INDX_BUFFER.\n"

l_.str.3:                               ; @.str.3
	.asciz	"Invalid indx_buffer reg address %08X\n"

l_.str.4:                               ; @.str.4
	.asciz	"Invalid indx_buffer offset is %08X\n"

l_.str.5:                               ; @.str.5
	.asciz	"INDX_BUFFER: buffer size %i, expected %i\n"

	.no_dead_strip	_r300_emit_draw_indx_2
.subsections_via_symbols
