	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvp_update_mem_state
_kvp_update_mem_state:                  ## @kvp_update_mem_state
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_kvp_pools@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movslq	%edi, %rdi
	movq	%rdi, %r14
	shlq	$5, %r14
	movq	16(%rax,%r14), %rbx
	movl	(%rax,%r14), %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_ENTRIES_PER_BLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_kvp_acquire_lock
	movq	(%r13), %rax
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movl	24(%rax,%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	%rax, %r12
	leal	(,%r15,4), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leal	1(%rcx), %r13d
	imull	%r15d, %r13d
	shll	$2, %r13d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rbx,%r15,4), %rdi
	movq	_ENTRIES_PER_BLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rcx, %r14
	imull	%ecx, %edx
	movl	$4, %esi
	movq	%r12, %rcx
	callq	_fread
	movq	%r12, %rbx
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_ferror
	testq	%rax, %rax
	jne	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	%r12, %r15
	movq	%rbx, %rdi
	callq	_feof
	testl	%eax, %eax
	movq	%rbx, %r12
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%r14d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_realloc
	movq	%r14, %rcx
	movq	%rax, %rbx
	addl	-60(%rbp), %r13d                ## 4-byte Folded Reload
	testq	%rax, %rax
	jne	LBB0_2
## %bb.8:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_KVP_LOG
	jmp	LBB0_5
LBB0_9:
	movq	_kvp_pools@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%r14d, (%rax,%rdx)
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%rsi, 16(%rax,%rdx)
	movq	(%rcx), %rax
	movq	%r15, 8(%rax,%rdx)
	movq	%r12, %rdi
	callq	_fclose
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kvp_release_lock               ## TAILCALL
LBB0_3:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
LBB0_4:
	xorl	%eax, %eax
	callq	_KVP_LOG
LBB0_5:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_exit
LBB0_10:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_kvp_release_lock
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_kvp_pools,8,3                  ## @kvp_pools
	.comm	_ENTRIES_PER_BLOCK,4,2          ## @ENTRIES_PER_BLOCK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"r"

	.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 read file, pool: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"malloc failed\n"

	.no_dead_strip	_kvp_update_mem_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kvp_update_mem_state
_kvp_update_mem_state:                  ; @kvp_update_mem_state
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x23, _kvp_pools@GOTPAGE
Lloh1:
	ldr	x23, [x23, _kvp_pools@GOTPAGEOFF]
	ldr	x8, [x23]
	sbfiz	x21, x19, #5, #32
	add	x8, x8, x21
	ldr	x20, [x8, #16]
	ldr	w25, [x8]
Lloh2:
	adrp	x26, _ENTRIES_PER_BLOCK@GOTPAGE
Lloh3:
	ldr	x26, [x26, _ENTRIES_PER_BLOCK@GOTPAGEOFF]
	ldr	w22, [x26]
	bl	_kvp_acquire_lock
	ldr	x8, [x23]
	add	x8, x8, x21
	ldr	w0, [x8, #24]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_9
; %bb.1:
	mov	x21, x0
	mov	x27, #0
	sxtw	x28, w19
	lsl	w24, w22, #2
	madd	w8, w22, w25, w22
	lsl	w22, w8, #2
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x20, x27, lsl #2
	ldr	w8, [x26]
	mul	w2, w8, w25
	mov	w1, #4
	mov	x3, x21
	bl	_fread
	mov	x23, x0
	mov	x0, x21
	bl	_ferror
	cbnz	x0, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x27, x23, x27
	mov	x0, x21
	bl	_feof
	cbnz	w0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w25, w25, #1
	mov	x0, x20
	mov	x1, x22
	bl	_realloc
	mov	x20, x0
	add	w22, w22, w24
	cbnz	x0, LBB0_2
; %bb.5:
Lloh6:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_8
LBB0_6:
Lloh11:
	adrp	x10, _kvp_pools@GOTPAGE
Lloh12:
	ldr	x10, [x10, _kvp_pools@GOTPAGEOFF]
	ldr	x8, [x10]
	lsl	x9, x28, #5
	add	x8, x8, x9
	str	w25, [x8]
	str	x20, [x8, #16]
	ldr	x8, [x10]
	add	x8, x8, x9
	str	x27, [x8, #8]
	mov	x0, x21
	bl	_fclose
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_kvp_release_lock
LBB0_7:
Lloh13:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
	str	x19, [sp]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_8:
	bl	_KVP_LOG
Lloh18:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_exit
LBB0_9:
	mov	x0, x19
	bl	_kvp_release_lock
Lloh21:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
	str	x19, [sp]
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_kvp_pools,8,3                  ; @kvp_pools
	.comm	_ENTRIES_PER_BLOCK,4,2          ; @ENTRIES_PER_BLOCK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"r"

	.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 read file, pool: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"malloc failed\n"

	.no_dead_strip	_kvp_update_mem_state
.subsections_via_symbols
