	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_fence_wait             ## -- Begin function nouveau_fence_wait
	.p2align	4, 0x90
_nouveau_fence_wait:                    ## @nouveau_fence_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
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	%rdi, %r13
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	(%rax), %rax
	movq	(%rax), %rbx
	movq	_NSEC_PER_MSEC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%r14d, %r14d
	testq	%rbx, %rbx
	je	LBB0_15
## %bb.2:
	testl	%r15d, %r15d
	je	LBB0_15
## %bb.3:
	cmpq	$0, (%rbx)
	je	LBB0_15
## %bb.4:
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_nouveau_fence_done
	testl	%eax, %eax
	jne	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_nouveau_fence_wait_uevent
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_31
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	testl	%r15d, %r15d
	je	LBB0_15
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpq	$0, (%rbx)
	jne	LBB0_5
LBB0_15:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_16
LBB0_10:
	movq	_NSEC_PER_MSEC@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%r14d, %r14d
LBB0_16:
	movq	%r13, %rdi
	callq	_nouveau_fence_done
	testl	%eax, %eax
	jne	LBB0_30
## %bb.17:
	movslq	%ebx, %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	movslq	%eax, %rbx
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_19 Depth=1
	movq	%r13, %rdi
	callq	_nouveau_fence_done
	testl	%eax, %eax
	jne	LBB0_30
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rsi
	testq	%rsi, %rsi
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	_jiffies@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_time_after_eq
	testq	%rax, %rax
	jne	LBB0_28
LBB0_21:                                ##   in Loop: Header=BB0_19 Depth=1
	movq	_TASK_INTERRUPTIBLE@GOTPCREL(%rip), %rax
	testl	%r12d, %r12d
	jne	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	_TASK_UNINTERRUPTIBLE@GOTPCREL(%rip), %rax
LBB0_23:                                ##   in Loop: Header=BB0_19 Depth=1
	movl	(%rax), %edi
	callq	___set_current_state
	testl	%r15d, %r15d
	je	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_19 Depth=1
	xorl	%edi, %edi
	movq	%rbx, %rsi
	callq	_ktime_set
	movl	%eax, -48(%rbp)
	movq	_HRTIMER_MODE_REL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdi
	callq	_schedule_hrtimeout
	addq	%rbx, %rbx
	movq	_NSEC_PER_MSEC@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	cmovaeq	%rax, %rbx
LBB0_25:                                ##   in Loop: Header=BB0_19 Depth=1
	testl	%r12d, %r12d
	je	LBB0_18
## %bb.26:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_signal_pending
	testq	%rax, %rax
	je	LBB0_18
## %bb.27:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	jmp	LBB0_29
LBB0_28:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_29:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_30:
	movq	_TASK_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	___set_current_state
LBB0_31:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NSEC_PER_MSEC,4,2              ## @NSEC_PER_MSEC
	.comm	_jiffies,4,2                    ## @jiffies
	.comm	_EBUSY,4,2                      ## @EBUSY
	.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,4,2                ## @ERESTARTSYS
	.comm	_TASK_RUNNING,4,2               ## @TASK_RUNNING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_fence_wait             ; -- Begin function nouveau_fence_wait
	.p2align	2
_nouveau_fence_wait:                    ; @nouveau_fence_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	x20, x1
	mov	x21, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_9
; %bb.1:
	ldr	x8, [x8]
	ldr	x24, [x8]
Lloh0:
	adrp	x8, _NSEC_PER_MSEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NSEC_PER_MSEC@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	mov	w22, #0
	cbz	x24, LBB0_10
; %bb.2:
	cbz	w20, LBB0_10
; %bb.3:
	ldr	x8, [x24]
	cbz	x8, LBB0_10
; %bb.4:
	mov	w22, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_nouveau_fence_done
	cbnz	w0, LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	mov	x1, x19
	bl	_nouveau_fence_wait_uevent
	mov	x22, x0
	tbnz	w0, #31, LBB0_23
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	cbz	w20, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x24]
	cbnz	x8, LBB0_5
	b	LBB0_10
LBB0_9:
	mov	w22, #0
Lloh3:
	adrp	x8, _NSEC_PER_MSEC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NSEC_PER_MSEC@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
LBB0_10:
	mov	x0, x21
	bl	_nouveau_fence_done
	cbnz	w0, LBB0_22
; %bb.11:
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x8, w23, w8
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	sxtw	x23, w8
Lloh6:
	adrp	x24, _TASK_INTERRUPTIBLE@GOTPAGE
Lloh7:
	ldr	x24, [x24, _TASK_INTERRUPTIBLE@GOTPAGEOFF]
Lloh8:
	adrp	x25, _TASK_UNINTERRUPTIBLE@GOTPAGE
Lloh9:
	ldr	x25, [x25, _TASK_UNINTERRUPTIBLE@GOTPAGEOFF]
Lloh10:
	adrp	x27, _HRTIMER_MODE_REL@GOTPAGE
Lloh11:
	ldr	x27, [x27, _HRTIMER_MODE_REL@GOTPAGEOFF]
Lloh12:
	adrp	x28, _NSEC_PER_MSEC@GOTPAGE
Lloh13:
	ldr	x28, [x28, _NSEC_PER_MSEC@GOTPAGEOFF]
Lloh14:
	adrp	x26, _jiffies@GOTPAGE
Lloh15:
	ldr	x26, [x26, _jiffies@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x21
	bl	_nouveau_fence_done
	cbnz	w0, LBB0_22
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x21]
	cbz	x1, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w0, [x26]
	bl	_time_after_eq
	cbnz	x0, LBB0_20
LBB0_15:                                ;   in Loop: Header=BB0_13 Depth=1
	cmp	w19, #0
	csel	x8, x25, x24, eq
	ldr	w0, [x8]
	bl	___set_current_state
	cbz	w20, LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	w0, #0
	mov	x1, x23
	bl	_ktime_set
	str	w0, [sp, #12]
	ldr	w1, [x27]
	add	x0, sp, #12
	bl	_schedule_hrtimeout
	lsl	x8, x23, #1
	ldrsw	x9, [x28]
	cmp	x8, x9
	csel	x23, x8, x9, lo
LBB0_17:                                ;   in Loop: Header=BB0_13 Depth=1
	cbz	w19, LBB0_12
; %bb.18:                               ;   in Loop: Header=BB0_13 Depth=1
Lloh16:
	adrp	x8, _current@GOTPAGE
Lloh17:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_signal_pending
	cbz	x0, LBB0_12
; %bb.19:
Lloh19:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
	b	LBB0_21
LBB0_20:
Lloh21:
	adrp	x8, _EBUSY@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_21:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_22:
Lloh23:
	adrp	x8, _TASK_RUNNING@GOTPAGE
Lloh24:
	ldr	x8, [x8, _TASK_RUNNING@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	bl	___set_current_state
LBB0_23:
	mov	x0, x22
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_NSEC_PER_MSEC,4,2              ; @NSEC_PER_MSEC
	.comm	_jiffies,4,2                    ; @jiffies
	.comm	_EBUSY,4,2                      ; @EBUSY
	.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,4,2                ; @ERESTARTSYS
	.comm	_TASK_RUNNING,4,2               ; @TASK_RUNNING
.subsections_via_symbols
