	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mthca_free_eq
_mthca_free_eq:                         ## @mthca_free_eq
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	_MTHCA_EQ_ENTRY_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	(%rsi), %eax
	movq	%rdi, %rbx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	addl	%ecx, %eax
	decl	%eax
	cltd
	idivl	%ecx
	movl	%eax, %r12d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mthca_alloc_mailbox
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	20(%r15), %edx
	movq	%rbx, %rdi
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rsi
	callq	_mthca_HW2SW_EQ
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_mthca_warn
LBB0_3:
	movl	24(%r15), %eax
	notl	%eax
	andl	%eax, 4(%rbx)
	leaq	16(%r15), %rsi
	movq	%rbx, %rdi
	callq	_mthca_free_mr
	testl	%r12d, %r12d
	jle	LBB0_6
## %bb.4:
	movl	%r12d, %eax
	shlq	$2, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	(%r14), %r12d
	movq	8(%r15), %rdi
	movq	%r15, %r14
	movl	(%rdi,%r13), %r15d
	addq	%r13, %rdi
	movq	_mapping@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_dma_unmap_addr
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%r12d, %esi
	movl	%r15d, %edx
	movq	%r14, %r15
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r14
	movl	%eax, %ecx
	callq	_pci_free_consistent
	addq	$4, %r13
	cmpq	%r13, -64(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_5
LBB0_6:
	movq	8(%r15), %rdi
	callq	_kfree
	movq	%rbx, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mthca_free_mailbox             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MTHCA_EQ_ENTRY_SIZE,4,2        ## @MTHCA_EQ_ENTRY_SIZE
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HW2SW_EQ returned %d\n"

	.comm	_mapping,4,2                    ## @mapping
	.no_dead_strip	_mthca_free_eq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mthca_free_eq
_mthca_free_eq:                         ; @mthca_free_eq
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
	ldr	w23, [x1]
Lloh0:
	adrp	x8, _MTHCA_EQ_ENTRY_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTHCA_EQ_ENTRY_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
Lloh3:
	adrp	x25, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x25, [x25, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w22, [x25]
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_mthca_alloc_mailbox
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_2:
	madd	w8, w24, w23, w22
	sub	w8, w8, #1
	ldr	w2, [x20, #20]
	sdiv	w22, w8, w22
	mov	x0, x19
	mov	x1, x21
	bl	_mthca_HW2SW_EQ
	cbz	w0, LBB0_4
; %bb.3:
	mov	x2, x0
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mthca_warn
LBB0_4:
	ldr	w8, [x20, #24]
	ldr	w9, [x19, #4]
	bic	w8, w9, w8
	str	w8, [x19, #4]
	add	x1, x20, #16
	mov	x0, x19
	bl	_mthca_free_mr
	cmp	w22, #1
	b.lt	LBB0_7
; %bb.5:
	mov	x26, #0
	lsl	x27, x22, #2
Lloh10:
	adrp	x28, _mapping@GOTPAGE
Lloh11:
	ldr	x28, [x28, _mapping@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w22, [x19]
	ldr	w23, [x25]
	ldr	x8, [x20, #8]
	add	x0, x8, x26
	ldr	w24, [x0]
	ldr	w1, [x28]
	bl	_dma_unmap_addr
	mov	x3, x0
	mov	x0, x22
	mov	x1, x23
	mov	x2, x24
	bl	_pci_free_consistent
	add	x26, x26, #4
	cmp	x27, x26
	b.ne	LBB0_6
LBB0_7:
	ldr	x0, [x20, #8]
	bl	_kfree
	mov	x0, x19
	mov	x1, x21
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_mthca_free_mailbox
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_EQ_ENTRY_SIZE,4,2        ; @MTHCA_EQ_ENTRY_SIZE
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HW2SW_EQ returned %d\n"

	.comm	_mapping,4,2                    ; @mapping
	.no_dead_strip	_mthca_free_eq
.subsections_via_symbols
