	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_modify_srq               ## -- Begin function mthca_modify_srq
	.p2align	4, 0x90
_mthca_modify_srq:                      ## @mthca_modify_srq
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r13d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_to_mdev
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_to_msrq
	movq	%rax, %r12
	movq	_IB_SRQ_MAX_WR@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_IB_SRQ_LIMIT@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_3
## %bb.4:
	movq	%r15, %rdi
	callq	_mthca_is_memfree
	movq	(%r12), %rcx
	cmpq	$1, %rax
	adcq	$-1, %rcx
	cmpq	%rcx, (%r14)
	jg	LBB0_1
## %bb.5:
	movq	%r12, %rbx
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movl	12(%r12), %esi
	movq	(%r14), %rdx
	movq	%r15, %rdi
	callq	_mthca_ARM_SRQ
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r14d, %eax
	jmp	LBB0_6
LBB0_3:
	xorl	%eax, %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_SRQ_MAX_WR,4,2              ## @IB_SRQ_MAX_WR
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IB_SRQ_LIMIT,4,2               ## @IB_SRQ_LIMIT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_modify_srq               ; -- Begin function mthca_modify_srq
	.p2align	2
_mthca_modify_srq:                      ; @mthca_modify_srq
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x22, x2
	mov	x19, x1
	mov	x21, x0
	ldr	w0, [x0]
	bl	_to_mdev
	mov	x20, x0
	mov	x0, x21
	bl	_to_msrq
Lloh0:
	adrp	x8, _IB_SRQ_MAX_WR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IB_SRQ_MAX_WR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_3
LBB0_1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_3:
Lloh6:
	adrp	x8, _IB_SRQ_LIMIT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IB_SRQ_LIMIT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_6
; %bb.4:
	mov	x21, x0
	mov	x0, x20
	bl	_mthca_is_memfree
	cmp	x0, #0
	cset	w8, ne
	ldr	x9, [x21]
	ldr	x10, [x19]
	sub	x8, x9, x8
	cmp	x10, x8
	b.gt	LBB0_1
; %bb.5:
	add	x22, x21, #8
	mov	x0, x22
	bl	_mutex_lock
	ldr	w1, [x21, #12]
	ldr	x2, [x19]
	mov	x0, x20
	bl	_mthca_ARM_SRQ
	mov	x19, x0
	mov	x0, x22
	bl	_mutex_unlock
	mov	x0, x19
	b	LBB0_2
LBB0_6:
	mov	w0, #0
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_SRQ_MAX_WR,4,2              ; @IB_SRQ_MAX_WR
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IB_SRQ_LIMIT,4,2               ; @IB_SRQ_LIMIT
.subsections_via_symbols
