	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_riotclose                      ## -- Begin function riotclose
	.p2align	4, 0x90
_riotclose:                             ## @riotclose
	.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	%rdi, %rbx
	movq	_RIO_DEBUG_TTY@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movl	72(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_rio_dprintk
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_rio_dprintk
	movq	88(%rbx), %rdx
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_rio_dprintk
	movq	80(%rbx), %r15
	movq	_jiffies@GOTPCREL(%rip), %rcx
	testq	%r15, %r15
	jne	LBB0_2
## %bb.1:
	movq	_MAX_SCHEDULE_TIMEOUT@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
LBB0_2:
	addq	(%rcx), %r15
	leaq	40(%rbx), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_rio_spin_lock_irqsave
	movq	_RIO_CLOSING@GOTPCREL(%rip), %rax
	movl	(%rbx), %r14d
	orl	(%rax), %r14d
	movl	%r14d, (%rbx)
	movq	_RIO_DELETED@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	testl	%r14d, %r13d
	je	LBB0_4
## %bb.3:
	movl	(%r12), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_rio_dprintk
LBB0_4:
	movq	_p@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.5:
	movq	%rbx, %rdi
	callq	_RIOClearUp
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_6:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_7:
	movq	_RIO_CLOSING@GOTPCREL(%rip), %rcx
	movq	_RIO_DELETED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	notl	%eax
	andl	%eax, (%rbx)
	movq	48(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	decq	%rax
	movq	%rax, 48(%rbx)
LBB0_9:
	movq	%r14, %rdi
	callq	_rio_spin_unlock_irqrestore
	movq	_RIO_DEBUG_TTY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.15(%rip), %rsi
	xorl	%eax, %eax
	callq	_rio_dprintk
	jmp	LBB0_15
LBB0_10:
	movl	(%r12), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_rio_dprintk
	movq	_RIO_MOPEN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %eax
	notl	%eax
	andl	(%rbx), %eax
	movl	%eax, (%rbx)
	movq	_RIO_CARR_ON@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%eax, %ecx
	movl	%ecx, (%rbx)
	movq	_RIOC_MSVR1_CD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 76(%rbx)
	movq	_RIO_LOPEN@GOTPCREL(%rip), %rsi
	movl	(%rdx), %eax
	orl	(%rsi), %eax
	movl	(%r12), %edi
	testl	%ecx, %eax
	je	LBB0_16
## %bb.11:
	movl	72(%rbx), %edx
	leaq	L_.str.5(%rip), %rsi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_rio_dprintk
	movq	_RIO_CLOSING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%rbx)
	movq	48(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	decq	%rax
	movq	%rax, 48(%rbx)
LBB0_13:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_rio_spin_unlock_irqrestore
LBB0_14:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_15:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	leaq	L_.str.6(%rip), %rsi
	xorl	%eax, %eax
	callq	_rio_dprintk
	movq	_RIO_DYNOROD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%rbx)
	movl	(%r12), %edi
	leaq	L_.str.7(%rip), %rsi
	xorl	%eax, %eax
	callq	_rio_dprintk
	testl	%r14d, %r13d
	jne	LBB0_20
## %bb.17:
	movq	8(%rbx), %rax
	movq	_NOT_INUSE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_20
## %bb.18:
	movq	_p@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	$0, (%rax)
	jne	LBB0_20
## %bb.19:
	movq	16(%rbx), %rax
	cmpq	24(%rbx), %rax
	jne	LBB0_34
LBB0_20:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rbx)
	movq	$0, 24(%rbx)
	movq	_RIO_MOPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_RIO_LOPEN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	testl	%eax, (%rbx)
	je	LBB0_23
