	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvp_acquire_lock
_kvp_acquire_lock:                      ## @kvp_acquire_lock
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -24
	movl	%edi, %ebx
	movq	$0, -36(%rbp)
	movq	_F_WRLCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%rbp)
	movq	$0, -20(%rbp)
	xorl	%eax, %eax
	callq	_getpid
	movl	%eax, -40(%rbp)
	movq	_kvp_pools@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ebx, %rcx
	movl	(%rax,%rcx,4), %edi
	movq	_F_SETLKW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	callq	_fcntl
	cmpl	$-1, %eax
	je	LBB0_2
## %bb.1:
	addq	$40, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_2:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_KVP_LOG
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_F_WRLCK,4,2                    ## @F_WRLCK
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_kvp_pools,8,3                  ## @kvp_pools
	.comm	_F_SETLKW,4,2                   ## @F_SETLKW
	.comm	_LOG_ERR,4,2                    ## @LOG_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to acquire the lock pool: %d"

	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.no_dead_strip	_kvp_acquire_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kvp_acquire_lock
_kvp_acquire_lock:                      ; @kvp_acquire_lock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x0
	movi.2d	v0, #0000000000000000
	stur	d0, [sp, #4]
Lloh0:
	adrp	x8, _F_WRLCK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _F_WRLCK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _SEEK_SET@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SEEK_SET@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #12]
	stur	d0, [sp, #20]
	bl	_getpid
	str	w0, [sp]
Lloh6:
	adrp	x8, _kvp_pools@GOTPAGE
Lloh7:
	ldr	x8, [x8, _kvp_pools@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	w0, [x8, w19, sxtw #2]
Lloh9:
	adrp	x8, _F_SETLKW@GOTPAGE
Lloh10:
	ldr	x8, [x8, _F_SETLKW@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x2, sp
	bl	_fcntl
	cmn	w0, #1
	b.eq	LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_2:
Lloh12:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_KVP_LOG
Lloh17:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_F_WRLCK,4,2                    ; @F_WRLCK
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_kvp_pools,8,3                  ; @kvp_pools
	.comm	_F_SETLKW,4,2                   ; @F_SETLKW
	.comm	_LOG_ERR,4,2                    ; @LOG_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to acquire the lock pool: %d"

	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.no_dead_strip	_kvp_acquire_lock
.subsections_via_symbols
