	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_fence_default_wait
_radeon_fence_default_wait:             ## @radeon_fence_default_wait
	.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	%rdx, %rbx
	movl	%esi, %r15d
	movq	%rdi, %r14
	callq	_to_radeon_fence
	movq	%rax, %r12
	movq	(%rax), %r13
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	_radeon_fence_wait_cb@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_dma_fence_add_callback
	testq	%rax, %rax
	jne	LBB0_8
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_TASK_UNINTERRUPTIBLE@GOTPCREL(%rip), %rax
	testl	%r15d, %r15d
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_TASK_INTERRUPTIBLE@GOTPCREL(%rip), %rax
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	(%rax), %edi
	callq	_set_current_state
	movq	%r12, %rdi
	callq	_radeon_test_signaled
	testq	%rax, %rax
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpq	$0, (%r13)
	jne	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	callq	_schedule_timeout
	movq	%rax, %rbx
	testl	%r15d, %r15d
	je	LBB0_1
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	testq	%rbx, %rbx
	jle	LBB0_1
## %bb.11:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_signal_pending
	testq	%rax, %rax
	je	LBB0_1
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	xorl	%ebx, %ebx
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	subq	(%rax), %rbx
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	testq	%rbx, %rbx
	jg	LBB0_2
	jmp	LBB0_7
LBB0_6:
	movq	_EDEADLK@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
LBB0_7:
	movq	_TASK_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	___set_current_state
	leaq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_dma_fence_remove_callback
LBB0_8:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_current,4,2                    ## @current
	.comm	_radeon_fence_wait_cb,4,2       ## @radeon_fence_wait_cb
	.comm	_TASK_INTERRUPTIBLE,4,2         ## @TASK_INTERRUPTIBLE
	.comm	_TASK_UNINTERRUPTIBLE,4,2       ## @TASK_UNINTERRUPTIBLE
	.comm	_EDEADLK,8,3                    ## @EDEADLK
	.comm	_ERESTARTSYS,8,3                ## @ERESTARTSYS
	.comm	_TASK_RUNNING,4,2               ## @TASK_RUNNING
	.no_dead_strip	_radeon_fence_default_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_fence_default_wait
_radeon_fence_default_wait:             ; @radeon_fence_default_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	bl	_to_radeon_fence
	mov	x22, x0
Lloh0:
	adrp	x23, _current@GOTPAGE
Lloh1:
	ldr	x23, [x23, _current@GOTPAGEOFF]
	ldr	x24, [x0]
	ldr	w8, [x23]
	str	w8, [sp, #12]
Lloh2:
	adrp	x8, _radeon_fence_wait_cb@GOTPAGE
Lloh3:
	ldr	x8, [x8, _radeon_fence_wait_cb@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	add	x1, sp, #8
	mov	x0, x20
	bl	_dma_fence_add_callback
	cbnz	x0, LBB0_12
; %bb.1:
	cmp	x19, #1
	b.lt	LBB0_11
; %bb.2:
Lloh5:
	adrp	x25, _TASK_INTERRUPTIBLE@GOTPAGE
Lloh6:
	ldr	x25, [x25, _TASK_INTERRUPTIBLE@GOTPAGEOFF]
Lloh7:
	adrp	x26, _TASK_UNINTERRUPTIBLE@GOTPAGE
Lloh8:
	ldr	x26, [x26, _TASK_UNINTERRUPTIBLE@GOTPAGEOFF]
Lloh9:
	adrp	x27, _ERESTARTSYS@GOTPAGE
Lloh10:
	ldr	x27, [x27, _ERESTARTSYS@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	x19, #0
	b.le	LBB0_11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w21, #0
	csel	x8, x25, x26, ne
	ldr	w0, [x8]
	bl	_set_current_state
	mov	x0, x22
	bl	_radeon_test_signaled
	cbnz	x0, LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x24]
	cbnz	x8, LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	bl	_schedule_timeout
	mov	x19, x0
	cbz	w21, LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	x19, #1
	b.lt	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x23]
	bl	_signal_pending
	cbz	x0, LBB0_3
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x27]
	neg	x19, x8
	b	LBB0_3
LBB0_10:
Lloh11:
	adrp	x8, _EDEADLK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EDEADLK@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	neg	x19, x8
LBB0_11:
Lloh14:
	adrp	x8, _TASK_RUNNING@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TASK_RUNNING@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	___set_current_state
	add	x1, sp, #8
	mov	x0, x20
	bl	_dma_fence_remove_callback
LBB0_12:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_current,4,2                    ; @current
	.comm	_radeon_fence_wait_cb,4,2       ; @radeon_fence_wait_cb
	.comm	_TASK_INTERRUPTIBLE,4,2         ; @TASK_INTERRUPTIBLE
	.comm	_TASK_UNINTERRUPTIBLE,4,2       ; @TASK_UNINTERRUPTIBLE
	.comm	_EDEADLK,8,3                    ; @EDEADLK
	.comm	_ERESTARTSYS,8,3                ; @ERESTARTSYS
	.comm	_TASK_RUNNING,4,2               ; @TASK_RUNNING
	.no_dead_strip	_radeon_fence_default_wait
.subsections_via_symbols
