	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_sa_bo_new               ## -- Begin function amdgpu_sa_bo_new
	.p2align	4, 0x90
_amdgpu_sa_bo_new:                      ## @amdgpu_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	%ecx, %r12d
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_AMDGPU_SA_NUM_FENCE_LISTS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	(,%rbx,8), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	shlq	$2, %rbx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	xorl	%edi, %edi
	cmpl	%r12d, (%r15)
	setb	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	jne	LBB0_1
## %bb.3:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	xorl	%edi, %edi
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, 4(%r15)
	setb	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	je	LBB0_4
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_25:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_27
## %bb.26:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kmalloc
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%r15, 16(%rax)
	movq	(%r14), %rax
	movq	$0, 8(%rax)
	movq	(%r14), %rdi
	addq	$4, %rdi
	callq	_INIT_LIST_HEAD
	movq	(%r14), %rdi
	callq	_INIT_LIST_HEAD
	leaq	8(%r15), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_spin_lock
	movq	_AMDGPU_SA_NUM_FENCE_LISTS@GOTPCREL(%rip), %rax
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
                                        ##     Child Loop BB0_15 Depth 2
                                        ##     Child Loop BB0_20 Depth 2
	movl	(%rax), %esi
	testl	%esi, %esi
	jle	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	shlq	$2, %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	___bzero
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rdi
	callq	_amdgpu_sa_bo_try_free
	movq	(%r14), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	movl	%r12d, %ecx
	callq	_amdgpu_sa_bo_try_alloc
	testq	%rax, %rax
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_amdgpu_sa_bo_next_hole
	testq	%rax, %rax
	jne	LBB0_10
## %bb.13:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	_AMDGPU_SA_NUM_FENCE_LISTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_22
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_15 Depth=2
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_18
LBB0_15:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r13,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=2
	callq	_dma_fence_get
	movl	%r14d, %ecx
	incl	%r14d
	movq	%rax, (%r13,%rcx,8)
	movq	_AMDGPU_SA_NUM_FENCE_LISTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_17
LBB0_18:                                ##   in Loop: Header=BB0_7 Depth=1
	testl	%r14d, %r14d
	je	LBB0_22
## %bb.19:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	_MAX_SCHEDULE_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movl	%r14d, %esi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	callq	_dma_fence_wait_any_timeout
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_20:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r13,%rbx,8), %rdi
	callq	_dma_fence_put
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, %rbx
	sarq	$63, %rbx
	andl	%eax, %ebx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_lock
	jmp	LBB0_23
LBB0_22:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r15, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	callq	_amdgpu_sa_event
	movl	8(%r15), %edi
	movl	%eax, %esi
	callq	_wait_event_interruptible_locked
	movl	%eax, %ebx
LBB0_23:                                ##   in Loop: Header=BB0_7 Depth=1
	testl	%ebx, %ebx
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	_AMDGPU_SA_NUM_FENCE_LISTS@GOTPCREL(%rip), %rax
	je	LBB0_7
## %bb.24:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	(%r14), %rdi
	callq	_kfree
	movq	$0, (%r14)
	jmp	LBB0_25
LBB0_11:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	xorl	%ebx, %ebx
	jmp	LBB0_25
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_27:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_SA_NUM_FENCE_LISTS,4,2  ## @AMDGPU_SA_NUM_FENCE_LISTS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MAX_SCHEDULE_TIMEOUT,4,2       ## @MAX_SCHEDULE_TIMEOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_sa_bo_new               ; -- Begin function amdgpu_sa_bo_new
	.p2align	2
_amdgpu_sa_bo_new:                      ; @amdgpu_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, #16
	mov	x20, x3
	mov	x21, x2
	mov	x19, x1
	mov	x22, 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	x28, _AMDGPU_SA_NUM_FENCE_LISTS@GOTPAGE
