	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LockBuffer                     ## -- Begin function LockBuffer
	.p2align	4, 0x90
_LockBuffer:                            ## @LockBuffer
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_BufferIsValid
	movl	%eax, %edi
	callq	_Assert
	movq	%rbx, %rdi
	callq	_BufferIsLocal
	testq	%rax, %rax
	je	LBB0_1
## %bb.8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	decq	%rbx
	movq	%rbx, %rdi
	callq	_GetBufferDescriptor
	movq	_BUFFER_LOCK_UNLOCK@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	jne	LBB0_2
## %bb.9:
	movq	%rax, %rdi
	callq	_BufferDescriptorGetContentLock
	movl	%eax, %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_LWLockRelease                  ## TAILCALL
LBB0_2:
	movq	_BUFFER_LOCK_SHARE@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	jne	LBB0_5
## %bb.3:
	movq	%rax, %rdi
	callq	_BufferDescriptorGetContentLock
	movq	_LW_SHARED@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_5:
	movq	_BUFFER_LOCK_EXCLUSIVE@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	jne	LBB0_7
## %bb.6:
	movq	%rax, %rdi
	callq	_BufferDescriptorGetContentLock
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %rcx
LBB0_4:
	movl	(%rcx), %esi
	movl	%eax, %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_LWLockAcquire                  ## TAILCALL
LBB0_7:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_elog                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BUFFER_LOCK_UNLOCK,4,2         ## @BUFFER_LOCK_UNLOCK
	.comm	_BUFFER_LOCK_SHARE,4,2          ## @BUFFER_LOCK_SHARE
	.comm	_LW_SHARED,4,2                  ## @LW_SHARED
	.comm	_BUFFER_LOCK_EXCLUSIVE,4,2      ## @BUFFER_LOCK_EXCLUSIVE
	.comm	_LW_EXCLUSIVE,4,2               ## @LW_EXCLUSIVE
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unrecognized buffer lock mode: %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LockBuffer                     ; -- Begin function LockBuffer
	.p2align	2
_LockBuffer:                            ; @LockBuffer
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
	bl	_BufferIsValid
	bl	_Assert
	mov	x0, x20
	bl	_BufferIsLocal
	cbz	x0, LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_2:
	sub	x0, x20, #1
	bl	_GetBufferDescriptor
Lloh0:
	adrp	x8, _BUFFER_LOCK_UNLOCK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BUFFER_LOCK_UNLOCK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_4
; %bb.3:
	bl	_BufferDescriptorGetContentLock
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_LWLockRelease
LBB0_4:
Lloh3:
	adrp	x8, _BUFFER_LOCK_SHARE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BUFFER_LOCK_SHARE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_6
; %bb.5:
	bl	_BufferDescriptorGetContentLock
Lloh6:
	adrp	x8, _LW_SHARED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LW_SHARED@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
Lloh8:
	adrp	x8, _BUFFER_LOCK_EXCLUSIVE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BUFFER_LOCK_EXCLUSIVE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_9
; %bb.7:
	bl	_BufferDescriptorGetContentLock
Lloh11:
	adrp	x8, _LW_EXCLUSIVE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _LW_EXCLUSIVE@GOTPAGEOFF]
LBB0_8:
	ldr	w1, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_LWLockAcquire
LBB0_9:
Lloh13:
	adrp	x8, _ERROR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_elog
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_BUFFER_LOCK_UNLOCK,4,2         ; @BUFFER_LOCK_UNLOCK
	.comm	_BUFFER_LOCK_SHARE,4,2          ; @BUFFER_LOCK_SHARE
	.comm	_LW_SHARED,4,2                  ; @LW_SHARED
	.comm	_BUFFER_LOCK_EXCLUSIVE,4,2      ; @BUFFER_LOCK_EXCLUSIVE
	.comm	_LW_EXCLUSIVE,4,2               ; @LW_EXCLUSIVE
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unrecognized buffer lock mode: %d"

.subsections_via_symbols
