	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ib_mad_port_close
_ib_mad_port_close:                     ## @ib_mad_port_close
	.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
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_ib_mad_port_list_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	___ib_get_mad_port
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, %rdi
	addq	$20, %rdi
	callq	_list_del_init
	movq	_ib_mad_port_list_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	movl	16(%rbx), %edi
	callq	_destroy_workqueue
	movq	(%rbx), %rdi
	addq	$4, %rdi
	callq	_destroy_mad_qp
	movq	(%rbx), %rdi
	callq	_destroy_mad_qp
	movl	12(%rbx), %edi
	callq	_ib_dealloc_pd
	movl	8(%rbx), %edi
	callq	_ib_free_cq
	movq	(%rbx), %rdi
	addq	$4, %rdi
	callq	_cleanup_recv_queue
	movq	(%rbx), %rdi
	callq	_cleanup_recv_queue
	movq	%rbx, %rdi
	callq	_kfree
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	movq	_ib_mad_port_list_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ib_mad_port_list_lock,4,2      ## @ib_mad_port_list_lock
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Port %d not found\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_ib_mad_port_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ib_mad_port_close
_ib_mad_port_close:                     ; @ib_mad_port_close
	.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	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x0, _ib_mad_port_list_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _ib_mad_port_list_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
	mov	x0, x21
	mov	x1, x20
	bl	___ib_get_mad_port
	cbz	x0, LBB0_2
; %bb.1:
	mov	x19, x0
	add	x0, x0, #20
	bl	_list_del_init
Lloh2:
	adrp	x0, _ib_mad_port_list_lock@GOTPAGE
Lloh3:
	ldr	x0, [x0, _ib_mad_port_list_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	ldr	w0, [x19, #16]
	bl	_destroy_workqueue
	ldr	x8, [x19]
	add	x0, x8, #4
	bl	_destroy_mad_qp
	ldr	x0, [x19]
	bl	_destroy_mad_qp
	ldr	w0, [x19, #12]
	bl	_ib_dealloc_pd
	ldr	w0, [x19, #8]
	bl	_ib_free_cq
	ldr	x8, [x19]
	add	x0, x8, #4
	bl	_cleanup_recv_queue
	ldr	x0, [x19]
	bl	_cleanup_recv_queue
	mov	x0, x19
	bl	_kfree
	mov	w0, #0
	b	LBB0_3
LBB0_2:
Lloh4:
	adrp	x0, _ib_mad_port_list_lock@GOTPAGE
Lloh5:
	ldr	x0, [x0, _ib_mad_port_list_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	bl	_dev_err
Lloh8:
	adrp	x8, _ENODEV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ib_mad_port_list_lock,4,2      ; @ib_mad_port_list_lock
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Port %d not found\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_ib_mad_port_close
.subsections_via_symbols
