	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r300_emit_3d_load_vbpntr
_r300_emit_3d_load_vbpntr:              ## @r300_emit_3d_load_vbpntr
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_RADEON_CP_PACKET_COUNT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	andl	%edx, %r15d
	movl	%r15d, %r12d
	sarl	$16, %r12d
	cmpl	$4194304, %r15d                 ## imm = 0x400000
	jl	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_8
LBB0_2:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	movl	(%rsi), %edi
	movl	$4, %esi
	callq	_drm_buffer_advance
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %edi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_drm_buffer_pointer_to_dword
	movl	(%rax), %eax
	movl	$1, %r13d
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jle	LBB0_15
## %bb.3:
	cmpl	$65536, %r15d                   ## imm = 0x10000
	jl	LBB0_15
## %bb.4:
	movl	$1, %eax
	subl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ebx
	movl	$2, %r15d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_drm_buffer_pointer_to_dword
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_radeon_check_offset
	testl	%eax, %eax
	je	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	leal	1(%r15), %r13d
	movl	-64(%rbp), %eax                 ## 4-byte Reload
	addl	%ebx, %eax
	je	LBB0_20
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movl	%r13d, %esi
	callq	_drm_buffer_pointer_to_dword
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_radeon_check_offset
	testl	%eax, %eax
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=1
	addl	$2, %ebx
	leal	3(%r15), %r13d
	cmpl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	jge	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
	addl	$2, %r15d
	cmpl	%r12d, %r15d
	movl	%r13d, %r15d
	jle	LBB0_5
LBB0_14:
	decl	%r13d
	jmp	LBB0_15
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%ebx, %esi
	movl	%r15d, %edx
	jmp	LBB0_7
LBB0_20:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
LBB0_15:
	leal	1(%r12), %r15d
	cmpl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	jne	LBB0_17
## %bb.16:
	cmpl	%r15d, %r13d
	jne	LBB0_17
## %bb.18:
	addl	$2, %r12d
	movl	%r12d, %edi
	callq	_BEGIN_RING
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	callq	_OUT_RING
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_OUT_RING_DRM_BUFFER
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_ADVANCE_RING
	jmp	LBB0_19
LBB0_17:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%ebx, %esi
	movl	%r13d, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_8
LBB0_11:
	incl	%ebx
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%ebx, %esi
	movl	%r13d, %edx
LBB0_7:
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_19:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RING_LOCALS,4,2                ## @RING_LOCALS
	.comm	_RADEON_CP_PACKET_COUNT_MASK,4,2 ## @RADEON_CP_PACKET_COUNT_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Too large payload in 3D_LOAD_VBPNTR (count=%d)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Offset failed range check (k=%d i=%d) while processing 3D_LOAD_VBPNTR packet.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Malformed 3D_LOAD_VBPNTR packet (k=%d i=%d narrays=%d count+1=%d).\n"

	.comm	_MAX_ARRAY_PACKET,4,2           ## @MAX_ARRAY_PACKET
	.no_dead_strip	_r300_emit_3d_load_vbpntr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r300_emit_3d_load_vbpntr
_r300_emit_3d_load_vbpntr:              ; @r300_emit_3d_load_vbpntr
	.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
Lloh0:
	adrp	x8, _RADEON_CP_PACKET_COUNT_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RADEON_CP_PACKET_COUNT_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w24, w8, w2
	asr	w21, w24, #16
	cmp	w24, #1024, lsl #12             ; =4194304
	b.lt	LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	b	LBB0_18
LBB0_2:
	mov	x20, x2
	mov	x19, x1
	mov	x23, x0
	ldr	w0, [x1]
	mov	w1, #4
	bl	_drm_buffer_advance
	ldr	w0, [x19]
	mov	w1, #0
	bl	_drm_buffer_pointer_to_dword
	mov	w22, #0
	ldr	w25, [x0]
	mov	w1, #1
	subs	w26, w25, #1
	b.lt	LBB0_13
; %bb.3:
	cmp	w24, #16, lsl #12               ; =65536
	b.lt	LBB0_13
; %bb.4:
	mov	w22, #0
	mov	w24, #2
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	mov	x1, x24
	bl	_drm_buffer_pointer_to_dword
	ldr	w1, [x0]
	mov	x0, x23
	bl	_radeon_check_offset
	cbz	w0, LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w1, w24, #1
	cmp	w26, w22
	b.eq	LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x19]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_drm_buffer_pointer_to_dword
	ldr	w1, [x0]
	mov	x0, x23
	bl	_radeon_check_offset
	cbz	w0, LBB0_17
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w22, w22, #2
	add	w8, w24, #3
	cmp	w22, w25
	b.ge	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w9, w24, #2
	mov	x24, x8
	cmp	w9, w21
	b.le	LBB0_5
LBB0_10:
	sub	w1, w8, #1
	b	LBB0_13
LBB0_11:
	str	x24, [sp]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_15
LBB0_12:
	mov	x22, x25
LBB0_13:
	add	w23, w21, #1
	cmp	w22, w25
	ccmp	w1, w23, #0, eq
	b.eq	LBB0_16
; %bb.14:
	stp	x25, x23, [sp, #8]
	str	x1, [sp]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_15:
	mov	x1, x22
	b	LBB0_18
LBB0_16:
	add	w0, w21, #2
	bl	_BEGIN_RING
	mov	x0, x20
	bl	_OUT_RING
	ldr	w0, [x19]
	mov	x1, x23
	bl	_OUT_RING_DRM_BUFFER
	bl	_ADVANCE_RING
	mov	w0, #0
	b	LBB0_19
LBB0_17:
	add	w1, w22, #1
	add	w8, w24, #1
	str	x8, [sp]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_18:
	bl	_DRM_ERROR
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_19:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_RING_LOCALS,4,2                ; @RING_LOCALS
	.comm	_RADEON_CP_PACKET_COUNT_MASK,4,2 ; @RADEON_CP_PACKET_COUNT_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Too large payload in 3D_LOAD_VBPNTR (count=%d)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Offset failed range check (k=%d i=%d) while processing 3D_LOAD_VBPNTR packet.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Malformed 3D_LOAD_VBPNTR packet (k=%d i=%d narrays=%d count+1=%d).\n"

	.comm	_MAX_ARRAY_PACKET,4,2           ; @MAX_ARRAY_PACKET
	.no_dead_strip	_r300_emit_3d_load_vbpntr
.subsections_via_symbols
