	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function shutdown
_shutdown:                              ## @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	%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	_ASYNC_INITIALIZED@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, 16(%rdi)
	je	LBB0_19
## %bb.1:
	movq	%rdi, %rbx
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	leaq	32(%rbx), %rdi
	callq	_wake_up_interruptible
	leaq	68(%rbx), %rdi
	callq	_wake_up_interruptible
	movq	_ESP_STAT_DMA_RX@GOTPCREL(%rip), %rax
	movq	_ESP_STAT_DMA_TX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%ecx, (%rbx)
	je	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	callq	_claim_dma_lock
	movq	%rax, %r15
	movq	_dma@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_disable_dma
	movl	(%r13), %edi
	callq	_clear_dma_ff
	movq	%r15, %rdi
	callq	_release_dma_lock
	movq	_dma_bytes@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
LBB0_3:
	movl	64(%rbx), %edi
	movq	%rbx, %rsi
	callq	_free_irq
	movq	_dma_buffer@GOTPCREL(%rip), %r13
	cmpq	$0, (%r13)
	je	LBB0_10
## %bb.4:
	movq	_ports@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	movl	(%r12), %ecx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	56(%rax), %rax
	testq	%rax, %rax
	je	LBB0_9
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rbx, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	testl	%ecx, 16(%rax)
	je	LBB0_8
	jmp	LBB0_10
LBB0_19:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_dma@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_free_dma
	movq	(%r13), %r15
	movq	_DMA_BUFFER_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_get_order
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_free_pages
	movq	$0, (%r13)
