	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rds_iw_conn_shutdown           ## -- Begin function rds_iw_conn_shutdown
	.p2align	4, 0x90
_rds_iw_conn_shutdown:                  ## @rds_iw_conn_shutdown
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %rbx
	movq	144(%rbx), %rsi
	movq	136(%rbx), %rdx
	movq	112(%rbx), %r8
	movq	120(%rbx), %rcx
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movq	(%rsi), %r9
	jmp	LBB0_3
LBB0_1:
	xorl	%r9d, %r9d
LBB0_3:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_rdsdebug
	movq	144(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_30
## %bb.4:
	movq	8(%rsi), %r15
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_rdsdebug
	movq	144(%rbx), %rdi
	callq	_rdma_disconnect
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movq	144(%rbx), %rsi
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_rdsdebug
LBB0_6:
	movq	144(%rbx), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.7:
	movq	_IB_QPS_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	_IB_QP_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-40(%rbp), %rsi
	callq	_ib_modify_qp
LBB0_8:
	movq	_rds_iw_ring_empty_wait@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	leaq	28(%rbx), %rdi
	callq	_rds_iw_ring_empty
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	leaq	24(%rbx), %rdi
	callq	_rds_iw_ring_empty
	xorl	%esi, %esi
	testq	%rax, %rax
	setne	%sil
	jmp	LBB0_11
LBB0_9:
	xorl	%esi, %esi
LBB0_11:
	movl	%r12d, %edi
	callq	_wait_event
	movq	104(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_13
## %bb.12:
	movl	28(%rbx), %esi
	movl	160(%rbx), %ecx
	shll	$2, %esi
	movq	%r15, %rdi
	callq	_ib_dma_free_coherent
LBB0_13:
	movq	96(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_15
## %bb.14:
	movl	24(%rbx), %esi
	movl	156(%rbx), %ecx
	shll	$2, %esi
	movq	%r15, %rdi
	callq	_ib_dma_free_coherent
LBB0_15:
	movq	88(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_17
## %bb.16:
	movl	152(%rbx), %ecx
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_ib_dma_free_coherent
LBB0_17:
	cmpq	$0, 8(%rbx)
	je	LBB0_19
## %bb.18:
	movq	%rbx, %rdi
	callq	_rds_iw_send_clear_ring
LBB0_19:
	cmpq	$0, (%rbx)
	je	LBB0_21
## %bb.20:
	movq	%rbx, %rdi
	callq	_rds_iw_recv_clear_ring
LBB0_21:
	movq	144(%rbx), %rdi
	cmpq	$0, (%rdi)
	je	LBB0_23
## %bb.22:
	callq	_rdma_destroy_qp
LBB0_23:
	movq	120(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_25
## %bb.24:
	callq	_ib_destroy_cq
LBB0_25:
	movq	112(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_27
## %bb.26:
	callq	_ib_destroy_cq
LBB0_27:
	leaq	88(%rbx), %r15
	movq	80(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_29
## %bb.28:
	movq	%r14, %rsi
	callq	_rds_iw_remove_conn
LBB0_29:
	movq	144(%rbx), %rdi
	callq	_rdma_destroy_id
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r15)
	movups	%xmm0, 16(%r15)
	movups	%xmm0, 32(%r15)
	movups	%xmm0, 48(%r15)
LBB0_30:
	movq	80(%rbx), %rdi
	callq	_BUG_ON
	movq	72(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_32
## %bb.31:
	callq	_rds_message_put
	movq	$0, 72(%rbx)
LBB0_32:
	movq	_IB_ACK_IN_FLIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	64(%rbx), %rsi
	callq	_clear_bit
	leaq	32(%rbx), %rdi
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%rbx)
	movq	$0, 56(%rbx)
	xorl	%esi, %esi
	callq	_atomic_set
	leaq	28(%rbx), %rdi
	movq	_rds_iw_sysctl_max_send_wr@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_rds_iw_ring_init
	leaq	24(%rbx), %rdi
	movq	_rds_iw_sysctl_max_recv_wr@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_rds_iw_ring_init
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_34
## %bb.33:
	callq	_rds_inc_put
	movq	$0, 16(%rbx)
LBB0_34:
	movq	8(%rbx), %rdi
	callq	_vfree
	movq	$0, 8(%rbx)
	movq	(%rbx), %rdi
	callq	_vfree
	movq	$0, (%rbx)
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_rdsdebug
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cm %p pd %p cq %p %p qp %p\n"

L_.str.1:                               ## @.str.1
	.asciz	"disconnecting cm %p\n"

L_.str.2:                               ## @.str.2
	.asciz	"rds_iw_conn_shutdown: failed to disconnect, cm: %p err %d\n"

	.comm	_IB_QPS_ERR,4,2                 ## @IB_QPS_ERR
	.comm	_IB_QP_STATE,4,2                ## @IB_QP_STATE
	.comm	_rds_iw_ring_empty_wait,4,2     ## @rds_iw_ring_empty_wait
	.comm	_IB_ACK_IN_FLIGHT,4,2           ## @IB_ACK_IN_FLIGHT
	.comm	_rds_iw_sysctl_max_send_wr,4,2  ## @rds_iw_sysctl_max_send_wr
	.comm	_rds_iw_sysctl_max_recv_wr,4,2  ## @rds_iw_sysctl_max_recv_wr
L_.str.3:                               ## @.str.3
	.asciz	"shutdown complete\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rds_iw_conn_shutdown           ; -- Begin function rds_iw_conn_shutdown
	.p2align	2
_rds_iw_conn_shutdown:                  ; @rds_iw_conn_shutdown
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x0
	ldr	x19, [x0]
	ldp	x9, x8, [x19, #136]
	ldp	x11, x10, [x19, #112]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x12, [x8]
	b	LBB0_3
LBB0_2:
	mov	x12, #0
LBB0_3:
	stp	x11, x12, [sp, #24]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_rdsdebug
	ldr	x8, [x19, #144]
	cbz	x8, LBB0_30
; %bb.4:
	ldr	x21, [x8, #8]
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_rdsdebug
	ldr	x0, [x19, #144]
	bl	_rdma_disconnect
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_6
; %bb.5:
	ldr	x8, [x19, #144]
	stp	x8, x0, [sp]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_rdsdebug
LBB0_6:
	ldr	x8, [x19, #144]
	ldr	x0, [x8]
	cbz	x0, LBB0_8
; %bb.7:
Lloh6:
	adrp	x8, _IB_QPS_ERR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IB_QPS_ERR@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [sp, #40]
Lloh9:
	adrp	x8, _IB_QP_STATE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IB_QP_STATE@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	add	x1, sp, #40
	bl	_ib_modify_qp
LBB0_8:
Lloh12:
	adrp	x8, _rds_iw_ring_empty_wait@GOTPAGE
Lloh13:
	ldr	x8, [x8, _rds_iw_ring_empty_wait@GOTPAGEOFF]
Lloh14:
	ldr	w22, [x8]
	add	x0, x19, #28
	bl	_rds_iw_ring_empty
	cbz	x0, LBB0_10
; %bb.9:
	add	x0, x19, #24
	bl	_rds_iw_ring_empty
	cmp	x0, #0
	cset	w1, ne
	b	LBB0_11
LBB0_10:
	mov	w1, #0
LBB0_11:
	mov	x0, x22
	bl	_wait_event
	ldr	x2, [x19, #104]
	cbz	x2, LBB0_13
; %bb.12:
	ldr	w8, [x19, #28]
	lsl	w1, w8, #2
	ldr	w3, [x19, #160]
	mov	x0, x21
	bl	_ib_dma_free_coherent
LBB0_13:
	ldr	x2, [x19, #96]
	cbz	x2, LBB0_15
; %bb.14:
	ldr	w8, [x19, #24]
	lsl	w1, w8, #2
	ldr	w3, [x19, #156]
	mov	x0, x21
	bl	_ib_dma_free_coherent
LBB0_15:
	mov	x22, x19
	ldr	x2, [x22, #88]!
	cbz	x2, LBB0_17
; %bb.16:
	ldr	w3, [x19, #152]
	mov	x0, x21
	mov	w1, #4
	bl	_ib_dma_free_coherent
LBB0_17:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_19
; %bb.18:
	mov	x0, x19
	bl	_rds_iw_send_clear_ring
LBB0_19:
	ldr	x8, [x19]
	cbz	x8, LBB0_21
; %bb.20:
	mov	x0, x19
	bl	_rds_iw_recv_clear_ring
LBB0_21:
	ldr	x0, [x19, #144]
	ldr	x8, [x0]
	cbz	x8, LBB0_23
; %bb.22:
	bl	_rdma_destroy_qp
LBB0_23:
	ldr	x0, [x19, #120]
	cbz	x0, LBB0_25
; %bb.24:
	bl	_ib_destroy_cq
LBB0_25:
	ldr	x0, [x19, #112]
	cbz	x0, LBB0_27
; %bb.26:
	bl	_ib_destroy_cq
LBB0_27:
	ldr	x0, [x19, #80]
	cbz	x0, LBB0_29
; %bb.28:
	mov	x1, x20
	bl	_rds_iw_remove_conn
LBB0_29:
	ldr	x0, [x19, #144]
	bl	_rdma_destroy_id
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x22]
	stp	q0, q0, [x22, #32]
LBB0_30:
	ldr	x0, [x19, #80]
	bl	_BUG_ON
	ldr	x0, [x19, #72]
	cbz	x0, LBB0_32
; %bb.31:
	bl	_rds_message_put
	str	xzr, [x19, #72]
LBB0_32:
Lloh15:
	adrp	x8, _IB_ACK_IN_FLIGHT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IB_ACK_IN_FLIGHT@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	add	x1, x19, #64
	bl	_clear_bit
	add	x0, x19, #32
	stp	xzr, xzr, [x19, #48]
	str	xzr, [x19, #40]
	mov	w1, #0
	bl	_atomic_set
	add	x0, x19, #28
Lloh18:
	adrp	x8, _rds_iw_sysctl_max_send_wr@GOTPAGE
Lloh19:
	ldr	x8, [x8, _rds_iw_sysctl_max_send_wr@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_rds_iw_ring_init
	add	x0, x19, #24
Lloh21:
	adrp	x8, _rds_iw_sysctl_max_recv_wr@GOTPAGE
Lloh22:
	ldr	x8, [x8, _rds_iw_sysctl_max_recv_wr@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	bl	_rds_iw_ring_init
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_34
; %bb.33:
	bl	_rds_inc_put
	str	xzr, [x19, #16]
LBB0_34:
	ldr	x0, [x19, #8]
	bl	_vfree
	str	xzr, [x19, #8]
	ldr	x0, [x19]
	bl	_vfree
	str	xzr, [x19]
Lloh24:
	adrp	x0, l_.str.3@PAGE
Lloh25:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_rdsdebug
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cm %p pd %p cq %p %p qp %p\n"

l_.str.1:                               ; @.str.1
	.asciz	"disconnecting cm %p\n"

l_.str.2:                               ; @.str.2
	.asciz	"rds_iw_conn_shutdown: failed to disconnect, cm: %p err %d\n"

	.comm	_IB_QPS_ERR,4,2                 ; @IB_QPS_ERR
	.comm	_IB_QP_STATE,4,2                ; @IB_QP_STATE
	.comm	_rds_iw_ring_empty_wait,4,2     ; @rds_iw_ring_empty_wait
	.comm	_IB_ACK_IN_FLIGHT,4,2           ; @IB_ACK_IN_FLIGHT
	.comm	_rds_iw_sysctl_max_send_wr,4,2  ; @rds_iw_sysctl_max_send_wr
	.comm	_rds_iw_sysctl_max_recv_wr,4,2  ; @rds_iw_sysctl_max_recv_wr
l_.str.3:                               ; @.str.3
	.asciz	"shutdown complete\n"

.subsections_via_symbols