## %bb.21:
	movq	_RIO_DEBUG_TTY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	72(%rbx), %edx
	leaq	L_.str.11(%rip), %rsi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_rio_dprintk
	movq	_RIO_CLOSING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%rbx)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_rio_spin_unlock_irqrestore
	movq	48(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.22:
	decq	%rax
	movq	%rax, 48(%rbx)
	jmp	LBB0_14
LBB0_23:
	movq	_p@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	cmpq	$0, (%rax)
	je	LBB0_25
## %bb.24:
	movq	%rbx, %rdi
	callq	_RIOClearUp
	xorl	%r12d, %r12d
	jmp	LBB0_6
LBB0_25:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rcx, %r12
	callq	_rio_spin_unlock_irqrestore
	movq	(%r12), %rdi
	movq	_RIOC_CLOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r12d, %r12d
	movq	%rbx, %rsi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	_RIOShortCommand
	movq	_RIO_FAIL@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_27
## %bb.26:
	movq	_p@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_RIOC_FCLOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rsi
	callq	_RIOPreemptiveCmd
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_rio_spin_lock_irqsave
	jmp	LBB0_7
LBB0_27:
	movl	$-1, %ecx
	testl	%r14d, %r13d
	jne	LBB0_37
## %bb.28:
	movl	$-1, %ecx
	movq	_PORT_ISOPEN@GOTPCREL(%rip), %r14
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
                                        ## kill: def $ecx killed $ecx def $rcx
	movl	(%r14), %eax
	testl	%eax, 32(%rbx)
	je	LBB0_37
## %bb.30:                              ##   in Loop: Header=BB0_29 Depth=1
	movq	%rdx, %r12
	movq	%rcx, %r13
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%r15, %rsi
	callq	_time_after
	testq	%rax, %rax
	jne	LBB0_35
## %bb.31:                              ##   in Loop: Header=BB0_29 Depth=1
	movq	_RIO_DEBUG_TTY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r14), %edx
	andl	32(%rbx), %edx
	leaq	L_.str.13(%rip), %rsi
	xorl	%eax, %eax
	callq	_rio_dprintk
	movq	_p@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	$0, (%rax)
	jne	LBB0_39
## %bb.32:                              ##   in Loop: Header=BB0_29 Depth=1
	movq	_HUNDRED_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_RIODelay
	movq	%r13, %rcx
	leal	-1(%r13), %ecx
	movq	%r12, %rdx
	cmpq	(%r12), %rax
	jne	LBB0_29
## %bb.33:
	leaq	L_.str.10(%rip), %rsi
	movq	_RIO_DEBUG_TTY@GOTPCREL(%rip), %rax
	jmp	LBB0_36
LBB0_34:
	movq	_EINTR@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movq	_RIO_DEBUG_TTY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.8(%rip), %rsi
	xorl	%eax, %eax
	callq	_rio_dprintk
	movq	_p@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_RIOC_FCLOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rsi
	callq	_RIOPreemptiveCmd
	jmp	LBB0_6
LBB0_35:
	movq	_RIO_DEBUG_TTY@GOTPCREL(%rip), %rax
	leaq	L_.str.12(%rip), %rsi
LBB0_36:
	movl	(%rax), %edi
	xorl	%eax, %eax
	callq	_rio_dprintk
	movq	_p@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_RIOC_FCLOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rsi
	callq	_RIOPreemptiveCmd
	movq	%r13, %rcx
	decl	%ecx
LBB0_37:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	%rcx, %r15
	callq	_rio_spin_lock_irqsave
	movq	_RIO_DEBUG_TTY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.14(%rip), %rsi
	xorl	%r12d, %r12d
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_rio_dprintk
	movq	_RIO_CTSFLOW@GOTPCREL(%rip), %rax
	movq	_RIO_RTSFLOW@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, 36(%rbx)
	cmpq	$0, 64(%rbx)
	je	LBB0_7
## %bb.38:
	incl	56(%rbx)
	jmp	LBB0_7
LBB0_39:
	movq	%rbx, %rdi
	callq	_RIOClearUp
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_rio_spin_lock_irqsave
	xorl	%r12d, %r12d
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_RIO_DEBUG_TTY,4,2              ## @RIO_DEBUG_TTY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"port close SysPort %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Port is at address %p\n"

L_.str.2:                               ## @.str.2
	.asciz	"TTY is at address %p\n"

	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_MAX_SCHEDULE_TIMEOUT,8,3       ## @MAX_SCHEDULE_TIMEOUT
	.comm	_RIO_CLOSING,4,2                ## @RIO_CLOSING
	.comm	_RIO_DELETED,4,2                ## @RIO_DELETED
L_.str.3:                               ## @.str.3
	.asciz	"Close on deleted RTA\n"

	.comm	_p,8,3                          ## @p
	.comm	_EIO,4,2                        ## @EIO
