	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stli_close
_stli_close:                            ## @stli_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), %rbx
	testq	%rbx, %rbx
	je	LBB0_11
## %bb.1:
	movq	%rsi, %rdx
	movq	%rdi, %r15
	leaq	24(%rbx), %r14
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_tty_port_close_start
	testq	%rax, %rax
	je	LBB0_11
## %bb.2:
	movq	_stli_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movq	_stli_txcooktty@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jne	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	callq	_stli_flushchars
LBB0_4:
	movq	_stli_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	movq	(%rbx), %rsi
	movq	_ASYNC_CLOSING_WAIT_NONE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	je	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	callq	_tty_wait_until_sent
LBB0_6:
	movq	_ASYNC_INITIALIZED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 24(%rbx)
	movq	_stli_brds@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rbx), %rcx
	movq	(%rax,%rcx,8), %r12
	movq	%r12, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_stli_rawclose
	movq	8(%r15), %rax
	movq	_HUPCL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_10
## %bb.7:
	leaq	20(%rbx), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_stli_mkasysigs
	movq	_ST_CMDING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	16(%rbx), %r13
	movq	%r13, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	_ST_DOSIGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	callq	_set_bit
	jmp	LBB0_10
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_A_SETSIGNALS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	$4, %r8d
	xorl	%r9d, %r9d
	callq	_stli_sendcmd
LBB0_10:
	movq	_ST_TXBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$16, %rbx
	movq	%rbx, %rsi
	callq	_clear_bit
	movq	_ST_RXSTOP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_clear_bit
	movq	_TTY_IO_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_set_bit
	movq	%r15, %rdi
	callq	_tty_ldisc_flush
	movq	_ST_DOFLUSHRX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_set_bit
	movq	%r15, %rdi
	callq	_stli_flushbuffer
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_tty_port_close_end
	movq	%r14, %rdi
	xorl	%esi, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tty_port_tty_set               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_stli_lock,4,2                  ## @stli_lock
	.comm	_stli_txcooktty,8,3             ## @stli_txcooktty
	.comm	_ASYNC_CLOSING_WAIT_NONE,8,3    ## @ASYNC_CLOSING_WAIT_NONE
	.comm	_ASYNC_INITIALIZED,4,2          ## @ASYNC_INITIALIZED
	.comm	_stli_brds,8,3                  ## @stli_brds
	.comm	_HUPCL,4,2                      ## @HUPCL
	.comm	_ST_CMDING,4,2                  ## @ST_CMDING
	.comm	_ST_DOSIGS,4,2                  ## @ST_DOSIGS
	.comm	_A_SETSIGNALS,4,2               ## @A_SETSIGNALS
	.comm	_ST_TXBUSY,4,2                  ## @ST_TXBUSY
	.comm	_ST_RXSTOP,4,2                  ## @ST_RXSTOP
	.comm	_TTY_IO_ERROR,4,2               ## @TTY_IO_ERROR
	.comm	_ST_DOFLUSHRX,4,2               ## @ST_DOFLUSHRX
	.no_dead_strip	_stli_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stli_close
