	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function find_available_queue_slot
_find_available_queue_slot:             ## @find_available_queue_slot
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	(%rdi), %edi
	movq	_KFD_MAX_NUM_OF_QUEUES_PER_PROCESS@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	callq	_find_first_zero_bit
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	callq	_pr_debug
	cmpq	(%r12), %rbx
	jae	LBB0_1
## %bb.2:
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_set_bit
	movl	%ebx, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	movq	8(%r15), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_info
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KFD_MAX_NUM_OF_QUEUES_PER_PROCESS,8,3 ## @KFD_MAX_NUM_OF_QUEUES_PER_PROCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"The new slot id %lu\n"

L_.str.1:                               ## @.str.1
	.asciz	"Cannot open more queues for process with pasid %d\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_find_available_queue_slot
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function find_available_queue_slot
_find_available_queue_slot:             ; @find_available_queue_slot
	.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	x19, x1
	mov	x20, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x22, _KFD_MAX_NUM_OF_QUEUES_PER_PROCESS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _KFD_MAX_NUM_OF_QUEUES_PER_PROCESS@GOTPAGEOFF]
	ldr	x1, [x22]
	bl	_find_first_zero_bit
	mov	x21, x0
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_pr_debug
	ldr	x8, [x22]
	cmp	x21, x8
	b.hs	LBB0_2
; %bb.1:
	ldr	w1, [x20]
	mov	x0, x21
	bl	_set_bit
	mov	w0, #0
	str	w21, [x19]
	b	LBB0_3
LBB0_2:
	ldr	x8, [x20, #8]
	ldr	w1, [x8]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_info
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	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 AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_KFD_MAX_NUM_OF_QUEUES_PER_PROCESS,8,3 ; @KFD_MAX_NUM_OF_QUEUES_PER_PROCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"The new slot id %lu\n"

l_.str.1:                               ; @.str.1
	.asciz	"Cannot open more queues for process with pasid %d\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_find_available_queue_slot
.subsections_via_symbols