L_.str.4:                               ## @.str.4
	.asciz	"Clear bits\n"

	.comm	_RIO_MOPEN,4,2                  ## @RIO_MOPEN
	.comm	_RIO_CARR_ON,4,2                ## @RIO_CARR_ON
	.comm	_RIOC_MSVR1_CD,4,2              ## @RIOC_MSVR1_CD
	.comm	_RIO_LOPEN,4,2                  ## @RIO_LOPEN
L_.str.5:                               ## @.str.5
	.asciz	"Channel %d still open !\n"

L_.str.6:                               ## @.str.6
	.asciz	"Closing down - everything must go!\n"

	.comm	_RIO_DYNOROD,4,2                ## @RIO_DYNOROD
L_.str.7:                               ## @.str.7
	.asciz	"Timeout 1 starts\n"

	.comm	_NOT_INUSE,8,3                  ## @NOT_INUSE
	.comm	_EINTR,4,2                      ## @EINTR
L_.str.8:                               ## @.str.8
	.asciz	"Waiting for not idle closed broken by signal\n"

	.comm	_RIOC_FCLOSE,4,2                ## @RIOC_FCLOSE
	.comm	_HUNDRED_MS,4,2                 ## @HUNDRED_MS
	.comm	_RIO_FAIL,8,3                   ## @RIO_FAIL
L_.str.10:                              ## @.str.10
	.asciz	"RTA EINTR in delay \n"

L_.str.11:                              ## @.str.11
	.asciz	"Channel %d re-open!\n"

	.comm	_RIOC_CLOSE,4,2                 ## @RIOC_CLOSE
	.comm	_PORT_ISOPEN,4,2                ## @PORT_ISOPEN
L_.str.12:                              ## @.str.12
	.asciz	"Run out of tries - force the bugger shut!\n"

L_.str.13:                              ## @.str.13
	.asciz	"Close: PortState:ISOPEN is %d\n"

L_.str.14:                              ## @.str.14
	.asciz	"Close: try was %d on completion\n"

	.comm	_RIO_CTSFLOW,4,2                ## @RIO_CTSFLOW
	.comm	_RIO_RTSFLOW,4,2                ## @RIO_RTSFLOW
L_.str.15:                              ## @.str.15
	.asciz	"Return from close\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_riotclose                      ; -- Begin function riotclose
	.p2align	2
