	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_free_srq                 ## -- Begin function mthca_free_srq
	.p2align	4, 0x90
_mthca_free_srq:                        ## @mthca_free_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mthca_alloc_mailbox
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.7:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mthca_warn                     ## TAILCALL
LBB0_1:
	movl	(%r14), %edx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_mthca_HW2SW_SRQ
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_mthca_warn
LBB0_3:
	leaq	8(%rbx), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irq
	leaq	12(%rbx), %rdi
	movl	16(%rbx), %esi
	decl	%esi
	andl	(%r14), %esi
	callq	_mthca_array_clear
	decl	16(%r14)
	movq	%r12, %rdi
	callq	_spin_unlock_irq
	movl	12(%r14), %r12d
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_get_srq_refcount
	xorl	%esi, %esi
	testl	%eax, %eax
	sete	%sil
	movl	%r12d, %edi
	callq	_wait_event
	cmpl	$0, 8(%r14)
	jne	LBB0_6
## %bb.4:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_mthca_free_srq_buf
	movq	%rbx, %rdi
	callq	_mthca_is_memfree
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_MTHCA_DB_TYPE_SRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r14), %edx
	movq	%rbx, %rdi
	callq	_mthca_free_db
LBB0_6:
	movl	4(%rbx), %esi
	movl	(%r14), %edx
	movq	%rbx, %rdi
	callq	_mthca_table_put
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_mthca_free
	movq	%rbx, %rdi
	movq	%r15, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mthca_free_mailbox             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No memory for mailbox to free SRQ.\n"

L_.str.1:                               ## @.str.1
	.asciz	"HW2SW_SRQ failed (%d)\n"

	.comm	_MTHCA_DB_TYPE_SRQ,4,2          ## @MTHCA_DB_TYPE_SRQ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_free_srq                 ; -- Begin function mthca_free_srq
	.p2align	2
_mthca_free_srq:                        ; @mthca_free_srq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_mthca_alloc_mailbox
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_mthca_warn
LBB0_2:
	ldr	w2, [x20]
	mov	x0, x19
	mov	x1, x21
	bl	_mthca_HW2SW_SRQ
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_4
; %bb.3:
	str	x0, [sp]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_mthca_warn
LBB0_4:
	add	x22, x19, #8
	mov	x0, x22
	bl	_spin_lock_irq
	add	x0, x19, #12
	ldr	w8, [x20]
	ldr	w9, [x19, #16]
	sub	w9, w9, #1
	and	w1, w9, w8
	bl	_mthca_array_clear
	ldr	w8, [x20, #16]
	sub	w8, w8, #1
	str	w8, [x20, #16]
	mov	x0, x22
	bl	_spin_unlock_irq
	ldr	w22, [x20, #12]
	mov	x0, x19
	mov	x1, x20
	bl	_get_srq_refcount
	cmp	w0, #0
	cset	w1, eq
	mov	x0, x22
	bl	_wait_event
	ldr	w8, [x20, #8]
	cbnz	w8, LBB0_7
; %bb.5:
	mov	x0, x19
	mov	x1, x20
	bl	_mthca_free_srq_buf
	mov	x0, x19
	bl	_mthca_is_memfree
	cbz	x0, LBB0_7
; %bb.6:
Lloh7:
	adrp	x8, _MTHCA_DB_TYPE_SRQ@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MTHCA_DB_TYPE_SRQ@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	ldr	w2, [x20, #4]
	mov	x0, x19
	bl	_mthca_free_db
LBB0_7:
	ldr	w1, [x19, #4]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_mthca_table_put
	ldr	w1, [x20]
	mov	x0, x19
	bl	_mthca_free
	mov	x0, x19
	mov	x1, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_mthca_free_mailbox
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No memory for mailbox to free SRQ.\n"

l_.str.1:                               ; @.str.1
	.asciz	"HW2SW_SRQ failed (%d)\n"

	.comm	_MTHCA_DB_TYPE_SRQ,4,2          ; @MTHCA_DB_TYPE_SRQ
.subsections_via_symbols
