	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __mthca_remove_one
___mthca_remove_one:                    ## @__mthca_remove_one
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_pci_get_drvdata
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_mthca_free_agents
	movq	%r15, %rdi
	callq	_mthca_unregister_device
	cmpl	$0, 20(%r15)
	jle	LBB0_4
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_mthca_CLOSE_IB
	cmpl	20(%r15), %ebx
	jl	LBB0_3
LBB0_4:
	movq	%r15, %rdi
	callq	_mthca_cleanup_mcg_table
	movq	%r15, %rdi
	callq	_mthca_cleanup_av_table
	movq	%r15, %rdi
	callq	_mthca_cleanup_qp_table
	movq	%r15, %rdi
	callq	_mthca_cleanup_srq_table
	movq	%r15, %rdi
	callq	_mthca_cleanup_cq_table
	movq	%r15, %rdi
	callq	_mthca_cmd_use_polling
	movq	%r15, %rdi
	callq	_mthca_cleanup_eq_table
	leaq	16(%r15), %rsi
	movq	%r15, %rdi
	callq	_mthca_pd_free
	movq	%r15, %rdi
	callq	_mthca_cleanup_mr_table
	movq	%r15, %rdi
	callq	_mthca_cleanup_pd_table
	movl	12(%r15), %edi
	callq	_iounmap
	leaq	8(%r15), %rsi
	movq	%r15, %rdi
	callq	_mthca_uar_free
	movq	%r15, %rdi
	callq	_mthca_cleanup_uar_table
	movq	%r15, %rdi
	callq	_mthca_close_hca
	movq	%r15, %rdi
	callq	_mthca_cmd_cleanup
	movq	_MTHCA_FLAG_MSI_X@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	callq	_pci_free_irq_vectors
LBB0_6:
	addq	$4, %r15
	movq	%r15, %rdi
	callq	_ib_dealloc_device
	movq	%r14, %rdi
	callq	_pci_release_regions
	movq	%r14, %rdi
	callq	_pci_disable_device
	movq	%r14, %rdi
	xorl	%esi, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pci_set_drvdata                ## TAILCALL
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTHCA_FLAG_MSI_X,4,2           ## @MTHCA_FLAG_MSI_X
	.no_dead_strip	___mthca_remove_one
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __mthca_remove_one
___mthca_remove_one:                    ; @__mthca_remove_one
	.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	x19, x0
	bl	_pci_get_drvdata
	cbz	x0, LBB0_7
; %bb.1:
	mov	x20, x0
	bl	_mthca_free_agents
	mov	x0, x20
	bl	_mthca_unregister_device
	ldr	w8, [x20, #20]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	w21, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	w21, w21, #1
	mov	x0, x20
	mov	x1, x21
	bl	_mthca_CLOSE_IB
	ldr	w8, [x20, #20]
	cmp	w21, w8
	b.lt	LBB0_3
LBB0_4:
	mov	x0, x20
	bl	_mthca_cleanup_mcg_table
	mov	x0, x20
	bl	_mthca_cleanup_av_table
	mov	x0, x20
	bl	_mthca_cleanup_qp_table
	mov	x0, x20
	bl	_mthca_cleanup_srq_table
	mov	x0, x20
	bl	_mthca_cleanup_cq_table
	mov	x0, x20
	bl	_mthca_cmd_use_polling
	mov	x0, x20
	bl	_mthca_cleanup_eq_table
	add	x1, x20, #16
	mov	x0, x20
	bl	_mthca_pd_free
	mov	x0, x20
	bl	_mthca_cleanup_mr_table
	mov	x0, x20
	bl	_mthca_cleanup_pd_table
	ldr	w0, [x20, #12]
	bl	_iounmap
	add	x1, x20, #8
	mov	x0, x20
	bl	_mthca_uar_free
	mov	x0, x20
	bl	_mthca_cleanup_uar_table
	mov	x0, x20
	bl	_mthca_close_hca
	mov	x0, x20
	bl	_mthca_cmd_cleanup
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _MTHCA_FLAG_MSI_X@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MTHCA_FLAG_MSI_X@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_pci_free_irq_vectors
LBB0_6:
	add	x0, x20, #4
	bl	_ib_dealloc_device
	mov	x0, x19
	bl	_pci_release_regions
	mov	x0, x19
	bl	_pci_disable_device
	mov	x0, x19
	mov	x1, #0
	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
	b	_pci_set_drvdata
LBB0_7:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_FLAG_MSI_X,4,2           ; @MTHCA_FLAG_MSI_X
	.no_dead_strip	___mthca_remove_one
.subsections_via_symbols
