	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rs_open
_rs_open:                               ## @rs_open
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	testl	%edi, %edi
	js	LBB0_2
## %bb.1:
	movq	_NR_PORTS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	jge	LBB0_2
## %bb.4:
	movq	%rsi, %r14
	leaq	-24(%rbp), %rsi
	callq	_get_async_struct
	testl	%eax, %eax
	jne	LBB0_10
## %bb.5:
	movq	-24(%rbp), %rdi
	movq	%rdi, 16(%rbx)
	movq	%rbx, 8(%rdi)
	movl	4(%rbx), %esi
	leaq	L_.str(%rip), %rdx
	callq	_serial_paranoia_check
	testq	%rax, %rax
	je	LBB0_6
LBB0_2:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	movq	-24(%rbp), %rax
	movq	_ASYNC_LOW_LATENCY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%edx, %edx
	andl	(%rax), %ecx
	setne	%dl
	movq	8(%rax), %rax
	movl	%edx, 8(%rax)
	movq	%r14, %rdi
	callq	_tty_hung_up_p
	movq	-24(%rbp), %rdi
	movq	_ASYNC_CLOSING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rdi), %ecx
	testq	%rax, %rax
	je	LBB0_7
## %bb.11:
	testl	%ecx, %ecx
	jne	LBB0_12
	jmp	LBB0_13
LBB0_7:
	testl	%ecx, %ecx
	je	LBB0_8
LBB0_12:
	addq	$4, %rdi
	callq	_interruptible_sleep_on
LBB0_13:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_8:
	callq	_startup
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movq	-24(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_block_til_ready
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_NR_PORTS,4,2                   ## @NR_PORTS
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rs_open"

	.comm	_ASYNC_LOW_LATENCY,4,2          ## @ASYNC_LOW_LATENCY
	.comm	_ASYNC_CLOSING,4,2              ## @ASYNC_CLOSING
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_ASYNC_HUP_NOTIFY,4,2           ## @ASYNC_HUP_NOTIFY
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.no_dead_strip	_rs_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rs_open
_rs_open:                               ; @rs_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x0
	ldr	w0, [x0]
	tbnz	w0, #31, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _NR_PORTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NR_PORTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ge	LBB0_4
; %bb.2:
	mov	x19, x1
	add	x1, sp, #8
	bl	_get_async_struct
	cbnz	w0, LBB0_6
; %bb.3:
	ldr	x0, [sp, #8]
	str	x0, [x20, #16]
	str	x20, [x0, #8]
	ldr	w1, [x20, #4]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	bl	_serial_paranoia_check
	cbz	x0, LBB0_7
LBB0_4:
Lloh5:
	adrp	x8, _ENODEV@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_7:
	ldr	x8, [sp, #8]
Lloh7:
	adrp	x9, _ASYNC_LOW_LATENCY@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ASYNC_LOW_LATENCY@GOTPAGEOFF]
	ldr	w10, [x8]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w10
	cset	w9, ne
	ldr	x8, [x8, #8]
	str	w9, [x8, #8]
	mov	x0, x19
	bl	_tty_hung_up_p
	mov	x8, x0
	ldr	x0, [sp, #8]
	ldr	w9, [x0]
Lloh10:
	adrp	x10, _ASYNC_CLOSING@GOTPAGE
Lloh11:
	ldr	x10, [x10, _ASYNC_CLOSING@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	and	w9, w10, w9
	cbz	x8, LBB0_9
; %bb.8:
	cbnz	w9, LBB0_10
	b	LBB0_11
LBB0_9:
	cbz	w9, LBB0_12
LBB0_10:
	add	x0, x0, #4
	bl	_interruptible_sleep_on
LBB0_11:
Lloh13:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_5
LBB0_12:
	bl	_startup
	cbnz	w0, LBB0_6
; %bb.13:
	ldr	x2, [sp, #8]
	mov	x0, x20
	mov	x1, x19
	bl	_block_til_ready
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_NR_PORTS,4,2                   ; @NR_PORTS
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rs_open"

	.comm	_ASYNC_LOW_LATENCY,4,2          ; @ASYNC_LOW_LATENCY
	.comm	_ASYNC_CLOSING,4,2              ; @ASYNC_CLOSING
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_ASYNC_HUP_NOTIFY,4,2           ; @ASYNC_HUP_NOTIFY
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.no_dead_strip	_rs_open
.subsections_via_symbols
