	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_fence_activity
_radeon_fence_activity:                 ## @radeon_fence_activity
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	(%rdi), %rax
	movslq	%esi, %r15
	movq	%r15, %rbx
	shlq	$4, %rbx
	leaq	(%rax,%rbx), %rdi
	addq	$8, %rdi
	callq	_atomic64_read
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	(%r13), %rax
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	(%rax,%rbx), %rax
	movl	(%rax,%r15,4), %r14d
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movl	%r15d, %esi
	callq	_radeon_fence_read
	movl	%eax, %ebx
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	jle	LBB0_7
## %bb.1:
	cmpl	%r14d, %ebx
	jg	LBB0_7
## %bb.2:
	movl	$10, %r12d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	leaq	(%rax,%r13), %rdi
	addq	$8, %rdi
	movl	%ebx, %esi
	callq	_atomic64_xchg
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	cmpl	%ebx, %eax
	jle	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r15), %rax
	movq	(%rax,%r13), %rax
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	(%rax,%rsi,4), %r14d
	movq	%r15, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_radeon_fence_read
	subl	$1, %r12d
	setb	%cl
	cmpl	%ebx, %eax
	jle	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%r14d, %eax
	jg	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %ebx
	testb	%cl, %cl
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_3
## %bb.10:
	cmpl	%r14d, %eax
	jge	LBB0_12
LBB0_11:
	movq	%r15, %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	callq	_radeon_fence_schedule_check
LBB0_12:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	%ebx, %eax
LBB0_13:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	cmpl	%r14d, %eax
	jl	LBB0_11
	jmp	LBB0_12
LBB0_8:
	movl	%ebx, %eax
	cmpl	%r14d, %eax
	jl	LBB0_11
	jmp	LBB0_12
LBB0_9:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	cmpl	%r14d, %eax
	jge	LBB0_12
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_radeon_fence_activity
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_fence_activity
_radeon_fence_activity:                 ; @radeon_fence_activity
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0]
	sbfiz	x22, x19, #4, #32
	add	x8, x8, x22
	add	x0, x8, #8
	bl	_atomic64_read
	mov	x21, x0
	ldr	x8, [x20]
	ldr	x8, [x8, x22]
	ldr	w23, [x8, w19, sxtw #2]
	mov	x0, x20
	mov	x1, x19
	bl	_radeon_fence_read
	cmp	w0, w21
	ccmp	w0, w23, #0, gt
	b.le	LBB0_2
; %bb.1:
	mov	w21, #0
	cmp	w0, w23
	b.lt	LBB0_7
	b	LBB0_8
LBB0_2:
	sxtw	x24, w19
	mov	w25, #10
	lsl	x26, x24, #4
	mov	x22, x0
	mov	w21, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	add	x8, x8, x24, lsl #4
	add	x0, x8, #8
	mov	x1, x22
	bl	_atomic64_xchg
	cmp	w0, w22
	b.le	LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x20]
	ldr	x8, [x8, x26]
	ldr	w23, [x8, x24, lsl #2]
	mov	x0, x20
	mov	x1, x19
	bl	_radeon_fence_read
	cmp	w0, w22
	b.le	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w0, w23
	ccmp	w25, #0, #4, le
	sub	w25, w25, #1
	mov	x22, x0
	b.ne	LBB0_3
LBB0_6:
	cmp	w0, w23
	b.ge	LBB0_8
LBB0_7:
	mov	x0, x20
	mov	x1, x19
	bl	_radeon_fence_schedule_check
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	w21, #1
	mov	x0, x22
	cmp	w0, w23
	b.lt	LBB0_7
	b	LBB0_8
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_radeon_fence_activity
.subsections_via_symbols
