	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open_terminal
_open_terminal:                         ## @open_terminal
	.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
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_stderr@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_fileno
	movl	%eax, %edi
	callq	_isatty
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %edi
	callq	_fileno
	movl	%eax, %edi
	callq	_ttyname
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_7
LBB0_2:
	movq	_stdout@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_fileno
	movl	%eax, %edi
	callq	_isatty
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	(%rbx), %edi
	callq	_fileno
	movl	%eax, %edi
	callq	_ttyname
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_7
LBB0_4:
	movq	_stdin@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_fileno
	movl	%eax, %edi
	callq	_isatty
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	(%rbx), %edi
	callq	_fileno
	movl	%eax, %edi
	callq	_ttyname
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_7
LBB0_6:
	movq	_TTY_DEVICE@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_7:
	movq	%rbx, %rdi
	callq	_dlg_strclone
	movq	%rax, (%r15)
	movq	%rbx, %rdi
	movl	%r14d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_open                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TTY_DEVICE,8,3                 ## @TTY_DEVICE
	.comm	_stderr,4,2                     ## @stderr
	.comm	_stdout,4,2                     ## @stdout
	.comm	_stdin,4,2                      ## @stdin
	.no_dead_strip	_open_terminal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_terminal
_open_terminal:                         ; @open_terminal
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x21, _stderr@GOTPAGE
Lloh1:
	ldr	x21, [x21, _stderr@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_fileno
	bl	_isatty
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x21]
	bl	_fileno
	bl	_ttyname
	mov	x21, x0
	cbnz	x0, LBB0_7
LBB0_2:
Lloh2:
	adrp	x21, _stdout@GOTPAGE
Lloh3:
	ldr	x21, [x21, _stdout@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_fileno
	bl	_isatty
	cbz	w0, LBB0_4
; %bb.3:
	ldr	w0, [x21]
	bl	_fileno
	bl	_ttyname
	mov	x21, x0
	cbnz	x0, LBB0_7
LBB0_4:
Lloh4:
	adrp	x21, _stdin@GOTPAGE
Lloh5:
	ldr	x21, [x21, _stdin@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_fileno
	bl	_isatty
	cbz	w0, LBB0_6
; %bb.5:
	ldr	w0, [x21]
	bl	_fileno
	bl	_ttyname
	mov	x21, x0
	cbnz	x0, LBB0_7
LBB0_6:
Lloh6:
	adrp	x8, _TTY_DEVICE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TTY_DEVICE@GOTPAGEOFF]
Lloh8:
	ldr	x21, [x8]
LBB0_7:
	mov	x0, x21
	bl	_dlg_strclone
	str	x0, [x20]
	mov	x0, x21
	mov	x1, x19
	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
	b	_open
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_TTY_DEVICE,8,3                 ; @TTY_DEVICE
	.comm	_stderr,4,2                     ; @stderr
	.comm	_stdout,4,2                     ; @stdout
	.comm	_stdin,4,2                      ; @stdin
	.no_dead_strip	_open_terminal
.subsections_via_symbols
