	.file	"818351.c"
	.intel_syntax noprefix
	.text
	.globl	sbuf
	.bss
	.align 32
	.type	sbuf, @object
	.size	sbuf, 144
sbuf:
	.zero	144
	.globl	tty
	.align 8
	.type	tty, @object
	.size	tty, 8
tty:
	.zero	8
	.section	.rodata
.LC0:
	.string	"cannot stat"
.LC1:
	.string	"is y\n"
.LC2:
	.string	"is n\n"
.LC3:
	.string	"usage: mesg [y] [n]"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -4[rbp], 0
	mov	edi, 2
	mov	eax, 0
	call	ttyname@PLT
	mov	QWORD PTR tty[rip], rax
	mov	rax, QWORD PTR tty[rip]
	lea	rsi, sbuf[rip]
	mov	rdi, rax
	call	stat@PLT
	test	eax, eax
	jns	.L2
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	error
.L2:
	cmp	DWORD PTR -20[rbp], 1
	jg	.L3
	mov	eax, DWORD PTR sbuf[rip+24]
	and	eax, 2
	test	eax, eax
	je	.L4
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 5
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	jmp	.L5
.L4:
	mov	DWORD PTR -4[rbp], 1
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 5
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	jmp	.L5
.L3:
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	cmp	eax, 110
	je	.L6
	cmp	eax, 121
	jne	.L7
	mov	edi, 402
	mov	eax, 0
	call	newmode
	jmp	.L5
.L6:
	mov	edi, 384
	mov	eax, 0
	call	newmode
	mov	DWORD PTR -4[rbp], 1
	jmp	.L5
.L7:
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	error
.L5:
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC4:
	.string	"mesg: %s\n"
	.text
	.globl	error
	.type	error, @function
error:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, -1
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	error, .-error
	.section	.rodata
.LC5:
	.string	"cannot change mode"
	.text
	.globl	newmode
	.type	newmode, @function
newmode:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	mov	edx, DWORD PTR -4[rbp]
	mov	rax, QWORD PTR tty[rip]
	mov	esi, edx
	mov	rdi, rax
	call	chmod@PLT
	test	eax, eax
	jns	.L10
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	error
.L10:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	newmode, .-newmode
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"818351.c"
	.text
	.comm	sbuf,88,8
	.comm	tty,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"cannot stat\000"
	.align	2
.LC1:
	.ascii	"is y\012\000"
	.align	2
.LC2:
	.ascii	"is n\012\000"
	.align	2
.LC3:
	.ascii	"usage: mesg [y] [n]\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-8]
	mov	r0, #2
	bl	ttyname
	mov	r3, r0
	ldr	r2, .L8
	str	r3, [r2]
	ldr	r3, .L8
	ldr	r3, [r3]
	ldr	r1, .L8+4
	mov	r0, r3
	bl	stat
	mov	r3, r0
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L8+8
	bl	error
.L2:
	ldr	r3, [fp, #-16]
	cmp	r3, #1
	bgt	.L3
	ldr	r3, .L8+4
	ldr	r3, [r3, #16]
	and	r3, r3, #2
	cmp	r3, #0
	beq	.L4
	ldr	r3, .L8+12
	ldr	r3, [r3]
	mov	r2, #5
	mov	r1, #1
	ldr	r0, .L8+16
	bl	fwrite
	b	.L5
.L4:
	mov	r3, #1
	str	r3, [fp, #-8]
	ldr	r3, .L8+12
	ldr	r3, [r3]
	mov	r2, #5
	mov	r1, #1
	ldr	r0, .L8+20
	bl	fwrite
	b	.L5
.L3:
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #110
	beq	.L6
	cmp	r3, #121
	bne	.L7
	ldr	r0, .L8+24
	bl	newmode
	b	.L5
.L6:
	mov	r0, #384
	bl	newmode
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L5
.L7:
	ldr	r0, .L8+28
	bl	error
.L5:
	ldr	r0, [fp, #-8]
	bl	exit
.L9:
	.align	2
.L8:
	.word	tty
	.word	sbuf
	.word	.LC0
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	402
	.word	.LC3
	.size	main, .-main
	.section	.rodata
	.align	2
.LC4:
	.ascii	"mesg: %s\012\000"
	.text
	.align	2
	.global	error
	.syntax unified
	.arm
	.fpu softvfp
	.type	error, %function
error:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, .L11
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r1, .L11+4
	mov	r0, r3
	bl	fprintf
	mvn	r0, #0
	bl	exit
.L12:
	.align	2
.L11:
	.word	stderr
	.word	.LC4
	.size	error, .-error
	.section	.rodata
	.align	2
.LC5:
	.ascii	"cannot change mode\000"
	.text
	.align	2
	.global	newmode
	.syntax unified
	.arm
	.fpu softvfp
	.type	newmode, %function
newmode:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, .L15
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	mov	r1, r2
	mov	r0, r3
	bl	chmod
	mov	r3, r0
	cmp	r3, #0
	bge	.L14
	ldr	r0, .L15+4
	bl	error
.L14:
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	tty
	.word	.LC5
	.size	newmode, .-newmode
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
