	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_unload_one
_mlx4_unload_one:                       ## @mlx4_unload_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	%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
	movq	%rdi, %r15
	callq	_pci_get_drvdata
	movq	(%rax), %r12
	movq	%r12, %rdi
	callq	_mlx4_priv
	cmpl	$0, (%rax)
	jne	LBB0_24
## %bb.1:
	movq	%rax, %r14
	cmpl	$0, 8(%r12)
	jle	LBB0_4
## %bb.2:
	movq	16(%r12), %r8
	movq	24(%r12), %rcx
	movq	32(%r12), %rsi
	movq	(%rsi), %rdx
	movq	8(%rsi), %rsi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%rcx,%rdi,4), %ebx
	movl	%ebx, (%rsi,%rdi,4)
	movl	4(%r8,%rdi,4), %ebx
	movl	%ebx, (%rdx,%rdi,4)
	leaq	1(%rdi), %rbx
	movslq	8(%r12), %rax
	movq	%rbx, %rdi
	cmpq	%rax, %rbx
	jl	LBB0_3
LBB0_4:
	movl	4(%r14), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	callq	_mlx4_stop_sense
	movq	%r12, %rdi
	callq	_mlx4_unregister_device
	cmpl	$0, 8(%r12)
	jle	LBB0_7
## %bb.5:
	movl	$4, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rdi
	addq	%r13, %rdi
	callq	_mlx4_cleanup_port_info
	incq	%rbx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_mlx4_CLOSE_PORT
	movslq	8(%r12), %rax
	addq	$4, %r13
	cmpq	%rax, %rbx
	jl	LBB0_6
LBB0_7:
	movq	%r12, %rdi
	callq	_mlx4_is_master
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	_RES_TR_FREE_SLAVES_ONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_mlx4_free_resource_tracker
LBB0_9:
	movq	%r12, %rdi
	callq	_mlx4_cleanup_default_counters
	movq	%r12, %rdi
	callq	_mlx4_is_slave
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:
	movq	%r12, %rdi
	callq	_mlx4_cleanup_counters_table
LBB0_11:
	movq	%r12, %rdi
	callq	_mlx4_cleanup_qp_table
	movq	%r12, %rdi
	callq	_mlx4_cleanup_srq_table
	movq	%r12, %rdi
	callq	_mlx4_cleanup_cq_table
	movq	%r12, %rdi
	callq	_mlx4_cmd_use_polling
	movq	%r12, %rdi
	callq	_mlx4_cleanup_eq_table
	movq	%r12, %rdi
	callq	_mlx4_cleanup_mcg_table
	movq	%r12, %rdi
	callq	_mlx4_cleanup_mr_table
	movq	%r12, %rdi
	callq	_mlx4_cleanup_xrcd_table
	movq	%r12, %rdi
	callq	_mlx4_cleanup_pd_table
	movq	%r12, %rdi
	callq	_mlx4_is_master
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	_RES_TR_FREE_STRUCTS_ONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_mlx4_free_resource_tracker
LBB0_13:
	movl	12(%r14), %edi
	callq	_iounmap
	movq	%r14, %rsi
	addq	$8, %rsi
	movq	%r12, %rdi
	callq	_mlx4_uar_free
	movq	%r12, %rdi
	callq	_mlx4_cleanup_uar_table
	movq	%r12, %rdi
	callq	_mlx4_is_slave
	testq	%rax, %rax
	jne	LBB0_15
## %bb.14:
	movq	%r12, %rdi
	callq	_mlx4_clear_steering
LBB0_15:
	movq	%r12, %rdi
	callq	_mlx4_free_eq_table
	movq	%r12, %rdi
	callq	_mlx4_is_master
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movq	%r12, %rdi
	callq	_mlx4_multi_func_cleanup
LBB0_17:
	movq	%r12, %rdi
	callq	_mlx4_close_hca
	movq	%r12, %rdi
	callq	_mlx4_close_fw
	movq	%r12, %rdi
	callq	_mlx4_is_slave
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	movq	%r12, %rdi
	callq	_mlx4_multi_func_cleanup
LBB0_19:
	movq	_MLX4_CMD_CLEANUP_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_mlx4_cmd_cleanup
	movq	_MLX4_FLAG_MSI_X@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_21
## %bb.20:
	movq	%r15, %rdi
	callq	_pci_disable_msix
LBB0_21:
	movq	%r12, %rdi
	callq	_mlx4_is_slave
	testq	%rax, %rax
	jne	LBB0_23
## %bb.22:
	movq	%r12, %rdi
	callq	_mlx4_free_ownership
LBB0_23:
	movq	%r12, %rdi
	callq	_mlx4_slave_destroy_special_qp_cap
	movl	4(%r12), %edi
	callq	_kfree
	movq	%r12, %rdi
	callq	_mlx4_clean_dev
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%r14)
	movl	$1, (%r14)
LBB0_24:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RES_TR_FREE_SLAVES_ONLY,4,2    ## @RES_TR_FREE_SLAVES_ONLY
	.comm	_RES_TR_FREE_STRUCTS_ONLY,4,2   ## @RES_TR_FREE_STRUCTS_ONLY
	.comm	_MLX4_CMD_CLEANUP_ALL,4,2       ## @MLX4_CMD_CLEANUP_ALL
	.comm	_MLX4_FLAG_MSI_X,4,2            ## @MLX4_FLAG_MSI_X
	.no_dead_strip	_mlx4_unload_one
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_unload_one
_mlx4_unload_one:                       ; @mlx4_unload_one
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x0
	bl	_pci_get_drvdata
	ldr	x19, [x0]
	mov	x0, x19
	bl	_mlx4_priv
	ldr	w8, [x0]
	cbnz	w8, LBB0_24
