	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipath_resize_cq                ## -- Begin function ipath_resize_cq
	.p2align	4, 0x90
_ipath_resize_cq:                       ## @ipath_resize_cq
	.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	%rdx, %r12
	movl	%esi, %r13d
	movq	%rdi, %rbx
	callq	_to_icq
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	testl	%r13d, %r13d
	jle	LBB0_2
## %bb.1:
	movq	_ib_ipath_max_cqes@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jl	LBB0_2
## %bb.4:
	leal	28(,%r13,4), %r14d
	movl	%r14d, %edi
	callq	_vmalloc_user
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r15
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	testq	%r12, %r12
	je	LBB0_9
## %bb.7:
	cmpl	$4, (%r12)
	jb	LBB0_9
## %bb.8:
	movl	$0, -56(%rbp)
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	movl	$4, %edx
	callq	_ib_copy_to_udata
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_23
LBB0_9:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_spin_lock_irq
	movq	16(%rbx), %rcx
	movl	24(%rbx), %eax
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	(%rcx), %xmm0                   ## xmm0 = mem[0],zero
	movd	%eax, %xmm1
	pshufd	$80, %xmm1, %xmm1               ## xmm1 = xmm1[0,0,1,1]
	pminsd	%xmm0, %xmm1
	movd	%xmm1, %r15d
	pextrd	$1, %xmm1, %r12d
	incl	%eax
	xorl	%r14d, %r14d
	movl	%r15d, %ecx
	subl	%r12d, %ecx
	cmovgel	%r14d, %eax
	addl	%ecx, %eax
	xorl	%edi, %edi
	cmpl	%r13d, %eax
	setg	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_10
## %bb.22:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	movq	%rbx, %rdi
	callq	_spin_unlock_irq
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_23:
	movq	%r15, %rdi
	callq	_vfree
	jmp	LBB0_24
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_24:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	cmpl	%r12d, %r15d
	jne	LBB0_11
LBB0_15:
	movl	%r13d, 24(%rbx)
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movl	%r14d, (%r15)
	movl	$0, 4(%r15)
	movq	%r15, 16(%rbx)
	movq	%rbx, %rdi
	callq	_spin_unlock_irq
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_vfree
	xorl	%r14d, %r14d
	cmpq	$0, 8(%rbx)
	je	LBB0_24
## %bb.16:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_to_idev
	movq	%r15, %rcx
	movq	%rax, %r12
	movq	8(%rbx), %rbx
	movq	%rax, %rdi
	movq	%rbx, %rsi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_ipath_update_mmap_info
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_19
## %bb.17:
	cmpl	$4, (%rdi)
	jb	LBB0_19
## %bb.18:
	leaq	4(%rbx), %rsi
	movl	$4, %edx
	callq	_ib_copy_to_udata
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_24
LBB0_19:
	movq	%r12, %rdi
	callq	_spin_lock_irq
	movq	%rbx, %rdi
	callq	_list_empty
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	movq	%r12, %rsi
	addq	$4, %rsi
	movq	%rbx, %rdi
	callq	_list_add
LBB0_21:
	movq	%r12, %rdi
	callq	_spin_unlock_irq
	xorl	%r14d, %r14d
	jmp	LBB0_24
LBB0_11:
	xorl	%ecx, %ecx
	cmpq	$0, 8(%rbx)
	setne	%cl
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax,%rcx,8), %rax
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	8(%rdx,%rcx,8), %rcx
	xorl	%r14d, %r14d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%r14
	movl	%edx, %r12d
	cmpl	%r15d, %edx
	je	LBB0_15
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movslq	%r12d, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	%edx, (%rcx,%r14,4)
	movl	$0, %edx
	cmpl	24(%rbx), %r12d
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	incl	%r12d
	movl	%r12d, %edx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_ib_ipath_max_cqes,4,2          ## @ib_ipath_max_cqes
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipath_resize_cq                ; -- Begin function ipath_resize_cq
	.p2align	2
