	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ntb_transport_setup_qp_mw
_ntb_transport_setup_qp_mw:             ## @ntb_transport_setup_qp_mw
	.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	%esi, %r12d
	movq	%rdi, %rbx
	movq	24(%rdi), %r15
	movq	16(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %r14d
	movl	4(%rdi), %r13d
	callq	_QP_TO_MW
	movq	8(%rbx), %rdi
	movl	%eax, %esi
	movq	%rsi, %rbx
	shlq	$4, %rbx
	movq	(%rdi,%rbx), %r8
	testq	%r8, %r8
	je	LBB0_1
## %bb.2:
	movl	%r13d, %eax
	xorl	%edx, %edx
	movl	%r14d, %r9d
	divl	%r14d
	movl	%eax, %ecx
	movl	%r12d, %eax
	leaq	(%rax,%rax,8), %r14
	leaq	(%r15,%r14,8), %r13
	cmpl	%edx, %esi
	adcl	$0, %ecx
	movl	8(%rdi,%rbx), %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ebx
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%r9d
                                        ## kill: def $eax killed $eax def $rax
	imull	%ebx, %eax
	leaq	(%r8,%rax,4), %rax
	movq	%rax, 40(%r15,%r14,8)
	addl	$-4, %ebx
	leaq	(%rax,%rbx,4), %rax
	movq	%rax, 48(%r15,%r14,8)
	movq	_transport_mtu@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	shrl	%esi
	callq	_min
	movl	%eax, %ecx
	movl	%eax, (%r13)
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, 4(%r15,%r14,8)
	movq	$0, 64(%r15,%r14,8)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_to_node
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	4(%r15,%r14,8), %eax
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	8(%r15,%r14,8), %ebx
	cmpl	%eax, %ebx
	jae	LBB0_6
## %bb.3:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,8), %r14
	addq	$8, %r14
	leaq	(%rax,%rcx,8), %r15
	addq	$60, %r15
	leaq	(%rax,%rcx,8), %r12
	addq	$56, %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	callq	_kzalloc_node
	testq	%rax, %rax
	je	LBB0_1
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, 8(%rax)
	movq	%r15, %rdi
	movq	%rax, %rsi
	movq	%r12, %rdx
	callq	_ntb_list_add
	incl	(%r14)
	incl	%ebx
	movl	4(%r13), %eax
	cmpl	%eax, %ebx
	jb	LBB0_4
LBB0_6:
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%r15,%rcx,8), %rcx
	addq	$48, %rcx
	movq	(%rcx), %rcx
	subl	$1, %eax
	movl	%eax, (%rcx)
	jb	LBB0_9
## %bb.7:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(%r15,%rax,8), %r14
	addq	$40, %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	incl	%ebx
	movl	(%r13), %ecx
	imull	%ebx, %ecx
	leaq	(%rax,%rcx,4), %rdi
	addq	$-16, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	cmpl	4(%r13), %ebx
	jb	LBB0_8
LBB0_9:
	xorps	%xmm0, %xmm0
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movups	%xmm0, 16(%r15,%rax,8)
	movq	$0, 32(%r15,%rax,8)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_transport_mtu,4,2              ## @transport_mtu
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.no_dead_strip	_ntb_transport_setup_qp_mw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ntb_transport_setup_qp_mw
_ntb_transport_setup_qp_mw:             ; @ntb_transport_setup_qp_mw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x21, x0
	ldp	x19, x25, [x0, #16]
	ldp	w22, w23, [x0]
	bl	_QP_TO_MW
	ldr	x9, [x21, #8]
	mov	w10, w0
	lsl	x8, x10, #4
	ldr	x8, [x9, x8]
	cbz	x8, LBB0_10
; %bb.1:
	mov	w21, w20
	mov	w11, #72
	umaddl	x24, w20, w11, x25
	udiv	w11, w23, w22
	msub	w12, w11, w22, w23
	cmp	w10, w12
	cinc	w11, w11, lo
	add	x9, x9, x10, lsl #4
	ldr	w9, [x9, #8]
	udiv	w9, w9, w11
	udiv	w10, w20, w22
	mul	w10, w10, w9
	add	x8, x8, w10, uxtw #2
	mov	w10, #72
	str	x25, [sp, #8]                   ; 8-byte Folded Spill
	madd	x28, x21, x10, x25
	mov	x25, x28
	str	x8, [x25, #40]!
	sub	w20, w9, #4
	add	x8, x8, w20, uxtw #2
	mov	x27, x28
	str	x8, [x27, #48]!
Lloh0:
	adrp	x8, _transport_mtu@GOTPAGE
Lloh1:
	ldr	x8, [x8, _transport_mtu@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	lsr	w1, w20, #1
	bl	_min
	str	w0, [x24]
	udiv	w8, w20, w0
	mov	x26, x28
	str	w8, [x26, #4]!
	str	xzr, [x28, #64]
	mov	x0, x19
	bl	_dev_to_node
	ldr	w23, [x28, #8]!
	ldr	w8, [x26]
	cmp	w23, w8
	b.hs	LBB0_6
; %bb.2:
	mov	x19, x0
	mov	w8, #72
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	str	x21, [sp]                       ; 8-byte Folded Spill
	madd	x8, x21, x8, x9
	add	x20, x8, #60
	add	x21, x8, #56
Lloh3:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	w0, #16
	mov	x2, x19
	bl	_kzalloc_node
	cbz	x0, LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x1, x0
	str	x24, [x0, #8]
	mov	x0, x20
	mov	x2, x21
	bl	_ntb_list_add
	ldr	w8, [x28]
	add	w8, w8, #1
	str	w8, [x28]
	add	w23, w23, #1
	ldr	w8, [x26]
	cmp	w23, w8
	b.lo	LBB0_3
; %bb.5:
	ldr	x21, [sp]                       ; 8-byte Folded Reload
LBB0_6:
	sub	w9, w8, #1
	ldr	x10, [x27]
	str	w9, [x10]
	cbz	w8, LBB0_9
; %bb.7:
	mov	w19, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25]
	ldr	w9, [x24]
	add	w19, w19, #1
	mul	w9, w9, w19
	add	x8, x8, w9, uxtw #2
	sub	x0, x8, #16
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	w8, [x26]
	cmp	w19, w8
	b.lo	LBB0_8
LBB0_9:
	mov	w0, #0
	mov	w8, #72
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	madd	x8, x21, x8, x9
	stp	xzr, xzr, [x8, #16]
	str	xzr, [x8, #32]
	b	LBB0_11
LBB0_10:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_transport_mtu,4,2              ; @transport_mtu
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.no_dead_strip	_ntb_transport_setup_qp_mw
.subsections_via_symbols
