	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ttyopen
_ttyopen:                               ## @ttyopen
	.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
	leaq	-32(%rbp), %rsi
	callq	_tcgetattr
	movl	-32(%rbp), %eax
	movl	%eax, -24(%rbp)
	leaq	-24(%rbp), %r14
	movq	%r14, %rdi
	callq	_cfmakeraw
	movq	_CLOCAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, -24(%rbp)
	movl	(%rbx), %edi
	movq	_TCSANOW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdx
	callq	_tcsetattr
	movq	_uart_stdio@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movl	-32(%rbp), %eax
	movq	_tio_stdio_orig@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_ttyclose@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_atexit
LBB0_2:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CLOCAL,4,2                     ## @CLOCAL
	.comm	_TCSANOW,4,2                    ## @TCSANOW
	.comm	_uart_stdio,8,3                 ## @uart_stdio
	.comm	_tio_stdio_orig,4,2             ## @tio_stdio_orig
	.comm	_ttyclose,4,2                   ## @ttyclose
	.no_dead_strip	_ttyopen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ttyopen
_ttyopen:                               ; @ttyopen
	.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	x19, x0
	ldr	w0, [x0]
	add	x1, sp, #8
	bl	_tcgetattr
	ldr	w8, [sp, #8]
	str	w8, [sp]
	mov	x0, sp
	bl	_cfmakeraw
Lloh0:
	adrp	x8, _CLOCAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CLOCAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [sp]
	orr	w8, w9, w8
	str	w8, [sp]
	ldr	w0, [x19]
Lloh3:
	adrp	x8, _TCSANOW@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TCSANOW@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x2, sp
	bl	_tcsetattr
Lloh6:
	adrp	x8, _uart_stdio@GOTPAGE
Lloh7:
	ldr	x8, [x8, _uart_stdio@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w8, [sp, #8]
Lloh9:
	adrp	x9, _tio_stdio_orig@GOTPAGE
Lloh10:
	ldr	x9, [x9, _tio_stdio_orig@GOTPAGEOFF]
Lloh11:
	str	w8, [x9]
Lloh12:
	adrp	x8, _ttyclose@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ttyclose@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_atexit
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotStr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_CLOCAL,4,2                     ; @CLOCAL
	.comm	_TCSANOW,4,2                    ; @TCSANOW
	.comm	_uart_stdio,8,3                 ; @uart_stdio
	.comm	_tio_stdio_orig,4,2             ; @tio_stdio_orig
	.comm	_ttyclose,4,2                   ; @ttyclose
	.no_dead_strip	_ttyopen
.subsections_via_symbols
