	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_fence_wait_seq
_radeon_fence_wait_seq:                 ## @radeon_fence_wait_seq
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r12d
	movq	16(%rdi), %rax
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %r13
	shlq	$4, %r13
	leaq	(%rax,%r13), %rdi
	addq	$8, %rdi
	callq	_atomic64_read
	xorl	%ebx, %ebx
	cmpq	%r15, %rax
	jge	LBB0_34
## %bb.1:
	movq	_jiffies@GOTPCREL(%rip), %rdx
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_mutex_unlock
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%r14), %rax
	leaq	(%rax,%r13), %rdi
	addq	$8, %rdi
	callq	_atomic64_read
	cmpq	%r15, %rax
	movq	_jiffies@GOTPCREL(%rip), %rdx
	jge	LBB0_20
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpl	$0, (%rax,%rcx,4)
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rdx), %rbx
	movq	_RADEON_FENCE_JIFFIES_TIMEOUT@GOTPCREL(%rip), %rax
	subq	(%rax), %rbx
	movq	16(%r14), %rax
	movq	(%rax,%r13), %rdi
	movq	%rbx, %rsi
	callq	_time_after
	movq	16(%r14), %rcx
	movq	%r15, %r12
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rcx,%r13), %r15
	subq	%rbx, %r15
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %r15d
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%rcx,%r13), %rdi
	addq	$8, %rdi
	callq	_atomic64_read
	movq	%rax, %rsi
	movq	16(%r14), %rax
	movq	(%rax,%r13), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	28(%r14), %edi
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	callq	_trace_radeon_fence_wait_begin
	movq	%r14, %rdi
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %esi
	callq	_radeon_irq_kms_sw_irq_get
	movl	32(%r14), %ebx
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%r13d, %edx
	callq	_radeon_fence_seq_signaled
	movl	%eax, %r13d
	cmpl	$0, -60(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %edi
	movl	%r13d, %esi
	movq	%r15, %rdx
	callq	_wait_event_interruptible_timeout
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %edi
	movl	%r13d, %esi
	movq	%r15, %rdx
	callq	_wait_event_timeout
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %ebx
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_radeon_irq_kms_sw_irq_put
	movl	%ebx, %edi
	shrl	$31, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_34
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	28(%r14), %edi
	movq	%r12, %rsi
	callq	_trace_radeon_fence_wait_end
	xorl	%edi, %edi
	testl	%r13d, %r13d
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_19
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	testl	%ebx, %ebx
	jne	LBB0_19
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%r14), %rax
	leaq	(%rax,%r13), %rdi
	addq	$8, %rdi
	callq	_atomic64_read
	cmpq	%rax, %r12
	jne	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_15
## %bb.17:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	16(%r14), %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	cmpq	(%rax,%r13), %rcx
	jne	LBB0_18
## %bb.21:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(,%rax,4), %rdx
	addq	8(%r14), %rdx
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_radeon_ring_is_lockup
	testq	%rax, %rax
	je	LBB0_18
	jmp	LBB0_22
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%r14), %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	cmpq	(%rax,%r13), %rcx
	jne	LBB0_19
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(,%rax,4), %rdx
	addq	8(%r14), %rdx
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_radeon_ring_is_lockup
	testq	%rax, %rax
	je	LBB0_19
LBB0_22:
	movl	24(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	movq	%r12, %rcx
	callq	_dev_warn
	movq	_RADEON_NUM_RINGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testq	%rdx, %rdx
	movq	_jiffies@GOTPCREL(%rip), %rax
	je	LBB0_30
## %bb.23:
	movq	16(%r14), %r8
	leaq	-1(%rdx), %rsi
	movl	%edx, %ecx
	andl	$3, %ecx
	cmpq	$3, %rsi
	jae	LBB0_25
## %bb.24:
	xorl	%esi, %esi
	jmp	LBB0_27
LBB0_3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_33:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_34
LBB0_20:
	xorl	%ebx, %ebx
LBB0_34:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	andl	$-4, %edx
	leaq	48(%r8), %rdi
	xorl	%esi, %esi
LBB0_26:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rax), %rbx
	movq	%rbx, -48(%rdi)
	movq	(%rax), %rbx
	movq	%rbx, -32(%rdi)
	movq	(%rax), %rbx
	movq	%rbx, -16(%rdi)
	movq	(%rax), %rbx
	movq	%rbx, (%rdi)
	addq	$4, %rsi
	addq	$64, %rdi
	cmpq	%rsi, %rdx
	jne	LBB0_26
LBB0_27:
	testq	%rcx, %rcx
	je	LBB0_30
## %bb.28:
	shlq	$4, %rsi
	addq	%rsi, %r8
	shlq	$4, %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rax), %rsi
	movq	%rsi, (%r8,%rdx)
	addq	$16, %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_29
LBB0_30:
	movq	8(%r14), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	$0, (%rax,%rcx,4)
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_32
## %bb.31:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_32:
	movq	_EDEADLK@GOTPCREL(%rip), %rax
	jmp	LBB0_33
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_RADEON_FENCE_JIFFIES_TIMEOUT,8,3 ## @RADEON_FENCE_JIFFIES_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GPU lockup (waiting for 0x%016llx last fence id 0x%016llx)\n"

	.comm	_RADEON_NUM_RINGS,4,2           ## @RADEON_NUM_RINGS
	.comm	_EDEADLK,4,2                    ## @EDEADLK
	.no_dead_strip	_radeon_fence_wait_seq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_fence_wait_seq