_riotclose:                             ; @riotclose
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x24, _RIO_DEBUG_TTY@GOTPAGE
Lloh1:
	ldr	x24, [x24, _RIO_DEBUG_TTY@GOTPAGEOFF]
	ldr	w0, [x24]
	ldr	w8, [x19, #72]
	str	x8, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_rio_dprintk
	ldr	w0, [x24]
	str	x19, [sp]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_rio_dprintk
	ldr	x8, [x19, #88]
	ldr	w0, [x24]
	str	x8, [sp]
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_rio_dprintk
	ldr	x8, [x19, #80]
Lloh8:
	adrp	x27, _jiffies@GOTPAGE
Lloh9:
	ldr	x27, [x27, _jiffies@GOTPAGEOFF]
	ldr	x21, [x27]
Lloh10:
	adrp	x9, _MAX_SCHEDULE_TIMEOUT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _MAX_SCHEDULE_TIMEOUT@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, #0
	csel	x22, x9, x8, eq
	add	x20, x19, #40
	mov	x0, x20
	bl	_rio_spin_lock_irqsave
Lloh13:
	adrp	x25, _RIO_CLOSING@GOTPAGE
Lloh14:
	ldr	x25, [x25, _RIO_CLOSING@GOTPAGEOFF]
	ldr	w8, [x25]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
Lloh15:
	adrp	x26, _RIO_DELETED@GOTPAGE
Lloh16:
	ldr	x26, [x26, _RIO_DELETED@GOTPAGEOFF]
	ldr	w9, [x26]
	ands	w23, w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	w0, [x24]
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_rio_dprintk
LBB0_2:
Lloh19:
	adrp	x28, _p@GOTPAGE
Lloh20:
	ldr	x28, [x28, _p@GOTPAGEOFF]
	ldr	x8, [x28]
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.3:
	mov	x0, x19
	bl	_RIOClearUp
Lloh21:
	adrp	x8, _EIO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_4:
	ldr	w8, [x25]
	ldr	w9, [x26]
	orr	w8, w9, w8
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_6
; %bb.5:
	sub	x8, x8, #1
	str	x8, [x19, #48]
LBB0_6:
	mov	x0, x20
	bl	_rio_spin_unlock_irqrestore
	ldr	w0, [x24]
Lloh24:
	adrp	x1, l_.str.15@PAGE
Lloh25:
	add	x1, x1, l_.str.15@PAGEOFF
	bl	_rio_dprintk
	b	LBB0_12
LBB0_7:
	ldr	w0, [x24]
Lloh26:
	adrp	x1, l_.str.4@PAGE
Lloh27:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_rio_dprintk
Lloh28:
	adrp	x26, _RIO_MOPEN@GOTPAGE
Lloh29:
	ldr	x26, [x26, _RIO_MOPEN@GOTPAGEOFF]
	ldr	w8, [x26]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
Lloh30:
	adrp	x9, _RIO_CARR_ON@GOTPAGE
Lloh31:
	ldr	x9, [x9, _RIO_CARR_ON@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	bic	w8, w8, w9
Lloh33:
	adrp	x9, _RIOC_MSVR1_CD@GOTPAGE
Lloh34:
	ldr	x9, [x9, _RIOC_MSVR1_CD@GOTPAGEOFF]
	str	w8, [x19]
Lloh35:
	ldr	w9, [x9]
	ldr	w10, [x19, #76]
	bic	w9, w10, w9
Lloh36:
	adrp	x25, _RIO_LOPEN@GOTPAGE
Lloh37:
	ldr	x25, [x25, _RIO_LOPEN@GOTPAGEOFF]
	str	w9, [x19, #76]
	ldr	w9, [x25]
	ldr	w10, [x26]
	orr	w9, w10, w9
	ldr	w0, [x24]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.8:
	ldr	w8, [x19, #72]
	str	x8, [sp]
Lloh38:
	adrp	x1, l_.str.5@PAGE
Lloh39:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_rio_dprintk
Lloh40:
	adrp	x8, _RIO_CLOSING@GOTPAGE
Lloh41:
	ldr	x8, [x8, _RIO_CLOSING@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_10
; %bb.9:
	sub	x8, x8, #1
	str	x8, [x19, #48]
LBB0_10:
	mov	x0, x20
	bl	_rio_spin_unlock_irqrestore
LBB0_11:
Lloh43:
	adrp	x8, _EIO@GOTPAGE
Lloh44:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_12:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_13:
Lloh46:
	adrp	x1, l_.str.6@PAGE
Lloh47:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_rio_dprintk
Lloh48:
	adrp	x8, _RIO_DYNOROD@GOTPAGE
Lloh49:
	ldr	x8, [x8, _RIO_DYNOROD@GOTPAGEOFF]
Lloh50:
	ldr	w8, [x8]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	ldr	w0, [x24]
Lloh51:
	adrp	x1, l_.str.7@PAGE
Lloh52:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_rio_dprintk
	cbnz	w23, LBB0_17
; %bb.14:
	ldr	x8, [x19, #8]
Lloh53:
	adrp	x9, _NOT_INUSE@GOTPAGE
Lloh54:
	ldr	x9, [x9, _NOT_INUSE@GOTPAGEOFF]
Lloh55:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_17
; %bb.15:
	ldr	x8, [x28]
	ldr	x8, [x8]
	cbnz	x8, LBB0_17
; %bb.16:
	ldp	x8, x9, [x19, #16]
	cmp	x8, x9
	b.ne	LBB0_29
LBB0_17:
	stp	xzr, xzr, [x19, #8]
	str	xzr, [x19, #24]
	ldr	w8, [x19]
	ldr	w9, [x25]
	ldr	w10, [x26]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_20
; %bb.18:
	ldr	w0, [x24]
	ldr	w8, [x19, #72]
	str	x8, [sp]
Lloh56:
	adrp	x1, l_.str.11@PAGE
Lloh57:
	add	x1, x1, l_.str.11@PAGEOFF
	bl	_rio_dprintk
Lloh58:
	adrp	x8, _RIO_CLOSING@GOTPAGE
Lloh59:
	ldr	x8, [x8, _RIO_CLOSING@GOTPAGEOFF]
Lloh60:
	ldr	w8, [x8]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	mov	x0, x20
	bl	_rio_spin_unlock_irqrestore
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_11
; %bb.19:
	sub	x8, x8, #1
	str	x8, [x19, #48]
	b	LBB0_11
LBB0_20:
	ldr	x8, [x28]
	ldr	x8, [x8]
Lloh61:
	adrp	x25, _RIO_CLOSING@GOTPAGE
Lloh62:
	ldr	x25, [x25, _RIO_CLOSING@GOTPAGEOFF]
	cbz	x8, LBB0_22
; %bb.21:
	mov	x0, x19
	bl	_RIOClearUp
	b	LBB0_24
LBB0_22:
	mov	x0, x20
	bl	_rio_spin_unlock_irqrestore
	ldr	x0, [x28]
Lloh63:
	adrp	x8, _RIOC_CLOSE@GOTPAGE
Lloh64:
	ldr	x8, [x8, _RIOC_CLOSE@GOTPAGEOFF]
Lloh65:
	ldr	w2, [x8]
	mov	x1, x19
	mov	w3, #1
	mov	w4, #0
	bl	_RIOShortCommand
Lloh66:
	adrp	x26, _RIO_FAIL@GOTPAGE
Lloh67:
	ldr	x26, [x26, _RIO_FAIL@GOTPAGEOFF]
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_26
; %bb.23:
	ldr	x0, [x28]
Lloh68:
	adrp	x8, _RIOC_FCLOSE@GOTPAGE
Lloh69:
	ldr	x8, [x8, _RIOC_FCLOSE@GOTPAGEOFF]
Lloh70:
	ldr	w2, [x8]
	mov	x1, x19
	bl	_RIOPreemptiveCmd
	mov	x0, x20
	bl	_rio_spin_lock_irqsave
LBB0_24:
	mov	w21, #0
LBB0_25:
Lloh71:
	adrp	x26, _RIO_DELETED@GOTPAGE
Lloh72:
	ldr	x26, [x26, _RIO_DELETED@GOTPAGEOFF]
	b	LBB0_4
LBB0_26:
	cbz	w23, LBB0_31
; %bb.27:
	mov	w21, #-1
LBB0_28:
Lloh73:
	adrp	x26, _RIO_DELETED@GOTPAGE
Lloh74:
	ldr	x26, [x26, _RIO_DELETED@GOTPAGEOFF]
	b	LBB0_40
LBB0_29:
Lloh75:
	adrp	x8, _EINTR@GOTPAGE
Lloh76:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
Lloh77:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	w0, [x24]
Lloh78:
	adrp	x1, l_.str.8@PAGE
Lloh79:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_rio_dprintk
	ldr	x0, [x28]
Lloh80:
	adrp	x8, _RIOC_FCLOSE@GOTPAGE
Lloh81:
	ldr	x8, [x8, _RIOC_FCLOSE@GOTPAGEOFF]
Lloh82:
	ldr	w2, [x8]
	mov	x1, x19
	bl	_RIOPreemptiveCmd
LBB0_30:
Lloh83:
	adrp	x25, _RIO_CLOSING@GOTPAGE
Lloh84:
	ldr	x25, [x25, _RIO_CLOSING@GOTPAGEOFF]
	b	LBB0_25
LBB0_31:
	add	x22, x21, x22
	mov	w8, #-1
Lloh85:
	adrp	x25, _PORT_ISOPEN@GOTPAGE
Lloh86:
	ldr	x25, [x25, _PORT_ISOPEN@GOTPAGEOFF]
Lloh87:
	adrp	x23, l_.str.13@PAGE
Lloh88:
	add	x23, x23, l_.str.13@PAGEOFF
LBB0_32:                                ; =>This Inner Loop Header: Depth=1
	mov	x21, x8
	ldr	w8, [x19, #32]
	ldr	w9, [x25]
	tst	w9, w8
	b.eq	LBB0_37
; %bb.33:                               ;   in Loop: Header=BB0_32 Depth=1
	ldr	x0, [x27]
	mov	x1, x22
	bl	_time_after
	cbnz	x0, LBB0_38
; %bb.34:                               ;   in Loop: Header=BB0_32 Depth=1
	ldr	w0, [x24]
	ldr	w8, [x19, #32]
	ldr	w9, [x25]
	and	w8, w9, w8
	str	x8, [sp]
	mov	x1, x23
	bl	_rio_dprintk
	ldr	x8, [x28]
	ldr	x8, [x8]
	cbnz	x8, LBB0_43
; %bb.35:                               ;   in Loop: Header=BB0_32 Depth=1
Lloh89:
	adrp	x8, _HUNDRED_MS@GOTPAGE
Lloh90:
	ldr	x8, [x8, _HUNDRED_MS@GOTPAGEOFF]
Lloh91:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_RIODelay
	ldr	x9, [x26]
	sub	w8, w21, #1
	cmp	x0, x9
	b.ne	LBB0_32
; %bb.36:
Lloh92:
	adrp	x1, l_.str.10@PAGE
Lloh93:
	add	x1, x1, l_.str.10@PAGEOFF
Lloh94:
	adrp	x25, _RIO_CLOSING@GOTPAGE
Lloh95:
	ldr	x25, [x25, _RIO_CLOSING@GOTPAGEOFF]
Lloh96:
	adrp	x26, _RIO_DELETED@GOTPAGE
Lloh97:
	ldr	x26, [x26, _RIO_DELETED@GOTPAGEOFF]
	b	LBB0_39
LBB0_37:
Lloh98:
	adrp	x25, _RIO_CLOSING@GOTPAGE
Lloh99:
	ldr	x25, [x25, _RIO_CLOSING@GOTPAGEOFF]
	b	LBB0_28
LBB0_38:
Lloh100:
	adrp	x25, _RIO_CLOSING@GOTPAGE
Lloh101:
	ldr	x25, [x25, _RIO_CLOSING@GOTPAGEOFF]
Lloh102:
	adrp	x26, _RIO_DELETED@GOTPAGE
Lloh103:
	ldr	x26, [x26, _RIO_DELETED@GOTPAGEOFF]
Lloh104:
	adrp	x1, l_.str.12@PAGE
Lloh105:
	add	x1, x1, l_.str.12@PAGEOFF
LBB0_39:
	ldr	w0, [x24]
	bl	_rio_dprintk
	ldr	x0, [x28]
Lloh106:
	adrp	x8, _RIOC_FCLOSE@GOTPAGE
Lloh107:
	ldr	x8, [x8, _RIOC_FCLOSE@GOTPAGEOFF]
Lloh108:
	ldr	w2, [x8]
	mov	x1, x19
	bl	_RIOPreemptiveCmd
	sub	w21, w21, #1
LBB0_40:
	mov	x0, x20
	bl	_rio_spin_lock_irqsave
	ldr	w0, [x24]
	str	x21, [sp]
Lloh109:
	adrp	x1, l_.str.14@PAGE
Lloh110:
	add	x1, x1, l_.str.14@PAGEOFF
	bl	_rio_dprintk
Lloh111:
	adrp	x8, _RIO_CTSFLOW@GOTPAGE
Lloh112:
	ldr	x8, [x8, _RIO_CTSFLOW@GOTPAGEOFF]
Lloh113:
	ldr	w8, [x8]
Lloh114:
	adrp	x9, _RIO_RTSFLOW@GOTPAGE
Lloh115:
	ldr	x9, [x9, _RIO_RTSFLOW@GOTPAGEOFF]
Lloh116:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x19, #36]
	bic	w8, w9, w8
	str	w8, [x19, #36]
	ldr	x8, [x19, #64]
	cbz	x8, LBB0_42
; %bb.41:
	mov	w21, #0
	ldr	w8, [x19, #56]
	add	w8, w8, #1
	str	w8, [x19, #56]
	b	LBB0_4
LBB0_42:
	mov	w21, #0
	b	LBB0_4
LBB0_43:
	mov	x0, x19
	bl	_RIOClearUp
	mov	x0, x20
	bl	_rio_spin_lock_irqsave
	mov	w21, #0
	b	LBB0_30
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpLdrGot	Lloh61, Lloh62
	.loh AdrpLdrGot	Lloh66, Lloh67
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh68, Lloh69, Lloh70
	.loh AdrpLdrGot	Lloh71, Lloh72
	.loh AdrpLdrGot	Lloh73, Lloh74
	.loh AdrpLdrGotLdr	Lloh80, Lloh81, Lloh82
	.loh AdrpAdd	Lloh78, Lloh79
	.loh AdrpLdrGotLdr	Lloh75, Lloh76, Lloh77
	.loh AdrpLdrGot	Lloh83, Lloh84
	.loh AdrpAdd	Lloh87, Lloh88
	.loh AdrpLdrGot	Lloh85, Lloh86
	.loh AdrpLdrGotLdr	Lloh89, Lloh90, Lloh91
	.loh AdrpLdrGot	Lloh96, Lloh97
	.loh AdrpLdrGot	Lloh94, Lloh95
	.loh AdrpAdd	Lloh92, Lloh93
	.loh AdrpLdrGot	Lloh98, Lloh99
	.loh AdrpAdd	Lloh104, Lloh105
	.loh AdrpLdrGot	Lloh102, Lloh103
	.loh AdrpLdrGot	Lloh100, Lloh101
	.loh AdrpLdrGotLdr	Lloh106, Lloh107, Lloh108
	.loh AdrpLdrGotLdr	Lloh114, Lloh115, Lloh116
	.loh AdrpLdrGotLdr	Lloh111, Lloh112, Lloh113
	.loh AdrpAdd	Lloh109, Lloh110
	.cfi_endproc
                                        ; -- End function
	.comm	_RIO_DEBUG_TTY,4,2              ; @RIO_DEBUG_TTY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"port close SysPort %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Port is at address %p\n"

l_.str.2:                               ; @.str.2
	.asciz	"TTY is at address %p\n"

	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_MAX_SCHEDULE_TIMEOUT,8,3       ; @MAX_SCHEDULE_TIMEOUT
	.comm	_RIO_CLOSING,4,2                ; @RIO_CLOSING
	.comm	_RIO_DELETED,4,2                ; @RIO_DELETED
l_.str.3:                               ; @.str.3
	.asciz	"Close on deleted RTA\n"

	.comm	_p,8,3                          ; @p
	.comm	_EIO,4,2                        ; @EIO
l_.str.4:                               ; @.str.4
	.asciz	"Clear bits\n"

	.comm	_RIO_MOPEN,4,2                  ; @RIO_MOPEN
	.comm	_RIO_CARR_ON,4,2                ; @RIO_CARR_ON
	.comm	_RIOC_MSVR1_CD,4,2              ; @RIOC_MSVR1_CD
	.comm	_RIO_LOPEN,4,2                  ; @RIO_LOPEN
l_.str.5:                               ; @.str.5
	.asciz	"Channel %d still open !\n"

l_.str.6:                               ; @.str.6
	.asciz	"Closing down - everything must go!\n"

	.comm	_RIO_DYNOROD,4,2                ; @RIO_DYNOROD
l_.str.7:                               ; @.str.7
	.asciz	"Timeout 1 starts\n"

	.comm	_NOT_INUSE,8,3                  ; @NOT_INUSE
	.comm	_EINTR,4,2                      ; @EINTR
l_.str.8:                               ; @.str.8
	.asciz	"Waiting for not idle closed broken by signal\n"

	.comm	_RIOC_FCLOSE,4,2                ; @RIOC_FCLOSE
	.comm	_HUNDRED_MS,4,2                 ; @HUNDRED_MS
	.comm	_RIO_FAIL,8,3                   ; @RIO_FAIL
l_.str.10:                              ; @.str.10
	.asciz	"RTA EINTR in delay \n"

l_.str.11:                              ; @.str.11
	.asciz	"Channel %d re-open!\n"

	.comm	_RIOC_CLOSE,4,2                 ; @RIOC_CLOSE
	.comm	_PORT_ISOPEN,4,2                ; @PORT_ISOPEN
l_.str.12:                              ; @.str.12
	.asciz	"Run out of tries - force the bugger shut!\n"

l_.str.13:                              ; @.str.13
	.asciz	"Close: PortState:ISOPEN is %d\n"

l_.str.14:                              ; @.str.14
	.asciz	"Close: try was %d on completion\n"

	.comm	_RIO_CTSFLOW,4,2                ; @RIO_CTSFLOW
	.comm	_RIO_RTSFLOW,4,2                ; @RIO_RTSFLOW
l_.str.15:                              ; @.str.15
	.asciz	"Return from close\n"

.subsections_via_symbols
