	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_close
_qib_close:                             ## @qib_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	%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	%rsi, %rbx
	movq	_qib_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	(%rbx), %r14
	movq	$0, (%rbx)
	movq	16(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	movq	88(%rbx), %r15
	xorl	%eax, %eax
	callq	_qib_flush_wc
	movq	8(%r14), %rsi
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.3:
	movl	16(%rbx), %edi
	callq	_qib_user_sdma_queue_drain
	movq	8(%r14), %rdi
	callq	_qib_user_sdma_queue_destroy
LBB0_4:
	movl	(%r14), %edi
	cmpl	$-1, %edi
	je	LBB0_6
## %bb.5:
	movq	_qib_cpulist@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	___clear_bit
LBB0_6:
	decq	80(%rbx)
	je	LBB0_8
## %bb.7:
	movslq	4(%r14), %rcx
	movl	$-2, %eax
	roll	%cl, %eax
	andl	%eax, (%rbx)
	movq	72(%rbx), %rax
	movq	$0, (%rax,%rcx,8)
LBB0_1:
	movq	_qib_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	jmp	LBB0_20
LBB0_8:
	leaq	40(%r15), %r13
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movl	4(%rbx), %r12d
	movq	48(%r15), %rax
	movq	$0, (%rax,%r12,8)
	movq	$0, 64(%rbx)
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	cmpq	$0, 56(%rbx)
	jne	LBB0_12
## %bb.9:
	cmpq	$0, 48(%rbx)
	jne	LBB0_12
## %bb.10:
	cmpq	$0, 40(%rbx)
	jne	LBB0_12
## %bb.11:
	cmpq	$0, 32(%rbx)
	je	LBB0_13
LBB0_12:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 48(%rbx)
	movups	%xmm0, 32(%rbx)
LBB0_13:
	cmpq	$0, 24(%rbx)
	je	LBB0_15
## %bb.14:
	movq	$0, 24(%rbx)
LBB0_15:
	cmpq	$0, 32(%r15)
	je	LBB0_19
## %bb.16:
	movl	16(%rbx), %edi
	movq	_QIB_RCVCTRL_CTXT_DIS@GOTPCREL(%rip), %rax
	movq	_QIB_RCVCTRL_INTRAVAIL_DIS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movl	%r12d, %edx
	callq	*24(%r15)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_qib_clean_part_key
	movl	8(%rbx), %edx
	movl	12(%rbx), %esi
	movq	%r15, %rdi
	callq	_qib_disarm_piobufs
	movl	8(%rbx), %edx
	movl	12(%rbx), %esi
	movq	_TXCHK_CHG_TYPE_KERN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	xorl	%r8d, %r8d
	callq	_qib_chg_pioavailkernel
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	*16(%r15)
	cmpq	$0, 8(%r15)
	je	LBB0_18
## %bb.17:
	movq	%rbx, %rdi
	callq	_unlock_expected_tids
LBB0_18:
	movq	_qib_stats@GOTPCREL(%rip), %rax
	decl	(%rax)
	incl	(%r15)
LBB0_19:
	movq	_qib_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_qib_free_ctxtdata
LBB0_20:
	movq	%r14, %rdi
	callq	_kfree
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_qib_mutex,4,2                  ## @qib_mutex
	.comm	_qib_cpulist,4,2                ## @qib_cpulist
	.comm	_QIB_RCVCTRL_CTXT_DIS,4,2       ## @QIB_RCVCTRL_CTXT_DIS
	.comm	_QIB_RCVCTRL_INTRAVAIL_DIS,4,2  ## @QIB_RCVCTRL_INTRAVAIL_DIS
	.comm	_TXCHK_CHG_TYPE_KERN,4,2        ## @TXCHK_CHG_TYPE_KERN
	.comm	_qib_stats,4,2                  ## @qib_stats
	.no_dead_strip	_qib_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_close
_qib_close:                             ; @qib_close
	.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	x20, x1
Lloh0:
	adrp	x0, _qib_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _qib_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	ldr	x19, [x20]
	str	xzr, [x20]
	ldr	x20, [x19, #16]
	cbz	x20, LBB0_7
; %bb.1:
	ldr	x21, [x20, #88]
	bl	_qib_flush_wc
	ldr	x1, [x19, #8]
	cbz	x1, LBB0_3
; %bb.2:
	ldr	w0, [x20, #16]
	bl	_qib_user_sdma_queue_drain
	ldr	x0, [x19, #8]
	bl	_qib_user_sdma_queue_destroy
LBB0_3:
	ldr	w0, [x19]
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.4:
Lloh2:
	adrp	x8, _qib_cpulist@GOTPAGE
Lloh3:
	ldr	x8, [x8, _qib_cpulist@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	___clear_bit
LBB0_5:
	ldr	x8, [x20, #80]
	subs	x8, x8, #1
	str	x8, [x20, #80]
	b.eq	LBB0_8
; %bb.6:
	ldrsw	x8, [x19, #4]
	mov	w9, #1
	lsl	w9, w9, w8
	ldr	w10, [x20]
	bic	w9, w10, w9
	str	w9, [x20]
	ldr	x9, [x20, #72]
	str	xzr, [x9, x8, lsl #3]
LBB0_7:
Lloh5:
	adrp	x0, _qib_mutex@GOTPAGE
Lloh6:
	ldr	x0, [x0, _qib_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	b	LBB0_20
LBB0_8:
	add	x23, x21, #40
	mov	x0, x23
	bl	_spin_lock_irqsave
	ldr	w22, [x20, #4]
	ldr	x8, [x21, #48]
	str	xzr, [x8, x22, lsl #3]
	str	xzr, [x20, #64]
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	ldr	x8, [x20, #56]
	cbnz	x8, LBB0_12
; %bb.9:
	ldr	x8, [x20, #48]
	cbnz	x8, LBB0_12
; %bb.10:
	ldr	x8, [x20, #40]
	cbnz	x8, LBB0_12
; %bb.11:
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_13
LBB0_12:
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x20, #32]
LBB0_13:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_15
; %bb.14:
	str	xzr, [x20, #24]
LBB0_15:
	ldr	x8, [x21, #32]
	cbz	x8, LBB0_19
; %bb.16:
	ldr	x8, [x21, #24]
Lloh7:
	adrp	x9, _QIB_RCVCTRL_CTXT_DIS@GOTPAGE
Lloh8:
	ldr	x9, [x9, _QIB_RCVCTRL_CTXT_DIS@GOTPAGEOFF]
	ldr	w0, [x20, #16]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _QIB_RCVCTRL_INTRAVAIL_DIS@GOTPAGE
Lloh11:
	ldr	x10, [x10, _QIB_RCVCTRL_INTRAVAIL_DIS@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	orr	w1, w10, w9
	mov	x2, x22
	blr	x8
	mov	x0, x20
	mov	x1, x21
	bl	_qib_clean_part_key
	ldp	w2, w1, [x20, #8]
	mov	x0, x21
	bl	_qib_disarm_piobufs
	ldp	w2, w1, [x20, #8]
Lloh13:
	adrp	x8, _TXCHK_CHG_TYPE_KERN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _TXCHK_CHG_TYPE_KERN@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
	mov	x0, x21
	mov	x4, #0
	bl	_qib_chg_pioavailkernel
	ldr	x8, [x21, #16]
	mov	x0, x21
	mov	x1, x20
	blr	x8
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_18
; %bb.17:
	mov	x0, x20
	bl	_unlock_expected_tids
LBB0_18:
Lloh16:
	adrp	x8, _qib_stats@GOTPAGE
Lloh17:
	ldr	x8, [x8, _qib_stats@GOTPAGEOFF]
	ldr	w9, [x8]
	sub	w9, w9, #1
	str	w9, [x8]
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
LBB0_19:
Lloh18:
	adrp	x0, _qib_mutex@GOTPAGE
Lloh19:
	ldr	x0, [x0, _qib_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x21
	mov	x1, x20
	bl	_qib_free_ctxtdata
LBB0_20:
	mov	x0, x19
	bl	_kfree
	mov	w0, #0
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_qib_mutex,4,2                  ; @qib_mutex
	.comm	_qib_cpulist,4,2                ; @qib_cpulist
	.comm	_QIB_RCVCTRL_CTXT_DIS,4,2       ; @QIB_RCVCTRL_CTXT_DIS
	.comm	_QIB_RCVCTRL_INTRAVAIL_DIS,4,2  ; @QIB_RCVCTRL_INTRAVAIL_DIS
	.comm	_TXCHK_CHG_TYPE_KERN,4,2        ; @TXCHK_CHG_TYPE_KERN
	.comm	_qib_stats,4,2                  ; @qib_stats
	.no_dead_strip	_qib_close
.subsections_via_symbols