_radeon_fence_wait_seq:                 ; @radeon_fence_wait_seq
	.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	x20, x4
	mov	x22, x3
	mov	x23, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
	add	x8, x8, w2, uxtw #4
	add	x0, x8, #8
	bl	_atomic64_read
	cmp	x0, x21
	b.ge	LBB0_26
; %bb.1:
	stp	w20, w22, [sp, #8]              ; 8-byte Folded Spill
	mov	w28, w23
Lloh0:
	adrp	x9, _jiffies@GOTPAGE
Lloh1:
	ldr	x9, [x9, _jiffies@GOTPAGEOFF]
	lsl	x20, x28, #4
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	bl	_mutex_unlock
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #16]
	add	x8, x8, x28, lsl #4
	add	x0, x8, #8
	bl	_atomic64_read
	cmp	x0, x21
Lloh2:
	adrp	x9, _jiffies@GOTPAGE
Lloh3:
	ldr	x9, [x9, _jiffies@GOTPAGEOFF]
	b.ge	LBB0_26
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	w8, [x8, x28, lsl #2]
	cbz	w8, LBB0_27
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x9]
Lloh4:
	adrp	x9, _RADEON_FENCE_JIFFIES_TIMEOUT@GOTPAGE
Lloh5:
	ldr	x9, [x9, _RADEON_FENCE_JIFFIES_TIMEOUT@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	sub	x24, x8, x9
	ldr	x8, [x19, #16]
	ldr	x0, [x8, x20]
	mov	x1, x24
	bl	_time_after
	ldr	x8, [x19, #16]
	cbz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x8, x20]
	sub	x25, x9, x24
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w25, #1
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x8, x20
	add	x0, x8, #8
	bl	_atomic64_read
	mov	x24, x0
	ldr	x8, [x19, #16]
	ldr	x22, [x8, x20]
	ldr	w0, [x19, #28]
	mov	x1, x24
	bl	_trace_radeon_fence_wait_begin
	mov	x0, x19
	mov	x1, x23
	bl	_radeon_irq_kms_sw_irq_get
	ldr	w27, [x19, #32]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	bl	_radeon_fence_seq_signaled
	mov	x26, x0
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x27
	mov	x1, x26
	mov	x2, x25
	bl	_wait_event_interruptible_timeout
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x27
	mov	x1, x26
	mov	x2, x25
	bl	_wait_event_timeout
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x25, x0
	mov	x0, x19
	mov	x1, x23
	bl	_radeon_irq_kms_sw_irq_put
	lsr	w0, w25, #31
	bl	_unlikely
	cbnz	x0, LBB0_29
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19, #28]
	mov	x1, x24
	bl	_trace_radeon_fence_wait_end
	cmp	w26, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_3
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
	cbnz	w25, LBB0_3
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #16]
	add	x8, x8, x28, lsl #4
	add	x0, x8, #8
	bl	_atomic64_read
	cmp	x24, x0
	b.ne	LBB0_3
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #8]                    ; 4-byte Folded Reload
	cbz	w8, LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x19, #16]
	ldr	x8, [x8, x20]
	cmp	x22, x8
	b.ne	LBB0_2
; %bb.17:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #8]
	add	x2, x8, x28, lsl #2
	mov	x0, x19
	mov	x1, x23
	bl	_radeon_ring_is_lockup
	cbz	x0, LBB0_2
	b	LBB0_20
LBB0_18:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #16]
	ldr	x8, [x8, x20]
	cmp	x22, x8
	b.ne	LBB0_3
; %bb.19:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #8]
	add	x2, x8, x28, lsl #2
	mov	x0, x19
	mov	x1, x23
	bl	_radeon_ring_is_lockup
	cbz	x0, LBB0_3
LBB0_20:
	ldr	w0, [x19, #24]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x24
	bl	_dev_warn
Lloh9:
	adrp	x8, _RADEON_NUM_RINGS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RADEON_NUM_RINGS@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x11, _jiffies@GOTPAGE
Lloh13:
	ldr	x11, [x11, _jiffies@GOTPAGEOFF]
	cbz	w8, LBB0_23
; %bb.21:
	ldr	x9, [x19, #16]
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x11]
	str	x10, [x9], #16
	subs	x8, x8, #1
	b.ne	LBB0_22
LBB0_23:
	ldr	x8, [x19, #8]
	str	wzr, [x8, x28, lsl #2]
	ldr	w8, [sp, #8]                    ; 4-byte Folded Reload
	cbz	w8, LBB0_25
; %bb.24:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_25:
Lloh14:
	adrp	x8, _EDEADLK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EDEADLK@GOTPAGEOFF]
	b	LBB0_28
LBB0_26:
	mov	w25, #0
	b	LBB0_29
LBB0_27:
Lloh16:
	adrp	x8, _EBUSY@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_28:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_29:
	mov	x0, x25
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_RADEON_FENCE_JIFFIES_TIMEOUT,8,3 ; @RADEON_FENCE_JIFFIES_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GPU lockup (waiting for 0x%016llx last fence id 0x%016llx)\n"

	.comm	_RADEON_NUM_RINGS,4,2           ; @RADEON_NUM_RINGS
	.comm	_EDEADLK,4,2                    ; @EDEADLK
	.no_dead_strip	_radeon_fence_wait_seq
.subsections_via_symbols
