	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_check_writeable                ## -- Begin function check_writeable
	.p2align	4, 0x90
_check_writeable:                       ## @check_writeable
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_STDERR_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ttyname
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_err
LBB0_2:
	leaq	-16(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_stat
	testq	%rax, %rax
	jns	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_err
LBB0_4:
	movq	_S_IWGRP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -16(%rbp)
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	callq	_errx
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STDERR_FILENO,4,2              ## @STDERR_FILENO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ttyname"

L_.str.1:                               ## @.str.1
	.asciz	"%s"

	.comm	_S_IWGRP,4,2                    ## @S_IWGRP
L_.str.2:                               ## @.str.2
	.asciz	"The callee cannot write to this terminal, use \"mesg y\"."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_check_writeable                ; -- Begin function check_writeable
	.p2align	2
_check_writeable:                       ; @check_writeable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
Lloh0:
	adrp	x8, _STDERR_FILENO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STDERR_FILENO@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_ttyname
	mov	x19, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	add	x1, sp, #8
	mov	x0, x19
	bl	_stat
	tbz	x0, #63, LBB0_4
; %bb.3:
	str	x19, [sp]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_4:
	ldr	w8, [sp, #8]
Lloh7:
	adrp	x9, _S_IWGRP@GOTPAGE
Lloh8:
	ldr	x9, [x9, _S_IWGRP@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_6
; %bb.5:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_STDERR_FILENO,4,2              ; @STDERR_FILENO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ttyname"

l_.str.1:                               ; @.str.1
	.asciz	"%s"

	.comm	_S_IWGRP,4,2                    ; @S_IWGRP
l_.str.2:                               ; @.str.2
	.asciz	"The callee cannot write to this terminal, use \"mesg y\"."

.subsections_via_symbols
