	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function unixShmSystemLock
_unixShmSystemLock:                     ## @unixShmSystemLock
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %r12d
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rax
	movq	(%rax), %r14
	movl	$1, %r15d
	cmpq	$0, (%r14)
	movl	$1, %edi
	je	LBB0_2
## %bb.1:
	movl	24(%r14), %edi
	callq	_sqlite3_mutex_held
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
LBB0_2:
	callq	_assert
	cmpq	$0, (%r14)
	jg	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_unixMutexHeld
	xorl	%r15d, %r15d
	testq	%rax, %rax
	setne	%r15b
LBB0_4:
	movl	%r15d, %edi
	callq	_assert
	cmpl	$1, %ebx
	sete	%al
	movq	_F_RDLCK@GOTPCREL(%rip), %rcx
	cmpl	%r12d, (%rcx)
	setne	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_assert
	testl	%ebx, %ebx
	setg	%al
	movq	_SQLITE_SHM_NLOCK@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	setge	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	callq	_assert
	movq	8(%r14), %rdi
	testq	%rdi, %rdi
	js	LBB0_8
## %bb.5:
	movl	%r12d, -64(%rbp)
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, -60(%rbp)
	movl	%ebx, -56(%rbp)
	leaq	-64(%rbp), %rsi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_osSetPosixAdvisoryLock
	cmpl	$-1, %eax
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	jne	LBB0_7
## %bb.6:
	movq	_SQLITE_BUSY@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %r13d
LBB0_8:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.comm	_F_RDLCK,4,2                    ## @F_RDLCK
	.comm	_SQLITE_SHM_NLOCK,4,2           ## @SQLITE_SHM_NLOCK
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_SQLITE_BUSY,4,2                ## @SQLITE_BUSY
	.comm	_F_UNLCK,4,2                    ## @F_UNLCK
	.comm	_F_WRLCK,4,2                    ## @F_WRLCK
	.no_dead_strip	_unixShmSystemLock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function unixShmSystemLock
_unixShmSystemLock:                     ; @unixShmSystemLock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x3
	mov	x21, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x24, _SQLITE_OK@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SQLITE_OK@GOTPAGEOFF]
	ldr	w22, [x24]
	ldr	x8, [x0]
	ldr	x25, [x8]
	ldr	x8, [x25]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w0, [x25, #24]
	bl	_sqlite3_mutex_held
	cmp	x0, #0
	cset	w0, ne
	b	LBB0_3
LBB0_2:
	mov	w0, #1
LBB0_3:
	bl	_assert
	ldr	x8, [x25]
	cmp	x8, #0
	b.le	LBB0_5
; %bb.4:
	mov	w0, #1
	b	LBB0_6
LBB0_5:
	bl	_unixMutexHeld
	cmp	x0, #0
	cset	w0, ne
LBB0_6:
	bl	_assert
	cmp	w20, #1
Lloh2:
	adrp	x8, _F_RDLCK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _F_RDLCK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ccmp	w8, w23, #0, ne
	cset	w0, ne
	bl	_assert
	cmp	w20, #0
Lloh5:
	adrp	x8, _SQLITE_SHM_NLOCK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SQLITE_SHM_NLOCK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ccmp	w8, w20, #8, gt
	cset	w0, ge
	bl	_assert
	ldr	x0, [x25, #8]
	tbnz	x0, #63, LBB0_8
; %bb.7:
Lloh8:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	stp	w23, w21, [sp]
	stp	w20, w8, [sp, #8]
	mov	x1, sp
	mov	x2, x19
	bl	_osSetPosixAdvisoryLock
Lloh11:
	adrp	x8, _SQLITE_BUSY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SQLITE_BUSY@GOTPAGEOFF]
	cmn	w0, #1
	csel	x8, x8, x24, eq
	ldr	w22, [x8]
LBB0_8:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_F_RDLCK,4,2                    ; @F_RDLCK
	.comm	_SQLITE_SHM_NLOCK,4,2           ; @SQLITE_SHM_NLOCK
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_SQLITE_BUSY,4,2                ; @SQLITE_BUSY
	.comm	_F_UNLCK,4,2                    ; @F_UNLCK
	.comm	_F_WRLCK,4,2                    ; @F_WRLCK
	.no_dead_strip	_unixShmSystemLock
.subsections_via_symbols
