	.file	"232955751.c"
	.intel_syntax noprefix
	.text
	.local	fd_lock
	.comm	fd_lock,4,4
	.type	aquire_lock, @function
aquire_lock:
.LFB0:
	.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	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR fd_lock[rip], eax
	mov	eax, DWORD PTR fd_lock[rip]
	test	eax, eax
	jns	.L2
	mov	eax, -1
	jmp	.L3
.L2:
	mov	eax, DWORD PTR fd_lock[rip]
	mov	esi, 6
	mov	edi, eax
	call	flock@PLT
	test	eax, eax
	sete	al
	movzx	eax, al
	mov	DWORD PTR -4[rbp], eax
	mov	edi, 1
	call	sleep@PLT
	cmp	DWORD PTR -4[rbp], 1
	jne	.L2
	mov	eax, 0
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	aquire_lock, .-aquire_lock
	.type	release_lock, @function
release_lock:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR fd_lock[rip]
	mov	esi, 12
	mov	edi, eax
	call	flock@PLT
	mov	eax, DWORD PTR fd_lock[rip]
	mov	edi, eax
	call	close@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	release_lock, .-release_lock
	.type	rename_retry, @function
rename_retry:
.LFB2:
	.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	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -4[rbp], 0
	jmp	.L7
.L10:
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	rename@PLT
	test	eax, eax
	jne	.L8
	mov	eax, 0
	jmp	.L9
.L8:
	mov	edi, 2
	call	sleep@PLT
	add	DWORD PTR -4[rbp], 1
.L7:
	cmp	DWORD PTR -4[rbp], 3
	jle	.L10
	mov	eax, -1
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	rename_retry, .-rename_retry
	.section	.rodata
	.align 8
.LC0:
	.string	"Usage: %s <lock_file> <new_version_path> <app_path> <tmp_app_path> <exec_path> ...argv\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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
	cmp	DWORD PTR -52[rbp], 5
	jg	.L12
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L13
.L12:
	add	QWORD PTR -64[rbp], 8
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -40[rbp], rax
	add	QWORD PTR -64[rbp], 8
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -32[rbp], rax
	add	QWORD PTR -64[rbp], 8
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -24[rbp], rax
	add	QWORD PTR -64[rbp], 8
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -16[rbp], rax
	add	QWORD PTR -64[rbp], 8
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	aquire_lock
	test	eax, eax
	je	.L14
	mov	eax, 2
	jmp	.L13
.L14:
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	rename_retry
	test	eax, eax
	je	.L15
	mov	eax, 3
	jmp	.L13
.L15:
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	rename_retry
	test	eax, eax
	je	.L16
	mov	eax, 4
	jmp	.L13
.L16:
	mov	rdx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	rename_retry
	test	eax, eax
	je	.L17
	mov	eax, 5
	jmp	.L13
.L17:
	mov	eax, 0
	call	release_lock
	mov	rdx, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	execv@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	"232955751.c"
	.text
	.local	fd_lock
	.comm	fd_lock,4,4
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	aquire_lock, %function
aquire_lock:
	@ 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]
	mov	r1, #0
	ldr	r0, [fp, #-16]
	bl	open
	mov	r3, r0
	ldr	r2, .L5
	str	r3, [r2]
	ldr	r3, .L5
	ldr	r3, [r3]
	cmp	r3, #0
	bge	.L2
	mvn	r3, #0
	b	.L3
.L2:
	ldr	r3, .L5
	ldr	r3, [r3]
	mov	r1, #6
	mov	r0, r3
	bl	flock
	mov	r3, r0
	cmp	r3, #0
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	str	r3, [fp, #-8]
	mov	r0, #1
	bl	sleep
	ldr	r3, [fp, #-8]
	cmp	r3, #1
	bne	.L2
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	fd_lock
	.size	aquire_lock, .-aquire_lock
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	release_lock, %function
release_lock:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L8
	ldr	r3, [r3]
	mov	r1, #12
	mov	r0, r3
	bl	flock
	ldr	r3, .L8
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	nop
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	fd_lock
	.size	release_lock, .-release_lock
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rename_retry, %function
rename_retry:
	@ 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]
	b	.L11
.L14:
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	rename
	mov	r3, r0
	cmp	r3, #0
	bne	.L12
	mov	r3, #0
	b	.L13
.L12:
	mov	r0, #2
	bl	sleep
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L11:
	ldr	r3, [fp, #-8]
	cmp	r3, #3
	ble	.L14
	mvn	r3, #0
.L13:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	rename_retry, .-rename_retry
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s <lock_file> <new_version_path> <app_path>"
	.ascii	" <tmp_app_path> <exec_path> ...argv\012\000"
	.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
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, [fp, #-32]
	cmp	r3, #5
	bgt	.L16
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L22
	bl	printf
	mov	r3, #1
	b	.L17
.L16:
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-36]
	add	r3, r3, #4
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-24]
	bl	aquire_lock
	mov	r3, r0
	cmp	r3, #0
	beq	.L18
	mov	r3, #2
	b	.L17
.L18:
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-20]
	bl	rename_retry
	mov	r3, r0
	cmp	r3, #0
	beq	.L19
	mov	r3, #3
	b	.L17
.L19:
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	rename_retry
	mov	r3, r0
	cmp	r3, #0
	beq	.L20
	mov	r3, #4
	b	.L17
.L20:
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-12]
	bl	rename_retry
	mov	r3, r0
	cmp	r3, #0
	beq	.L21
	mov	r3, #5
	b	.L17
.L21:
	bl	release_lock
	ldr	r1, [fp, #-36]
	ldr	r0, [fp, #-8]
	bl	execv
	mov	r3, r0
.L17:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC0
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
