	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_ib_resize_cq              ## -- Begin function mlx4_ib_resize_cq
	.p2align	4, 0x90
_mlx4_ib_resize_cq:                     ## @mlx4_ib_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	%esi, %ebx
	movq	%rdi, %r13
	movl	16(%rdi), %edi
	callq	_to_mdev
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_to_mcq
	movq	%rax, %r15
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_mutex_lock
	testl	%ebx, %ebx
	jle	LBB0_2
## %bb.1:
	movq	(%r14), %rax
	cmpl	%ebx, (%rax)
	jge	LBB0_5
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_3:
	movq	%r12, %r14
LBB0_4:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	incl	%ebx
	movl	%ebx, %edi
	callq	_roundup_pow_of_two
	movl	(%r13), %ecx
	incl	%ecx
	xorl	%ebx, %ebx
	cmpl	%ecx, %eax
	je	LBB0_3
## %bb.7:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rcx
	movl	(%rcx), %ecx
	incl	%ecx
	cmpl	%ecx, %eax
	jg	LBB0_2
## %bb.8:
	cmpq	$0, 8(%r13)
	je	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	movq	%r12, %r14
	movq	%r12, %rsi
	movl	%eax, %r12d
	movl	%eax, %edx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	callq	_mlx4_alloc_resize_umem
	jmp	LBB0_12
LBB0_10:
	movq	%r12, %r14
	movq	%r12, %rdi
	movl	%eax, %r12d
	callq	_mlx4_ib_get_outstanding_cqes
	cmpl	%eax, %r12d
	jle	LBB0_17
## %bb.11:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r12d, %edx
	callq	_mlx4_alloc_resize_buf
LBB0_12:
	movq	%rbx, %rcx
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.13:
	movl	32(%r14), %eax
	movl	%eax, -64(%rbp)
	movq	(%rcx), %rdi
	leaq	48(%r15), %rsi
	movq	16(%r14), %rcx
	addq	$4, %rcx
	movl	%r12d, %edx
	callq	_mlx4_cq_resize
	movl	%eax, %ebx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	testl	%ebx, %ebx
	je	LBB0_18
## %bb.14:
	movq	16(%r14), %rsi
	addq	$4, %rsi
	callq	_mlx4_mtt_cleanup
	cmpq	$0, 8(%r13)
	jne	LBB0_16
## %bb.15:
	movq	16(%r14), %rsi
	movl	(%rsi), %edx
	addq	$4, %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mlx4_ib_free_cq_buf
LBB0_16:
	movq	16(%r14), %rdi
	callq	_kfree
	movq	$0, 16(%r14)
	movq	8(%r14), %rdi
	callq	_ib_umem_release
	movq	$0, 8(%r14)
	jmp	LBB0_4
LBB0_17:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_4
LBB0_18:
	leaq	-64(%rbp), %rsi
	callq	_mlx4_mtt_cleanup
	cmpq	$0, 8(%r13)
	je	LBB0_20
## %bb.19:
	movq	16(%r14), %rax
	movq	40(%r14), %rdi
	movl	4(%rax), %ecx
	movl	%ecx, 32(%r14)
	movl	(%rax), %eax
	movl	%eax, 28(%r14)
	callq	_ib_umem_release
	movq	8(%r14), %rax
	movq	16(%r14), %rdi
	movq	%rax, 40(%r14)
	callq	_kfree
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_4
LBB0_20:
	addq	$24, %r15
	movq	%r15, %rdi
	callq	_spin_lock_irq
	cmpq	$0, 16(%r14)
	je	LBB0_24
## %bb.21:
	movq	%r14, %rdi
	callq	_mlx4_ib_cq_resize_copy_cqes
	movl	32(%r14), %eax
	movl	%eax, -56(%rbp)
	movl	28(%r14), %ebx
	movq	16(%r14), %rdi
	movl	4(%rdi), %eax
	movl	%eax, 32(%r14)
	movl	(%rdi), %eax
	movl	%eax, 28(%r14)
	callq	_kfree
	movq	$0, 16(%r14)
	movq	%r15, %rdi
	callq	_spin_unlock_irq
	testl	%ebx, %ebx
	je	LBB0_23
## %bb.22:
	leaq	-56(%rbp), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	callq	_mlx4_ib_free_cq_buf
LBB0_23:
	xorl	%ebx, %ebx
	jmp	LBB0_4
