	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tty_init                       ## -- Begin function tty_init
	.p2align	4, 0x90
_tty_init:                              ## @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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_DEVTTY@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_open
	testl	%eax, %eax
	js	LBB0_5
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_fdopen
	movq	_ttyoutf@GOTPCREL(%rip), %r15
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	callq	_fdopen
	movq	%rax, %rcx
	movq	_ttyinf@GOTPCREL(%rip), %rax
	movq	%rcx, (%rax)
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_8
## %bb.3:
	movq	(%r15), %rdi
	callq	_fclose
LBB0_4:
	movl	%ebx, %edi
	callq	_close
LBB0_5:
	movq	_iflag@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.7:
	movl	(%r14), %edx
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	callq	_paxwarn
	movl	$-1, %eax
	jmp	LBB0_8
LBB0_6:
	xorl	%eax, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DEVTTY,4,2                     ## @DEVTTY
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"w"

	.comm	_ttyoutf,8,3                    ## @ttyoutf
L_.str.1:                               ## @.str.1
	.asciz	"r"

	.comm	_ttyinf,8,3                     ## @ttyinf
	.comm	_iflag,8,3                      ## @iflag
L_.str.2:                               ## @.str.2
	.asciz	"Fatal error, cannot open %s"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tty_init                       ; -- Begin function tty_init
	.p2align	2
_tty_init:                              ; @tty_init
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
Lloh0:
	adrp	x20, _DEVTTY@GOTPAGE
Lloh1:
	ldr	x20, [x20, _DEVTTY@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh2:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_open
	tbnz	w0, #31, LBB0_5
; %bb.1:
	mov	x19, x0
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fdopen
Lloh7:
	adrp	x21, _ttyoutf@GOTPAGE
Lloh8:
	ldr	x21, [x21, _ttyoutf@GOTPAGEOFF]
	str	x0, [x21]
	cbz	x0, LBB0_4
; %bb.2:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_fdopen
Lloh11:
	adrp	x8, _ttyinf@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ttyinf@GOTPAGEOFF]
Lloh13:
	str	x0, [x8]
	cbnz	x0, LBB0_7
; %bb.3:
	ldr	x0, [x21]
	bl	_fclose
LBB0_4:
	mov	x0, x19
	bl	_close
LBB0_5:
Lloh14:
	adrp	x8, _iflag@GOTPAGE
Lloh15:
	ldr	x8, [x8, _iflag@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.6:
	ldr	w2, [x20]
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_paxwarn
	mov	w0, #-1
	b	LBB0_8
LBB0_7:
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_DEVTTY,4,2                     ; @DEVTTY
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"w"

	.comm	_ttyoutf,8,3                    ; @ttyoutf
l_.str.1:                               ; @.str.1
	.asciz	"r"

	.comm	_ttyinf,8,3                     ; @ttyinf
	.comm	_iflag,8,3                      ; @iflag
l_.str.2:                               ; @.str.2
	.asciz	"Fatal error, cannot open %s"

.subsections_via_symbols