_ipath_resize_cq:                       ; @ipath_resize_cq
	.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	x19, x2
	mov	x24, x1
	mov	x22, x0
	bl	_to_icq
	cmp	w24, #1
	b.lt	LBB0_9
; %bb.1:
Lloh0:
	adrp	x8, _ib_ipath_max_cqes@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ib_ipath_max_cqes@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w24
	b.lt	LBB0_9
; %bb.2:
	mov	x20, x0
	lsl	w8, w24, #2
	add	w23, w8, #28
	mov	x0, x23
	bl	_vmalloc_user
	cbz	x0, LBB0_10
; %bb.3:
	mov	x21, x0
	cbz	x19, LBB0_6
; %bb.4:
	ldr	w8, [x19]
	cmp	w8, #4
	b.lo	LBB0_6
; %bb.5:
	str	wzr, [sp, #12]
	add	x1, sp, #12
	mov	x0, x19
	mov	w2, #4
	bl	_ib_copy_to_udata
	mov	x25, x0
	cbnz	w0, LBB0_8
LBB0_6:
	mov	x0, x20
	bl	_spin_lock_irq
	ldr	x25, [x20, #16]
	ldr	w8, [x20, #24]
	ldp	w9, w10, [x25]
	cmp	w9, w8
	csel	w26, w9, w8, lt
	cmp	w10, w8
	csel	w27, w10, w8, lt
	subs	w9, w26, w27
	csinc	w8, wzr, w8, ge
	add	w8, w9, w8
	cmp	w8, w24
	cset	w0, gt
	bl	_unlikely
	cbz	x0, LBB0_13
; %bb.7:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w25, w8
	mov	x0, x20
	bl	_spin_unlock_irq
LBB0_8:
	mov	x0, x21
	bl	_vfree
	b	LBB0_12
LBB0_9:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_12:
	mov	x0, x25
	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
LBB0_13:
	cmp	w26, w27
	b.ne	LBB0_15
; %bb.14:
	mov	w8, #0
	b	LBB0_17
LBB0_15:
	mov	x8, #0
	ldr	x9, [x20, #8]
	mov	w10, #16
	mov	w11, #8
	cmp	x9, #0
	csel	x10, x11, x10, eq
	ldr	x9, [x25, x10]
	ldr	x10, [x21, x10]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9, w27, sxtw #2]
	str	w11, [x10, x8, lsl #2]
	ldr	w11, [x20, #24]
	cmp	w27, w11
	csinc	w27, wzr, w27, eq
	add	x8, x8, #1
	cmp	w27, w26
	b.ne	LBB0_16
LBB0_17:
	str	w24, [x20, #24]
	stp	w8, wzr, [x21]
	str	x21, [x20, #16]
	mov	x0, x20
	bl	_spin_unlock_irq
	mov	x0, x25
	bl	_vfree
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_24
; %bb.18:
	ldr	w0, [x22]
	bl	_to_idev
	mov	x22, x0
	ldr	x20, [x20, #8]
	mov	x1, x20
	mov	x2, x23
	mov	x3, x21
	bl	_ipath_update_mmap_info
	cbz	x19, LBB0_21
; %bb.19:
	ldr	w8, [x19]
	cmp	w8, #4
	b.lo	LBB0_21
; %bb.20:
	add	x1, x20, #4
	mov	x0, x19
	mov	w2, #4
	bl	_ib_copy_to_udata
	mov	x25, x0
	cbnz	w0, LBB0_12
LBB0_21:
	mov	x0, x22
	bl	_spin_lock_irq
	mov	x0, x20
	bl	_list_empty
	cbz	x0, LBB0_23
; %bb.22:
	add	x1, x22, #4
	mov	x0, x20
	bl	_list_add
LBB0_23:
	mov	x0, x22
	bl	_spin_unlock_irq
LBB0_24:
	mov	w25, #0
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ib_ipath_max_cqes,4,2          ; @ib_ipath_max_cqes
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
