	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i40iw_handle_q_mem
_i40iw_handle_q_mem:                    ## @i40iw_handle_q_mem
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	72(%rdx), %r13
	movq	(%r13), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movslq	(%rsi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movslq	4(%rsi), %rbx
	movslq	8(%rsi), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	16(%r13), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	%r13, %rsi
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %edx
	callq	_i40iw_setup_pbles
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_1
LBB0_18:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	-60(%rbp), %r8d                 ## 4-byte Reload
	movq	%r15, %r14
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	leaq	80(%r15), %rsi
	addq	-56(%rbp), %rbx                 ## 8-byte Folded Reload
	addq	-80(%rbp), %rbx                 ## 8-byte Folded Reload
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	testl	%edi, %edi
	je	LBB0_4
## %bb.2:
	movq	(%rsi), %rax
	movq	_I40IW_LEVEL_1@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.14:
	movq	%r14, %rdx
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	96(%r15), %rax
	movq	8(%r13), %rcx
	movq	%rax, %r13
	movq	_IW_MEMREG_TYPE_QP@GOTPCREL(%rip), %rsi
	movq	(%rax,%rbx,8), %rax
	cmpq	(%rsi), %rcx
	jne	LBB0_15
## %bb.9:
	movq	%rax, 48(%r15)
	movl	(%rdx), %esi
	movq	%r13, %rdi
	movl	%r8d, %ebx
	movl	%r8d, %edx
	callq	_i40iw_check_mem_contiguous
	movq	%r14, %rcx
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movslq	(%rcx), %rax
	leaq	(,%rax,8), %rdi
	addq	%r13, %rdi
	movl	4(%rcx), %esi
	movl	%ebx, %edx
	callq	_i40iw_check_mem_contiguous
	movq	%r14, %rcx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	testl	%eax, %eax
	jne	LBB0_13
LBB0_11:
	movq	88(%r15), %rax
	movq	%rax, 64(%r15)
	movslq	(%rcx), %rcx
	addq	%rax, %rcx
	movq	%rcx, 40(%r15)
	jmp	LBB0_17
LBB0_4:
	movq	8(%r13), %rcx
	movq	_IW_MEMREG_TYPE_QP@GOTPCREL(%rip), %r8
	movslq	%ebx, %rax
	movq	%rdx, %r13
	movq	(%rdx,%rax,8), %rax
	cmpq	(%r8), %rcx
	jne	LBB0_5
## %bb.12:
	movq	%r14, %rcx
	movq	%rax, 48(%r15)
LBB0_13:
	movq	(%r13), %rax
	movq	%rax, 56(%r15)
	movslq	(%rcx), %rax
	movq	(%r13,%rax,8), %rax
	movq	%r15, %rbx
	movq	%rax, 32(%r15)
	jmp	LBB0_7
LBB0_3:
	movl	(%r12), %edi
	callq	_i40iw_free_pble
	movl	$0, (%r15)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_18
LBB0_5:
	movq	%rax, 8(%r15)
	jmp	LBB0_6
LBB0_15:
	movq	%rax, 8(%r15)
	movl	8(%rdx), %esi
	movq	%r13, %rdi
	movl	%r8d, %edx
	callq	_i40iw_check_mem_contiguous
	testl	%eax, %eax
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	je	LBB0_16
LBB0_6:
	movq	(%r13), %rax
	movq	%r15, %rbx
	movq	%rax, 16(%r15)
LBB0_7:
	xorl	%r14d, %r14d
	testl	%edi, %edi
	je	LBB0_18
## %bb.8:
	movl	(%r12), %edi
	callq	_i40iw_free_pble
	movl	$0, (%rbx)
	jmp	LBB0_18
LBB0_16:
	movq	88(%r15), %rax
	movq	%rax, 24(%r15)
LBB0_17:
	xorl	%r14d, %r14d
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_I40IW_LEVEL_1,8,3              ## @I40IW_LEVEL_1
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_IW_MEMREG_TYPE_QP,8,3          ## @IW_MEMREG_TYPE_QP
	.no_dead_strip	_i40iw_handle_q_mem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i40iw_handle_q_mem
_i40iw_handle_q_mem:                    ; @i40iw_handle_q_mem
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x3
	mov	x19, x2
	mov	x24, x1
	mov	x20, x0
	ldr	x26, [x2, #72]
	ldr	x23, [x26]
	ldp	w27, w28, [x1]
	ldr	w22, [x1, #8]
	ldr	w25, [x26, #16]
	mov	x1, x26
	mov	x2, x3
	bl	_i40iw_setup_pbles
	cbz	w0, LBB0_2
LBB0_1:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_2:
	add	x1, x19, #80
	add	w8, w28, w27
	add	w8, w8, w22
	cbz	w21, LBB0_8
; %bb.3:
	ldr	x9, [x1]
Lloh0:
	adrp	x10, _I40IW_LEVEL_1@GOTPAGE
Lloh1:
	ldr	x10, [x10, _I40IW_LEVEL_1@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_12
; %bb.4:
	mov	x22, x1
	ldr	x23, [x19, #96]
	ldr	x9, [x26, #8]
Lloh3:
	adrp	x10, _IW_MEMREG_TYPE_QP@GOTPAGE
Lloh4:
	ldr	x10, [x10, _IW_MEMREG_TYPE_QP@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	ldr	x8, [x23, w8, sxtw #3]
	cmp	x9, x10
	b.ne	LBB0_14
; %bb.5:
	str	x8, [x19, #48]
	ldr	w1, [x24]
	mov	x0, x23
	mov	x2, x25
	bl	_i40iw_check_mem_contiguous
	cbz	w0, LBB0_7
; %bb.6:
	ldp	w8, w1, [x24]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	add	x0, x23, x8, lsl #3
	mov	x2, x25
	bl	_i40iw_check_mem_contiguous
	mov	x1, x22
	cbnz	w0, LBB0_10
LBB0_7:
	mov	w0, #0
	ldr	x8, [x19, #88]
	str	x8, [x19, #64]
	ldrsw	x9, [x24]
	add	x8, x8, x9
	str	x8, [x19, #40]
	b	LBB0_1
LBB0_8:
	ldr	x9, [x26, #8]
Lloh6:
	adrp	x10, _IW_MEMREG_TYPE_QP@GOTPAGE
Lloh7:
	ldr	x10, [x10, _IW_MEMREG_TYPE_QP@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	ldr	x8, [x23, w8, sxtw #3]
	cmp	x9, x10
	b.ne	LBB0_13
; %bb.9:
	str	x8, [x19, #48]
LBB0_10:
	ldr	x8, [x23]
	str	x8, [x19, #56]
	ldrsw	x8, [x24]
	ldr	x8, [x23, x8, lsl #3]
	str	x8, [x19, #32]
	cbnz	w21, LBB0_16
LBB0_11:
	mov	w0, #0
	b	LBB0_1
LBB0_12:
	ldr	w0, [x20]
	bl	_i40iw_free_pble
	str	wzr, [x19]
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_1
LBB0_13:
	str	x8, [x19, #8]
	b	LBB0_15
LBB0_14:
	str	x8, [x19, #8]
	ldr	w1, [x24, #8]
	mov	x0, x23
	mov	x2, x25
	bl	_i40iw_check_mem_contiguous
	mov	x1, x22
	cbz	w0, LBB0_17
LBB0_15:
	ldr	x8, [x23]
	str	x8, [x19, #16]
	cbz	w21, LBB0_11
LBB0_16:
	ldr	w0, [x20]
	bl	_i40iw_free_pble
	mov	w0, #0
	str	wzr, [x19]
	b	LBB0_1
LBB0_17:
	ldr	x8, [x19, #88]
	str	x8, [x19, #24]
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_I40IW_LEVEL_1,8,3              ; @I40IW_LEVEL_1
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_IW_MEMREG_TYPE_QP,8,3          ; @IW_MEMREG_TYPE_QP
	.no_dead_strip	_i40iw_handle_q_mem
.subsections_via_symbols
