	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LWLockRelease                  ## -- Begin function LWLockRelease
	.p2align	4, 0x90
_LWLockRelease:                         ## @LWLockRelease
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	_num_held_lwlocks@GOTPCREL(%rip), %r9
	movl	(%r9), %ecx
	movq	_held_lwlocks@GOTPCREL(%rip), %r10
	movq	(%r10), %r8
	leal	-1(%rcx), %edx
	movslq	%edx, %rdi
	movq	%rdi, %rbx
	shlq	$4, %rbx
	addq	$32, %rbx
	incq	%rdi
	movq	%rcx, %rdx
	shlq	$4, %rdx
	leaq	(%r8,%rdx), %rsi
	addq	$-8, %rsi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %r15
	movq	%rdi, %r12
	leal	(%rcx,%rdx), %r14d
	testl	%r14d, %r14d
	jle	LBB0_14
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	leaq	-16(%r15), %rbx
	decl	%edx
	leaq	-1(%r12), %rdi
	leaq	-16(%rsi), %rax
	cmpq	%r13, (%rsi)
	movq	%rax, %rsi
	jne	LBB0_1
## %bb.3:
	leal	(%rcx,%rdx), %r14d
	incl	%r14d
	jmp	LBB0_4
LBB0_14:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	movq	%r10, %rbx
	callq	_T_NAME
	leaq	L_.str(%rip), %rsi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%eax, %edx
	callq	_elog
	movq	%rbx, %r10
	movq	_num_held_lwlocks@GOTPCREL(%rip), %r9
	movq	(%rbx), %r8
	movl	(%r9), %ecx
LBB0_4:
	movq	-32(%r8,%r15), %rbx
	leal	-1(%rcx), %eax
	movl	%eax, (%r9)
	cmpl	%r14d, %ecx
	jle	LBB0_8
## %bb.5:
	movups	-16(%r8,%r15), %xmm0
	movups	%xmm0, -32(%r8,%r15)
	movslq	(%r9), %rax
	cmpq	%rax, %r12
	jge	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r10), %rax
	incq	%r12
	movups	(%rax,%r15), %xmm0
	movups	%xmm0, -16(%rax,%r15)
	movslq	(%r9), %rax
	addq	$16, %r15
	cmpq	%rax, %r12
	jl	LBB0_6
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_PRINT_LWDEBUG
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %rcx
	movq	_LW_VAL_EXCLUSIVE@GOTPCREL(%rip), %r15
	movq	%r15, %rax
	cmpq	(%rcx), %rbx
	je	LBB0_10
## %bb.9:
	movq	_LW_VAL_SHARED@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_pg_atomic_sub_fetch_u32
	movl	%eax, %r14d
	xorl	%edi, %edi
	movl	(%r15), %eax
	andl	%r14d, %eax
	sete	%dil
	callq	_Assert
	movq	_LW_FLAG_HAS_WAITERS@GOTPCREL(%rip), %rax
	movq	_LW_FLAG_RELEASE_OK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%r14d, %eax
	notl	%eax
	testl	%eax, %ecx
	jne	LBB0_13
## %bb.11:
	movq	_LW_LOCK_MASK@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	jne	LBB0_13
## %bb.12:
	leaq	L_.str.1(%rip), %rdi
	leaq	L_.str.2(%rip), %rdx
	movq	%r13, %rsi
	callq	_LOG_LWDEBUG
	movq	%r13, %rdi
	callq	_LWLockWakeup
LBB0_13:
	movq	%r13, %rdi
	callq	_T_NAME
	movl	%eax, %edi
	callq	_TRACE_POSTGRESQL_LWLOCK_RELEASE
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_RESUME_INTERRUPTS              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_num_held_lwlocks,4,2           ## @num_held_lwlocks
	.comm	_held_lwlocks,8,3               ## @held_lwlocks
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"lock %s is not held"

L_.str.1:                               ## @.str.1
	.asciz	"LWLockRelease"

	.comm	_LW_EXCLUSIVE,8,3               ## @LW_EXCLUSIVE
	.comm	_LW_VAL_EXCLUSIVE,4,2           ## @LW_VAL_EXCLUSIVE
	.comm	_LW_VAL_SHARED,4,2              ## @LW_VAL_SHARED
	.comm	_LW_FLAG_HAS_WAITERS,4,2        ## @LW_FLAG_HAS_WAITERS
	.comm	_LW_FLAG_RELEASE_OK,4,2         ## @LW_FLAG_RELEASE_OK
	.comm	_LW_LOCK_MASK,4,2               ## @LW_LOCK_MASK
L_.str.2:                               ## @.str.2
	.asciz	"releasing waiters"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LWLockRelease                  ; -- Begin function LWLockRelease
	.p2align	2
_LWLockRelease:                         ; @LWLockRelease
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	mov	x10, #0
	mov	x11, #0
Lloh0:
	adrp	x21, _num_held_lwlocks@GOTPAGE
