	.file	"154827583.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"stdio rpath fattr"
.LC1:
	.string	"pledge"
.LC2:
	.string	""
.LC3:
	.string	"ttyname"
.LC4:
	.string	"%s"
.LC5:
	.string	"is y\n"
.LC6:
	.string	"is n\n"
.LC7:
	.string	"usage: mesg [n | 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, 192
	mov	DWORD PTR -180[rbp], edi
	mov	QWORD PTR -192[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	pledge@PLT
	cmp	eax, -1
	jne	.L14
	lea	rsi, .LC1[rip]
	mov	edi, 2
	mov	eax, 0
	call	err@PLT
.L14:
	nop
	mov	rcx, QWORD PTR -192[rbp]
	mov	eax, DWORD PTR -180[rbp]
	lea	rdx, .LC2[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	getopt@PLT
	mov	DWORD PTR -172[rbp], eax
	cmp	DWORD PTR -172[rbp], -1
	jne	.L15
	mov	eax, DWORD PTR optind[rip]
	sub	DWORD PTR -180[rbp], eax
	mov	eax, DWORD PTR optind[rip]
	cdqe
	sal	rax, 3
	add	QWORD PTR -192[rbp], rax
	mov	edi, 2
	call	ttyname@PLT
	mov	QWORD PTR -168[rbp], rax
	cmp	QWORD PTR -168[rbp], 0
	jne	.L6
	lea	rsi, .LC3[rip]
	mov	edi, 2
	mov	eax, 0
	call	err@PLT
.L6:
	lea	rdx, -160[rbp]
	mov	rax, QWORD PTR -168[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	test	eax, eax
	jns	.L7
	mov	rax, QWORD PTR -168[rbp]
	mov	rdx, rax
	lea	rsi, .LC4[rip]
	mov	edi, 2
	mov	eax, 0
	call	err@PLT
.L7:
	mov	eax, DWORD PTR -136[rbp]
	and	eax, 511
	mov	DWORD PTR -136[rbp], eax
	mov	rax, QWORD PTR -192[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L8
	mov	eax, DWORD PTR -136[rbp]
	and	eax, 16
	test	eax, eax
	je	.L9
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 5
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	edi, 0
	call	exit@PLT
.L9:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 5
	mov	esi, 1
	lea	rdi, .LC6[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	rax, QWORD PTR -192[rbp]
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	cmp	eax, 110
	je	.L10
	cmp	eax, 121
	jne	.L4
	mov	eax, DWORD PTR -136[rbp]
	or	eax, 16
	mov	edx, eax
	mov	rax, QWORD PTR -168[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	chmod@PLT
	test	eax, eax
	jns	.L11
	mov	rax, QWORD PTR -168[rbp]
	mov	rdx, rax
	lea	rsi, .LC4[rip]
	mov	edi, 2
	mov	eax, 0
	call	err@PLT
.L11:
	mov	edi, 0
	call	exit@PLT
.L10:
	mov	eax, DWORD PTR -136[rbp]
	and	eax, -17
	mov	edx, eax
	mov	rax, QWORD PTR -168[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	chmod@PLT
	test	eax, eax
	jns	.L12
	mov	rax, QWORD PTR -168[rbp]
	mov	rdx, rax
	lea	rsi, .LC4[rip]
	mov	edi, 2
	mov	eax, 0
	call	err@PLT
.L12:
	mov	edi, 1
	call	exit@PLT
.L15:
	nop
.L4:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 20
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	mov	edi, 2
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.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	"154827583.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"stdio rpath fattr\000"
	.align	2
.LC1:
	.ascii	"pledge\000"
	.align	2
.LC2:
	.ascii	"\000"
	.align	2
.LC3:
	.ascii	"ttyname\000"
	.align	2
.LC4:
	.ascii	"%s\000"
	.align	2
.LC5:
	.ascii	"is y\012\000"
	.align	2
.LC6:
	.ascii	"is n\012\000"
	.align	2
.LC7:
	.ascii	"usage: mesg [n | y]\012\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 112
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #112
	str	r0, [fp, #-112]
	str	r1, [fp, #-116]
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #0
	ldr	r0, .L16+4
	bl	pledge
	mov	r3, r0
	cmn	r3, #1
	bne	.L14
	ldr	r1, .L16+8
	mov	r0, #2
	bl	err
.L14:
	nop
	ldr	r2, .L16+12
	ldr	r1, [fp, #-116]
	ldr	r0, [fp, #-112]
	bl	getopt
	str	r0, [fp, #-108]
	ldr	r3, [fp, #-108]
	cmn	r3, #1
	bne	.L15
	ldr	r3, .L16+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-112]
	sub	r3, r2, r3
	str	r3, [fp, #-112]
	ldr	r3, .L16+16
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-116]
	add	r3, r2, r3
	str	r3, [fp, #-116]
	mov	r0, #2
	bl	ttyname
	str	r0, [fp, #-104]
	ldr	r3, [fp, #-104]
	cmp	r3, #0
	bne	.L6
	ldr	r1, .L16+20
	mov	r0, #2
	bl	err
.L6:
	sub	r3, fp, #100
	mov	r1, r3
	ldr	r0, [fp, #-104]
	bl	stat
	mov	r3, r0
	cmp	r3, #0
	bge	.L7
	ldr	r2, [fp, #-104]
	ldr	r1, .L16+24
	mov	r0, #2
	bl	err
.L7:
	ldr	r3, [fp, #-84]
	lsl	r3, r3, #23
	lsr	r3, r3, #23
	str	r3, [fp, #-84]
	ldr	r3, [fp, #-116]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L8
	ldr	r3, [fp, #-84]
	and	r3, r3, #16
	cmp	r3, #0
	beq	.L9
	ldr	r3, .L16+28
	ldr	r3, [r3]
	mov	r2, #5
	mov	r1, #1
	ldr	r0, .L16+32
	bl	fwrite
	mov	r0, #0
	bl	exit
.L9:
	ldr	r3, .L16+28
	ldr	r3, [r3]
	mov	r2, #5
	mov	r1, #1
	ldr	r0, .L16+36
	bl	fwrite
	mov	r0, #1
	bl	exit
.L8:
	ldr	r3, [fp, #-116]
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #110
	beq	.L10
	cmp	r3, #121
	bne	.L4
	ldr	r3, [fp, #-84]
	orr	r3, r3, #16
	mov	r1, r3
	ldr	r0, [fp, #-104]
	bl	chmod
	mov	r3, r0
	cmp	r3, #0
	bge	.L11
	ldr	r2, [fp, #-104]
	ldr	r1, .L16+24
	mov	r0, #2
	bl	err
.L11:
	mov	r0, #0
	bl	exit
.L10:
	ldr	r3, [fp, #-84]
	bic	r3, r3, #16
	mov	r1, r3
	ldr	r0, [fp, #-104]
	bl	chmod
	mov	r3, r0
	cmp	r3, #0
	bge	.L12
	ldr	r2, [fp, #-104]
	ldr	r1, .L16+24
	mov	r0, #2
	bl	err
.L12:
	mov	r0, #1
	bl	exit
.L15:
	nop
.L4:
	ldr	r3, .L16+28
	ldr	r3, [r3]
	mov	r2, #20
	mov	r1, #1
	ldr	r0, .L16+40
	bl	fwrite
	mov	r0, #2
	bl	exit
.L17:
	.align	2
.L16:
	.word	.LC8
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	optind
	.word	.LC3
	.word	.LC4
	.word	stderr
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
