	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function validate_queue_index
_validate_queue_index:                  ## @validate_queue_index
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rdi, %r13
	movl	$1, (%rcx)
	movq	(%rdx), %rdx
	movq	_HL_MAX_QUEUES@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jae	LBB0_2
## %bb.1:
	movq	8(%r13), %rdi
	movq	%rdx, %rbx
	shlq	$4, %rbx
	movq	(%rdi,%rbx), %r8
	movq	_QUEUE_TYPE_NA@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r8
	jne	LBB0_6
LBB0_2:
	movl	(%r13), %edi
	leaq	L_.str(%rip), %rsi
LBB0_3:
	callq	_dev_err
LBB0_4:
	xorl	%r14d, %r14d
LBB0_5:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	cmpq	$0, 8(%rdi,%rbx)
	je	LBB0_8
## %bb.7:
	movl	(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_3
LBB0_8:
	movq	_QUEUE_TYPE_INT@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r8
	jne	LBB0_10
## %bb.9:
	movl	$0, (%rcx)
	movslq	8(%r15), %r14
	jmp	LBB0_5
LBB0_10:
	movl	8(%r15), %eax
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movslq	%eax, %r12
	movq	%r13, %rdi
	movq	%r12, %rdx
	callq	_hl_cb_get
	testq	%rax, %rax
	je	LBB0_14
## %bb.11:
	movq	%rax, %r14
	movl	12(%r15), %eax
	cmpl	$8, %eax
	jl	LBB0_13
## %bb.12:
	cmpq	%rax, (%r14)
	jge	LBB0_15
LBB0_13:
	movl	(%r13), %edi
	movslq	%eax, %rdx
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
	movq	%r14, %rdi
	callq	_hl_cb_put
	jmp	LBB0_4
LBB0_14:
	movl	(%r13), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdx
	jmp	LBB0_3
LBB0_15:
	movq	%r14, %rbx
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_spin_lock
	incl	12(%r14)
	movq	%rbx, %rdi
	callq	_spin_unlock
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_HL_MAX_QUEUES,8,3              ## @HL_MAX_QUEUES
	.comm	_QUEUE_TYPE_NA,8,3              ## @QUEUE_TYPE_NA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Queue index %d is invalid\n"

L_.str.1:                               ## @.str.1
	.asciz	"Queue index %d is restricted for the kernel driver\n"

	.comm	_QUEUE_TYPE_INT,8,3             ## @QUEUE_TYPE_INT
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
L_.str.2:                               ## @.str.2
	.asciz	"CB handle 0x%x invalid\n"

L_.str.3:                               ## @.str.3
	.asciz	"CB size %u invalid\n"

	.no_dead_strip	_validate_queue_index
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function validate_queue_index
_validate_queue_index:                  ; @validate_queue_index
	.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	x19, x0
	mov	w8, #1
	str	w8, [x3]
	ldr	x2, [x2]
Lloh0:
	adrp	x8, _HL_MAX_QUEUES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HL_MAX_QUEUES@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x2, x8
	b.hs	LBB0_2
; %bb.1:
	ldr	x9, [x19, #8]
	lsl	x8, x2, #4
	ldr	x8, [x9, x8]
Lloh3:
	adrp	x10, _QUEUE_TYPE_NA@GOTPAGE
Lloh4:
	ldr	x10, [x10, _QUEUE_TYPE_NA@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x10
	b.ne	LBB0_6
LBB0_2:
	ldr	w0, [x19]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
LBB0_3:
	bl	_dev_err
LBB0_4:
	mov	x21, #0
LBB0_5:
	mov	x0, x21
	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
LBB0_6:
	add	x9, x9, x2, lsl #4
	ldr	x9, [x9, #8]
	cbz	x9, LBB0_8
; %bb.7:
	ldr	w0, [x19]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_8:
Lloh10:
	adrp	x9, _QUEUE_TYPE_INT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _QUEUE_TYPE_INT@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.9:
	str	wzr, [x3]
	ldrsw	x21, [x20, #8]
	b	LBB0_5
LBB0_10:
	ldr	w8, [x20, #8]
Lloh13:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	asr	w8, w8, w9
	sxtw	x22, w8
	mov	x0, x19
	mov	x2, x22
	bl	_hl_cb_get
	mov	x21, x0
	cbz	x0, LBB0_14
; %bb.11:
	ldr	w8, [x20, #12]
	cmp	w8, #8
	b.lt	LBB0_13
; %bb.12:
	ldr	x9, [x21]
	cmp	x9, x8
	b.ge	LBB0_15
LBB0_13:
	ldr	w0, [x19]
	sxtw	x2, w8
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	mov	x0, x21
	bl	_hl_cb_put
	b	LBB0_4
LBB0_14:
	ldr	w0, [x19]
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x22
	bl	_dev_err
	b	LBB0_5
LBB0_15:
	add	x19, x21, #8
	mov	x0, x19
	bl	_spin_lock
	ldr	w8, [x21, #12]
	add	w8, w8, #1
	str	w8, [x21, #12]
	mov	x0, x19
	bl	_spin_unlock
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_HL_MAX_QUEUES,8,3              ; @HL_MAX_QUEUES
	.comm	_QUEUE_TYPE_NA,8,3              ; @QUEUE_TYPE_NA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Queue index %d is invalid\n"

l_.str.1:                               ; @.str.1
	.asciz	"Queue index %d is restricted for the kernel driver\n"

	.comm	_QUEUE_TYPE_INT,8,3             ; @QUEUE_TYPE_INT
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
l_.str.2:                               ; @.str.2
	.asciz	"CB handle 0x%x invalid\n"

l_.str.3:                               ; @.str.3
	.asciz	"CB size %u invalid\n"

	.no_dead_strip	_validate_queue_index
.subsections_via_symbols
