	.file	"331512.c"
	.intel_syntax noprefix
	.text
	.globl	lock_reg
	.type	lock_reg, @function
lock_reg:
.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, 80
	mov	DWORD PTR -52[rbp], edi
	mov	DWORD PTR -56[rbp], esi
	mov	DWORD PTR -60[rbp], edx
	mov	QWORD PTR -72[rbp], rcx
	mov	DWORD PTR -64[rbp], r8d
	mov	QWORD PTR -80[rbp], r9
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -60[rbp]
	mov	WORD PTR -48[rbp], ax
	mov	rax, QWORD PTR -72[rbp]
	mov	QWORD PTR -40[rbp], rax
	mov	eax, DWORD PTR -64[rbp]
	mov	WORD PTR -46[rbp], ax
	mov	rax, QWORD PTR -80[rbp]
	mov	QWORD PTR -32[rbp], rax
	lea	rdx, -48[rbp]
	mov	ecx, DWORD PTR -56[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, ecx
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	lock_reg, .-lock_reg
	.section	.rodata
	.align 8
.LC0:
	.string	"lock_test: fcntl F_GETLK call returned %d\n"
	.text
	.globl	lock_test
	.type	lock_test, @function
lock_test:
.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, 96
	mov	DWORD PTR -68[rbp], edi
	mov	DWORD PTR -72[rbp], esi
	mov	QWORD PTR -80[rbp], rdx
	mov	DWORD PTR -84[rbp], ecx
	mov	QWORD PTR -96[rbp], r8
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -72[rbp]
	mov	WORD PTR -48[rbp], ax
	mov	rax, QWORD PTR -80[rbp]
	mov	QWORD PTR -40[rbp], rax
	mov	eax, DWORD PTR -84[rbp]
	mov	WORD PTR -46[rbp], ax
	mov	rax, QWORD PTR -96[rbp]
	mov	QWORD PTR -32[rbp], rax
	lea	rdx, -48[rbp]
	mov	eax, DWORD PTR -68[rbp]
	mov	esi, 5
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], 0
	jns	.L5
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -52[rbp]
	jmp	.L10
.L5:
	movzx	eax, WORD PTR -48[rbp]
	cmp	ax, 2
	jne	.L7
	mov	eax, 0
	jmp	.L10
.L7:
	mov	eax, DWORD PTR -24[rbp]
	test	eax, eax
	je	.L8
	mov	eax, DWORD PTR -24[rbp]
	jmp	.L10
.L8:
	mov	eax, 1
.L10:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	lock_test, .-lock_test
	.section	.rodata
	.align 8
.LC1:
	.string	"Usage: checkLock filename\nChecks for ability to get advisory write lock on file filename.\nReturns 0 on success, 1 on failure.\n--checkSetLock option: Print warning if setting lock fails."
.LC2:
	.string	"--checkSetLock"
	.align 8
.LC3:
	.string	"WARNING: fcntl locks are not working.\nRunning processes are not protected against overwrite from other computers.\nfcntl call returned %d\n"
	.align 8
.LC4:
	.string	"checkLock: File %s is locked.\n"
	.align 8
.LC5:
	.string	"checkLock: File %s is locked by PID %d\n"