_stli_close:                            ; @stli_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
	ldr	x21, [x0, #16]
	cbz	x21, LBB0_9
; %bb.1:
	mov	x2, x1
	mov	x19, x0
	add	x20, x21, #24
	mov	x0, x20
	mov	x1, x19
	bl	_tty_port_close_start
	cbz	x0, LBB0_9
; %bb.2:
Lloh0:
	adrp	x0, _stli_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _stli_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
Lloh2:
	adrp	x8, _stli_txcooktty@GOTPAGE
Lloh3:
	ldr	x8, [x8, _stli_txcooktty@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x8, x19
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_stli_flushchars
LBB0_4:
Lloh5:
	adrp	x0, _stli_lock@GOTPAGE
Lloh6:
	ldr	x0, [x0, _stli_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	ldr	x1, [x21]
Lloh7:
	adrp	x8, _ASYNC_CLOSING_WAIT_NONE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ASYNC_CLOSING_WAIT_NONE@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x1, x8
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_tty_wait_until_sent
LBB0_6:
Lloh10:
	adrp	x8, _ASYNC_INITIALIZED@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ASYNC_INITIALIZED@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	w9, [x21, #24]
	bic	w8, w9, w8
	str	w8, [x21, #24]
Lloh13:
	adrp	x8, _stli_brds@GOTPAGE
Lloh14:
	ldr	x8, [x8, _stli_brds@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	ldr	x9, [x21, #8]
	ldr	x22, [x8, x9, lsl #3]
	mov	x0, x22
	mov	x1, x21
	mov	w2, #0
	mov	w3, #0
	bl	_stli_rawclose
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _HUPCL@GOTPAGE
Lloh17:
	ldr	x9, [x9, _HUPCL@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.7:
	add	x23, x21, #20
	mov	x0, x23
	mov	w1, #0
	mov	w2, #0
	bl	_stli_mkasysigs
Lloh19:
	adrp	x8, _ST_CMDING@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ST_CMDING@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	add	x24, x21, #16
	mov	x1, x24
	bl	_test_bit
	cbz	x0, LBB0_10
; %bb.8:
Lloh22:
	adrp	x8, _ST_DOSIGS@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ST_DOSIGS@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	mov	x1, x24
	bl	_set_bit
	b	LBB0_11
LBB0_9:
	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
LBB0_10:
Lloh25:
	adrp	x8, _A_SETSIGNALS@GOTPAGE
Lloh26:
	ldr	x8, [x8, _A_SETSIGNALS@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	mov	x0, x22
	mov	x1, x21
	mov	x3, x23
	mov	w4, #4
	mov	w5, #0
	bl	_stli_sendcmd
LBB0_11:
Lloh28:
	adrp	x8, _ST_TXBUSY@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ST_TXBUSY@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	add	x21, x21, #16
	mov	x1, x21
	bl	_clear_bit
Lloh31:
	adrp	x8, _ST_RXSTOP@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ST_RXSTOP@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_clear_bit
Lloh34:
	adrp	x8, _TTY_IO_ERROR@GOTPAGE
Lloh35:
	ldr	x8, [x8, _TTY_IO_ERROR@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_set_bit
	mov	x0, x19
	bl	_tty_ldisc_flush
Lloh37:
	adrp	x8, _ST_DOFLUSHRX@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ST_DOFLUSHRX@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_set_bit
	mov	x0, x19
	bl	_stli_flushbuffer
	mov	x0, x20
	mov	x1, x19
	bl	_tty_port_close_end
	mov	x0, x20
	mov	x1, #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
	b	_tty_port_tty_set
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_stli_lock,4,2                  ; @stli_lock
	.comm	_stli_txcooktty,8,3             ; @stli_txcooktty
	.comm	_ASYNC_CLOSING_WAIT_NONE,8,3    ; @ASYNC_CLOSING_WAIT_NONE
	.comm	_ASYNC_INITIALIZED,4,2          ; @ASYNC_INITIALIZED
	.comm	_stli_brds,8,3                  ; @stli_brds
	.comm	_HUPCL,4,2                      ; @HUPCL
	.comm	_ST_CMDING,4,2                  ; @ST_CMDING
	.comm	_ST_DOSIGS,4,2                  ; @ST_DOSIGS
	.comm	_A_SETSIGNALS,4,2               ; @A_SETSIGNALS
	.comm	_ST_TXBUSY,4,2                  ; @ST_TXBUSY
	.comm	_ST_RXSTOP,4,2                  ; @ST_RXSTOP
	.comm	_TTY_IO_ERROR,4,2               ; @TTY_IO_ERROR
	.comm	_ST_DOFLUSHRX,4,2               ; @ST_DOFLUSHRX
	.no_dead_strip	_stli_close
.subsections_via_symbols
