	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_wq_pages
_alloc_wq_pages:                        ## @alloc_wq_pages
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r13d
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	(%rsi), %r15
	callq	_WQ_SIZE
	movl	(%r12), %esi
	movl	%eax, %edi
	callq	_ALIGN
	cltd
	idivl	(%r12)
	cmpl	%r13d, %eax
	jle	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_3:
	movl	%eax, %ebx
	leal	-1(%rbx), %eax
	testl	%eax, %ebx
	jne	LBB0_4
## %bb.5:
	movl	%ebx, 4(%r12)
	movq	%r12, %rdi
	callq	_alloc_wqes_shadow
	testl	%eax, %eax
	je	LBB0_6
## %bb.8:
	movl	%eax, %r13d
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	jmp	LBB0_14
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movq	%r15, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_13:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_14:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	testl	%ebx, %ebx
	jle	LBB0_7
## %bb.9:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	%ebx, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %r14
	movq	16(%r12), %r13
	movl	(%r12), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	leaq	-44(%rbp), %rdx
	callq	_dma_alloc_coherent
	movq	%rax, (%r14,%rbx,8)
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	-44(%rbp), %edi
	callq	_cpu_to_be64
	movl	%eax, (%r13,%rbx,4)
	incq	%rbx
	xorl	%r13d, %r13d
	cmpq	%rbx, -64(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_10
	jmp	LBB0_14
LBB0_7:
	xorl	%r13d, %r13d
	jmp	LBB0_14
LBB0_12:
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	callq	_free_wq_pages
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Number wq pages exceeds the limit\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Number wq pages must be power of 2\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to allocate wqe shadow\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.3:                               ## @.str.3
	.asciz	"Failed to allocate wq page\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_wq_pages
_alloc_wq_pages:                        ; @alloc_wq_pages
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x19, [x1]
	bl	_WQ_SIZE
	ldr	w1, [x21]
	bl	_ALIGN
	ldr	w8, [x21]
	sdiv	w24, w0, w8
	cmp	w24, w22
	b.le	LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_2:
	sub	w8, w24, #1
	tst	w24, w8
	b.ne	LBB0_5
; %bb.3:
	str	w24, [x21, #4]
	mov	x0, x21
	bl	_alloc_wqes_shadow
	cbz	w0, LBB0_9
; %bb.4:
	mov	x23, x0
Lloh2:
	adrp	x1, l_.str.2@PAGE
Lloh3:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_8
LBB0_5:
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	mov	x0, x19
	bl	_dev_err
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_8:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_9:
	cmp	w24, #1
	b.lt	LBB0_13
; %bb.10:
	mov	x22, #0
Lloh8:
	adrp	x25, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x25, [x25, _GFP_KERNEL@GOTPAGEOFF]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldp	x23, x26, [x21, #8]
	ldr	w1, [x21]
	ldr	w3, [x25]
	add	x2, sp, #12
	mov	x0, x19
	bl	_dma_alloc_coherent
	str	x0, [x23, x22, lsl #3]
	cbz	x0, LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w0, [sp, #12]
	bl	_cpu_to_be64
	mov	w23, #0
	str	w0, [x26, x22, lsl #2]
	add	x22, x22, #1
	cmp	x24, x22
	b.ne	LBB0_11
	b	LBB0_8
LBB0_13:
	mov	w23, #0
	b	LBB0_8
LBB0_14:
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	bl	_free_wq_pages
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Number wq pages exceeds the limit\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Number wq pages must be power of 2\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to allocate wqe shadow\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.3:                               ; @.str.3
	.asciz	"Failed to allocate wq page\n"

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