.LC6:
	.string	"File %s can't be opened: %s\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -36[rbp], 0
	cmp	DWORD PTR -52[rbp], 1
	jg	.L13
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L14
.L13:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L15
	movabs	rax, 7310238724270485551
	mov	QWORD PTR -23[rbp], rax
	mov	DWORD PTR -15[rbp], 1697605228
	mov	WORD PTR -11[rbp], 25976
	mov	BYTE PTR -9[rbp], 0
	lea	rax, -23[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	js	.L16
	mov	eax, DWORD PTR -28[rbp]
	mov	r9d, 0
	mov	r8d, 0
	mov	ecx, 0
	mov	edx, 0
	mov	esi, 6
	mov	edi, eax
	call	lock_reg
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jns	.L17
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	jmp	.L14
.L17:
	mov	eax, DWORD PTR -28[rbp]
	mov	r9d, 0
	mov	r8d, 0
	mov	ecx, 0
	mov	edx, 2
	mov	esi, 6
	mov	edi, eax
	call	lock_reg
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	close@PLT
.L16:
	mov	eax, 0
	jmp	.L14
.L15:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -32[rbp], eax
	cmp	DWORD PTR -32[rbp], 0
	jle	.L19
	mov	eax, DWORD PTR -32[rbp]
	mov	r8d, 0
	mov	ecx, 0
	mov	edx, 0
	mov	esi, 1
	mov	edi, eax
	call	lock_test
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 1
	jne	.L20
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L21
.L20:
	cmp	DWORD PTR -36[rbp], 0
	jle	.L21
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	edx, DWORD PTR -36[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
.L21:
	mov	eax, DWORD PTR -32[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L22
.L19:
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 2
	je	.L22
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -36[rbp], 1
.L22:
	cmp	DWORD PTR -36[rbp], 0
	setne	al
	movzx	eax, al
.L14:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"331512.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	lock_reg
	.syntax unified
	.arm
	.fpu softvfp
	.type	lock_reg, %function
lock_reg:
	@ args = 8, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	str	r2, [fp, #-40]
	str	r3, [fp, #-44]
	ldr	r3, .L4
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #16
	asr	r3, r3, #16
	strh	r3, [fp, #-24]	@ movhi
	ldr	r3, [fp, #-44]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #4]
	lsl	r3, r3, #16
	asr	r3, r3, #16
	strh	r3, [fp, #-22]	@ movhi
	ldr	r3, [fp, #8]
	str	r3, [fp, #-16]
	sub	r3, fp, #24
	mov	r2, r3
	ldr	r1, [fp, #-36]
	ldr	r0, [fp, #-32]
	bl	fcntl
	mov	r3, r0
	ldr	r2, .L4
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L3
	bl	__stack_chk_fail
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	.LC0
	.size	lock_reg, .-lock_reg
	.section	.rodata
	.align	2
.LC1:
	.ascii	"lock_test: fcntl F_GETLK call returned %d\012\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	lock_test
	.syntax unified
	.arm
	.fpu softvfp
	.type	lock_test, %function
lock_test:
	@ args = 4, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	str	r2, [fp, #-40]
	str	r3, [fp, #-44]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #16
	asr	r3, r3, #16
	strh	r3, [fp, #-24]	@ movhi
	ldr	r3, [fp, #-40]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #16
	asr	r3, r3, #16
	strh	r3, [fp, #-22]	@ movhi
	ldr	r3, [fp, #4]
	str	r3, [fp, #-16]
	sub	r3, fp, #24
	mov	r2, r3
	mov	r1, #5
	ldr	r0, [fp, #-32]
	bl	fcntl
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L7
	ldr	r1, [fp, #-28]
	ldr	r0, .L14+4
	bl	printf
	ldr	r3, [fp, #-28]
	b	.L12
.L7:
	ldrsh	r3, [fp, #-24]
	cmp	r3, #2
	bne	.L9
	mov	r3, #0
	b	.L12
.L9:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L10
	ldr	r3, [fp, #-12]
	b	.L12
.L10:
	mov	r3, #1
.L12:
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L13
	bl	__stack_chk_fail
.L13:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC2
	.word	.LC1
	.size	lock_test, .-lock_test
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Usage: checkLock filename\012Checks for ability to "
	.ascii	"get advisory write lock on file filename.\012Return"
	.ascii	"s 0 on success, 1 on failure.\012--checkSetLock opt"
	.ascii	"ion: Print warning if setting lock fails.\000"
	.align	2
.LC4:
	.ascii	"--checkSetLock\000"
	.align	2
.LC6:
	.ascii	"WARNING: fcntl locks are not working.\012Running pr"
	.ascii	"ocesses are not protected against overwrite from ot"
	.ascii	"her computers.\012fcntl call returned %d\012\000"
	.align	2
.LC7:
	.ascii	"checkLock: File %s is locked.\012\000"
	.align	2
.LC8:
	.ascii	"checkLock: File %s is locked by PID %d\012\000"
	.align	2
.LC9:
	.ascii	"File %s can't be opened: %s\012\000"
	.align	2
.LC5:
	.ascii	"/proc/self/exe\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #52
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L28
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-48]
	cmp	r3, #1
	bgt	.L17
	ldr	r0, .L28+4
	bl	puts
	mvn	r3, #0
	b	.L18
.L17:
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L28+8
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L19
	ldr	r3, .L28+12
	sub	ip, fp, #32
	ldm	r3, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2}
	strh	r3, [ip]	@ movhi
	add	ip, ip, #2
	lsr	r3, r3, #16
	strb	r3, [ip]
	sub	r3, fp, #32
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	blt	.L20
	mov	r3, #0
	str	r3, [sp, #4]
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #0
	mov	r1, #6
	ldr	r0, [fp, #-36]
	bl	lock_reg
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bge	.L21
	ldr	r1, [fp, #-44]
	ldr	r0, .L28+16
	bl	printf
	mov	r3, #0
	b	.L18
.L21:
	mov	r3, #0
	str	r3, [sp, #4]
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #2
	mov	r1, #6
	ldr	r0, [fp, #-36]
	bl	lock_reg
	ldr	r0, [fp, #-36]
	bl	close
.L20:
	mov	r3, #0
	b	.L18
.L19:
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	ble	.L23
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #0
	mov	r1, #1
	ldr	r0, [fp, #-40]
	bl	lock_test
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #1
	bne	.L24
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L28+20
	bl	printf
	b	.L25
.L24:
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	ble	.L25
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r2, [fp, #-44]
	mov	r1, r3
	ldr	r0, .L28+24
	bl	printf
.L25:
	ldr	r0, [fp, #-40]
	bl	close
	b	.L26
.L23:
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #2
	beq	.L26
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L28+28
	bl	printf
	mov	r3, #1
	str	r3, [fp, #-44]
.L26:
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	movne	r3, #1
	moveq	r3, #0
	and	r3, r3, #255
.L18:
	ldr	r2, .L28
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L27
	bl	__stack_chk_fail
.L27:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L29:
	.align	2
.L28:
	.word	.LC10
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