LBB0_24:
	movq	%r15, %rdi
	callq	_spin_unlock_irq
	xorl	%ebx, %ebx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_ib_resize_cq              ; -- Begin function mlx4_ib_resize_cq
	.p2align	2
_mlx4_ib_resize_cq:                     ; @mlx4_ib_resize_cq
	.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	x22, x2
	mov	x23, x1
	mov	x21, x0
	ldr	w0, [x0, #16]
	bl	_to_mdev
	mov	x20, x0
	mov	x0, x21
	bl	_to_mcq
	mov	x19, x0
	bl	_mutex_lock
	cmp	w23, #1
	b.lt	LBB0_2
; %bb.1:
	ldr	x8, [x20]
	ldr	w8, [x8]
	cmp	w8, w23
	b.ge	LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_3:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x22
	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:
	add	w0, w23, #1
	bl	_roundup_pow_of_two
	ldr	w8, [x21]
	add	w8, w8, #1
	cmp	w0, w8
	b.ne	LBB0_6
LBB0_5:
	mov	w22, #0
	b	LBB0_3
LBB0_6:
	mov	x23, x0
	ldr	x8, [x20]
	ldr	w8, [x8]
	add	w8, w8, #1
	cmp	w0, w8
	b.gt	LBB0_2
; %bb.7:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x23
	mov	x3, x22
	bl	_mlx4_alloc_resize_umem
	mov	x22, x0
	cbnz	w0, LBB0_3
	b	LBB0_11
LBB0_9:
	mov	x0, x19
	bl	_mlx4_ib_get_outstanding_cqes
	cmp	w23, w0
	b.le	LBB0_2
; %bb.10:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x23
	bl	_mlx4_alloc_resize_buf
	mov	x22, x0
	cbnz	w0, LBB0_3
LBB0_11:
	ldr	w8, [x19, #32]
	str	w8, [sp, #8]
	ldr	x0, [x20]
	add	x1, x19, #48
	ldr	x8, [x19, #16]
	add	x3, x8, #4
	mov	x2, x23
	bl	_mlx4_cq_resize
	mov	x22, x0
	ldr	x0, [x20]
	cbz	w22, LBB0_15
; %bb.12:
	ldr	x8, [x19, #16]
	add	x1, x8, #4
	bl	_mlx4_mtt_cleanup
	ldr	x8, [x21, #8]
	cbnz	x8, LBB0_14
; %bb.13:
	ldr	x1, [x19, #16]
	ldr	w2, [x1], #4
	mov	x0, x20
	bl	_mlx4_ib_free_cq_buf
LBB0_14:
	ldr	x0, [x19, #16]
	bl	_kfree
	str	xzr, [x19, #16]
	ldr	x0, [x19, #8]
	bl	_ib_umem_release
	b	LBB0_17
LBB0_15:
	add	x1, sp, #8
	bl	_mlx4_mtt_cleanup
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_18
; %bb.16:
	ldr	x8, [x19, #16]
	ldr	w9, [x8, #4]
	str	w9, [x19, #32]
	ldr	w8, [x8]
	str	w8, [x19, #28]
	ldr	x0, [x19, #40]
	bl	_ib_umem_release
	ldp	x8, x0, [x19, #8]
	str	x8, [x19, #40]
	bl	_kfree
	mov	w22, #0
	str	xzr, [x19, #16]
LBB0_17:
	str	xzr, [x19, #8]
	b	LBB0_3
LBB0_18:
	add	x21, x19, #24
	mov	x0, x21
	bl	_spin_lock_irq
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_21
; %bb.19:
	mov	x0, x19
	bl	_mlx4_ib_cq_resize_copy_cqes
	ldp	w22, w8, [x19, #28]
	str	w8, [sp]
	ldr	x0, [x19, #16]
	ldr	w8, [x0, #4]
	str	w8, [x19, #32]
	ldr	w8, [x0]
	str	w8, [x19, #28]
	bl	_kfree
	str	xzr, [x19, #16]
	mov	x0, x21
	bl	_spin_unlock_irq
	cbz	w22, LBB0_5
; %bb.20:
	mov	x1, sp
	mov	x0, x20
	mov	x2, x22
	bl	_mlx4_ib_free_cq_buf
	b	LBB0_5
LBB0_21:
	mov	x0, x21
	bl	_spin_unlock_irq
	mov	w22, #0
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
