	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvp_update_file
_kvp_update_file:                       ## @kvp_update_file
	.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
	movl	%edi, %r14d
	callq	_kvp_acquire_lock
	movq	_kvp_pools@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movslq	%r14d, %rcx
	leaq	(%rcx,%rcx,2), %rbx
	movl	8(%rax,%rbx,4), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r12
	movq	(%r15), %rax
	movl	(%rax,%rbx,4), %edx
	movl	4(%rax,%rbx,4), %edi
	movl	$4, %esi
	movq	%r12, %rcx
	callq	_fwrite
	movq	%r12, %rdi
	callq	_ferror
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	%r12, %rdi
	callq	_fclose
	testq	%rax, %rax
	jne	LBB0_5
## %bb.6:
	movl	%r14d, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kvp_release_lock               ## TAILCALL
LBB0_5:
	movl	%r14d, %edi
	callq	_kvp_release_lock
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
LBB0_1:
	movl	%r14d, %edi
	callq	_kvp_release_lock
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movl	%r14d, %edx
	callq	_KVP_LOG
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_kvp_pools,8,3                  ## @kvp_pools
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"w"

	.comm	_LOG_ERR,4,2                    ## @LOG_ERR
L_.str.1:                               ## @.str.1
	.asciz	"Failed to open file, pool: %d\n"

	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
L_.str.2:                               ## @.str.2
	.asciz	"Failed to write file, pool: %d\n"

	.no_dead_strip	_kvp_update_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kvp_update_file
_kvp_update_file:                       ; @kvp_update_file
	.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, x0
	bl	_kvp_acquire_lock
Lloh0:
	adrp	x21, _kvp_pools@GOTPAGE
Lloh1:
	ldr	x21, [x21, _kvp_pools@GOTPAGEOFF]
	ldr	x8, [x21]
	mov	w9, #12
	smaddl	x8, w19, w9, x8
	ldr	w0, [x8, #8]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	sxtw	x8, w19
	ldr	x9, [x21]
	mov	w10, #12
	madd	x8, x8, x10, x9
	ldp	w2, w0, [x8]
	mov	w1, #4
	mov	x3, x20
	bl	_fwrite
	mov	x0, x20
	bl	_ferror
	cbnz	x0, LBB0_4
; %bb.2:
	mov	x0, x20
	bl	_fclose
	cbnz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	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
	b	_kvp_release_lock
LBB0_4:
	mov	x0, x19
	bl	_kvp_release_lock
Lloh4:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_5:
	mov	x0, x19
	bl	_kvp_release_lock
Lloh9:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	mov	x2, x19
	bl	_KVP_LOG
Lloh14:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_exit
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_kvp_pools,8,3                  ; @kvp_pools
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"w"

	.comm	_LOG_ERR,4,2                    ; @LOG_ERR
l_.str.1:                               ; @.str.1
	.asciz	"Failed to open file, pool: %d\n"

	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
l_.str.2:                               ; @.str.2
	.asciz	"Failed to write file, pool: %d\n"

	.no_dead_strip	_kvp_update_file
.subsections_via_symbols
