	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rfcomm_tty_close
_rfcomm_tty_close:                      ## @rfcomm_tty_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.1:
	movq	%rdi, %r14
	movl	8(%rbx), %r15d
	leaq	40(%rbx), %r12
	movq	%r12, %rdi
	callq	_atomic_read
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movl	%r15d, %ecx
	movl	%eax, %r8d
	callq	_BT_DBG
	movq	%r12, %rdi
	callq	_atomic_dec_and_test
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	32(%rbx), %rdi
	cmpq	$0, (%rdi)
	je	LBB0_4
## %bb.3:
	movq	_DPM_ORDER_DEV_LAST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_device_move
LBB0_4:
	movl	8(%rbx), %edi
	xorl	%esi, %esi
	callq	_rfcomm_dlc_close
	movq	_RFCOMM_TTY_ATTACHED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	4(%rbx), %r15
	movq	%r15, %rsi
	callq	_clear_bit
	leaq	24(%rbx), %rdi
	callq	_tasklet_kill
	movl	8(%rbx), %edi
	callq	_rfcomm_dlc_lock
	movq	$0, (%r14)
	movq	$0, 16(%rbx)
	movl	8(%rbx), %edi
	callq	_rfcomm_dlc_unlock
	movq	_RFCOMM_TTY_RELEASED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_rfcomm_dev_lock@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_write_lock_bh
	movq	%rbx, %rdi
	callq	_list_del_init
	movq	%r14, %rdi
	callq	_write_unlock_bh
	movq	%rbx, %rdi
	callq	_rfcomm_dev_put
LBB0_6:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rfcomm_dev_put                 ## TAILCALL
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tty %p dev %p dlc %p opened %d"

	.comm	_DPM_ORDER_DEV_LAST,4,2         ## @DPM_ORDER_DEV_LAST
	.comm	_RFCOMM_TTY_ATTACHED,4,2        ## @RFCOMM_TTY_ATTACHED
	.comm	_RFCOMM_TTY_RELEASED,4,2        ## @RFCOMM_TTY_RELEASED
	.comm	_rfcomm_dev_lock,4,2            ## @rfcomm_dev_lock
	.no_dead_strip	_rfcomm_tty_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rfcomm_tty_close
_rfcomm_tty_close:                      ; @rfcomm_tty_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
	ldr	x19, [x0]
	cbz	x19, LBB0_7
; %bb.1:
	mov	x20, x0
	ldr	w21, [x19, #8]
	add	x22, x19, #40
	mov	x0, x22
	bl	_atomic_read
	mov	x4, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x19
	mov	x3, x21
	bl	_BT_DBG
	mov	x0, x22
	bl	_atomic_dec_and_test
	cbz	x0, LBB0_6
; %bb.2:
	ldr	x0, [x19, #32]
	ldr	x8, [x0]
	cbz	x8, LBB0_4
; %bb.3:
Lloh2:
	adrp	x8, _DPM_ORDER_DEV_LAST@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DPM_ORDER_DEV_LAST@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x1, #0
	bl	_device_move
LBB0_4:
	ldr	w0, [x19, #8]
	mov	w1, #0
	bl	_rfcomm_dlc_close
Lloh5:
	adrp	x8, _RFCOMM_TTY_ATTACHED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RFCOMM_TTY_ATTACHED@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x21, x19, #4
	mov	x1, x21
	bl	_clear_bit
	add	x0, x19, #24
	bl	_tasklet_kill
	ldr	w0, [x19, #8]
	bl	_rfcomm_dlc_lock
	str	xzr, [x20]
	str	xzr, [x19, #16]
	ldr	w0, [x19, #8]
	bl	_rfcomm_dlc_unlock
Lloh8:
	adrp	x8, _RFCOMM_TTY_RELEASED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RFCOMM_TTY_RELEASED@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_test_bit
	cbz	x0, LBB0_6
; %bb.5:
Lloh11:
	adrp	x20, _rfcomm_dev_lock@GOTPAGE
Lloh12:
	ldr	x20, [x20, _rfcomm_dev_lock@GOTPAGEOFF]
	mov	x0, x20
	bl	_write_lock_bh
	mov	x0, x19
	bl	_list_del_init
	mov	x0, x20
	bl	_write_unlock_bh
	mov	x0, x19
	bl	_rfcomm_dev_put
LBB0_6:
	mov	x0, x19
	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	_rfcomm_dev_put
LBB0_7:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tty %p dev %p dlc %p opened %d"

	.comm	_DPM_ORDER_DEV_LAST,4,2         ; @DPM_ORDER_DEV_LAST
	.comm	_RFCOMM_TTY_ATTACHED,4,2        ; @RFCOMM_TTY_ATTACHED
	.comm	_RFCOMM_TTY_RELEASED,4,2        ; @RFCOMM_TTY_RELEASED
	.comm	_rfcomm_dev_lock,4,2            ; @rfcomm_dev_lock
	.no_dead_strip	_rfcomm_tty_close
.subsections_via_symbols
