	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LWLockConditionalAcquire       ## -- Begin function LWLockConditionalAcquire
	.p2align	4, 0x90
_LWLockConditionalAcquire:              ## @LWLockConditionalAcquire
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	_LW_SHARED@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	sete	%al
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %rcx
	cmpq	%rsi, (%rcx)
	movq	%rdi, %r14
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_AssertArg
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_PRINT_LWDEBUG
	movq	_num_held_lwlocks@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	_MAX_SIMUL_LWLOCKS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jb	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_elog
LBB0_2:
	xorl	%eax, %eax
	callq	_HOLD_INTERRUPTS
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_LWLockAttemptLock
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_RESUME_INTERRUPTS
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, %rsi
	callq	_LOG_LWDEBUG
	movq	%r14, %rdi
	callq	_T_NAME
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_TRACE_POSTGRESQL_LWLOCK_CONDACQUIRE_FAIL
	jmp	LBB0_5
LBB0_4:
	movq	_held_lwlocks@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	(%r12), %rdx
	movq	%rdx, %rsi
	shlq	$4, %rsi
	movq	%r14, 8(%rcx,%rsi)
	movq	(%rax), %rax
	incq	%rdx
	movq	%rdx, (%r12)
	movq	%rbx, (%rax,%rsi)
	movq	%r14, %rdi
	callq	_T_NAME
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_TRACE_POSTGRESQL_LWLOCK_CONDACQUIRE
LBB0_5:
	xorl	%eax, %eax
	testl	%r15d, %r15d
	sete	%al
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LW_SHARED,8,3                  ## @LW_SHARED
	.comm	_LW_EXCLUSIVE,8,3               ## @LW_EXCLUSIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LWLockConditionalAcquire"

	.comm	_num_held_lwlocks,8,3           ## @num_held_lwlocks
	.comm	_MAX_SIMUL_LWLOCKS,8,3          ## @MAX_SIMUL_LWLOCKS
	.comm	_ERROR,4,2                      ## @ERROR
L_.str.1:                               ## @.str.1
	.asciz	"too many LWLocks taken"

L_.str.2:                               ## @.str.2
	.asciz	"failed"

	.comm	_held_lwlocks,8,3               ## @held_lwlocks
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LWLockConditionalAcquire       ; -- Begin function LWLockConditionalAcquire
	.p2align	2
_LWLockConditionalAcquire:              ; @LWLockConditionalAcquire
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _LW_SHARED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LW_SHARED@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x1
Lloh3:
	adrp	x8, _LW_EXCLUSIVE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LW_EXCLUSIVE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ccmp	x8, x1, #4, ne
	cset	w0, eq
	bl	_AssertArg
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x19
	bl	_PRINT_LWDEBUG
Lloh8:
	adrp	x22, _num_held_lwlocks@GOTPAGE
Lloh9:
	ldr	x22, [x22, _num_held_lwlocks@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh10:
	adrp	x9, _MAX_SIMUL_LWLOCKS@GOTPAGE
Lloh11:
	ldr	x9, [x9, _MAX_SIMUL_LWLOCKS@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lo	LBB0_2
; %bb.1:
Lloh13:
	adrp	x8, _ERROR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_elog
LBB0_2:
	bl	_HOLD_INTERRUPTS
	mov	x0, x20
	mov	x1, x19
	bl	_LWLockAttemptLock
	mov	x21, x0
	cbz	w0, LBB0_4
; %bb.3:
	bl	_RESUME_INTERRUPTS
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
Lloh20:
	adrp	x2, l_.str.2@PAGE
Lloh21:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_LOG_LWDEBUG
	mov	x0, x20
	bl	_T_NAME
	mov	x1, x19
	bl	_TRACE_POSTGRESQL_LWLOCK_CONDACQUIRE_FAIL
	b	LBB0_5
LBB0_4:
Lloh22:
	adrp	x8, _held_lwlocks@GOTPAGE
Lloh23:
	ldr	x8, [x8, _held_lwlocks@GOTPAGEOFF]
	ldr	x9, [x8]
	ldr	x10, [x22]
	lsl	x11, x10, #4
	add	x9, x9, x11
	str	x20, [x9, #8]
	ldr	x8, [x8]
	add	x9, x10, #1
	str	x9, [x22]
	str	x19, [x8, x11]
	mov	x0, x20
	bl	_T_NAME
	mov	x1, x19
	bl	_TRACE_POSTGRESQL_LWLOCK_CONDACQUIRE
LBB0_5:
	cmp	w21, #0
	cset	w0, eq
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_LW_SHARED,8,3                  ; @LW_SHARED
	.comm	_LW_EXCLUSIVE,8,3               ; @LW_EXCLUSIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LWLockConditionalAcquire"

	.comm	_num_held_lwlocks,8,3           ; @num_held_lwlocks
	.comm	_MAX_SIMUL_LWLOCKS,8,3          ; @MAX_SIMUL_LWLOCKS
	.comm	_ERROR,4,2                      ; @ERROR
l_.str.1:                               ; @.str.1
	.asciz	"too many LWLocks taken"

l_.str.2:                               ; @.str.2
	.asciz	"failed"

	.comm	_held_lwlocks,8,3               ; @held_lwlocks
.subsections_via_symbols
