	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_bo_list_create          ## -- Begin function amdgpu_bo_list_create
	.p2align	4, 0x90
_amdgpu_bo_list_create:                 ## @amdgpu_bo_list_create
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, -112(%rbp)                ## 8-byte Spill
	movl	%ecx, %ebx
	movq	_SIZE_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$-40, %rax
	shrq	$4, %rax
	cmpq	%rbx, %rax
	jae	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_3:
	movq	%r8, %r14
	movl	%ecx, %r12d
	movq	%rbx, %r15
	shlq	$4, %r15
	leaq	40(%r15), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kvmalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r13
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	leaq	32(%rax), %rdi
	callq	_kref_init
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%r13)
	movq	$0, 24(%r13)
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_bo_list_array_entry
	movq	%rax, %r14
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_memset
	movl	$0, %r15d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
	testl	%r12d, %r12d
	je	LBB0_28
## %bb.6:
	movq	%r13, %rax
	addq	$8, %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%r15d, %r15d
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_27:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, %rdi
	callq	_amdgpu_bo_size
	addl	%eax, %r15d
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_trace_amdgpu_bo_list_set
	incq	%r12
	cmpq	%r12, -104(%rbp)                ## 8-byte Folded Reload
	je	LBB0_28
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax,%r12,8), %esi
	movq	-112(%rbp), %rdi                ## 8-byte Reload
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_gem_to_amdgpu_bo
	movl	%eax, %edi
	callq	_amdgpu_bo_ref
	movq	%rax, %r13
	movq	%rax, -56(%rbp)
	movq	%rbx, %rdi
	callq	_drm_gem_object_put_unlocked
	movl	8(%r13), %edi
	callq	_amdgpu_ttm_tt_get_usermm
	testq	%rax, %rax
	je	LBB0_20
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_current@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.19:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	decl	%eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%ecx, %eax
	incl	%ecx
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
LBB0_21:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	%eax, %ebx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%r12,8), %edi
	movq	_AMDGPU_BO_LIST_MAX_PRIORITY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_min
	shlq	$4, %rbx
	movl	%eax, 8(%r14,%rbx)
	addq	$8, %r13
	movq	%r13, (%r14,%rbx)
	movq	-56(%rbp), %rbx
	movq	(%rbx), %rax
	movq	_AMDGPU_GEM_DOMAIN_GDS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	jne	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, 24(%r13)
LBB0_23:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_AMDGPU_GEM_DOMAIN_GWS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, 16(%r13)
LBB0_25:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_AMDGPU_GEM_DOMAIN_OA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
	jmp	LBB0_27
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_29
LBB0_28:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r13)
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movl	%edi, 4(%r13)
	movl	%r15d, %esi
	callq	_trace_amdgpu_cs_bo_status
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	%r13, (%rax)
	xorl	%eax, %eax
	jmp	LBB0_29
LBB0_8:
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	jmp	LBB0_12
LBB0_11:
	leaq	-56(%rbp), %rdi
	callq	_amdgpu_bo_unref
	movq	_EPERM@GOTPCREL(%rip), %rcx
	movq	-80(%rbp), %r13                 ## 8-byte Reload
LBB0_12:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	testl	%eax, %eax
	je	LBB0_15
## %bb.13:
	movl	%eax, %r12d
	shlq	$4, %r12
	xorl	%ebx, %ebx
	leaq	-56(%rbp), %r15
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14,%rbx), %rdi
	callq	_ttm_to_amdgpu_bo
	movq	%rax, -56(%rbp)
	movq	%r15, %rdi
	callq	_amdgpu_bo_unref
	addq	$16, %rbx
	cmpq	%rbx, %r12
	jne	LBB0_14
LBB0_15:
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ebx, %ecx
	jae	LBB0_18
## %bb.16:
	movl	%ecx, %eax
	shlq	$4, %rax
	addq	%rax, %r14
	subl	%ecx, %ebx
	leaq	-56(%rbp), %r15
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	callq	_ttm_to_amdgpu_bo
	movq	%rax, -56(%rbp)
	movq	%r15, %rdi
	callq	_amdgpu_bo_unref
	addq	$16, %r14
	decl	%ebx
	jne	LBB0_17
LBB0_18:
	movq	%r13, %rdi
	callq	_kvfree
	movl	-64(%rbp), %eax                 ## 4-byte Reload
LBB0_29:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SIZE_MAX,4,2                   ## @SIZE_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_current,8,3                    ## @current
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_AMDGPU_BO_LIST_MAX_PRIORITY,4,2 ## @AMDGPU_BO_LIST_MAX_PRIORITY
	.comm	_AMDGPU_GEM_DOMAIN_GDS,8,3      ## @AMDGPU_GEM_DOMAIN_GDS
	.comm	_AMDGPU_GEM_DOMAIN_GWS,8,3      ## @AMDGPU_GEM_DOMAIN_GWS
	.comm	_AMDGPU_GEM_DOMAIN_OA,8,3       ## @AMDGPU_GEM_DOMAIN_OA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_bo_list_create          ; -- Begin function amdgpu_bo_list_create
	.p2align	2
_amdgpu_bo_list_create:                 ; @amdgpu_bo_list_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	w27, w3
Lloh0:
	adrp	x8, _SIZE_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SIZE_MAX@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	sub	x8, x8, #40
	cmp	x27, x8, lsr #4
	b.ls	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_18
