	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_resize_cq                 ## -- Begin function mlx4_resize_cq
	.p2align	4, 0x90
_mlx4_resize_cq:                        ## @mlx4_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
	movl	%esi, %ebx
	movq	%rdi, %r12
	callq	_to_mcq
	cmpl	$4194304, %ebx                  ## imm = 0x400000
	jl	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_10
LBB0_2:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_pthread_spin_lock
	incl	%ebx
	movl	%ebx, %edi
	callq	_align_queue_size
	movl	%eax, %r15d
	movl	(%r12), %eax
	incl	%eax
	xorl	%ebx, %ebx
	cmpl	%eax, %r15d
	je	LBB0_9
## %bb.3:
	movq	%r14, %rdi
	callq	_mlx4_get_outstanding_cqes
	cmpl	%eax, %r15d
	jle	LBB0_4
## %bb.5:
	movq	8(%r12), %rax
	movl	(%rax), %edi
	callq	_to_mdev
	movl	16(%r14), %ecx
	leaq	-48(%rbp), %rsi
	movl	%eax, %edi
	movl	%r15d, %edx
	callq	_mlx4_alloc_cq_buf
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.6:
	movl	(%r12), %r13d
	movq	-48(%rbp), %rax
	movq	%rax, -72(%rbp)
	decl	%r15d
	leaq	-64(%rbp), %rdx
	leaq	-56(%rbp), %r8
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	$16, %ecx
	movl	$4, %r9d
	callq	_ibv_cmd_resize_cq
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	leaq	-48(%rbp), %rdi
	callq	_mlx4_free_buf
	jmp	LBB0_9
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_9:
	movq	%r14, %rdi
	callq	_pthread_spin_unlock
LBB0_10:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	-48(%rbp), %rsi
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_mlx4_cq_resize_copy_cqes
	movq	%r14, %rdi
	addq	$8, %rdi
	callq	_mlx4_free_buf
	movq	-48(%rbp), %rax
	movq	%rax, 8(%r14)
	movq	%r14, %rdi
	callq	_mlx4_update_cons_index
	xorl	%ebx, %ebx
	jmp	LBB0_9
	.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_resize_cq                 ; -- Begin function mlx4_resize_cq
	.p2align	2
_mlx4_resize_cq:                        ; @mlx4_resize_cq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x1
	mov	x20, x0
	bl	_to_mcq
	cmp	w21, #1024, lsl #12             ; =4194304
	b.lt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	b	LBB0_10
LBB0_2:
	mov	x19, x0
	bl	_pthread_spin_lock
	add	w0, w21, #1
	bl	_align_queue_size
	ldr	w8, [x20]
	add	w8, w8, #1
	cmp	w0, w8
	b.ne	LBB0_4
; %bb.3:
	mov	w22, #0
	b	LBB0_9
LBB0_4:
	mov	x21, x0
	mov	x0, x19
	bl	_mlx4_get_outstanding_cqes
	cmp	w21, w0
	b.le	LBB0_8
; %bb.5:
	ldr	x8, [x20, #8]
	ldr	w0, [x8]
	bl	_to_mdev
	ldr	w3, [x19, #16]
	mov	x1, sp
	mov	x2, x21
	bl	_mlx4_alloc_cq_buf
	mov	x22, x0
	cbnz	w0, LBB0_9
; %bb.6:
	ldr	w23, [x20]
	ldr	x8, [sp]
	str	x8, [sp, #16]
	sub	w1, w21, #1
	add	x8, sp, #16
	add	x2, x8, #8
	add	x4, sp, #8
	mov	x0, x20
	mov	w3, #16
	mov	w5, #4
	bl	_ibv_cmd_resize_cq
	mov	x22, x0
	cbz	w0, LBB0_11
; %bb.7:
	mov	x0, sp
	bl	_mlx4_free_buf
	b	LBB0_9
LBB0_8:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
LBB0_9:
	mov	x0, x19
	bl	_pthread_spin_unlock
LBB0_10:
	mov	x0, x22
	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
	add	sp, sp, #96
	ret
LBB0_11:
	ldr	x1, [sp]
	mov	x0, x19
	mov	x2, x23
	bl	_mlx4_cq_resize_copy_cqes
	add	x0, x19, #8
	bl	_mlx4_free_buf
	ldr	x8, [sp]
	str	x8, [x19, #8]
	mov	x0, x19
	bl	_mlx4_update_cons_index
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
