	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_ASYNC_INITIALIZED@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	testl	%eax, (%rdi)
	je	LBB0_10
## %bb.1:
	movq	%rdi, %rbx
	callq	_local_irq_save
	leaq	32(%rbx), %rdi
	callq	_wake_up_interruptible
	movq	_IRQ_ports@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_IRQ_AMIGA_VERTB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_free_irq
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.2:
	callq	_free_page
	movq	$0, 24(%rbx)
LBB0_3:
	movq	$0, 16(%rbx)
	movq	_IF_RBF@GOTPCREL(%rip), %rax
	movq	_IF_TBE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_custom@GOTPCREL(%rip), %r15
	movl	%ecx, (%r15)
	xorl	%eax, %eax
	callq	_mb
	movq	_AC_UARTBRK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	xorl	%eax, %eax
	callq	_mb
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	8(%rax), %rax
	movq	_HUPCL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_5
LBB0_6:
	movq	_SER_DTR@GOTPCREL(%rip), %rax
	movq	_SER_RTS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	notl	%edi
	andl	4(%rbx), %edi
	movl	%edi, 4(%rbx)
	jmp	LBB0_7
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	4(%rbx), %edi
LBB0_7:
	callq	_rtsdtr_ctrl
	movq	8(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_9
## %bb.8:
	movq	_TTY_IO_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_set_bit
LBB0_9:
	movl	(%r14), %eax
	notl	%eax
	andl	%eax, (%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_local_irq_restore              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ASYNC_INITIALIZED,4,2          ## @ASYNC_INITIALIZED
	.comm	_IRQ_ports,8,3                  ## @IRQ_ports
	.comm	_IRQ_AMIGA_VERTB,4,2            ## @IRQ_AMIGA_VERTB
	.comm	_IF_RBF,4,2                     ## @IF_RBF
	.comm	_IF_TBE,4,2                     ## @IF_TBE
	.comm	_custom,8,2                     ## @custom
	.comm	_AC_UARTBRK,4,2                 ## @AC_UARTBRK
	.comm	_HUPCL,4,2                      ## @HUPCL
	.comm	_SER_DTR,4,2                    ## @SER_DTR
	.comm	_SER_RTS,4,2                    ## @SER_RTS
	.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	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	w8, [x0]
Lloh0:
	adrp	x20, _ASYNC_INITIALIZED@GOTPAGE
Lloh1:
	ldr	x20, [x20, _ASYNC_INITIALIZED@GOTPAGEOFF]
	ldr	w9, [x20]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.1:
	mov	x19, x0
	bl	_local_irq_save
	add	x0, x19, #32
	bl	_wake_up_interruptible
Lloh2:
	adrp	x8, _IRQ_ports@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IRQ_ports@GOTPAGEOFF]
Lloh4:
	str	xzr, [x8]
Lloh5:
	adrp	x8, _IRQ_AMIGA_VERTB@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IRQ_AMIGA_VERTB@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_free_irq
	ldr	x0, [x19, #24]
	cbz	x0, LBB0_3
; %bb.2:
	bl	_free_page
	str	xzr, [x19, #24]
LBB0_3:
	str	xzr, [x19, #16]
Lloh8:
	adrp	x8, _IF_RBF@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IF_RBF@GOTPAGEOFF]
Lloh10:
	adrp	x9, _IF_TBE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _IF_TBE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh14:
	adrp	x21, _custom@GOTPAGE
Lloh15:
	ldr	x21, [x21, _custom@GOTPAGEOFF]
	str	w8, [x21]
	bl	_mb
Lloh16:
	adrp	x8, _AC_UARTBRK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AC_UARTBRK@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w8, [x21, #4]
	bl	_mb
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_5
; %bb.4:
	ldr	x8, [x8, #8]
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _HUPCL@GOTPAGE
Lloh20:
	ldr	x9, [x9, _HUPCL@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
LBB0_5:
Lloh22:
	adrp	x8, _SER_DTR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SER_DTR@GOTPAGEOFF]
Lloh24:
	adrp	x9, _SER_RTS@GOTPAGE
Lloh25:
	ldr	x9, [x9, _SER_RTS@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
Lloh27:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x19, #4]
	bic	w0, w9, w8
	str	w0, [x19, #4]
	b	LBB0_8
LBB0_6:
	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_7:
	ldr	w0, [x19, #4]
LBB0_8:
	bl	_rtsdtr_ctrl
	ldr	x1, [x19, #8]
	cbz	x1, LBB0_10
; %bb.9:
Lloh28:
	adrp	x8, _TTY_IO_ERROR@GOTPAGE
Lloh29:
	ldr	x8, [x8, _TTY_IO_ERROR@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	bl	_set_bit
LBB0_10:
	ldr	w8, [x20]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [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	_local_irq_restore
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh26
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_ASYNC_INITIALIZED,4,2          ; @ASYNC_INITIALIZED
	.comm	_IRQ_ports,8,3                  ; @IRQ_ports
	.comm	_IRQ_AMIGA_VERTB,4,2            ; @IRQ_AMIGA_VERTB
	.comm	_IF_RBF,4,2                     ; @IF_RBF
	.comm	_IF_TBE,4,2                     ; @IF_TBE
	.comm	_custom,8,2                     ; @custom
	.comm	_AC_UARTBRK,4,2                 ; @AC_UARTBRK
	.comm	_HUPCL,4,2                      ; @HUPCL
	.comm	_SER_DTR,4,2                    ; @SER_DTR
	.comm	_SER_RTS,4,2                    ; @SER_RTS
	.comm	_TTY_IO_ERROR,4,2               ; @TTY_IO_ERROR
	.no_dead_strip	_shutdown
.subsections_via_symbols