LBB0_2:
	mov	x20, x4
	mov	x26, x3
	mov	x25, x2
	mov	x23, x1
	lsl	x24, x27, #4
	add	x0, x24, #40
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_kvmalloc
	cbz	x0, LBB0_17
; %bb.3:
	mov	x19, x0
	add	x0, x0, #32
	bl	_kref_init
	mov	x8, x19
	str	xzr, [x8, #8]!
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
	stp	xzr, xzr, [x19, #16]
	mov	x0, x19
	mov	w1, #0
	bl	_amdgpu_bo_list_array_entry
	mov	x22, x0
	mov	w1, #0
	mov	x2, x24
	bl	_memset
	str	w26, [sp, #12]                  ; 4-byte Folded Spill
	str	x20, [sp]                       ; 8-byte Folded Spill
	cbz	w26, LBB0_19
; %bb.4:
	mov	w21, #0
	mov	w24, #0
	add	x20, x25, #4
	mov	x28, x26
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x25
	bl	_amdgpu_bo_size
	add	w24, w24, w0
	mov	x0, x19
	mov	x1, x25
	bl	_trace_amdgpu_bo_list_set
	add	x20, x20, #8
	subs	x27, x27, #1
	b.eq	LBB0_20
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20]
	mov	x0, x23
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_21
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x26, x0
	bl	_gem_to_amdgpu_bo
	bl	_amdgpu_bo_ref
	mov	x25, x0
	str	x0, [sp, #24]
	mov	x0, x26
	bl	_drm_gem_object_put_unlocked
	ldr	w0, [x25, #8]
	bl	_amdgpu_ttm_tt_get_usermm
	cbz	x0, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh8:
	adrp	x8, _current@GOTPAGE
Lloh9:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_22
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	sub	w28, w28, #1
	mov	x26, x28
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x26, x21
	add	w21, w21, #1
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	ldur	w0, [x20, #-4]
Lloh11:
	adrp	x8, _AMDGPU_BO_LIST_MAX_PRIORITY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AMDGPU_BO_LIST_MAX_PRIORITY@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_min
	add	x8, x22, w26, uxtw #4
	str	w0, [x8, #8]
	add	x9, x25, #8
	str	x9, [x8]
	ldr	x25, [sp, #24]
	ldr	x8, [x25]
Lloh14:
	adrp	x9, _AMDGPU_GEM_DOMAIN_GDS@GOTPAGE
Lloh15:
	ldr	x9, [x9, _AMDGPU_GEM_DOMAIN_GDS@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	str	x25, [x19, #24]
LBB0_13:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh17:
	adrp	x9, _AMDGPU_GEM_DOMAIN_GWS@GOTPAGE
Lloh18:
	ldr	x9, [x9, _AMDGPU_GEM_DOMAIN_GWS@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_6 Depth=1
	str	x25, [x19, #16]
LBB0_15:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh20:
	adrp	x9, _AMDGPU_GEM_DOMAIN_OA@GOTPAGE
Lloh21:
	ldr	x9, [x9, _AMDGPU_GEM_DOMAIN_OA@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.16:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	str	x25, [x8]
	b	LBB0_5
LBB0_17:
Lloh23:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_29
LBB0_19:
	mov	w24, #0
	mov	w28, #0
LBB0_20:
	ldr	w0, [sp, #12]                   ; 4-byte Folded Reload
	stp	w28, w0, [x19]
	mov	x1, x24
	bl	_trace_amdgpu_cs_bo_status
	mov	w23, #0
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	str	x19, [x8]
	b	LBB0_29
LBB0_21:
Lloh25:
	adrp	x8, _ENOENT@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh27:
	ldr	w20, [x8]
	cbnz	w21, LBB0_23
	b	LBB0_25
LBB0_22:
	add	x0, sp, #24
	bl	_amdgpu_bo_unref
Lloh28:
	adrp	x8, _EPERM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh30:
	ldr	w20, [x8]
	cbz	w21, LBB0_25
LBB0_23:
	mov	w21, w21
	mov	x23, x22
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x23], #16
	bl	_ttm_to_amdgpu_bo
	str	x0, [sp, #24]
	add	x0, sp, #24
	bl	_amdgpu_bo_unref
	subs	x21, x21, #1
	b.ne	LBB0_24
LBB0_25:
	neg	w23, w20
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cmp	w28, w8
	b.hs	LBB0_28
; %bb.26:
	add	x20, x22, w28, uxtw #4
	sub	w21, w8, w28
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20], #16
	bl	_ttm_to_amdgpu_bo
	str	x0, [sp, #24]
	add	x0, sp, #24
	bl	_amdgpu_bo_unref
	subs	w21, w21, #1
	b.ne	LBB0_27
LBB0_28:
	mov	x0, x19
	bl	_kvfree
LBB0_29:
	mov	x0, x23
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_SIZE_MAX,4,2                   ; @SIZE_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_current,8,3                    ; @current
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_AMDGPU_BO_LIST_MAX_PRIORITY,4,2 ; @AMDGPU_BO_LIST_MAX_PRIORITY
	.comm	_AMDGPU_GEM_DOMAIN_GDS,8,3      ; @AMDGPU_GEM_DOMAIN_GDS
	.comm	_AMDGPU_GEM_DOMAIN_GWS,8,3      ; @AMDGPU_GEM_DOMAIN_GWS
	.comm	_AMDGPU_GEM_DOMAIN_OA,8,3       ; @AMDGPU_GEM_DOMAIN_OA
.subsections_via_symbols
