	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function create_kernel_queue_cpsch
_create_kernel_queue_cpsch:             ## @create_kernel_queue_cpsch
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_dqm_lock
	movq	(%rbx), %rsi
	movq	_max_num_of_queues_per_device@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jge	LBB0_1
## %bb.2:
	incq	%rsi
	movq	%rsi, (%rbx)
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_debug
	leaq	4(%r14), %rsi
	movq	%r15, %rdi
	callq	_list_add
	incl	8(%rbx)
	movl	$1, (%r14)
	movq	_KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_execute_queues_cpsch
	movq	%rbx, %rdi
	callq	_dqm_unlock
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_warn
	movq	%rbx, %rdi
	callq	_dqm_unlock
	movq	_EPERM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_3:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_max_num_of_queues_per_device,8,3 ## @max_num_of_queues_per_device
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't create new kernel queue because %d queues were already created\n"

	.comm	_EPERM,4,2                      ## @EPERM
L_.str.1:                               ## @.str.1
	.asciz	"Total of %d queues are accountable so far\n"

	.comm	_KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES,4,2 ## @KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES
	.no_dead_strip	_create_kernel_queue_cpsch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function create_kernel_queue_cpsch
_create_kernel_queue_cpsch:             ; @create_kernel_queue_cpsch
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_dqm_lock
	ldr	x1, [x19]
Lloh0:
	adrp	x8, _max_num_of_queues_per_device@GOTPAGE
Lloh1:
	ldr	x8, [x8, _max_num_of_queues_per_device@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ge	LBB0_2
; %bb.1:
	add	x1, x1, #1
	str	x1, [x19]
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
	add	x1, x20, #4
	mov	x0, x21
	bl	_list_add
	ldr	w8, [x19, #8]
	add	w8, w8, #1
	str	w8, [x19, #8]
	mov	w8, #1
	str	w8, [x20]
Lloh5:
	adrp	x8, _KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_execute_queues_cpsch
	mov	x0, x19
	bl	_dqm_unlock
	mov	w0, #0
	b	LBB0_3
LBB0_2:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
	mov	x0, x19
	bl	_dqm_unlock
Lloh10:
	adrp	x8, _EPERM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_max_num_of_queues_per_device,8,3 ; @max_num_of_queues_per_device
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't create new kernel queue because %d queues were already created\n"

	.comm	_EPERM,4,2                      ; @EPERM
l_.str.1:                               ; @.str.1
	.asciz	"Total of %d queues are accountable so far\n"

	.comm	_KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES,4,2 ; @KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES
	.no_dead_strip	_create_kernel_queue_cpsch
.subsections_via_symbols
