	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rs_close
_rs_close:                              ## @rs_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	16(%rdi), %r15
	testq	%r15, %r15
	je	LBB0_23
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	8(%rdi), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	callq	_serial_paranoia_check
	testq	%rax, %rax
	je	LBB0_2
LBB0_23:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	72(%r15), %r12
	callq	_local_irq_save
	movq	%rbx, %rdi
	callq	_tty_hung_up_p
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
LBB0_21:
	callq	_DBG_CNT
	jmp	LBB0_22
LBB0_4:
	cmpl	$1, (%r14)
	movl	(%r12), %esi
	jne	LBB0_7
## %bb.5:
	cmpl	$1, %esi
	je	LBB0_9
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_printk
	movl	$1, (%r12)
	jmp	LBB0_9
LBB0_7:
	leal	-1(%rsi), %edx
	movl	%edx, (%r12)
	testl	%esi, %esi
	jle	LBB0_8
## %bb.19:
	testl	%edx, %edx
	je	LBB0_10
## %bb.20:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_21
LBB0_8:
	movl	64(%r15), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_printk
LBB0_9:
	movl	$0, (%r12)
LBB0_10:
	movq	_ASYNC_CLOSING@GOTPCREL(%rip), %r12
	movl	(%r15), %eax
	orl	(%r12), %eax
	movl	%eax, (%r15)
	movl	$1, 4(%r14)
	movq	8(%r15), %rsi
	movq	_ASYNC_CLOSING_WAIT_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rsi
	je	LBB0_12
## %bb.11:
	movq	%r14, %rdi
	callq	_tty_wait_until_sent
	movl	(%r15), %eax
LBB0_12:
	movq	_UART_LSR_DR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, 60(%r15)
	movq	_ASYNC_INITIALIZED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_14
## %bb.13:
	movq	_IF_RBF@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	_custom@GOTPCREL(%rip), %rbx
	movq	%rax, 8(%rbx)
	xorl	%eax, %eax
	callq	_mb
	movq	(%r13), %rax
	movq	%rax, (%rbx)
	xorl	%eax, %eax
	callq	_mb
	movl	56(%r15), %esi
	movq	%r14, %rdi
	callq	_rs_wait_until_sent
LBB0_14:
	movq	%r15, %rdi
	callq	_shutdown
	movq	%r14, %rdi
	callq	_rs_flush_buffer
	movq	%r14, %rdi
	callq	_tty_ldisc_flush
	movl	$0, 4(%r14)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%r15)
	cmpq	$0, 32(%r15)
	je	LBB0_18
## %bb.15:
	movq	24(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.16:
	callq	_jiffies_to_msecs
	movl	%eax, %edi
	callq	_msleep_interruptible
LBB0_17:
	leaq	20(%r15), %rdi
	callq	_wake_up_interruptible
LBB0_18:
	movq	_ASYNC_NORMAL_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%r12), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, (%r15)
	addq	$16, %r15
	movq	%r15, %rdi
	callq	_wake_up_interruptible
LBB0_22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_local_irq_restore              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rs_close"

L_.str.1:                               ## @.str.1
	.asciz	"before DEC-hung"

L_.str.2:                               ## @.str.2
	.asciz	"rs_close: bad serial port count; tty->count is 1, state->count is %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"rs_close: bad serial port count for ttys%d: %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"before DEC-2"

	.comm	_ASYNC_CLOSING,4,2              ## @ASYNC_CLOSING
	.comm	_ASYNC_CLOSING_WAIT_NONE,8,3    ## @ASYNC_CLOSING_WAIT_NONE
	.comm	_UART_LSR_DR,4,2                ## @UART_LSR_DR
	.comm	_ASYNC_INITIALIZED,4,2          ## @ASYNC_INITIALIZED
	.comm	_IF_RBF,8,3                     ## @IF_RBF
	.comm	_custom,16,3                    ## @custom
	.comm	_ASYNC_NORMAL_ACTIVE,4,2        ## @ASYNC_NORMAL_ACTIVE
	.no_dead_strip	_rs_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rs_close
