	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxser_shutdown
_mxser_shutdown:                        ## @mxser_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	16(%rdi), %rbx
	movq	_ASYNC_INITIALIZED@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, 24(%rbx)
	je	LBB0_11
## %bb.1:
	movq	%rdi, %r15
	leaq	4(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	leaq	40(%rbx), %rdi
	callq	_wake_up_interruptible
	movq	32(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.2:
	callq	_free_page
	movq	$0, 32(%rbx)
LBB0_3:
	movq	$0, 48(%rbx)
	movq	_UART_IER@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	xorl	%edi, %edi
	callq	_outb
	movq	8(%r15), %rax
	movq	_HUPCL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_4
## %bb.5:
	movq	_UART_MCR_DTR@GOTPCREL(%rip), %rax
	movq	_UART_MCR_RTS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	notl	%edi
	andl	(%rbx), %edi
	movl	%edi, (%rbx)
	jmp	LBB0_6
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	(%rbx), %edi
LBB0_6:
	movq	_UART_MCR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	callq	_outb
	movq	_UART_FCR_CLEAR_RCVR@GOTPCREL(%rip), %rax
	movq	_UART_FCR_CLEAR_XMIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	16(%rbx), %rcx
	xorl	%eax, %eax
	cmpq	$0, (%rcx)
	je	LBB0_8
## %bb.7:
	movq	_MOXA_MUST_FCR_GDA_MODE_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_8:
	orl	%eax, %edi
	movq	_UART_FCR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	callq	_outb
	movq	_UART_RX@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	callq	_inb
	movq	_TTY_IO_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_set_bit
	movl	(%r12), %eax
	notl	%eax
	andl	%eax, 24(%rbx)
	movq	16(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.9:
	movq	8(%rbx), %rdi
	callq	_SET_MOXA_MUST_NO_SOFTWARE_FLOW_CONTROL
LBB0_10:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ASYNC_INITIALIZED,4,2          ## @ASYNC_INITIALIZED
	.comm	_UART_IER,8,3                   ## @UART_IER
	.comm	_HUPCL,4,2                      ## @HUPCL
	.comm	_UART_MCR_DTR,4,2               ## @UART_MCR_DTR
	.comm	_UART_MCR_RTS,4,2               ## @UART_MCR_RTS
	.comm	_UART_MCR,8,3                   ## @UART_MCR
	.comm	_UART_FCR_CLEAR_RCVR,4,2        ## @UART_FCR_CLEAR_RCVR
	.comm	_UART_FCR_CLEAR_XMIT,4,2        ## @UART_FCR_CLEAR_XMIT
	.comm	_MOXA_MUST_FCR_GDA_MODE_ENABLE,4,2 ## @MOXA_MUST_FCR_GDA_MODE_ENABLE
	.comm	_UART_FCR,8,3                   ## @UART_FCR
	.comm	_UART_RX,8,3                    ## @UART_RX
	.comm	_TTY_IO_ERROR,4,2               ## @TTY_IO_ERROR
	.no_dead_strip	_mxser_shutdown
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxser_shutdown
_mxser_shutdown:                        ; @mxser_shutdown
	.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	x21, [x0, #16]
	ldr	w8, [x21, #24]
Lloh0:
	adrp	x22, _ASYNC_INITIALIZED@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ASYNC_INITIALIZED@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.1:
	mov	x20, x0
	add	x19, x21, #4
	mov	x0, x19
	bl	_spin_lock_irqsave
	add	x0, x21, #40
	bl	_wake_up_interruptible
	ldr	x0, [x21, #32]
	cbz	x0, LBB0_3
; %bb.2:
	bl	_free_page
	str	xzr, [x21, #32]
LBB0_3:
	str	xzr, [x21, #48]
	ldr	x8, [x21, #8]
Lloh2:
	adrp	x9, _UART_IER@GOTPAGE
Lloh3:
	ldr	x9, [x9, _UART_IER@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_outb
	ldr	x8, [x20, #8]
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _HUPCL@GOTPAGE
Lloh6:
	ldr	x9, [x9, _HUPCL@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.4:
Lloh8:
	adrp	x8, _UART_MCR_DTR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _UART_MCR_DTR@GOTPAGEOFF]
Lloh10:
	adrp	x9, _UART_MCR_RTS@GOTPAGE
Lloh11:
	ldr	x9, [x9, _UART_MCR_RTS@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x21]
	bic	w0, w9, w8
	str	w0, [x21]
	b	LBB0_7
LBB0_5:
	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
LBB0_6:
	ldr	w0, [x21]
LBB0_7:
	ldr	x8, [x21, #8]
Lloh14:
	adrp	x9, _UART_MCR@GOTPAGE
Lloh15:
	ldr	x9, [x9, _UART_MCR@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_outb
Lloh17:
	adrp	x8, _UART_FCR_CLEAR_RCVR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _UART_FCR_CLEAR_RCVR@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _UART_FCR_CLEAR_XMIT@GOTPAGE
Lloh21:
	ldr	x9, [x9, _UART_FCR_CLEAR_XMIT@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldp	x10, x9, [x21, #8]
	ldr	x9, [x9]
	cmp	x9, #0
Lloh23:
	adrp	x9, _MOXA_MUST_FCR_GDA_MODE_ENABLE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _MOXA_MUST_FCR_GDA_MODE_ENABLE@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	csel	w9, wzr, w9, eq
	orr	w0, w8, w9
Lloh26:
	adrp	x8, _UART_FCR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _UART_FCR@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	add	x1, x8, x10
	bl	_outb
	ldr	x8, [x21, #8]
Lloh29:
	adrp	x9, _UART_RX@GOTPAGE
Lloh30:
	ldr	x9, [x9, _UART_RX@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_inb
Lloh32:
	adrp	x8, _TTY_IO_ERROR@GOTPAGE
Lloh33:
	ldr	x8, [x8, _TTY_IO_ERROR@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_set_bit
	ldr	w8, [x22]
	ldr	w9, [x21, #24]
	bic	w8, w9, w8
	str	w8, [x21, #24]
	ldr	x8, [x21, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_9
; %bb.8:
	ldr	x0, [x21, #8]
	bl	_SET_MOXA_MUST_NO_SOFTWARE_FLOW_CONTROL
LBB0_9:
	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	_spin_unlock_irqrestore
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_ASYNC_INITIALIZED,4,2          ; @ASYNC_INITIALIZED
	.comm	_UART_IER,8,3                   ; @UART_IER
	.comm	_HUPCL,4,2                      ; @HUPCL
	.comm	_UART_MCR_DTR,4,2               ; @UART_MCR_DTR
	.comm	_UART_MCR_RTS,4,2               ; @UART_MCR_RTS
	.comm	_UART_MCR,8,3                   ; @UART_MCR
	.comm	_UART_FCR_CLEAR_RCVR,4,2        ; @UART_FCR_CLEAR_RCVR
	.comm	_UART_FCR_CLEAR_XMIT,4,2        ; @UART_FCR_CLEAR_XMIT
	.comm	_MOXA_MUST_FCR_GDA_MODE_ENABLE,4,2 ; @MOXA_MUST_FCR_GDA_MODE_ENABLE
	.comm	_UART_FCR,8,3                   ; @UART_FCR
	.comm	_UART_RX,8,3                    ; @UART_RX
	.comm	_TTY_IO_ERROR,4,2               ; @TTY_IO_ERROR
	.no_dead_strip	_mxser_shutdown
.subsections_via_symbols
