	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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	%rsi, %r15
	movl	%edi, %ebx
	leaq	L_.str(%rip), %rdx
	callq	_getopt
	cmpl	$-1, %eax
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_usage
	movl	%ebx, %edi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_getopt
	cmpl	$-1, %eax
	jne	LBB0_2
LBB0_3:
	movq	_optind@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_STDIN_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ttyname
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_7
## %bb.4:
	movq	_STDOUT_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ttyname
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_7
## %bb.5:
	movq	_STDERR_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ttyname
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r14d, %r14d
	movl	$2, %edi
	xorl	%eax, %eax
	callq	_err
LBB0_7:
	leaq	-32(%rbp), %rsi
	movq	%r14, %rdi
	callq	_stat
	testq	%rax, %rax
	jns	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rsi
	movl	$2, %edi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_err
LBB0_9:
	movq	(%r15,%rbx,8), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.12:
	movsbl	(%rax), %eax
	cmpl	$110, %eax
	je	LBB0_17
## %bb.13:
	cmpl	$121, %eax
	je	LBB0_14
## %bb.20:
	xorl	%eax, %eax
	callq	_usage
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_S_IWGRP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -32(%rbp)
	jne	LBB0_21
## %bb.11:
	leaq	L_.str.4(%rip), %rdi
	callq	_puts
	movl	$1, %edi
	callq	_exit
LBB0_17:
	movq	_S_IWGRP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	notl	%esi
	andl	-32(%rbp), %esi
	movq	%r14, %rdi
	callq	_chmod
	testl	%eax, %eax
	jns	LBB0_19
## %bb.18:
	leaq	L_.str.2(%rip), %rsi
	movl	$2, %edi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_err
LBB0_19:
	movl	$1, %edi
	callq	_exit
LBB0_14:
	movq	_S_IWGRP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	-32(%rbp), %esi
	movq	%r14, %rdi
	callq	_chmod
	testl	%eax, %eax
	jns	LBB0_16
## %bb.15:
	leaq	L_.str.2(%rip), %rsi
	movl	$2, %edi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_err
LBB0_16:
	xorl	%edi, %edi
	callq	_exit
LBB0_21:
	leaq	L_.str.3(%rip), %rdi
	callq	_puts
	xorl	%edi, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

	.comm	_optind,8,3                     ## @optind
	.comm	_STDIN_FILENO,4,2               ## @STDIN_FILENO
	.comm	_STDOUT_FILENO,4,2              ## @STDOUT_FILENO
	.comm	_STDERR_FILENO,4,2              ## @STDERR_FILENO
L_.str.1:                               ## @.str.1
	.asciz	"ttyname"

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

	.comm	_S_IWGRP,4,2                    ## @S_IWGRP
L_.str.3:                               ## @.str.3
	.asciz	"is y"

L_.str.4:                               ## @.str.4
	.asciz	"is n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	bl	_getopt
	cmn	w0, #1
	b.eq	LBB0_3
; %bb.1:
Lloh2:
	adrp	x21, l_.str@PAGE
Lloh3:
	add	x21, x21, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	bl	_usage
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_getopt
	cmn	w0, #1
	b.ne	LBB0_2
LBB0_3:
Lloh4:
	adrp	x8, _optind@GOTPAGE
Lloh5:
	ldr	x8, [x8, _optind@GOTPAGEOFF]
Lloh6:
	ldr	x21, [x8]
Lloh7:
	adrp	x8, _STDIN_FILENO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _STDIN_FILENO@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_ttyname
	mov	x20, x0
	cbnz	x0, LBB0_7
; %bb.4:
Lloh10:
	adrp	x8, _STDOUT_FILENO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _STDOUT_FILENO@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_ttyname
	mov	x20, x0
	cbnz	x0, LBB0_7
; %bb.5:
Lloh13:
	adrp	x8, _STDERR_FILENO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _STDERR_FILENO@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_ttyname
	mov	x20, x0
	cbnz	x0, LBB0_7
; %bb.6:
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #2
	bl	_err
LBB0_7:
	add	x1, sp, #8
	mov	x0, x20
	bl	_stat
	tbz	x0, #63, LBB0_9
; %bb.8:
	str	x20, [sp]
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #2
	bl	_err
LBB0_9:
	ldr	x8, [x19, x21, lsl #3]
	cbz	x8, LBB0_13
; %bb.10:
	ldrsb	w8, [x8]
	cmp	w8, #110
	b.eq	LBB0_15
; %bb.11:
	cmp	w8, #121
	b.eq	LBB0_18
; %bb.12:
	bl	_usage
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_13:
	ldr	w8, [sp, #8]
Lloh20:
	adrp	x9, _S_IWGRP@GOTPAGE
Lloh21:
	ldr	x9, [x9, _S_IWGRP@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_21
; %bb.14:
Lloh23:
	adrp	x0, l_.str.4@PAGE
Lloh24:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_puts
	mov	w0, #1
	bl	_exit
LBB0_15:
	ldr	w8, [sp, #8]
Lloh25:
	adrp	x9, _S_IWGRP@GOTPAGE
Lloh26:
	ldr	x9, [x9, _S_IWGRP@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	bic	w1, w8, w9
	mov	x0, x20
	bl	_chmod
	tbz	w0, #31, LBB0_17
; %bb.16:
	str	x20, [sp]
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #2
	bl	_err
LBB0_17:
	mov	w0, #1
	bl	_exit
LBB0_18:
	ldr	w8, [sp, #8]
Lloh30:
	adrp	x9, _S_IWGRP@GOTPAGE
Lloh31:
	ldr	x9, [x9, _S_IWGRP@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x20
	bl	_chmod
	tbz	w0, #31, LBB0_20
; %bb.19:
	str	x20, [sp]
Lloh33:
	adrp	x1, l_.str.2@PAGE
Lloh34:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #2
	bl	_err
LBB0_20:
	mov	w0, #0
	bl	_exit
LBB0_21:
Lloh35:
	adrp	x0, l_.str.3@PAGE
Lloh36:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_puts
	mov	w0, #0
	bl	_exit
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

	.comm	_optind,8,3                     ; @optind
	.comm	_STDIN_FILENO,4,2               ; @STDIN_FILENO
	.comm	_STDOUT_FILENO,4,2              ; @STDOUT_FILENO
	.comm	_STDERR_FILENO,4,2              ; @STDERR_FILENO
l_.str.1:                               ; @.str.1
	.asciz	"ttyname"

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

	.comm	_S_IWGRP,4,2                    ; @S_IWGRP
l_.str.3:                               ; @.str.3
	.asciz	"is y"

l_.str.4:                               ; @.str.4
	.asciz	"is n"

.subsections_via_symbols
