	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_real_tty_init                  ## -- Begin function real_tty_init
	.p2align	4, 0x90
_real_tty_init:                         ## @real_tty_init
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	_REAL_TTY_NUM@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.1:
	movq	%rdi, %r14
	movq	_STDIN_FILENO@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_TIOCGWINSZ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_2
## %bb.4:
	movaps	-48(%rbp), %xmm0
	movups	%xmm0, 16(%r14)
	movl	(%rbx), %edi
	leaq	-32(%rbp), %rsi
	callq	_tcgetattr
	testq	%rax, %rax
	js	LBB0_3
## %bb.5:
	movl	-32(%rbp), %edi
	callq	_termios_from_real
	movl	%eax, 12(%r14)
	movl	-32(%rbp), %eax
	movq	_old_termios@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	leaq	-32(%rbp), %r15
	movq	%r15, %rdi
	callq	_cfmakeraw
	movl	(%rbx), %edi
	movq	_TCSANOW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdx
	callq	_tcsetattr
	testq	%rax, %rax
	jns	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rdi
	callq	_ERRNO_DIE
	jmp	LBB0_7
LBB0_2:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ENOTTY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
LBB0_7:
	leaq	8(%r14), %r15
	movq	_real_tty_read_thread@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	movq	%r14, %rcx
	callq	_pthread_create
	testq	%rax, %rax
	js	LBB0_8
## %bb.9:
	movl	(%r15), %edi
	callq	_pthread_detach
	jmp	LBB0_10
LBB0_3:
	xorl	%eax, %eax
	callq	_errno_map
	movl	%eax, %ebx
	jmp	LBB0_10
LBB0_8:
	movq	__EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REAL_TTY_NUM,8,3               ## @REAL_TTY_NUM
	.comm	_STDIN_FILENO,4,2               ## @STDIN_FILENO
	.comm	_TIOCGWINSZ,4,2                 ## @TIOCGWINSZ
	.comm	_errno,8,3                      ## @errno
	.comm	_ENOTTY,8,3                     ## @ENOTTY
	.comm	_old_termios,4,2                ## @old_termios
	.comm	_TCSANOW,4,2                    ## @TCSANOW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to set terminal to raw mode"

	.comm	_real_tty_read_thread,8,3       ## @real_tty_read_thread
	.comm	__EIO,4,2                       ## @_EIO
	.comm	_ONLCR,4,2                      ## @ONLCR
	.comm	_OPOST,4,2                      ## @OPOST
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_real_tty_init                  ; -- Begin function real_tty_init
	.p2align	2
_real_tty_init:                         ; @real_tty_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _REAL_TTY_NUM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _REAL_TTY_NUM@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x20, _STDIN_FILENO@GOTPAGE
Lloh4:
	ldr	x20, [x20, _STDIN_FILENO@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh5:
	adrp	x8, _TIOCGWINSZ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TIOCGWINSZ@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x2, sp, #16
	bl	_ioctl
	tbnz	x0, #63, LBB0_5
; %bb.2:
	ldr	q0, [sp, #16]
	str	q0, [x19, #16]
	ldr	w0, [x20]
	add	x1, sp, #8
	bl	_tcgetattr
	tbnz	x0, #63, LBB0_9
; %bb.3:
	ldr	w0, [sp, #8]
	bl	_termios_from_real
	str	w0, [x19, #12]
	ldr	w8, [sp, #8]
Lloh8:
	adrp	x9, _old_termios@GOTPAGE
Lloh9:
	ldr	x9, [x9, _old_termios@GOTPAGEOFF]
Lloh10:
	str	w8, [x9]
	add	x0, sp, #8
	bl	_cfmakeraw
	ldr	w0, [x20]
Lloh11:
	adrp	x8, _TCSANOW@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TCSANOW@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_tcsetattr
	tbz	x0, #63, LBB0_6
; %bb.4:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERRNO_DIE
	b	LBB0_6
LBB0_5:
Lloh16:
	adrp	x8, _errno@GOTPAGE
Lloh17:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
Lloh19:
	adrp	x9, _ENOTTY@GOTPAGE
Lloh20:
	ldr	x9, [x9, _ENOTTY@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
LBB0_6:
	add	x20, x19, #8
Lloh22:
	adrp	x8, _real_tty_read_thread@GOTPAGE
Lloh23:
	ldr	x8, [x8, _real_tty_read_thread@GOTPAGEOFF]
Lloh24:
	ldr	x2, [x8]
	mov	x0, x20
	mov	x1, #0
	mov	x3, x19
	bl	_pthread_create
	tbnz	x0, #63, LBB0_10
; %bb.7:
	ldr	w0, [x20]
	bl	_pthread_detach
LBB0_8:
	mov	w0, #0
	b	LBB0_11
LBB0_9:
	bl	_errno_map
	b	LBB0_11
LBB0_10:
Lloh25:
	adrp	x8, __EIO@GOTPAGE
Lloh26:
	ldr	x8, [x8, __EIO@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
LBB0_11:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_REAL_TTY_NUM,8,3               ; @REAL_TTY_NUM
	.comm	_STDIN_FILENO,4,2               ; @STDIN_FILENO
	.comm	_TIOCGWINSZ,4,2                 ; @TIOCGWINSZ
	.comm	_errno,8,3                      ; @errno
	.comm	_ENOTTY,8,3                     ; @ENOTTY
	.comm	_old_termios,4,2                ; @old_termios
	.comm	_TCSANOW,4,2                    ; @TCSANOW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to set terminal to raw mode"

	.comm	_real_tty_read_thread,8,3       ; @real_tty_read_thread
	.comm	__EIO,4,2                       ; @_EIO
	.comm	_ONLCR,4,2                      ; @ONLCR
	.comm	_OPOST,4,2                      ; @OPOST
.subsections_via_symbols
