	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttysetup                       ## -- Begin function ttysetup
	.p2align	4, 0x90
_ttysetup:                              ## @ttysetup
	.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	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %ebx
	movq	_FD@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	leaq	-48(%rbp), %rsi
	callq	_tcgetattr
	movq	%rax, %rcx
	movl	$-1, %eax
	testq	%rcx, %rcx
	jne	LBB0_8
## %bb.1:
	leaq	-48(%rbp), %rdi
	movl	%ebx, %esi
	callq	_cfsetspeed
	movq	_CSIZE@GOTPCREL(%rip), %rax
	movq	_PARENB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	andl	-48(%rbp), %ecx
	movq	_CS8@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, -48(%rbp)
	movq	_DC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_value
	movl	%eax, %edi
	callq	_boolean
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_CLOCAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, -48(%rbp)
LBB0_3:
	movq	_HARDWAREFLOW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_value
	movl	%eax, %edi
	callq	_boolean
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_CRTSCTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, -48(%rbp)
LBB0_5:
	movq	_ISTRIP@GOTPCREL(%rip), %rax
	movq	_ICRNL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, -44(%rbp)
	movq	_OPOST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, -24(%rbp)
	movq	_ICANON@GOTPCREL(%rip), %rax
	movq	_ISIG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_IEXTEN@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_ECHO@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, -40(%rbp)
	movq	-32(%rbp), %rax
	movq	_VMIN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	$1, (%rax,%rcx,4)
	movq	_VTIME@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	$0, (%rax,%rcx,4)
	movq	_TAND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_value
	movl	%eax, %edi
	callq	_boolean
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_IXOFF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, -44(%rbp)
LBB0_7:
	movl	(%r14), %edi
	movq	_TCSAFLUSH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	callq	_tcsetattr
LBB0_8:
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FD,4,2                         ## @FD
	.comm	_CSIZE,4,2                      ## @CSIZE
	.comm	_PARENB,4,2                     ## @PARENB
	.comm	_CS8,4,2                        ## @CS8
	.comm	_DC,4,2                         ## @DC
	.comm	_CLOCAL,4,2                     ## @CLOCAL
	.comm	_HARDWAREFLOW,4,2               ## @HARDWAREFLOW
	.comm	_CRTSCTS,4,2                    ## @CRTSCTS
	.comm	_ISTRIP,4,2                     ## @ISTRIP
	.comm	_ICRNL,4,2                      ## @ICRNL
	.comm	_OPOST,4,2                      ## @OPOST
	.comm	_ICANON,4,2                     ## @ICANON
	.comm	_ISIG,4,2                       ## @ISIG
	.comm	_IEXTEN,4,2                     ## @IEXTEN
	.comm	_ECHO,4,2                       ## @ECHO
	.comm	_VMIN,8,3                       ## @VMIN
	.comm	_VTIME,8,3                      ## @VTIME
	.comm	_TAND,4,2                       ## @TAND
	.comm	_IXOFF,4,2                      ## @IXOFF
	.comm	_TCSAFLUSH,4,2                  ## @TCSAFLUSH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttysetup                       ; -- Begin function ttysetup
	.p2align	2
_ttysetup:                              ; @ttysetup
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _FD@GOTPAGE
Lloh1:
	ldr	x20, [x20, _FD@GOTPAGEOFF]
	ldr	w0, [x20]
	mov	x1, sp
	bl	_tcgetattr
	cbz	x0, LBB0_2
; %bb.1:
	mov	w0, #-1
	b	LBB0_9
LBB0_2:
	mov	x0, sp
	mov	x1, x19
	bl	_cfsetspeed
Lloh2:
	adrp	x8, _CSIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CSIZE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _PARENB@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PARENB@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [sp]
	bic	w8, w9, w8
Lloh8:
	adrp	x9, _CS8@GOTPAGE
