	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_gem_va_ioctl            ## -- Begin function radeon_gem_va_ioctl
	.p2align	4, 0x90
_radeon_gem_va_ioctl:                   ## @radeon_gem_va_ioctl
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	8(%rdi), %r12
	cmpl	$0, (%r12)
	je	LBB0_3
## %bb.1:
	cmpq	$0, 24(%r14)
	je	LBB0_5
## %bb.2:
	movq	_RADEON_VA_RESULT_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_RADEON_VA_RESULT_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	_ENOTTY@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_5:
	movq	8(%r14), %rax
	movq	_RADEON_VA_RESERVED_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jge	LBB0_7
## %bb.6:
	movq	(%rdi), %rdi
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_9
LBB0_7:
	movq	_RADEON_VM_PAGE_VALID@GOTPCREL(%rip), %rax
	movq	_RADEON_VM_PAGE_SYSTEM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	16(%r14), %eax
	testl	%ecx, %eax
	je	LBB0_12
## %bb.8:
	movq	(%rdi), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_9:
	movq	_RADEON_VA_RESULT_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_10:
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_RADEON_VM_PAGE_SNOOPED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_17
## %bb.13:
	movl	(%r14), %eax
	movl	%eax, %ecx
	andl	$-2, %ecx
	cmpl	$128, %ecx
	jne	LBB0_18
## %bb.14:
	movq	(%rdx), %rbx
	movl	20(%r14), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_19
## %bb.15:
	movq	%rax, %r15
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_gem_to_radeon_bo
	movq	%rax, %r13
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_radeon_bo_reserve
	testl	%eax, %eax
	je	LBB0_21
## %bb.16:
	movl	%eax, %ebx
	movq	_RADEON_VA_RESULT_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	jmp	LBB0_34
LBB0_17:
	movq	(%rdi), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_9
LBB0_18:
	movq	(%rdi), %rdi
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_9
LBB0_19:
	movq	_RADEON_VA_RESULT_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
LBB0_20:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_21:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_radeon_vm_bo_find
	testq	%rax, %rax
	je	LBB0_26
## %bb.22:
	movl	(%r14), %ecx
	cmpl	$128, %ecx
	je	LBB0_27
## %bb.23:
	cmpl	$129, %ecx
	jne	LBB0_28
## %bb.24:
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_29
## %bb.25:
	movq	_RADEON_VA_RESULT_VA_EXIST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	%rcx, 8(%r14)
	jmp	LBB0_32
LBB0_26:
	movq	_RADEON_VA_RESULT_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	%r15, %rdi
	callq	_drm_gem_object_unreference_unlocked
	jmp	LBB0_20
LBB0_27:
	movq	%r12, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	LBB0_30
LBB0_28:
	movq	_RADEON_VA_RESULT_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	jmp	LBB0_32
LBB0_29:
	movq	8(%r14), %rdx
	movl	16(%r14), %ecx
	movq	%r12, %rdi
	movq	%rax, %rsi
LBB0_30:
	callq	_radeon_vm_bo_set_addr
	movl	%eax, %ebx
	movq	_RADEON_VA_RESULT_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	testl	%ebx, %ebx
	je	LBB0_32
## %bb.31:
	movq	_RADEON_VA_RESULT_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	jmp	LBB0_33
LBB0_32:
	xorl	%ebx, %ebx
LBB0_33:
	movq	%r13, %rdi
	callq	_radeon_bo_unreserve
LBB0_34:
	movq	%r15, %rdi
	callq	_drm_gem_object_unreference_unlocked
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_VA_RESULT_ERROR,8,3     ## @RADEON_VA_RESULT_ERROR
	.comm	_ENOTTY,4,2                     ## @ENOTTY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RADEON_VA_RESERVED_SIZE,8,3    ## @RADEON_VA_RESERVED_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"offset 0x%lX is in reserved area 0x%X\n"

	.comm	_RADEON_VM_PAGE_VALID,4,2       ## @RADEON_VM_PAGE_VALID
	.comm	_RADEON_VM_PAGE_SYSTEM,4,2      ## @RADEON_VM_PAGE_SYSTEM