Lloh4:
	ldr	x28, [x28, _AMDGPU_SA_NUM_FENCE_LISTS@GOTPAGEOFF]
	ldr	w12, [x28]
	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	x25, x9, x8
	mov	sp, x25
	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	x24, x9, x8
	mov	sp, x24
	ldr	w8, [x0]
	cmp	w8, w3
	cset	w0, lo
	bl	_WARN_ON_ONCE
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x22, #4]
	cmp	w8, w21
	cset	w0, lo
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_6
LBB0_2:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w26, w8
LBB0_4:
	ldur	x8, [x29, #-88]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_25
; %bb.5:
	mov	x0, x26
	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_6:
Lloh14:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kmalloc
	str	x0, [x19]
	cbz	x0, LBB0_24
; %bb.7:
	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	x23, x22, #8
	mov	x0, x23
	bl	_spin_lock
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
                                        ;     Child Loop BB0_15 Depth 2
                                        ;     Child Loop BB0_19 Depth 2
	ldr	w8, [x28]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	lsl	x1, x8, #2
	mov	x0, x24
	bl	_bzero
LBB0_10:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x22
	bl	_amdgpu_sa_bo_try_free
	ldr	x1, [x19]
	mov	x0, x22
	mov	x2, x21
	mov	x3, x20
	bl	_amdgpu_sa_bo_try_alloc
	cbnz	x0, LBB0_23
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	mov	x0, x22
	mov	x1, x25
	mov	x2, x24
	bl	_amdgpu_sa_bo_next_hole
	cbnz	x0, LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x28]
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x27, #0
	mov	w26, #0
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=2
	add	x27, x27, #1
	cmp	x27, w8, sxtw
	b.ge	LBB0_17
LBB0_15:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x25, x27, lsl #3]
	cbz	x0, LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=2
	bl	_dma_fence_get
	str	x0, [x25, w26, uxtw #3]
	add	w26, w26, #1
	ldr	w8, [x28]
	b	LBB0_14
LBB0_17:                                ;   in Loop: Header=BB0_8 Depth=1
	cbz	w26, LBB0_21
; %bb.18:                               ;   in Loop: Header=BB0_8 Depth=1
	stur	x23, [x29, #-96]                ; 8-byte Folded Spill
	mov	x0, x23
	bl	_spin_unlock
Lloh17:
	adrp	x8, _MAX_SCHEDULE_TIMEOUT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MAX_SCHEDULE_TIMEOUT@GOTPAGEOFF]
Lloh19:
	ldr	w3, [x8]
	mov	x0, x25
	mov	x1, x26
	mov	w2, #0
	mov	x4, #0
	bl	_dma_fence_wait_any_timeout
	mov	x27, x0
	mov	w26, w26
	mov	x23, x25
LBB0_19:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x23], #8
	bl	_dma_fence_put
	subs	x26, x26, #1
	b.ne	LBB0_19
; %bb.20:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	x27, #0
	csel	x26, x27, xzr, lt
	ldur	x23, [x29, #-96]                ; 8-byte Folded Reload
	mov	x0, x23
	bl	_spin_lock
	cbz	w26, LBB0_8
	b	LBB0_22
LBB0_21:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_amdgpu_sa_event
	mov	x1, x0
	ldr	w0, [x22, #8]
	bl	_wait_event_interruptible_locked
	mov	x26, x0
	cbz	w26, LBB0_8
LBB0_22:
	mov	x0, x23
	bl	_spin_unlock
	ldr	x0, [x19]
	bl	_kfree
	str	xzr, [x19]
	b	LBB0_4
LBB0_23:
	mov	x0, x23
	bl	_spin_unlock
	mov	w26, #0
	b	LBB0_4
LBB0_24:
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_3
LBB0_25:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_SA_NUM_FENCE_LISTS,4,2  ; @AMDGPU_SA_NUM_FENCE_LISTS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MAX_SCHEDULE_TIMEOUT,4,2       ; @MAX_SCHEDULE_TIMEOUT
.subsections_via_symbols
