	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_gem_wait_idle_ioctl     ## -- Begin function radeon_gem_wait_idle_ioctl
	.p2align	4, 0x90
_radeon_gem_wait_idle_ioctl:            ## @radeon_gem_wait_idle_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	(%rdi), %r14
	movl	(%rsi), %esi
	movq	%rdx, %rdi
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_gem_to_radeon_bo
	movq	%rax, %r15
	movl	12(%rax), %edi
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	shll	$5, %ecx
	subl	%eax, %ecx
	subl	%eax, %ecx
	movl	$1, %esi
	movl	$1, %edx
	callq	_dma_resv_wait_timeout_rcu
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	subl	(%rcx), %edx
	xorl	%ebx, %ebx
	testq	%rax, %rax
	cmovsq	%rax, %rbx
	cmovel	%edx, %ebx
	movl	8(%r15), %edi
	callq	_READ_ONCE
	movq	(%r14), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_4
## %bb.2:
	movl	%eax, %edi
	callq	_radeon_mem_type_to_domain
	movq	_RADEON_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movq	(%r15), %rax
	movq	(%rax), %rax
	movq	%r14, %rdi
	callq	*(%rax)
LBB0_4:
	movq	%r12, %rdi
	callq	_drm_gem_object_put_unlocked
	movq	%r14, %rdi
	movl	%ebx, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_radeon_gem_handle_lockup       ## TAILCALL
LBB0_5:
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_HZ,4,2                         ## @HZ
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_RADEON_GEM_DOMAIN_VRAM,8,3     ## @RADEON_GEM_DOMAIN_VRAM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_gem_wait_idle_ioctl     ; -- Begin function radeon_gem_wait_idle_ioctl
	.p2align	2
_radeon_gem_wait_idle_ioctl:            ; @radeon_gem_wait_idle_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
	ldr	x19, [x0]
	ldr	w1, [x1]
	mov	x0, x2
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	bl	_gem_to_radeon_bo
	mov	x21, x0
	ldr	w0, [x0, #12]
Lloh0:
	adrp	x8, _HZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	w9, #30
	mul	w3, w8, w9
	mov	w1, #1
	mov	w2, #1
	bl	_dma_resv_wait_timeout_rcu
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	x9, x0, xzr, lt
	csneg	w22, w9, w8, ne
	ldr	w0, [x21, #8]
	bl	_READ_ONCE
	ldr	x8, [x19]
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.2:
	bl	_radeon_mem_type_to_domain
Lloh6:
	adrp	x8, _RADEON_GEM_DOMAIN_VRAM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RADEON_GEM_DOMAIN_VRAM@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.3:
	ldr	x8, [x21]
	ldr	x8, [x8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
LBB0_4:
	mov	x0, x20
	bl	_drm_gem_object_put_unlocked
	mov	x0, x19
	mov	x1, x22
	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
	b	_radeon_gem_handle_lockup
LBB0_5:
Lloh9:
	adrp	x8, _ENOENT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_HZ,4,2                         ; @HZ
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_RADEON_GEM_DOMAIN_VRAM,8,3     ; @RADEON_GEM_DOMAIN_VRAM
.subsections_via_symbols
