	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_resize_cq                 ## -- Begin function mlx5_resize_cq
	.p2align	4, 0x90
_mlx5_resize_cq:                        ## @mlx5_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
	movl	%esi, %ebx
	movq	%rdi, %r12
	callq	_to_mcq
	movq	%rax, %r14
	movl	4(%r12), %edi
	callq	_to_mctx
	testl	%ebx, %ebx
	js	LBB0_1
## %bb.2:
	movq	%rax, %r15
	leaq	-72(%rbp), %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	leaq	-96(%rbp), %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movl	%ebx, %eax
	shlq	$6, %rax
	movq	_INT_MAX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_4
## %bb.3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_12
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	jmp	LBB0_12
LBB0_4:
	leaq	8(%r14), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mlx5_spin_lock
	movl	24(%r14), %eax
	movl	%eax, (%r14)
	leaq	48(%r14), %rax
	movq	%r14, %rcx
	addq	$56, %rcx
	cmpq	%rax, 32(%r14)
	cmovneq	%rax, %rcx
	movq	%rcx, 16(%r14)
	incl	%ebx
	movl	%ebx, %edi
	callq	_align_queue_size
	movl	%eax, %r13d
	movl	(%r12), %eax
	incl	%eax
	cmpl	%eax, %r13d
	jne	LBB0_6
## %bb.5:
	movq	$0, 16(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_6:
	movl	44(%r14), %r8d
	movl	%r8d, 40(%r14)
	movl	%r13d, 4(%r14)
	movq	16(%r14), %rdx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%r13d, %ecx
	callq	_mlx5_alloc_cq_buf
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	movq	$0, 16(%r14)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_11
LBB0_8:
	movq	16(%r14), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)
	movl	40(%r14), %eax
	movl	%eax, -56(%rbp)
	decl	%r13d
	leaq	-60(%rbp), %rdx
	leaq	-88(%rbp), %r8
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	$24, %ecx
	movl	$24, %r9d
	callq	_ibv_cmd_resize_cq
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movl	%eax, %ebx
	movq	16(%r14), %rsi
	movq	%r15, %rdi
	callq	_mlx5_free_cq_buf
	movq	$0, 16(%r14)
LBB0_11:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mlx5_spin_unlock
LBB0_12:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r14, %rdi
	callq	_mlx5_cq_resize_copy_cqes
	movq	32(%r14), %rsi
	movq	%r15, %rdi
	callq	_mlx5_free_cq_buf
	movq	16(%r14), %rax
	movq	%rax, 32(%r14)
	movl	%r13d, 24(%r14)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mlx5_spin_unlock
	movq	$0, 16(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_INT_MAX,8,3                    ## @INT_MAX
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_resize_cq                 ; -- Begin function mlx5_resize_cq
	.p2align	2
_mlx5_resize_cq:                        ; @mlx5_resize_cq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x23, x1
	mov	x22, x0
	bl	_to_mcq
	mov	x19, x0
	ldr	w0, [x22, #4]
	bl	_to_mctx
	tbnz	w23, #31, LBB0_3
; %bb.1:
	mov	x21, x0
	mov	x0, sp
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	mov	w8, w23
Lloh0:
	adrp	x9, _INT_MAX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _INT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x9, x8, lsl #6
	b.ge	LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
	b	LBB0_10
LBB0_3:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w23, [x8]
Lloh9:
	adrp	x8, _errno@GOTPAGE
Lloh10:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh11:
	str	w23, [x8]
	b	LBB0_10
LBB0_4:
	add	x20, x19, #8
	mov	x0, x20
	bl	_mlx5_spin_lock
	ldr	w8, [x19, #24]
	str	w8, [x19]
	ldr	x8, [x19, #32]
	add	x9, x19, #48
	add	x10, x19, #56
	cmp	x8, x9
	csel	x8, x10, x9, eq
	str	x8, [x19, #16]
	add	w0, w23, #1
	bl	_align_queue_size
	ldr	w8, [x22]
	add	w8, w8, #1
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.5:
	mov	w23, #0
LBB0_6:
	str	xzr, [x19, #16]
	b	LBB0_9
LBB0_7:
	mov	x24, x0
	ldr	w4, [x19, #44]
	str	w4, [x19, #40]
	str	w0, [x19, #4]
	ldr	x2, [x19, #16]
	mov	x0, x21
	mov	x1, x19
	mov	x3, x24
	bl	_mlx5_alloc_cq_buf
	cbz	w0, LBB0_11
; %bb.8:
	mov	x23, x0
	str	xzr, [x19, #16]
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _errno@GOTPAGE
Lloh16:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh17:
	str	w8, [x9]
LBB0_9:
	mov	x0, x20
	bl	_mlx5_spin_unlock
LBB0_10:
	mov	x0, x23
	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
	add	sp, sp, #112
	ret
LBB0_11:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	str	x8, [sp]
	ldr	w8, [x19, #40]
	str	w8, [sp, #16]
	sub	w24, w24, #1
	mov	x8, sp
	add	x2, x8, #12
	add	x8, sp, #24
	add	x4, x8, #8
	mov	x0, x22
	mov	x1, x24
	mov	w3, #24
	mov	w5, #24
	bl	_ibv_cmd_resize_cq
	mov	x23, x0
	cbz	w0, LBB0_13
; %bb.12:
	ldr	x1, [x19, #16]
	mov	x0, x21
	bl	_mlx5_free_cq_buf
	b	LBB0_6
LBB0_13:
	mov	x0, x19
	bl	_mlx5_cq_resize_copy_cqes
	ldr	x1, [x19, #32]
	mov	x0, x21
	bl	_mlx5_free_cq_buf
	ldr	x8, [x19, #16]
	str	x8, [x19, #32]
	str	w24, [x19, #24]
	mov	x0, x20
	bl	_mlx5_spin_unlock
	str	xzr, [x19, #16]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotStr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotStr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_INT_MAX,8,3                    ; @INT_MAX
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
