	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_gem_op_ioctl            ## -- Begin function radeon_gem_op_ioctl
	.p2align	4, 0x90
_radeon_gem_op_ioctl:                   ## @radeon_gem_op_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rdi
	movq	%rsi, %r15
	movl	8(%rsi), %esi
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_gem_to_radeon_bo
	movq	%rax, %r12
	movq	_EPERM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movl	4(%r12), %edi
	callq	_radeon_ttm_tt_has_userptr
	testq	%rax, %rax
	jne	LBB0_10
## %bb.3:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_radeon_bo_reserve
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_10
## %bb.4:
	movl	(%r15), %eax
	cmpl	$128, %eax
	je	LBB0_7
## %bb.5:
	cmpl	$129, %eax
	jne	LBB0_8
## %bb.6:
	movl	(%r12), %eax
	movl	%eax, 4(%r15)
	jmp	LBB0_9
LBB0_1:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_7:
	movq	_RADEON_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rax
	movq	_RADEON_GEM_DOMAIN_GTT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_RADEON_GEM_DOMAIN_CPU@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	andl	4(%r15), %ecx
	movl	%ecx, (%r12)
	jmp	LBB0_9
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movq	%r12, %rdi
	callq	_radeon_bo_unreserve
LBB0_10:
	movq	%r14, %rdi
	callq	_drm_gem_object_put_unlocked
LBB0_11:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_RADEON_GEM_DOMAIN_VRAM,4,2     ## @RADEON_GEM_DOMAIN_VRAM
	.comm	_RADEON_GEM_DOMAIN_GTT,4,2      ## @RADEON_GEM_DOMAIN_GTT
	.comm	_RADEON_GEM_DOMAIN_CPU,4,2      ## @RADEON_GEM_DOMAIN_CPU
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_gem_op_ioctl            ; -- Begin function radeon_gem_op_ioctl
	.p2align	2
_radeon_gem_op_ioctl:                   ; @radeon_gem_op_ioctl
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x0, x2
	mov	x22, x1
	ldr	w1, [x1, #8]
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	bl	_gem_to_radeon_bo
	mov	x21, x0
Lloh0:
	adrp	x8, _EPERM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	ldr	w0, [x0, #4]
	bl	_radeon_ttm_tt_has_userptr
	cbz	x0, LBB0_4
; %bb.2:
	neg	w20, w20
	b	LBB0_11
LBB0_3:
Lloh3:
	adrp	x8, _ENOENT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_12
LBB0_4:
	mov	x0, x21
	mov	w1, #0
	bl	_radeon_bo_reserve
	mov	x20, x0
	bl	_unlikely
	cbnz	x0, LBB0_11
; %bb.5:
	ldr	w8, [x22]
	cmp	w8, #128
	b.eq	LBB0_8
; %bb.6:
	cmp	w8, #129
	b.ne	LBB0_9
; %bb.7:
	ldr	w8, [x21]
	str	w8, [x22, #4]
	b	LBB0_10
LBB0_8:
Lloh6:
	adrp	x8, _RADEON_GEM_DOMAIN_VRAM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RADEON_GEM_DOMAIN_VRAM@GOTPAGEOFF]
	ldr	w9, [x22, #4]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x10, _RADEON_GEM_DOMAIN_GTT@GOTPAGE
Lloh10:
	ldr	x10, [x10, _RADEON_GEM_DOMAIN_GTT@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	orr	w8, w10, w8
Lloh12:
	adrp	x10, _RADEON_GEM_DOMAIN_CPU@GOTPAGE
Lloh13:
	ldr	x10, [x10, _RADEON_GEM_DOMAIN_CPU@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	orr	w8, w8, w10
	and	w8, w8, w9
	str	w8, [x21]
	b	LBB0_10
LBB0_9:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_10:
	mov	x0, x21
	bl	_radeon_bo_unreserve
LBB0_11:
	mov	x0, x19
	bl	_drm_gem_object_put_unlocked
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_RADEON_GEM_DOMAIN_VRAM,4,2     ; @RADEON_GEM_DOMAIN_VRAM
	.comm	_RADEON_GEM_DOMAIN_GTT,4,2      ; @RADEON_GEM_DOMAIN_GTT
	.comm	_RADEON_GEM_DOMAIN_CPU,4,2      ; @RADEON_GEM_DOMAIN_CPU
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
