	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hinic_wqs_alloc                ## -- Begin function hinic_wqs_alloc
	.p2align	4, 0x90
_hinic_wqs_alloc:                       ## @hinic_wqs_alloc
	.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, %rbx
	movl	%esi, %eax
	movq	%rdi, %r14
	movq	(%rdx), %r15
	movq	_WQS_BLOCKS_PER_PAGE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	%eax, %edi
	callq	_ALIGN
	movq	_WQS_MAX_NUM_BLOCKS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_16
LBB0_2:
	movq	%rbx, 8(%r14)
	cltd
	idivl	(%r12)
	movl	%eax, (%r14)
	movq	%r14, %rdi
	callq	_alloc_page_arrays
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_16
LBB0_3:
	cmpl	$0, (%r14)
	jle	LBB0_4
## %bb.6:
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_wqs_allocate_page
	testl	%eax, %eax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	incl	%r13d
	cmpl	(%r14), %r13d
	jl	LBB0_7
	jmp	LBB0_10
LBB0_4:
	xorl	%r13d, %r13d
LBB0_10:
	movq	%r14, %rdi
	callq	_WQS_FREE_BLOCKS_SIZE
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_devm_kzalloc
	movl	%eax, 4(%r14)
	testl	%eax, %eax
	je	LBB0_11
## %bb.17:
	movq	%r14, %rdi
	callq	_init_wqs_blocks_arr
	xorl	%r12d, %r12d
	jmp	LBB0_16
LBB0_8:
	movl	%eax, %r12d
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	testl	%r13d, %r13d
	jne	LBB0_13
	jmp	LBB0_15
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	testl	%r13d, %r13d
	je	LBB0_15
LBB0_13:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_wqs_free_page
	incl	%ebx
	cmpl	%ebx, %r13d
	jne	LBB0_14
LBB0_15:
	movq	%r14, %rdi
	callq	_free_page_arrays
LBB0_16:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WQS_BLOCKS_PER_PAGE,4,2        ## @WQS_BLOCKS_PER_PAGE
	.comm	_WQS_MAX_NUM_BLOCKS,4,2         ## @WQS_MAX_NUM_BLOCKS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid max_wqs = %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate mem for page addresses\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"Failed wq page allocation\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hinic_wqs_alloc                ; -- Begin function hinic_wqs_alloc
	.p2align	2
_hinic_wqs_alloc:                       ; @hinic_wqs_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x8, x1
	mov	x19, x0
	ldr	x21, [x2]
Lloh0:
	adrp	x22, _WQS_BLOCKS_PER_PAGE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _WQS_BLOCKS_PER_PAGE@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x8
	bl	_ALIGN
                                        ; kill: def $w0 killed $w0 def $x0
Lloh2:
	adrp	x8, _WQS_MAX_NUM_BLOCKS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _WQS_MAX_NUM_BLOCKS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w0, w8
	b.le	LBB0_2
; %bb.1:
	str	x0, [sp]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
	str	x20, [x19, #8]
	ldr	w8, [x22]
	sdiv	w8, w0, w8
	str	w8, [x19]
	mov	x0, x19
	bl	_alloc_page_arrays
	cbz	x0, LBB0_6
; %bb.3:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_err
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_5:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_6:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.7:
	mov	w20, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_wqs_allocate_page
	cbnz	w0, LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	w20, w20, #1
	ldr	w8, [x19]
	cmp	w20, w8
	b.lt	LBB0_8
	b	LBB0_11
LBB0_10:
	mov	w20, #0
LBB0_11:
	mov	x0, x19
	bl	_WQS_FREE_BLOCKS_SIZE
	mov	x1, x0
Lloh13:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_devm_kzalloc
	str	w0, [x19, #4]
	cbz	w0, LBB0_14
; %bb.12:
	mov	x0, x19
	bl	_init_wqs_blocks_arr
	mov	w22, #0
	b	LBB0_5
LBB0_13:
	mov	x22, x0
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	cbnz	w20, LBB0_15
	b	LBB0_17
LBB0_14:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w22, w8
	cbz	w20, LBB0_17
LBB0_15:
	mov	w21, #0
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_wqs_free_page
	add	w21, w21, #1
	cmp	w20, w21
	b.ne	LBB0_16
LBB0_17:
	mov	x0, x19
	bl	_free_page_arrays
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_WQS_BLOCKS_PER_PAGE,4,2        ; @WQS_BLOCKS_PER_PAGE
	.comm	_WQS_MAX_NUM_BLOCKS,4,2         ; @WQS_MAX_NUM_BLOCKS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid max_wqs = %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate mem for page addresses\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"Failed wq page allocation\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
.subsections_via_symbols
