	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function unixFileLock
_unixFileLock:                          ## @unixFileLock
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	8(%rdi), %r15
	xorl	%edi, %edi
	testq	%r15, %r15
	setne	%dil
	callq	_assert
	movl	16(%r15), %edi
	callq	_sqlite3_mutex_held
	movl	%eax, %edi
	callq	_assert
	movq	_UNIXFILE_EXCL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_UNIXFILE_RDONLY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%eax, %ecx
	andl	(%rbx), %ecx
	cmpl	%eax, %ecx
	jne	LBB0_5
## %bb.1:
	xorl	%eax, %eax
	cmpl	$0, (%r15)
	jne	LBB0_4
## %bb.2:
	xorl	%edi, %edi
	cmpq	$0, 8(%r15)
	sete	%dil
	callq	_assert
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	movq	_SHARED_FIRST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -32(%rbp)
	movq	_SHARED_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movq	_F_WRLCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movl	4(%rbx), %edi
	leaq	-40(%rbp), %rsi
	movq	%rbx, %rdx
	callq	_osSetPosixAdvisoryLock
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	movl	$1, (%r15)
	incq	8(%r15)
LBB0_4:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	4(%rbx), %edi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_osSetPosixAdvisoryLock         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_UNIXFILE_EXCL,4,2              ## @UNIXFILE_EXCL
	.comm	_UNIXFILE_RDONLY,4,2            ## @UNIXFILE_RDONLY
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_SHARED_FIRST,4,2               ## @SHARED_FIRST
	.comm	_SHARED_SIZE,4,2                ## @SHARED_SIZE
	.comm	_F_WRLCK,4,2                    ## @F_WRLCK
	.no_dead_strip	_unixFileLock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function unixFileLock
_unixFileLock:                          ; @unixFileLock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x1
	mov	x19, x0
	ldr	x21, [x0, #8]
	cmp	x21, #0
	cset	w0, ne
	bl	_assert
	ldr	w0, [x21, #16]
	bl	_sqlite3_mutex_held
	bl	_assert
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _UNIXFILE_EXCL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _UNIXFILE_EXCL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _UNIXFILE_RDONLY@GOTPAGE
Lloh4:
	ldr	x10, [x10, _UNIXFILE_RDONLY@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	orr	w10, w10, w9
	and	w8, w10, w8
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.1:
	ldr	w8, [x21]
	cbz	w8, LBB0_4
; %bb.2:
	mov	w0, #0
	b	LBB0_6
LBB0_3:
	ldr	w0, [x19, #4]
	mov	x1, x20
	mov	x2, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_osSetPosixAdvisoryLock
LBB0_4:
	ldr	x8, [x21, #8]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
Lloh6:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _SHARED_FIRST@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SHARED_FIRST@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #8]
Lloh12:
	adrp	x8, _SHARED_SIZE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SHARED_SIZE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _F_WRLCK@GOTPAGE
Lloh16:
	ldr	x9, [x9, _F_WRLCK@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	stp	w9, w8, [sp]
	ldr	w0, [x19, #4]
	mov	x1, sp
	mov	x2, x19
	bl	_osSetPosixAdvisoryLock
	tbnz	w0, #31, LBB0_6
; %bb.5:
	mov	w8, #1
	str	w8, [x21]
	ldr	x8, [x21, #8]
	add	x8, x8, #1
	str	x8, [x21, #8]
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_UNIXFILE_EXCL,4,2              ; @UNIXFILE_EXCL
	.comm	_UNIXFILE_RDONLY,4,2            ; @UNIXFILE_RDONLY
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_SHARED_FIRST,4,2               ; @SHARED_FIRST
	.comm	_SHARED_SIZE,4,2                ; @SHARED_SIZE
	.comm	_F_WRLCK,4,2                    ; @F_WRLCK
	.no_dead_strip	_unixFileLock
.subsections_via_symbols
