	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_new_tty                        ## -- Begin function new_tty
	.p2align	4, 0x90
_new_tty:                               ## @new_tty
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_inferior_thisrun_terminal@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.1:
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_open
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:
	cmpl	$-1, %ebx
	je	LBB0_7
## %bb.3:
	xorl	%edi, %edi
	callq	_close
	movl	%ebx, %edi
	callq	_dup
	cmpl	$1, %ebx
	je	LBB0_5
LBB0_4:
	movl	$1, %edi
	callq	_close
	movl	%ebx, %edi
	callq	_dup
	cmpl	$2, %ebx
	je	LBB0_6
LBB0_5:
	movl	$2, %edi
	callq	_close
	movl	%ebx, %edi
	callq	_dup
	cmpl	$3, %ebx
	jl	LBB0_6
## %bb.8:
	movl	%ebx, %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_close                          ## TAILCALL
LBB0_6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	movq	(%r14), %rdi
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_print_sys_errmsg
	movl	$1, %edi
	callq	__exit
	.cfi_endproc
                                        ## -- End function
	.comm	_inferior_thisrun_terminal,8,3  ## @inferior_thisrun_terminal
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_errno,4,2                      ## @errno
	.comm	_O_NOCTTY,4,2                   ## @O_NOCTTY
	.comm	_SIGTTOU,4,2                    ## @SIGTTOU
	.comm	_TIOCNOTTY,4,2                  ## @TIOCNOTTY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_new_tty                        ; -- Begin function new_tty
	.p2align	2
_new_tty:                               ; @new_tty
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x20, _inferior_thisrun_terminal@GOTPAGE
Lloh1:
	ldr	x20, [x20, _inferior_thisrun_terminal@GOTPAGEOFF]
	ldr	x0, [x20]
	cbz	x0, LBB0_7
; %bb.1:
Lloh2:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_open
	mov	x19, x0
	cbz	w0, LBB0_4
; %bb.2:
	cmn	w19, #1
	b.eq	LBB0_8
; %bb.3:
	mov	w0, #0
	bl	_close
	mov	x0, x19
	bl	_dup
	cmp	w19, #1
	b.eq	LBB0_5
LBB0_4:
	mov	w0, #1
	bl	_close
	mov	x0, x19
	bl	_dup
	cmp	w19, #2
	b.eq	LBB0_7
LBB0_5:
	mov	w0, #2
	bl	_close
	mov	x0, x19
	bl	_dup
	cmp	w19, #3
	b.lt	LBB0_7
; %bb.6:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_close
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
	ldr	x0, [x20]
Lloh5:
	adrp	x8, _errno@GOTPAGE
Lloh6:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_print_sys_errmsg
	mov	w0, #1
	bl	__exit
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_inferior_thisrun_terminal,8,3  ; @inferior_thisrun_terminal
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_errno,4,2                      ; @errno
	.comm	_O_NOCTTY,4,2                   ; @O_NOCTTY
	.comm	_SIGTTOU,4,2                    ; @SIGTTOU
	.comm	_TIOCNOTTY,4,2                  ; @TIOCNOTTY
.subsections_via_symbols
