	.file	"130672.c"
	.intel_syntax noprefix
	.text
	.globl	lockf
	.type	lockf, @function
lockf:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 72
	.cfi_offset 3, -24
	mov	DWORD PTR -68[rbp], edi
	mov	DWORD PTR -72[rbp], esi
	mov	QWORD PTR -80[rbp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -64[rbp], 0
	mov	QWORD PTR -56[rbp], 0
	mov	QWORD PTR -48[rbp], 0
	mov	QWORD PTR -40[rbp], 0
	mov	WORD PTR -64[rbp], 1
	mov	WORD PTR -62[rbp], 1
	mov	rax, QWORD PTR -80[rbp]
	mov	QWORD PTR -48[rbp], rax
	cmp	DWORD PTR -72[rbp], 3
	je	.L2
	cmp	DWORD PTR -72[rbp], 3
	jg	.L3
	cmp	DWORD PTR -72[rbp], 2
	je	.L4
	cmp	DWORD PTR -72[rbp], 2
	jg	.L3
	cmp	DWORD PTR -72[rbp], 0
	je	.L5
	cmp	DWORD PTR -72[rbp], 1
	je	.L6
	jmp	.L3
.L2:
	mov	WORD PTR -64[rbp], 0
	lea	rdx, -64[rbp]
	mov	eax, DWORD PTR -68[rbp]
	mov	esi, 5
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	test	eax, eax
	jns	.L7
	mov	eax, -1
	jmp	.L11
.L7:
	movzx	eax, WORD PTR -64[rbp]
	cmp	ax, 2
	je	.L9
	mov	ebx, DWORD PTR -40[rbp]
	call	getpid@PLT
	cmp	ebx, eax
	jne	.L10
.L9:
	mov	eax, 0
	jmp	.L11
.L10:
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 13
	mov	eax, -1
	jmp	.L11
.L5:
	mov	WORD PTR -64[rbp], 2
.L4:
	lea	rdx, -64[rbp]
	mov	eax, DWORD PTR -68[rbp]
	mov	esi, 6
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	jmp	.L11
.L6:
	lea	rdx, -64[rbp]
	mov	eax, DWORD PTR -68[rbp]
	mov	esi, 7
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	jmp	.L11
.L3:
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 22
	mov	eax, -1
.L11:
	mov	rcx, QWORD PTR -24[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	lockf, .-lockf
	.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	"130672.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	lockf
	.syntax unified
	.arm
	.fpu softvfp
	.type	lockf, %function
lockf:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #44
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	str	r2, [fp, #-48]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #32
	mov	r2, #0
	str	r2, [r3]
	str	r2, [r3, #4]
	str	r2, [r3, #8]
	str	r2, [r3, #12]
	mov	r3, #1
	strh	r3, [fp, #-32]	@ movhi
	mov	r3, #1
	strh	r3, [fp, #-30]	@ movhi
	ldr	r3, [fp, #-48]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-44]
	cmp	r3, #3
	ldrls	pc, [pc, r3, asl #2]
	b	.L2
.L4:
	.word	.L7
	.word	.L6
	.word	.L5
	.word	.L3
.L3:
	mov	r3, #0
	strh	r3, [fp, #-32]	@ movhi
	sub	r3, fp, #32
	mov	r2, r3
	mov	r1, #5
	ldr	r0, [fp, #-40]
	bl	fcntl
	mov	r3, r0
	cmp	r3, #0
	bge	.L8
	mvn	r3, #0
	b	.L12
.L8:
	ldrsh	r3, [fp, #-32]
	cmp	r3, #2
	beq	.L10
	ldr	r4, [fp, #-20]
	bl	getpid
	mov	r3, r0
	cmp	r4, r3
	bne	.L11
.L10:
	mov	r3, #0
	b	.L12
.L11:
	bl	__errno_location
	mov	r3, r0
	mov	r2, #13
	str	r2, [r3]
	mvn	r3, #0
	b	.L12
.L7:
	mov	r3, #2
	strh	r3, [fp, #-32]	@ movhi
.L5:
	sub	r3, fp, #32
	mov	r2, r3
	mov	r1, #6
	ldr	r0, [fp, #-40]
	bl	fcntl
	mov	r3, r0
	b	.L12
.L6:
	sub	r3, fp, #32
	mov	r2, r3
	mov	r1, #7
	ldr	r0, [fp, #-40]
	bl	fcntl
	mov	r3, r0
	b	.L12
.L2:
	bl	__errno_location
	mov	r3, r0
	mov	r2, #22
	str	r2, [r3]
	mvn	r3, #0
.L12:
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L13
	bl	__stack_chk_fail
.L13:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC0
	.size	lockf, .-lockf
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
