	.file	"extr_sqlite3_omit.c_unixLockSharedMemory.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"ftruncate"
	.text
	.p2align 4
	.type	unixLockSharedMemory, @function
unixLockSharedMemory:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rsi
	sub	rsp, 32
	.cfi_def_cfa_offset 64
	mov	edi, DWORD PTR 8[rsi]
	mov	esi, DWORD PTR F_GETLK[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR SEEK_SET[rip]
	mov	rdx, rsp
	mov	DWORD PTR [rsp], 1
	mov	r12d, DWORD PTR SQLITE_OK[rip]
	mov	DWORD PTR 20[rsp], eax
	mov	eax, DWORD PTR UNIX_SHM_DMS[rip]
	mov	DWORD PTR 16[rsp], eax
	mov	rax, QWORD PTR F_WRLCK[rip]
	mov	QWORD PTR 8[rsp], rax
	call	osFcntl@PLT
	test	rax, rax
	je	.L2
	mov	r12d, DWORD PTR SQLITE_IOERR_LOCK[rip]
.L3:
	cmp	DWORD PTR SQLITE_OK[rip], r12d
	je	.L17
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L18
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rax, QWORD PTR 8[rsp]
	cmp	rax, QWORD PTR F_UNLCK[rip]
	je	.L19
	cmp	rax, QWORD PTR F_WRLCK[rip]
	jne	.L8
	mov	r12d, DWORD PTR SQLITE_BUSY[rip]
.L8:
	cmp	r12d, DWORD PTR SQLITE_OK[rip]
	jne	.L1
.L10:
	xor	edi, edi
	cmp	QWORD PTR F_RDLCK[rip], rax
	sete	dil
.L7:
	call	assert@PLT
	mov	edx, DWORD PTR UNIX_SHM_DMS[rip]
	mov	ecx, 1
	mov	rdi, rbp
	mov	rsi, QWORD PTR F_RDLCK[rip]
	call	unixShmSystemLock@PLT
	mov	r12d, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	mov	rax, QWORD PTR 8[rsp]
	cmp	rax, QWORD PTR F_UNLCK[rip]
	jne	.L10
.L9:
	mov	edi, 1
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L19:
	cmp	QWORD PTR 16[rbx], 0
	je	.L5
	mov	r12d, DWORD PTR SQLITE_READONLY_CANTINIT[rip]
	cmp	r12d, DWORD PTR SQLITE_OK[rip]
	mov	DWORD PTR [rbx], 1
	jne	.L1
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edx, DWORD PTR UNIX_SHM_DMS[rip]
	mov	rsi, QWORD PTR F_WRLCK[rip]
	mov	ecx, 1
	mov	rdi, rbp
	call	unixShmSystemLock@PLT
	cmp	DWORD PTR SQLITE_OK[rip], eax
	mov	r12d, eax
	jne	.L1
	mov	edi, DWORD PTR 8[rbx]
	mov	esi, 3
	call	robust_ftruncate@PLT
	test	rax, rax
	je	.L3
	mov	edx, DWORD PTR 4[rbx]
	mov	edi, DWORD PTR SQLITE_IOERR_SHMOPEN[rip]
	lea	rsi, .LC0[rip]
	call	unixLogError@PLT
	mov	r12d, eax
	jmp	.L3
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	unixLockSharedMemory, .-unixLockSharedMemory
	.comm	UNIX_SHM_DMS,4,4
	.comm	SQLITE_READONLY_CANTINIT,4,4
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_IOERR_SHMOPEN,4,4
	.comm	SQLITE_IOERR_LOCK,4,4
	.comm	SQLITE_BUSY,4,4
	.comm	SEEK_SET,4,4
	.comm	F_WRLCK,8,8
	.comm	F_UNLCK,8,8
	.comm	F_RDLCK,8,8
	.comm	F_GETLK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_sqlite3_omit.c_unixLockSharedMemory.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"ftruncate\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	unixLockSharedMemory, %function
unixLockSharedMemory:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r5, r1
	mov	r10, #1
	ldr	r3, .L20
	ldr	r8, .L20+4
	ldr	r9, .L20+8
	ldr	r2, [r3]
	ldr	lr, .L20+12
	ldr	r1, .L20+16
	sub	sp, sp, #24
	ldr	ip, [r8]
	ldr	r3, [r9]
	ldr	r7, .L20+20
	ldr	lr, [lr]
	str	lr, [sp, #20]
	mov	lr,#0
	mov	r6, r0
	str	r2, [sp, #16]
	ldr	r0, [r5, #8]
	ldr	r1, [r1]
	add	r2, sp, #4
	ldr	r4, [r7]
	str	ip, [sp, #12]
	str	r3, [sp, #8]
	str	r10, [sp, #4]
	bl	osFcntl
	cmp	r0, #0
	beq	.L2
	ldr	r3, .L20+24
	ldr	r4, [r3]
.L3:
	ldr	r3, [r7]
	cmp	r3, r4
	beq	.L17
.L1:
	ldr	r3, .L20+12
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	mov	r0, r4
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	ldr	r3, .L20+28
	ldr	r0, [sp, #8]
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L19
	ldr	r3, [r9]
	cmp	r0, r3
	ldreq	r3, .L20+32
	ldreq	r4, [r3]
.L8:
	ldr	r3, [r7]
	cmp	r4, r3
	bne	.L1
.L10:
	ldr	r4, .L20+36
	ldr	r3, [r4]
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
.L7:
	bl	assert
	ldr	r1, [r4]
	mov	r0, r6
	mov	r3, #1
	ldr	r2, [r8]
	bl	unixShmSystemLock
	mov	r4, r0
	b	.L1
.L17:
	ldr	r3, .L20+28
	ldr	r0, [sp, #8]
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L10
.L9:
	mov	r0, #1
	ldr	r4, .L20+36
	b	.L7
.L19:
	ldr	r3, [r5, #12]
	cmp	r3, #0
	beq	.L5
	ldr	r2, .L20+40
	ldr	r3, [r7]
	ldr	r4, [r2]
	str	r10, [r5]
	cmp	r4, r3
	bne	.L1
	b	.L9
.L5:
	mov	r3, r10
	mov	r0, r6
	ldr	r1, [r9]
	ldr	r2, [r8]
	bl	unixShmSystemLock
	ldr	r3, [r7]
	mov	r4, r0
	cmp	r3, r0
	bne	.L1
	mov	r1, #3
	ldr	r0, [r5, #8]
	bl	robust_ftruncate
	cmp	r0, #0
	beq	.L3
	ldr	r3, .L20+44
	ldr	r2, [r5, #4]
	ldr	r0, [r3]
	ldr	r1, .L20+48
	bl	unixLogError
	mov	r4, r0
	b	.L3
.L18:
	bl	__stack_chk_fail
.L21:
	.align	2
.L20:
	.word	SEEK_SET
	.word	UNIX_SHM_DMS
	.word	F_WRLCK
	.word	.LC1
	.word	F_GETLK
	.word	SQLITE_OK
	.word	SQLITE_IOERR_LOCK
	.word	F_UNLCK
	.word	SQLITE_BUSY
	.word	F_RDLCK
	.word	SQLITE_READONLY_CANTINIT
	.word	SQLITE_IOERR_SHMOPEN
	.word	.LC0
	.size	unixLockSharedMemory, .-unixLockSharedMemory
	.comm	UNIX_SHM_DMS,4,4
	.comm	SQLITE_READONLY_CANTINIT,4,4
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_IOERR_SHMOPEN,4,4
	.comm	SQLITE_IOERR_LOCK,4,4
	.comm	SQLITE_BUSY,4,4
	.comm	SEEK_SET,4,4
	.comm	F_WRLCK,4,4
	.comm	F_UNLCK,4,4
	.comm	F_RDLCK,4,4
	.comm	F_GETLK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
