	.file	"118331.c"
	.intel_syntax noprefix
	.text
	.globl	report_and_exit
	.type	report_and_exit, @function
report_and_exit:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, -1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	report_and_exit, .-report_and_exit
	.section	.rodata
.LC0:
	.string	"data.dat"
.LC1:
	.string	"open to read failed..."
.LC2:
	.string	"file is still write locked..."
.LC3:
	.string	"can't get a read-only lock..."
.LC4:
	.string	"explicit unlocking failed..."
	.text
	.globl	main
	.type	main, @function
main:
.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, 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	WORD PTR -48[rbp], 1
	mov	WORD PTR -46[rbp], 0
	mov	QWORD PTR -40[rbp], 0
	mov	QWORD PTR -32[rbp], 0
	call	getpid@PLT
	mov	DWORD PTR -24[rbp], eax
	mov	esi, 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], 0
	jns	.L3
	lea	rdi, .LC1[rip]
	call	report_and_exit
.L3:
	lea	rdx, -48[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, 5
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	movzx	eax, WORD PTR -48[rbp]
	cmp	ax, 2
	je	.L4
	lea	rdi, .LC2[rip]
	call	report_and_exit
.L4:
	mov	WORD PTR -48[rbp], 0
	lea	rdx, -48[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, 6
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	test	eax, eax
	jns	.L6
	lea	rdi, .LC3[rip]
	call	report_and_exit
	jmp	.L6
.L7:
	lea	rax, -56[rbp]
	mov	edx, 1
	mov	rsi, rax
	mov	edi, 1
	call	write@PLT
.L6:
	lea	rcx, -56[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	test	rax, rax
	jg	.L7
	mov	WORD PTR -48[rbp], 2
	lea	rdx, -48[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, 6
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	test	eax, eax
	jns	.L8
	lea	rdi, .LC4[rip]
	call	report_and_exit
.L8:
	mov	eax, DWORD PTR -52[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"118331.c"
	.text
	.align	2
	.global	report_and_exit
	.syntax unified
	.arm
	.fpu softvfp
	.type	report_and_exit, %function
report_and_exit:
	@ 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	r0, [fp, #-8]
	bl	perror
	mvn	r0, #0
	bl	exit
	.size	report_and_exit, .-report_and_exit
	.section	.rodata
	.align	2
.LC0:
	.ascii	"data.dat\000"
	.align	2
.LC1:
	.ascii	"open to read failed...\000"
	.align	2
.LC2:
	.ascii	"file is still write locked...\000"
	.align	2
.LC3:
	.ascii	"can't get a read-only lock...\000"
	.align	2
.LC4:
	.ascii	"explicit unlocking failed...\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	strh	r3, [fp, #-24]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-22]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-16]
	bl	getpid
	mov	r3, r0
	str	r3, [fp, #-12]
	mov	r1, #0
	ldr	r0, .L11+4
	bl	open
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L11+8
	bl	report_and_exit
.L3:
	sub	r3, fp, #24
	mov	r2, r3
	mov	r1, #5
	ldr	r0, [fp, #-28]
	bl	fcntl
	ldrsh	r3, [fp, #-24]
	cmp	r3, #2
	beq	.L4
	ldr	r0, .L11+12
	bl	report_and_exit
.L4:
	mov	r3, #0
	strh	r3, [fp, #-24]	@ movhi
	sub	r3, fp, #24
	mov	r2, r3
	mov	r1, #6
	ldr	r0, [fp, #-28]
	bl	fcntl
	mov	r3, r0
	cmp	r3, #0
	bge	.L6
	ldr	r0, .L11+16
	bl	report_and_exit
	b	.L6
.L7:
	sub	r3, fp, #32
	mov	r2, #1
	mov	r1, r3
	mov	r0, #1
	bl	write
.L6:
	sub	r3, fp, #32
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-28]
	bl	read
	mov	r3, r0
	cmp	r3, #0
	bgt	.L7
	mov	r3, #2
	strh	r3, [fp, #-24]	@ movhi
	sub	r3, fp, #24
	mov	r2, r3
	mov	r1, #6
	ldr	r0, [fp, #-28]
	bl	fcntl
	mov	r3, r0
	cmp	r3, #0
	bge	.L8
	ldr	r0, .L11+20
	bl	report_and_exit
.L8:
	ldr	r0, [fp, #-28]
	bl	close
	mov	r3, #0
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC5
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