; %bb.1:
	mov	x20, x0
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x8, #0
	ldp	x12, x10, [x19, #24]
	ldr	x11, [x19, #16]
	ldp	x10, x9, [x10]
	add	x11, x11, #4
	add	x12, x12, #4
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x13, x8, #2
	ldr	w14, [x12, x13]
	str	w14, [x9, x13]
	ldr	w14, [x11, x13]
	add	x15, x8, #1
	str	w14, [x10, x13]
	ldrsw	x13, [x19, #8]
	mov	x8, x15
	cmp	x15, x13
	b.lt	LBB0_3
LBB0_4:
	ldr	w23, [x20, #4]
	mov	x0, x19
	bl	_mlx4_stop_sense
	mov	x0, x19
	bl	_mlx4_unregister_device
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.5:
	mov	x22, #0
	mov	w24, #4
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	add	x0, x8, x24
	bl	_mlx4_cleanup_port_info
	add	x22, x22, #1
	mov	x0, x19
	mov	x1, x22
	bl	_mlx4_CLOSE_PORT
	ldrsw	x8, [x19, #8]
	add	x24, x24, #4
	cmp	x22, x8
	b.lt	LBB0_6
LBB0_7:
	mov	x0, x19
	bl	_mlx4_is_master
	cbz	x0, LBB0_9
; %bb.8:
Lloh0:
	adrp	x8, _RES_TR_FREE_SLAVES_ONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RES_TR_FREE_SLAVES_ONLY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mlx4_free_resource_tracker
LBB0_9:
	mov	x0, x19
	bl	_mlx4_cleanup_default_counters
	mov	x0, x19
	bl	_mlx4_is_slave
	cbnz	x0, LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_mlx4_cleanup_counters_table
LBB0_11:
	mov	x0, x19
	bl	_mlx4_cleanup_qp_table
	mov	x0, x19
	bl	_mlx4_cleanup_srq_table
	mov	x0, x19
	bl	_mlx4_cleanup_cq_table
	mov	x0, x19
	bl	_mlx4_cmd_use_polling
	mov	x0, x19
	bl	_mlx4_cleanup_eq_table
	mov	x0, x19
	bl	_mlx4_cleanup_mcg_table
	mov	x0, x19
	bl	_mlx4_cleanup_mr_table
	mov	x0, x19
	bl	_mlx4_cleanup_xrcd_table
	mov	x0, x19
	bl	_mlx4_cleanup_pd_table
	mov	x0, x19
	bl	_mlx4_is_master
	cbz	x0, LBB0_13
; %bb.12:
Lloh3:
	adrp	x8, _RES_TR_FREE_STRUCTS_ONLY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RES_TR_FREE_STRUCTS_ONLY@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mlx4_free_resource_tracker
LBB0_13:
	ldr	w0, [x20, #12]
	bl	_iounmap
	add	x1, x20, #8
	mov	x0, x19
	bl	_mlx4_uar_free
	mov	x0, x19
	bl	_mlx4_cleanup_uar_table
	mov	x0, x19
	bl	_mlx4_is_slave
	cbnz	x0, LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_mlx4_clear_steering
LBB0_15:
	mov	x0, x19
	bl	_mlx4_free_eq_table
	mov	x0, x19
	bl	_mlx4_is_master
	cbz	x0, LBB0_17
; %bb.16:
	mov	x0, x19
	bl	_mlx4_multi_func_cleanup
LBB0_17:
	mov	x0, x19
	bl	_mlx4_close_hca
	mov	x0, x19
	bl	_mlx4_close_fw
	mov	x0, x19
	bl	_mlx4_is_slave
	cbz	x0, LBB0_19
; %bb.18:
	mov	x0, x19
	bl	_mlx4_multi_func_cleanup
LBB0_19:
Lloh6:
	adrp	x8, _MLX4_CMD_CLEANUP_ALL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MLX4_CMD_CLEANUP_ALL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mlx4_cmd_cleanup
	ldr	w8, [x19]
Lloh9:
	adrp	x9, _MLX4_FLAG_MSI_X@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MLX4_FLAG_MSI_X@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_21
; %bb.20:
	mov	x0, x21
	bl	_pci_disable_msix
LBB0_21:
	mov	x0, x19
	bl	_mlx4_is_slave
	cbnz	x0, LBB0_23
; %bb.22:
	mov	x0, x19
	bl	_mlx4_free_ownership
LBB0_23:
	mov	x0, x19
	bl	_mlx4_slave_destroy_special_qp_cap
	ldr	w0, [x19, #4]
	bl	_kfree
	mov	x0, x19
	bl	_mlx4_clean_dev
	mov	w8, #1
	stp	w8, w23, [x20]
LBB0_24:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_RES_TR_FREE_SLAVES_ONLY,4,2    ; @RES_TR_FREE_SLAVES_ONLY
	.comm	_RES_TR_FREE_STRUCTS_ONLY,4,2   ; @RES_TR_FREE_STRUCTS_ONLY
	.comm	_MLX4_CMD_CLEANUP_ALL,4,2       ; @MLX4_CMD_CLEANUP_ALL
	.comm	_MLX4_FLAG_MSI_X,4,2            ; @MLX4_FLAG_MSI_X
	.no_dead_strip	_mlx4_unload_one
.subsections_via_symbols