L_.str.1:                               ## @.str.1
	.asciz	"invalid flags 0x%08X vs 0x%08X\n"

	.comm	_RADEON_VM_PAGE_SNOOPED,4,2     ## @RADEON_VM_PAGE_SNOOPED
L_.str.2:                               ## @.str.2
	.asciz	"only supported snooped mapping for now\n"

L_.str.3:                               ## @.str.3
	.asciz	"unsupported operation %d\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_RADEON_VA_RESULT_VA_EXIST,4,2  ## @RADEON_VA_RESULT_VA_EXIST
	.comm	_RADEON_VA_RESULT_OK,4,2        ## @RADEON_VA_RESULT_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_gem_va_ioctl            ; -- Begin function radeon_gem_va_ioctl
	.p2align	2
_radeon_gem_va_ioctl:                   ; @radeon_gem_va_ioctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	ldr	x22, [x0, #8]
	ldr	w8, [x22]
	cbz	w8, LBB0_4
; %bb.1:
	ldr	x8, [x19, #24]
	cbnz	x8, LBB0_8
; %bb.2:
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x9, _RADEON_VA_RESERVED_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RADEON_VA_RESERVED_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_5
; %bb.3:
	ldr	x0, [x0]
	stp	x8, x9, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_4:
Lloh5:
	adrp	x8, _RADEON_VA_RESULT_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RADEON_VA_RESULT_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	str	w8, [x19]
Lloh8:
	adrp	x8, _ENOTTY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOTTY@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
Lloh10:
	adrp	x8, _RADEON_VM_PAGE_VALID@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RADEON_VM_PAGE_VALID@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _RADEON_VM_PAGE_SYSTEM@GOTPAGE
Lloh14:
	ldr	x9, [x9, _RADEON_VM_PAGE_SYSTEM@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w9, w9, w8
	ldr	w8, [x19, #16]
	tst	w8, w9
	b.eq	LBB0_11
; %bb.6:
	ldr	x0, [x0]
	stp	x8, x9, [sp]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	bl	_dev_err
LBB0_8:
Lloh18:
	adrp	x8, _RADEON_VA_RESULT_ERROR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _RADEON_VA_RESULT_ERROR@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	str	w8, [x19]
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_10:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_11:
Lloh23:
	adrp	x9, _RADEON_VM_PAGE_SNOOPED@GOTPAGE
Lloh24:
	ldr	x9, [x9, _RADEON_VM_PAGE_SNOOPED@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.12:
	ldr	w8, [x19]
	and	w9, w8, #0xfffffffe
	cmp	w9, #128
	b.ne	LBB0_17
; %bb.13:
	ldr	x24, [x2]
	ldr	w8, [x19, #20]
	mov	x1, x2
	mov	x2, x8
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_18
; %bb.14:
	mov	x20, x0
	bl	_gem_to_radeon_bo
	mov	x21, x0
	mov	w1, #0
	bl	_radeon_bo_reserve
	cbz	w0, LBB0_20
; %bb.15:
	mov	x23, x0
Lloh26:
	adrp	x8, _RADEON_VA_RESULT_ERROR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _RADEON_VA_RESULT_ERROR@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	str	w8, [x19]
	b	LBB0_32
LBB0_16:
	ldr	x0, [x0]
Lloh29:
	adrp	x1, l_.str.2@PAGE
Lloh30:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_17:
	ldr	x0, [x0]
	str	x8, [sp]
Lloh31:
	adrp	x1, l_.str.3@PAGE
Lloh32:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_7
LBB0_18:
Lloh33:
	adrp	x8, _RADEON_VA_RESULT_ERROR@GOTPAGE
Lloh34:
	ldr	x8, [x8, _RADEON_VA_RESULT_ERROR@GOTPAGEOFF]
Lloh35:
	ldr	x8, [x8]
	str	w8, [x19]
LBB0_19:
Lloh36:
	adrp	x8, _ENOENT@GOTPAGE
Lloh37:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_9
LBB0_20:
	mov	x0, x24
	mov	x1, x21
	bl	_radeon_vm_bo_find
	cbz	x0, LBB0_25
; %bb.21:
	mov	x1, x0
	ldr	w8, [x19]
	cmp	w8, #128
	b.eq	LBB0_26
; %bb.22:
	cmp	w8, #129
	b.ne	LBB0_27
; %bb.23:
	ldr	x8, [x1]
	cbz	x8, LBB0_28
; %bb.24:
	mov	w23, #0
Lloh38:
	adrp	x9, _RADEON_VA_RESULT_VA_EXIST@GOTPAGE
Lloh39:
	ldr	x9, [x9, _RADEON_VA_RESULT_VA_EXIST@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	str	w9, [x19]
	str	x8, [x19, #8]
	b	LBB0_31
LBB0_25:
Lloh41:
	adrp	x8, _RADEON_VA_RESULT_ERROR@GOTPAGE
Lloh42:
	ldr	x8, [x8, _RADEON_VA_RESULT_ERROR@GOTPAGEOFF]
Lloh43:
	ldr	x8, [x8]
	str	w8, [x19]
	mov	x0, x20
	bl	_drm_gem_object_unreference_unlocked
	b	LBB0_19
LBB0_26:
	mov	x0, x22
	mov	x2, #0
	mov	w3, #0
	b	LBB0_29
LBB0_27:
	mov	w23, #0
Lloh44:
	adrp	x8, _RADEON_VA_RESULT_OK@GOTPAGE
Lloh45:
	ldr	x8, [x8, _RADEON_VA_RESULT_OK@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	str	w8, [x19]
	b	LBB0_31
LBB0_28:
	ldr	x2, [x19, #8]
	ldr	w3, [x19, #16]
	mov	x0, x22
LBB0_29:
	bl	_radeon_vm_bo_set_addr
	mov	x23, x0
Lloh47:
	adrp	x8, _RADEON_VA_RESULT_OK@GOTPAGE
Lloh48:
	ldr	x8, [x8, _RADEON_VA_RESULT_OK@GOTPAGEOFF]
Lloh49:
	ldr	w8, [x8]
	str	w8, [x19]
	cbz	w0, LBB0_31
; %bb.30:
Lloh50:
	adrp	x8, _RADEON_VA_RESULT_ERROR@GOTPAGE
Lloh51:
	ldr	x8, [x8, _RADEON_VA_RESULT_ERROR@GOTPAGEOFF]
Lloh52:
	ldr	x8, [x8]
	str	w8, [x19]
LBB0_31:
	mov	x0, x21
	bl	_radeon_bo_unreserve
LBB0_32:
	mov	x0, x20
	bl	_drm_gem_object_unreference_unlocked
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_VA_RESULT_ERROR,8,3     ; @RADEON_VA_RESULT_ERROR
	.comm	_ENOTTY,4,2                     ; @ENOTTY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RADEON_VA_RESERVED_SIZE,8,3    ; @RADEON_VA_RESERVED_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"offset 0x%lX is in reserved area 0x%X\n"

	.comm	_RADEON_VM_PAGE_VALID,4,2       ; @RADEON_VM_PAGE_VALID
	.comm	_RADEON_VM_PAGE_SYSTEM,4,2      ; @RADEON_VM_PAGE_SYSTEM
l_.str.1:                               ; @.str.1
	.asciz	"invalid flags 0x%08X vs 0x%08X\n"

	.comm	_RADEON_VM_PAGE_SNOOPED,4,2     ; @RADEON_VM_PAGE_SNOOPED
l_.str.2:                               ; @.str.2
	.asciz	"only supported snooped mapping for now\n"

l_.str.3:                               ; @.str.3
	.asciz	"unsupported operation %d\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_RADEON_VA_RESULT_VA_EXIST,4,2  ; @RADEON_VA_RESULT_VA_EXIST
	.comm	_RADEON_VA_RESULT_OK,4,2        ; @RADEON_VA_RESULT_OK
.subsections_via_symbols
