	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rsi_disconnect
_rsi_disconnect:                        ## @rsi_disconnect
	.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, %rbx
	callq	_sdio_get_drvdata
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %r14
	movq	8(%rax), %r15
	leaq	4(%r15), %rdi
	callq	_rsi_kill_thread
	movq	%rbx, %rdi
	callq	_sdio_claim_host
	movq	%rbx, %rdi
	callq	_sdio_release_irq
	movq	%rbx, %rdi
	callq	_sdio_release_host
	movl	$10, %edi
	callq	_mdelay
	movq	%r14, %rdi
	callq	_rsi_mac80211_detach
	movl	$10, %edi
	callq	_mdelay
	movq	_CONFIG_RSI_COEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_IS_ENABLED
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	(%r14), %rax
	cmpl	$2, (%rax)
	jl	LBB0_5
## %bb.3:
	movq	8(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	movq	_rsi_bt_ops@GOTPCREL(%rip), %rax
	callq	*(%rax)
	movq	(%r14), %rax
	movq	$0, 8(%rax)
LBB0_5:
	movq	%r14, %rdi
	callq	_rsi_reset_chip
	movq	%rbx, %rdi
	callq	_sdio_claim_host
	movq	%rbx, %rdi
	callq	_rsi_reset_card
	movq	%rbx, %rdi
	callq	_sdio_disable_func
	movq	%rbx, %rdi
	callq	_sdio_release_host
	movl	$2, (%r15)
	movq	%r14, %rdi
	callq	_rsi_91x_deinit
	movq	_ERR_ZONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rsi_dbg                        ## TAILCALL
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CONFIG_RSI_COEX,4,2            ## @CONFIG_RSI_COEX
	.comm	_rsi_bt_ops,8,3                 ## @rsi_bt_ops
	.comm	_ERR_ZONE,4,2                   ## @ERR_ZONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"##### RSI SDIO device disconnected #####\n"

	.no_dead_strip	_rsi_disconnect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rsi_disconnect
_rsi_disconnect:                        ; @rsi_disconnect
	.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, x0
	bl	_sdio_get_drvdata
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
	ldr	x21, [x0, #8]
	add	x0, x21, #4
	bl	_rsi_kill_thread
	mov	x0, x20
	bl	_sdio_claim_host
	mov	x0, x20
	bl	_sdio_release_irq
	mov	x0, x20
	bl	_sdio_release_host
	mov	w0, #10
	bl	_mdelay
	mov	x0, x19
	bl	_rsi_mac80211_detach
	mov	w0, #10
	bl	_mdelay
Lloh0:
	adrp	x8, _CONFIG_RSI_COEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CONFIG_RSI_COEX@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_IS_ENABLED
	cbz	x0, LBB0_5
; %bb.2:
	ldr	x8, [x19]
	ldr	w9, [x8]
	cmp	w9, #2
	b.lt	LBB0_5
; %bb.3:
	ldr	x0, [x8, #8]
	cbz	x0, LBB0_5
; %bb.4:
Lloh3:
	adrp	x8, _rsi_bt_ops@GOTPAGE
Lloh4:
	ldr	x8, [x8, _rsi_bt_ops@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	blr	x8
	ldr	x8, [x19]
	str	xzr, [x8, #8]
LBB0_5:
	mov	x0, x19
	bl	_rsi_reset_chip
	mov	x0, x20
	bl	_sdio_claim_host
	mov	x0, x20
	bl	_rsi_reset_card
	mov	x0, x20
	bl	_sdio_disable_func
	mov	x0, x20
	bl	_sdio_release_host
	mov	w8, #2
	str	w8, [x21]
	mov	x0, x19
	bl	_rsi_91x_deinit
Lloh6:
	adrp	x8, _ERR_ZONE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ERR_ZONE@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	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	_rsi_dbg
LBB0_6:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_CONFIG_RSI_COEX,4,2            ; @CONFIG_RSI_COEX
	.comm	_rsi_bt_ops,8,3                 ; @rsi_bt_ops
	.comm	_ERR_ZONE,4,2                   ; @ERR_ZONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"##### RSI SDIO device disconnected #####\n"

	.no_dead_strip	_rsi_disconnect
.subsections_via_symbols
