	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_gem_busy_ioctl          ## -- Begin function radeon_gem_busy_ioctl
	.p2align	4, 0x90
_radeon_gem_busy_ioctl:                 ## @radeon_gem_busy_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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	(%rdi), %r14
	movl	$0, -36(%rbp)
	movl	4(%rsi), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_gem_to_radeon_bo
	leaq	-36(%rbp), %rsi
	movq	%rax, %rdi
	movl	$1, %edx
	callq	_radeon_bo_wait
	movl	%eax, %r12d
	movl	-36(%rbp), %eax
	addl	$-128, %eax
	cmpl	$2, %eax
	ja	LBB0_4
## %bb.3:
	cltq
	leaq	l_switch.table.radeon_gem_busy_ioctl(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
LBB0_4:
	movq	%rbx, %rdi
	callq	_drm_gem_object_unreference_unlocked
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_radeon_gem_handle_lockup
	jmp	LBB0_5
LBB0_1:
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
	.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
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.radeon_gem_busy_ioctl
l_switch.table.radeon_gem_busy_ioctl:
	.quad	_RADEON_GEM_DOMAIN_VRAM
	.quad	_RADEON_GEM_DOMAIN_GTT
	.quad	_RADEON_GEM_DOMAIN_CPU

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_gem_busy_ioctl          ; -- Begin function radeon_gem_busy_ioctl
	.p2align	2
_radeon_gem_busy_ioctl:                 ; @radeon_gem_busy_ioctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x8, x2
	mov	x20, x1
	ldr	x19, [x0]
	str	wzr, [sp, #12]
	ldr	w2, [x1, #4]
	mov	x1, x8
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
	bl	_gem_to_radeon_bo
	add	x1, sp, #12
	mov	w2, #1
	bl	_radeon_bo_wait
	mov	x22, x0
	ldr	w8, [sp, #12]
	sub	w8, w8, #128
	cmp	w8, #2
	b.hi	LBB0_3
; %bb.2:
Lloh0:
	adrp	x9, l_switch.table.radeon_gem_busy_ioctl@PAGE
Lloh1:
	add	x9, x9, l_switch.table.radeon_gem_busy_ioctl@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w8, [x8]
	str	w8, [x20]
LBB0_3:
	mov	x0, x21
	bl	_drm_gem_object_unreference_unlocked
	mov	x0, x19
	mov	x1, x22
	bl	_radeon_gem_handle_lockup
	b	LBB0_5
LBB0_4:
Lloh2:
	adrp	x8, _ENOENT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.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
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.radeon_gem_busy_ioctl
l_switch.table.radeon_gem_busy_ioctl:
	.quad	_RADEON_GEM_DOMAIN_VRAM
	.quad	_RADEON_GEM_DOMAIN_GTT
	.quad	_RADEON_GEM_DOMAIN_CPU

.subsections_via_symbols