Lloh9:
	ldr	x9, [x9, _CS8@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [sp]
Lloh11:
	adrp	x8, _DC@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DC@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_value
	bl	_boolean
	cbz	x0, LBB0_4
; %bb.3:
Lloh14:
	adrp	x8, _CLOCAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CLOCAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	w9, [sp]
	orr	w8, w9, w8
	str	w8, [sp]
LBB0_4:
Lloh17:
	adrp	x8, _HARDWAREFLOW@GOTPAGE
Lloh18:
	ldr	x8, [x8, _HARDWAREFLOW@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_value
	bl	_boolean
	cbz	x0, LBB0_6
; %bb.5:
Lloh20:
	adrp	x8, _CRTSCTS@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CRTSCTS@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	ldr	w9, [sp]
	orr	w8, w9, w8
	str	w8, [sp]
LBB0_6:
Lloh23:
	adrp	x8, _ISTRIP@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ISTRIP@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _ICRNL@GOTPAGE
Lloh27:
	ldr	x9, [x9, _ICRNL@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldp	w9, w10, [sp, #4]
	bic	w8, w9, w8
Lloh29:
	adrp	x9, _OPOST@GOTPAGE
Lloh30:
	ldr	x9, [x9, _OPOST@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	ldr	w11, [sp, #24]
	bic	w9, w11, w9
	str	w9, [sp, #24]
Lloh32:
	adrp	x9, _ICANON@GOTPAGE
Lloh33:
	ldr	x9, [x9, _ICANON@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
Lloh35:
	adrp	x11, _ISIG@GOTPAGE
Lloh36:
	ldr	x11, [x11, _ISIG@GOTPAGEOFF]
Lloh37:
	ldr	w11, [x11]
	orr	w9, w11, w9
Lloh38:
	adrp	x11, _IEXTEN@GOTPAGE
Lloh39:
	ldr	x11, [x11, _IEXTEN@GOTPAGEOFF]
Lloh40:
	ldr	w11, [x11]
	orr	w9, w9, w11
Lloh41:
	adrp	x11, _ECHO@GOTPAGE
Lloh42:
	ldr	x11, [x11, _ECHO@GOTPAGEOFF]
Lloh43:
	ldr	w11, [x11]
	orr	w9, w9, w11
	bic	w9, w10, w9
	stp	w8, w9, [sp, #4]
	ldr	x8, [sp, #16]
Lloh44:
	adrp	x9, _VMIN@GOTPAGE
Lloh45:
	ldr	x9, [x9, _VMIN@GOTPAGEOFF]
Lloh46:
	ldr	x9, [x9]
	mov	w10, #1
	str	w10, [x8, x9, lsl #2]
Lloh47:
	adrp	x9, _VTIME@GOTPAGE
Lloh48:
	ldr	x9, [x9, _VTIME@GOTPAGEOFF]
Lloh49:
	ldr	x9, [x9]
	str	wzr, [x8, x9, lsl #2]
Lloh50:
	adrp	x8, _TAND@GOTPAGE
Lloh51:
	ldr	x8, [x8, _TAND@GOTPAGEOFF]
Lloh52:
	ldr	w0, [x8]
	bl	_value
	bl	_boolean
	cbz	x0, LBB0_8
; %bb.7:
Lloh53:
	adrp	x8, _IXOFF@GOTPAGE
Lloh54:
	ldr	x8, [x8, _IXOFF@GOTPAGEOFF]
Lloh55:
	ldr	w8, [x8]
	ldr	w9, [sp, #4]
	orr	w8, w9, w8
	str	w8, [sp, #4]
LBB0_8:
	ldr	w0, [x20]
Lloh56:
	adrp	x8, _TCSAFLUSH@GOTPAGE
Lloh57:
	ldr	x8, [x8, _TCSAFLUSH@GOTPAGEOFF]
Lloh58:
	ldr	w1, [x8]
	mov	x2, sp
	bl	_tcsetattr
LBB0_9:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.cfi_endproc
                                        ; -- End function
	.comm	_FD,4,2                         ; @FD
	.comm	_CSIZE,4,2                      ; @CSIZE
	.comm	_PARENB,4,2                     ; @PARENB
	.comm	_CS8,4,2                        ; @CS8
	.comm	_DC,4,2                         ; @DC
	.comm	_CLOCAL,4,2                     ; @CLOCAL
	.comm	_HARDWAREFLOW,4,2               ; @HARDWAREFLOW
	.comm	_CRTSCTS,4,2                    ; @CRTSCTS
	.comm	_ISTRIP,4,2                     ; @ISTRIP
	.comm	_ICRNL,4,2                      ; @ICRNL
	.comm	_OPOST,4,2                      ; @OPOST
	.comm	_ICANON,4,2                     ; @ICANON
	.comm	_ISIG,4,2                       ; @ISIG
	.comm	_IEXTEN,4,2                     ; @IEXTEN
	.comm	_ECHO,4,2                       ; @ECHO
	.comm	_VMIN,8,3                       ; @VMIN
	.comm	_VTIME,8,3                      ; @VTIME
	.comm	_TAND,4,2                       ; @TAND
	.comm	_IXOFF,4,2                      ; @IXOFF
	.comm	_TCSAFLUSH,4,2                  ; @TCSAFLUSH
.subsections_via_symbols