LBB0_10:
	movq	48(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.11:
	callq	_free_page
	movq	$0, 48(%rbx)
LBB0_12:
	movq	$0, 40(%rbx)
	movq	_UART_ESI_CMD1@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_ESI_SET_SRV_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_serial_out
	movq	_UART_ESI_CMD2@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_serial_out
	movq	24(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movq	8(%rax), %rax
	movq	_HUPCL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_14
LBB0_15:
	movq	_UART_MCR_DTR@GOTPCREL(%rip), %rcx
	movq	_UART_MCR_RTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	notl	%eax
	andl	4(%rbx), %eax
	jmp	LBB0_16
LBB0_14:
	movl	4(%rbx), %eax
LBB0_16:
	movq	_UART_MCR_OUT2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movl	%ecx, 4(%rbx)
	movl	(%r13), %esi
	movq	_ESI_WRITE_UART@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_serial_out
	movl	(%r15), %esi
	movq	_UART_MCR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_serial_out
	movl	(%r15), %esi
	movl	4(%rbx), %edx
	movq	%rbx, %rdi
	callq	_serial_out
	movq	24(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_18
## %bb.17:
	movq	_TTY_IO_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_set_bit
LBB0_18:
	movl	(%r12), %eax
	notl	%eax
	andl	%eax, 16(%rbx)
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ASYNC_INITIALIZED,4,2          ## @ASYNC_INITIALIZED
	.comm	_ESP_STAT_DMA_RX,4,2            ## @ESP_STAT_DMA_RX
	.comm	_ESP_STAT_DMA_TX,4,2            ## @ESP_STAT_DMA_TX
	.comm	_dma,4,2                        ## @dma
	.comm	_dma_bytes,8,3                  ## @dma_bytes
	.comm	_dma_buffer,8,3                 ## @dma_buffer
	.comm	_ports,8,3                      ## @ports
	.comm	_DMA_BUFFER_SZ,4,2              ## @DMA_BUFFER_SZ
	.comm	_UART_ESI_CMD1,4,2              ## @UART_ESI_CMD1
	.comm	_ESI_SET_SRV_MASK,4,2           ## @ESI_SET_SRV_MASK
	.comm	_UART_ESI_CMD2,4,2              ## @UART_ESI_CMD2
	.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_OUT2,4,2              ## @UART_MCR_OUT2
	.comm	_ESI_WRITE_UART,4,2             ## @ESI_WRITE_UART
	.comm	_UART_MCR,4,2                   ## @UART_MCR
	.comm	_TTY_IO_ERROR,4,2               ## @TTY_IO_ERROR
	.no_dead_strip	_shutdown
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function shutdown
_shutdown:                              ; @shutdown
	.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	w8, [x0, #16]
Lloh0:
	adrp	x22, _ASYNC_INITIALIZED@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ASYNC_INITIALIZED@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.1:
	mov	x19, x0
	add	x20, x0, #8
	mov	x0, x20
	bl	_spin_lock_irqsave
	add	x0, x19, #32
	bl	_wake_up_interruptible
	add	x0, x19, #68
	bl	_wake_up_interruptible
	ldr	w8, [x19]
Lloh2:
	adrp	x9, _ESP_STAT_DMA_RX@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ESP_STAT_DMA_RX@GOTPAGEOFF]
Lloh4:
	adrp	x10, _ESP_STAT_DMA_TX@GOTPAGE
Lloh5:
	ldr	x10, [x10, _ESP_STAT_DMA_TX@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
Lloh7:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh8:
	adrp	x23, _dma@GOTPAGE
Lloh9:
	ldr	x23, [x23, _dma@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	bl	_claim_dma_lock
	mov	x21, x0
	ldr	w0, [x23]
	bl	_disable_dma
	ldr	w0, [x23]
	bl	_clear_dma_ff
	mov	x0, x21
	bl	_release_dma_lock
Lloh10:
	adrp	x8, _dma_bytes@GOTPAGE
Lloh11:
	ldr	x8, [x8, _dma_bytes@GOTPAGEOFF]
Lloh12:
	str	xzr, [x8]
LBB0_3:
	ldr	w0, [x19, #64]
	mov	x1, x19
	bl	_free_irq
Lloh13:
	adrp	x24, _dma_buffer@GOTPAGE
Lloh14:
	ldr	x24, [x24, _dma_buffer@GOTPAGEOFF]
	ldr	x8, [x24]
	cbz	x8, LBB0_11
; %bb.4:
Lloh15:
	adrp	x8, _ports@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ports@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.5:
	ldr	w9, [x22]
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x8, #56]
	cbz	x8, LBB0_10
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x8, x19
	b.eq	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w10, [x8, #16]
	tst	w9, w10
	b.eq	LBB0_6
	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:
	ldr	w0, [x23]
	bl	_free_dma
	ldr	x21, [x24]
Lloh18:
	adrp	x8, _DMA_BUFFER_SZ@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DMA_BUFFER_SZ@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_get_order
	mov	x1, x0
	mov	x0, x21
	bl	_free_pages
	str	xzr, [x24]
LBB0_11:
	ldr	x0, [x19, #48]
	cbz	x0, LBB0_13
; %bb.12:
	bl	_free_page
	str	xzr, [x19, #48]
LBB0_13:
	str	xzr, [x19, #40]
Lloh21:
	adrp	x23, _UART_ESI_CMD1@GOTPAGE
Lloh22:
	ldr	x23, [x23, _UART_ESI_CMD1@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh23:
	adrp	x8, _ESI_SET_SRV_MASK@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ESI_SET_SRV_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_serial_out
Lloh26:
	adrp	x21, _UART_ESI_CMD2@GOTPAGE
Lloh27:
	ldr	x21, [x21, _UART_ESI_CMD2@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #0
	bl	_serial_out
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_15
; %bb.14:
	ldr	x8, [x8, #8]
	ldr	w8, [x8]
Lloh28:
	adrp	x9, _HUPCL@GOTPAGE
Lloh29:
	ldr	x9, [x9, _HUPCL@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
LBB0_15:
Lloh31:
	adrp	x8, _UART_MCR_DTR@GOTPAGE
Lloh32:
	ldr	x8, [x8, _UART_MCR_DTR@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
Lloh34:
	adrp	x9, _UART_MCR_RTS@GOTPAGE
Lloh35:
	ldr	x9, [x9, _UART_MCR_RTS@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x19, #4]
	bic	w8, w9, w8
	b	LBB0_17
LBB0_16:
	ldr	w8, [x19, #4]
LBB0_17:
Lloh37:
	adrp	x9, _UART_MCR_OUT2@GOTPAGE
Lloh38:
	ldr	x9, [x9, _UART_MCR_OUT2@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	bic	w8, w8, w9
	str	w8, [x19, #4]
	ldr	w1, [x23]
Lloh40:
	adrp	x8, _ESI_WRITE_UART@GOTPAGE
Lloh41:
	ldr	x8, [x8, _ESI_WRITE_UART@GOTPAGEOFF]
Lloh42:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_serial_out
	ldr	w1, [x21]
Lloh43:
	adrp	x8, _UART_MCR@GOTPAGE
Lloh44:
	ldr	x8, [x8, _UART_MCR@GOTPAGEOFF]
Lloh45:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_serial_out
	ldr	w1, [x21]
	ldr	w2, [x19, #4]
	mov	x0, x19
	bl	_serial_out
	ldr	x1, [x19, #24]
	cbz	x1, LBB0_19
; %bb.18:
Lloh46:
	adrp	x8, _TTY_IO_ERROR@GOTPAGE
Lloh47:
	ldr	x8, [x8, _TTY_IO_ERROR@GOTPAGEOFF]
Lloh48:
	ldr	w0, [x8]
	bl	_set_bit
LBB0_19:
	ldr	w8, [x22]
	ldr	w9, [x19, #16]
	bic	w8, w9, w8
	str	w8, [x19, #16]
	mov	x0, x20
	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	_spin_unlock_irqrestore
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh6
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_ASYNC_INITIALIZED,4,2          ; @ASYNC_INITIALIZED
	.comm	_ESP_STAT_DMA_RX,4,2            ; @ESP_STAT_DMA_RX
	.comm	_ESP_STAT_DMA_TX,4,2            ; @ESP_STAT_DMA_TX
	.comm	_dma,4,2                        ; @dma
	.comm	_dma_bytes,8,3                  ; @dma_bytes
	.comm	_dma_buffer,8,3                 ; @dma_buffer
	.comm	_ports,8,3                      ; @ports
	.comm	_DMA_BUFFER_SZ,4,2              ; @DMA_BUFFER_SZ
	.comm	_UART_ESI_CMD1,4,2              ; @UART_ESI_CMD1
	.comm	_ESI_SET_SRV_MASK,4,2           ; @ESI_SET_SRV_MASK
	.comm	_UART_ESI_CMD2,4,2              ; @UART_ESI_CMD2
	.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_OUT2,4,2              ; @UART_MCR_OUT2
	.comm	_ESI_WRITE_UART,4,2             ; @ESI_WRITE_UART
	.comm	_UART_MCR,4,2                   ; @UART_MCR
	.comm	_TTY_IO_ERROR,4,2               ; @TTY_IO_ERROR
	.no_dead_strip	_shutdown
.subsections_via_symbols