Lloh1:
	ldr	x21, [x21, _num_held_lwlocks@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh2:
	adrp	x22, _held_lwlocks@GOTPAGE
Lloh3:
	ldr	x22, [x22, _held_lwlocks@GOTPAGEOFF]
	ldr	x9, [x22]
	sub	w12, w8, #1
	sxtw	x25, w12
	sbfiz	x23, x12, #4, #32
	add	x12, x9, x8, lsl #4
	sub	x12, x12, #8
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x24, x11
	mov	x26, x10
	add	w10, w8, w26
	cmp	w10, #1
	b.lt	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x13, [x12, x24]
	sub	x11, x24, #16
	sub	x10, x26, #1
	cmp	x13, x19
	b.ne	LBB0_1
; %bb.3:
	add	w10, w8, w10
	add	w27, w10, #1
	b	LBB0_5
LBB0_4:
	add	w27, w8, w26
Lloh4:
	adrp	x8, _ERROR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh6:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_T_NAME
	mov	x2, x0
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_elog
	ldr	x9, [x22]
	ldr	w8, [x21]
LBB0_5:
	add	x9, x9, x23
	ldr	x20, [x9, x24]
	sub	w10, w8, #1
	str	w10, [x21]
	cmp	w8, w27
	b.le	LBB0_9
; %bb.6:
	add	x8, x25, x26
	add	x8, x8, #1
	add	x9, x9, x24
	ldr	q0, [x9, #16]
	str	q0, [x9]
	ldrsw	x9, [x21]
	cmp	x8, x9
	b.ge	LBB0_9
; %bb.7:
	add	x9, x23, x24
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x22]
	add	x8, x8, #1
	add	x10, x10, x9
	ldr	q0, [x10, #32]
	str	q0, [x10, #16]
	ldrsw	x10, [x21]
	add	x9, x9, #16
	cmp	x8, x10
	b.lt	LBB0_8
LBB0_9:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	mov	x2, x20
	bl	_PRINT_LWDEBUG
Lloh11:
	adrp	x8, _LW_EXCLUSIVE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _LW_EXCLUSIVE@GOTPAGEOFF]
Lloh13:
	adrp	x21, _LW_VAL_EXCLUSIVE@GOTPAGE
Lloh14:
	ldr	x21, [x21, _LW_VAL_EXCLUSIVE@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
Lloh16:
	adrp	x9, _LW_VAL_SHARED@GOTPAGE
Lloh17:
	ldr	x9, [x9, _LW_VAL_SHARED@GOTPAGEOFF]
	cmp	x20, x8
	csel	x8, x21, x9, eq
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pg_atomic_sub_fetch_u32
	mov	x20, x0
	ldr	w8, [x21]
	tst	w8, w0
	cset	w0, eq
	bl	_Assert
Lloh18:
	adrp	x8, _LW_FLAG_HAS_WAITERS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _LW_FLAG_HAS_WAITERS@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _LW_FLAG_RELEASE_OK@GOTPAGE
Lloh22:
	ldr	x9, [x9, _LW_FLAG_RELEASE_OK@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bics	wzr, w8, w20
	b.ne	LBB0_12
; %bb.10:
Lloh24:
	adrp	x8, _LW_LOCK_MASK@GOTPAGE
Lloh25:
	ldr	x8, [x8, _LW_LOCK_MASK@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	tst	w8, w20
	b.ne	LBB0_12
; %bb.11:
Lloh27:
	adrp	x0, l_.str.1@PAGE
Lloh28:
	add	x0, x0, l_.str.1@PAGEOFF
Lloh29:
	adrp	x2, l_.str.2@PAGE
Lloh30:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_LOG_LWDEBUG
	mov	x0, x19
	bl	_LWLockWakeup
LBB0_12:
	mov	x0, x19
	bl	_T_NAME
	bl	_TRACE_POSTGRESQL_LWLOCK_RELEASE
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_RESUME_INTERRUPTS
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh15
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_num_held_lwlocks,4,2           ; @num_held_lwlocks
	.comm	_held_lwlocks,8,3               ; @held_lwlocks
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"lock %s is not held"

l_.str.1:                               ; @.str.1
	.asciz	"LWLockRelease"

	.comm	_LW_EXCLUSIVE,8,3               ; @LW_EXCLUSIVE
	.comm	_LW_VAL_EXCLUSIVE,4,2           ; @LW_VAL_EXCLUSIVE
	.comm	_LW_VAL_SHARED,4,2              ; @LW_VAL_SHARED
	.comm	_LW_FLAG_HAS_WAITERS,4,2        ; @LW_FLAG_HAS_WAITERS
	.comm	_LW_FLAG_RELEASE_OK,4,2         ; @LW_FLAG_RELEASE_OK
	.comm	_LW_LOCK_MASK,4,2               ; @LW_LOCK_MASK
l_.str.2:                               ; @.str.2
	.asciz	"releasing waiters"

.subsections_via_symbols
