	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_sa_bo_new               ## -- Begin function radeon_sa_bo_new
	.p2align	4, 0x90
_radeon_sa_bo_new:                      ## @radeon_sa_bo_new
	.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, -56(%rbp)                 ## 4-byte Spill
	movl	%ecx, %ebx
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_RADEON_NUM_RINGS@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	leaq	(,%r12,8), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	shlq	$2, %r12
	movq	%r12, %rax
	movl	-56(%rbp), %r12d                ## 4-byte Reload
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -80(%rbp)                 ## 8-byte Spill
	xorl	%edi, %edi
	cmpl	%r12d, (%r14)
	setb	%dil
	callq	_BUG_ON
	xorl	%edi, %edi
	cmpl	%ebx, 4(%r14)
	setb	%dil
	callq	_BUG_ON
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kmalloc
	movq	%rax, (%r13)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%r14, 16(%rax)
	movq	(%r13), %rax
	movq	$0, 8(%rax)
	movq	(%r13), %rdi
	addq	$4, %rdi
	callq	_INIT_LIST_HEAD
	movq	(%r13), %rdi
	callq	_INIT_LIST_HEAD
	leaq	8(%r14), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_spin_lock
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
                                        ##     Child Loop BB0_11 Depth 2
                                        ##     Child Loop BB0_14 Depth 2
	movq	_RADEON_NUM_RINGS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	jle	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	(,%rbx,8), %rsi
	movq	%r15, %rdi
	callq	___bzero
	shlq	$2, %rbx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	___bzero
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	callq	_radeon_sa_bo_try_free
	movq	(%r13), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	movl	%r12d, %ecx
	callq	_radeon_sa_bo_try_alloc
	testq	%rax, %rax
	jne	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=2
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	callq	_radeon_sa_bo_next_hole
	testq	%rax, %rax
	jne	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movq	_RADEON_NUM_RINGS@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r15,%rbx,8), %rdi
	callq	_radeon_fence_ref
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_11
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_radeon_fence_wait_any
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	cmpl	$0, (%r12)
	jle	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rbx
	movq	%r15, %r13
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r13, %rdi
	callq	_radeon_fence_unref
	incq	%r12
	movslq	(%rbx), %rax
	addq	$8, %r13
	cmpq	%rax, %r12
	jl	LBB0_14
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_lock
	movq	_ENOENT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	-68(%rbp), %eax                 ## 4-byte Reload
	addl	%eax, %ecx
	movl	-56(%rbp), %r12d                ## 4-byte Reload
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	_radeon_sa_event
	movl	8(%r14), %edi
	movl	%eax, %esi
	callq	_wait_event_interruptible_locked
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	testl	%eax, %eax
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_3
## %bb.18:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %ebx
	callq	_spin_unlock
	movq	(%r13), %rdi
	callq	_kfree
	movl	%ebx, %eax
	movq	$0, (%r13)
	jmp	LBB0_19
LBB0_7:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_19:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_21
## %bb.20:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_NUM_RINGS,4,2           ## @RADEON_NUM_RINGS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ENOENT,4,2                     ## @ENOENT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_sa_bo_new               ; -- Begin function radeon_sa_bo_new
	.p2align	2
_radeon_sa_bo_new:                      ; @radeon_sa_bo_new
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	sub	sp, sp, #32
	mov	x20, x4
	mov	x21, x3
	mov	x19, x2
	mov	x22, x1
	mov	x28, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x23, _RADEON_NUM_RINGS@GOTPAGE
Lloh4:
	ldr	x23, [x23, _RADEON_NUM_RINGS@GOTPAGEOFF]
	ldr	w12, [x23]
	lsl	x8, x12, #3
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x24, x9, x8
	mov	sp, x24
	lsl	x8, x12, #2
	mov	x9, x8
Lloh7:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh8:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x25, x9, x8
	mov	sp, x25
	ldr	w8, [x1]
	cmp	w8, w4
	cset	w0, lo
	bl	_BUG_ON
	ldr	w8, [x22, #4]
	cmp	w8, w21
	cset	w0, lo
	bl	_BUG_ON
Lloh9:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kmalloc
	str	x0, [x19]
	cbz	x0, LBB0_17
; %bb.1:
	str	x22, [x0, #16]
	ldr	x8, [x19]
	str	xzr, [x8, #8]
	ldr	x8, [x19]
	add	x0, x8, #4
	bl	_INIT_LIST_HEAD
	ldr	x0, [x19]
	bl	_INIT_LIST_HEAD
	add	x0, x22, #8
	stur	x0, [x29, #-96]                 ; 8-byte Folded Spill
	bl	_spin_lock
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
                                        ;     Child Loop BB0_8 Depth 2
                                        ;     Child Loop BB0_11 Depth 2
	ldr	w26, [x23]
	cmp	w26, #1
	b.lt	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	lsl	x1, x26, #3
	mov	x0, x24
	bl	_bzero
	lsl	x1, x26, #2
	mov	x0, x25
	bl	_bzero
LBB0_4:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x22
	bl	_radeon_sa_bo_try_free
	ldr	x1, [x19]
	mov	x0, x22
	mov	x2, x21
	mov	x3, x20
	bl	_radeon_sa_bo_try_alloc
	cbnz	x0, LBB0_16
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	mov	x0, x22
	mov	x1, x24
	mov	x2, x25
	bl	_radeon_sa_bo_next_hole
	cbnz	x0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x26, #0
LBB0_8:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x24, x26, lsl #3]
	bl	_radeon_fence_ref
	add	x26, x26, #1
	ldrsw	x8, [x23]
	cmp	x26, x8
	b.lt	LBB0_8
LBB0_9:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldur	x0, [x29, #-96]                 ; 8-byte Folded Reload
	bl	_spin_unlock
	stur	x28, [x29, #-104]               ; 8-byte Folded Spill
	mov	x0, x28
	mov	x1, x24
	mov	w2, #0
	bl	_radeon_fence_wait_any
	mov	x27, x0
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_2 Depth=1
	mov	x26, #0
	mov	x28, x24
LBB0_11:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x28
	bl	_radeon_fence_unref
	add	x26, x26, #1
	ldrsw	x8, [x23]
	add	x28, x28, #8
	cmp	x26, x8
	b.lt	LBB0_11
LBB0_12:                                ;   in Loop: Header=BB0_2 Depth=1
	ldur	x0, [x29, #-96]                 ; 8-byte Folded Reload
	bl	_spin_lock
Lloh12:
	adrp	x8, _ENOENT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmn	w27, w8
	b.ne	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_radeon_sa_event
	mov	x1, x0
	ldr	w0, [x22, #8]
	bl	_wait_event_interruptible_locked
	mov	x27, x0
LBB0_14:                                ;   in Loop: Header=BB0_2 Depth=1
	ldur	x28, [x29, #-104]               ; 8-byte Folded Reload
	cbz	w27, LBB0_2
; %bb.15:
	ldur	x0, [x29, #-96]                 ; 8-byte Folded Reload
	bl	_spin_unlock
	ldr	x0, [x19]
	bl	_kfree
	str	xzr, [x19]
	b	LBB0_18
LBB0_16:
	ldur	x0, [x29, #-96]                 ; 8-byte Folded Reload
	bl	_spin_unlock
	mov	w27, #0
	b	LBB0_18
LBB0_17:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w27, w8
LBB0_18:
	ldur	x8, [x29, #-88]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_20
; %bb.19:
	mov	x0, x27
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_20:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_NUM_RINGS,4,2           ; @RADEON_NUM_RINGS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ENOENT,4,2                     ; @ENOENT
.subsections_via_symbols
