	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_fence_wait_legacy
_nouveau_fence_wait_legacy:             ## @nouveau_fence_wait_legacy
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %r13d
	callq	_from_fence
	movq	%rax, %r12
	movq	_NSEC_PER_MSEC@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	leaq	(%rbx,%r15), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_nouveau_fence_done
	testl	%eax, %eax
	je	LBB0_1
LBB0_11:
	movq	_TASK_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	___set_current_state
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	subq	%rbx, %rax
LBB0_12:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movslq	%r14d, %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	movslq	%eax, %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	callq	_nouveau_fence_done
	testl	%eax, %eax
	jne	LBB0_11
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_MAX_SCHEDULE_TIMEOUT@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_time_after_eq
	testq	%rax, %rax
	jne	LBB0_4
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_TASK_INTERRUPTIBLE@GOTPCREL(%rip), %rax
	testl	%r13d, %r13d
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_TASK_UNINTERRUPTIBLE@GOTPCREL(%rip), %rax
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rax), %edi
	callq	___set_current_state
	movq	%r14, -56(%rbp)
	movq	_HRTIMER_MODE_REL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdi
	callq	_schedule_hrtimeout
	addq	%r14, %r14
	movq	_NSEC_PER_MSEC@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r14
	cmovaeq	%rax, %r14
	testl	%r13d, %r13d
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_signal_pending
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subq	(%rcx), %rax
	jmp	LBB0_12
LBB0_4:
	movq	_TASK_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	___set_current_state
	xorl	%eax, %eax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_NSEC_PER_MSEC,4,2              ## @NSEC_PER_MSEC
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_MAX_SCHEDULE_TIMEOUT,8,3       ## @MAX_SCHEDULE_TIMEOUT
	.comm	_TASK_RUNNING,4,2               ## @TASK_RUNNING
	.comm	_TASK_INTERRUPTIBLE,4,2         ## @TASK_INTERRUPTIBLE
	.comm	_TASK_UNINTERRUPTIBLE,4,2       ## @TASK_UNINTERRUPTIBLE
	.comm	_HRTIMER_MODE_REL,4,2           ## @HRTIMER_MODE_REL
	.comm	_current,4,2                    ## @current
	.comm	_ERESTARTSYS,8,3                ## @ERESTARTSYS
	.no_dead_strip	_nouveau_fence_wait_legacy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nouveau_fence_wait_legacy
_nouveau_fence_wait_legacy:             ; @nouveau_fence_wait_legacy
	.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	x20, x1
	bl	_from_fence
	mov	x22, x0
Lloh0:
	adrp	x8, _NSEC_PER_MSEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NSEC_PER_MSEC@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
Lloh3:
	adrp	x8, _jiffies@GOTPAGE
Lloh4:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh5:
	ldr	x23, [x8]
	add	x21, x23, x19
	bl	_nouveau_fence_done
	cbz	w0, LBB0_3
LBB0_1:
Lloh6:
	adrp	x8, _TASK_RUNNING@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TASK_RUNNING@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	___set_current_state
	sub	x0, x21, x23
LBB0_2:
	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
LBB0_3:
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x8, w24, w8
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	sxtw	x28, w8
Lloh9:
	adrp	x26, _MAX_SCHEDULE_TIMEOUT@GOTPAGE
Lloh10:
	ldr	x26, [x26, _MAX_SCHEDULE_TIMEOUT@GOTPAGEOFF]
Lloh11:
	adrp	x27, _TASK_INTERRUPTIBLE@GOTPAGE
Lloh12:
	ldr	x27, [x27, _TASK_INTERRUPTIBLE@GOTPAGEOFF]
Lloh13:
	adrp	x24, _TASK_UNINTERRUPTIBLE@GOTPAGE
Lloh14:
	ldr	x24, [x24, _TASK_UNINTERRUPTIBLE@GOTPAGEOFF]
Lloh15:
	adrp	x25, _HRTIMER_MODE_REL@GOTPAGE
Lloh16:
	ldr	x25, [x25, _HRTIMER_MODE_REL@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	bl	_nouveau_fence_done
	cbnz	w0, LBB0_1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
Lloh17:
	adrp	x8, _jiffies@GOTPAGE
Lloh18:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh19:
	ldr	x23, [x8]
	ldr	x8, [x26]
	cmp	x8, x19
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x23
	mov	x1, x21
	bl	_time_after_eq
	cbnz	x0, LBB0_10
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	cmp	w20, #0
	csel	x8, x24, x27, eq
	ldr	w0, [x8]
	bl	___set_current_state
	str	x28, [sp, #8]
	ldr	w1, [x25]
	add	x0, sp, #8
	bl	_schedule_hrtimeout
	lsl	x8, x28, #1
Lloh20:
	adrp	x9, _NSEC_PER_MSEC@GOTPAGE
Lloh21:
	ldr	x9, [x9, _NSEC_PER_MSEC@GOTPAGEOFF]
Lloh22:
	ldrsw	x9, [x9]
	cmp	x8, x9
	csel	x28, x8, x9, lo
	cbz	w20, LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh23:
	adrp	x8, _current@GOTPAGE
Lloh24:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	bl	_signal_pending
	cbz	x0, LBB0_4
; %bb.9:
Lloh26:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	neg	x0, x8
	b	LBB0_2
LBB0_10:
Lloh29:
	adrp	x8, _TASK_RUNNING@GOTPAGE
Lloh30:
	ldr	x8, [x8, _TASK_RUNNING@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	bl	___set_current_state
	mov	x0, #0
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_NSEC_PER_MSEC,4,2              ; @NSEC_PER_MSEC
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_MAX_SCHEDULE_TIMEOUT,8,3       ; @MAX_SCHEDULE_TIMEOUT
	.comm	_TASK_RUNNING,4,2               ; @TASK_RUNNING
	.comm	_TASK_INTERRUPTIBLE,4,2         ; @TASK_INTERRUPTIBLE
	.comm	_TASK_UNINTERRUPTIBLE,4,2       ; @TASK_UNINTERRUPTIBLE
	.comm	_HRTIMER_MODE_REL,4,2           ; @HRTIMER_MODE_REL
	.comm	_current,4,2                    ; @current
	.comm	_ERESTARTSYS,8,3                ; @ERESTARTSYS
	.no_dead_strip	_nouveau_fence_wait_legacy
.subsections_via_symbols
