	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mga_verify_tex
_mga_verify_tex:                        ## @mga_verify_tex
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %rax
	movq	(%rax), %r14
	movslq	%esi, %rbx
	movl	(%r14,%rbx,4), %esi
	movq	_MGA_TEXORGMAP_MASK@GOTPCREL(%rip), %rax
	movq	_MGA_TEXORGACC_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	andl	%esi, %ecx
	movq	_MGA_TEXORGMAP_SYSMEM@GOTPCREL(%rip), %rax
	movq	_MGA_TEXORGACC_PCI@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rax), %edx
	xorl	%eax, %eax
	cmpl	%edx, %ecx
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %edx
	callq	_DRM_ERROR
	movl	$0, (%r14,%rbx,4)
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_2:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MGA_TEXORGMAP_MASK,4,2         ## @MGA_TEXORGMAP_MASK
	.comm	_MGA_TEXORGACC_MASK,4,2         ## @MGA_TEXORGACC_MASK
	.comm	_MGA_TEXORGMAP_SYSMEM,4,2       ## @MGA_TEXORGMAP_SYSMEM
	.comm	_MGA_TEXORGACC_PCI,4,2          ## @MGA_TEXORGACC_PCI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"*** bad TEXORG: 0x%x, unit %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_mga_verify_tex
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mga_verify_tex
_mga_verify_tex:                        ; @mga_verify_tex
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x2, x1
	ldr	x8, [x0]
	ldr	x19, [x8]
	ldr	w1, [x19, w1, sxtw #2]
Lloh0:
	adrp	x8, _MGA_TEXORGMAP_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MGA_TEXORGMAP_MASK@GOTPAGEOFF]
Lloh2:
	adrp	x9, _MGA_TEXORGACC_MASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MGA_TEXORGACC_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
	and	w8, w8, w1
Lloh6:
	adrp	x9, _MGA_TEXORGMAP_SYSMEM@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MGA_TEXORGMAP_SYSMEM@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _MGA_TEXORGACC_PCI@GOTPAGE
Lloh10:
	ldr	x10, [x10, _MGA_TEXORGACC_PCI@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	orr	w9, w10, w9
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	sxtw	x20, w2
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_DRM_ERROR
	str	wzr, [x19, x20, lsl #2]
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
	mov	w0, #0
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MGA_TEXORGMAP_MASK,4,2         ; @MGA_TEXORGMAP_MASK
	.comm	_MGA_TEXORGACC_MASK,4,2         ; @MGA_TEXORGACC_MASK
	.comm	_MGA_TEXORGMAP_SYSMEM,4,2       ; @MGA_TEXORGMAP_SYSMEM
	.comm	_MGA_TEXORGACC_PCI,4,2          ; @MGA_TEXORGACC_PCI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"*** bad TEXORG: 0x%x, unit %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_mga_verify_tex
.subsections_via_symbols