_rs_close:                              ; @rs_close
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x19, [x0, #16]
	cbz	x19, LBB0_2
; %bb.1:
	mov	x21, x1
	mov	x20, x0
	ldr	w1, [x0, #8]
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_serial_paranoia_check
	cbz	x0, LBB0_3
LBB0_2:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_3:
	ldr	x22, [x19, #72]
	bl	_local_irq_save
	mov	x0, x21
	bl	_tty_hung_up_p
	cbz	x0, LBB0_6
; %bb.4:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_5:
	bl	_DBG_CNT
	b	LBB0_23
LBB0_6:
	ldr	w8, [x20]
	ldr	w1, [x22]
	cmp	w8, #1
	b.ne	LBB0_9
; %bb.7:
	cmp	w1, #1
	b.eq	LBB0_13
; %bb.8:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printk
	mov	w8, #1
	str	w8, [x22]
	b	LBB0_13
LBB0_9:
	sub	w8, w1, #1
	str	w8, [x22]
	cmp	w1, #0
	b.le	LBB0_12
; %bb.10:
	cbz	w8, LBB0_14
; %bb.11:
Lloh6:
	adrp	x0, l_.str.4@PAGE
Lloh7:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_5
LBB0_12:
	ldr	w1, [x19, #64]
	str	x8, [sp]
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printk
LBB0_13:
	str	wzr, [x22]
LBB0_14:
Lloh10:
	adrp	x21, _ASYNC_CLOSING@GOTPAGE
Lloh11:
	ldr	x21, [x21, _ASYNC_CLOSING@GOTPAGEOFF]
	ldr	w8, [x21]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	mov	w9, #1
	str	w9, [x20, #4]
	ldr	x1, [x19, #8]
Lloh12:
	adrp	x9, _ASYNC_CLOSING_WAIT_NONE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ASYNC_CLOSING_WAIT_NONE@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x1, x9
	b.eq	LBB0_16
; %bb.15:
	mov	x0, x20
	bl	_tty_wait_until_sent
	ldr	w8, [x19]
LBB0_16:
Lloh15:
	adrp	x9, _UART_LSR_DR@GOTPAGE
Lloh16:
	ldr	x9, [x9, _UART_LSR_DR@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	ldr	w10, [x19, #60]
	bic	w9, w10, w9
	str	w9, [x19, #60]
Lloh18:
	adrp	x9, _ASYNC_INITIALIZED@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ASYNC_INITIALIZED@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.17:
Lloh21:
	adrp	x22, _IF_RBF@GOTPAGE
Lloh22:
	ldr	x22, [x22, _IF_RBF@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh23:
	adrp	x23, _custom@GOTPAGE
Lloh24:
	ldr	x23, [x23, _custom@GOTPAGEOFF]
	str	x8, [x23, #8]
	bl	_mb
	ldr	x8, [x22]
	str	x8, [x23]
	bl	_mb
	ldr	w1, [x19, #56]
	mov	x0, x20
	bl	_rs_wait_until_sent
LBB0_18:
	mov	x0, x19
	bl	_shutdown
	mov	x0, x20
	bl	_rs_flush_buffer
	mov	x0, x20
	bl	_tty_ldisc_flush
	str	wzr, [x20, #4]
	stp	xzr, xzr, [x19, #40]
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_22
; %bb.19:
	ldr	x0, [x19, #24]
	cbz	x0, LBB0_21
; %bb.20:
	bl	_jiffies_to_msecs
	bl	_msleep_interruptible
LBB0_21:
	add	x0, x19, #20
	bl	_wake_up_interruptible
LBB0_22:
Lloh25:
	adrp	x8, _ASYNC_NORMAL_ACTIVE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ASYNC_NORMAL_ACTIVE@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	ldr	w9, [x21]
	orr	w8, w9, w8
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19], #16
	mov	x0, x19
	bl	_wake_up_interruptible
LBB0_23:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_local_irq_restore
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rs_close"

l_.str.1:                               ; @.str.1
	.asciz	"before DEC-hung"

l_.str.2:                               ; @.str.2
	.asciz	"rs_close: bad serial port count; tty->count is 1, state->count is %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"rs_close: bad serial port count for ttys%d: %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"before DEC-2"

	.comm	_ASYNC_CLOSING,4,2              ; @ASYNC_CLOSING
	.comm	_ASYNC_CLOSING_WAIT_NONE,8,3    ; @ASYNC_CLOSING_WAIT_NONE
	.comm	_UART_LSR_DR,4,2                ; @UART_LSR_DR
	.comm	_ASYNC_INITIALIZED,4,2          ; @ASYNC_INITIALIZED
	.comm	_IF_RBF,8,3                     ; @IF_RBF
	.comm	_custom,16,3                    ; @custom
	.comm	_ASYNC_NORMAL_ACTIVE,4,2        ; @ASYNC_NORMAL_ACTIVE
	.no_dead_strip	_rs_close
.subsections_via_symbols
