	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i40iw_setup_kmode_qp
_i40iw_setup_kmode_qp:                  ## @i40iw_setup_kmode_qp
	.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
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	80(%rdx), %esi
	movl	84(%rdx), %edi
	leaq	-52(%rbp), %rdx
	callq	_i40iw_get_wqe_shift
	movl	24(%rbx), %edi
	movl	-52(%rbp), %esi
	leaq	-48(%rbp), %rdx
	callq	_i40iw_get_sqdepth
	testl	%eax, %eax
	jne	LBB0_1
## %bb.2:
	movl	28(%rbx), %edi
	movq	_I40IW_MAX_RQ_WQE_SHIFT@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	callq	_i40iw_get_rqdepth
	testl	%eax, %eax
	je	LBB0_3
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	-48(%rbp), %eax
	shll	$2, %eax
	movl	-44(%rbp), %ecx
	leal	(%rax,%rcx,8), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	movq	%rax, 8(%r14)
	movq	%rax, 64(%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	leaq	16(%r14), %rsi
	movslq	-48(%rbp), %rcx
	leaq	(%rax,%rcx,4), %rax
	movq	%rax, 72(%rbx)
	movl	-44(%rbp), %eax
	addl	%ecx, %eax
	movq	_I40IW_QP_WQE_MIN_SIZE@GOTPCREL(%rip), %r13
	imull	(%r13), %eax
	movq	_I40IW_SHADOW_AREA_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leal	(%rax,%rcx,8), %edx
	movl	(%r15), %edi
	movl	$256, %ecx                      ## imm = 0x100
	callq	_i40iw_allocate_dma_mem
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movq	64(%rbx), %rdi
	callq	_kfree
	movq	$0, 64(%rbx)
	jmp	LBB0_1
LBB0_6:
	movq	24(%r14), %rax
	movq	%rax, 56(%rbx)
	movl	16(%r14), %ecx
	movl	%ecx, 16(%rbx)
	movslq	-48(%rbp), %rdx
	leaq	(%rax,%rdx,4), %rax
	movq	%rax, 40(%rbx)
	movl	(%r13), %esi
	movl	%esi, %edi
	imull	%edx, %edi
	addl	%ecx, %edi
	movslq	%edi, %rcx
	movq	%rcx, (%rbx)
	movslq	-44(%rbp), %rdi
	movl	(%rax,%rdi,4), %eax
	movl	%eax, 48(%rbx)
	imull	%edi, %esi
	movslq	%esi, %rax
	addq	%rcx, %rax
	movq	%rax, 8(%rbx)
	movb	-52(%rbp), %cl
	sarl	%cl, %edx
	movl	%edx, 24(%rbx)
	movb	(%r12), %cl
	sarl	%cl, %edi
	movl	%edi, 28(%rbx)
	movl	(%r14), %eax
	movl	%eax, 32(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_I40IW_MAX_RQ_WQE_SHIFT,4,2     ## @I40IW_MAX_RQ_WQE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_I40IW_QP_WQE_MIN_SIZE,4,2      ## @I40IW_QP_WQE_MIN_SIZE
	.comm	_I40IW_SHADOW_AREA_SIZE,4,2     ## @I40IW_SHADOW_AREA_SIZE
	.no_dead_strip	_i40iw_setup_kmode_qp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i40iw_setup_kmode_qp
_i40iw_setup_kmode_qp:                  ; @i40iw_setup_kmode_qp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldp	w1, w0, [x2, #80]
	add	x2, sp, #4
	bl	_i40iw_get_wqe_shift
	ldr	w0, [x19, #24]
	ldr	w1, [sp, #4]
	add	x2, sp, #12
	bl	_i40iw_get_sqdepth
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #28]
Lloh0:
	adrp	x22, _I40IW_MAX_RQ_WQE_SHIFT@GOTPAGE
Lloh1:
	ldr	x22, [x22, _I40IW_MAX_RQ_WQE_SHIFT@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #8
	bl	_i40iw_get_rqdepth
	cbz	w0, LBB0_4
LBB0_2:
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_4:
	ldp	w9, w8, [sp, #8]
	lsl	w9, w9, #3
	add	w0, w9, w8, lsl #2
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_kzalloc
	str	x0, [x20, #8]
	str	x0, [x19, #64]
	cbz	x0, LBB0_2
; %bb.5:
	add	x1, x20, #16
	ldrsw	x8, [sp, #12]
	add	x9, x0, x8, lsl #2
	str	x9, [x19, #72]
	ldr	w9, [sp, #8]
	add	w8, w9, w8
Lloh8:
	adrp	x23, _I40IW_QP_WQE_MIN_SIZE@GOTPAGE
Lloh9:
	ldr	x23, [x23, _I40IW_QP_WQE_MIN_SIZE@GOTPAGEOFF]
	ldr	w9, [x23]
	mul	w8, w8, w9
Lloh10:
	adrp	x9, _I40IW_SHADOW_AREA_SIZE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _I40IW_SHADOW_AREA_SIZE@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	add	w2, w8, w9, lsl #3
	ldr	w0, [x21]
	mov	w3, #256
	bl	_i40iw_allocate_dma_mem
	cbz	w0, LBB0_7
; %bb.6:
	ldr	x0, [x19, #64]
	bl	_kfree
	str	xzr, [x19, #64]
	b	LBB0_2
LBB0_7:
	ldr	x8, [x20, #24]
	str	x8, [x19, #56]
	ldpsw	x10, x9, [sp, #8]
	add	x8, x8, x9, lsl #2
	str	x8, [x19, #40]
	ldr	w8, [x8, x10, lsl #2]
	str	w8, [x19, #48]
	ldr	w8, [x20, #16]
	str	w8, [x19, #16]
	ldr	w11, [x23]
	madd	w8, w11, w9, w8
	sxtw	x8, w8
	mul	w11, w10, w11
	add	x11, x8, w11, sxtw
	stp	x8, x11, [x19]
	ldr	w8, [sp, #4]
	asr	w8, w9, w8
	ldr	w9, [x22]
	asr	w9, w10, w9
	stp	w8, w9, [x19, #24]
	ldr	w8, [x20]
	str	w8, [x19, #32]
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_I40IW_MAX_RQ_WQE_SHIFT,4,2     ; @I40IW_MAX_RQ_WQE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_I40IW_QP_WQE_MIN_SIZE,4,2      ; @I40IW_QP_WQE_MIN_SIZE
	.comm	_I40IW_SHADOW_AREA_SIZE,4,2     ; @I40IW_SHADOW_AREA_SIZE
	.no_dead_strip	_i40iw_setup_kmode_qp
.subsections_via_symbols
