	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_spdcache_init                  ## -- Begin function spdcache_init
	.p2align	4, 0x90
_spdcache_init:                         ## @spdcache_init
	.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
	leaq	L_.str(%rip), %rdi
	movq	_V_key_spdcache_maxentries@GOTPCREL(%rip), %r14
	movq	%r14, %rsi
	callq	_TUNABLE_INT_FETCH
	leaq	L_.str.1(%rip), %rdi
	movq	_V_key_spdcache_threshold@GOTPCREL(%rip), %rsi
	callq	_TUNABLE_INT_FETCH
	movl	(%r14), %edi
	testl	%edi, %edi
	je	LBB0_4
## %bb.1:
	movq	_SPDCACHE_MAX_ENTRIES_PER_HASH@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_MAX
	movl	%eax, (%r14)
	cltd
	idivl	(%rbx)
	movq	_M_IPSEC_SPDCACHE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_V_spdcachehash_mask@GOTPCREL(%rip), %r15
	movl	%eax, %edi
	movq	%r15, %rdx
	callq	_hashinit
	movq	_V_spdcachehashtbl@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	(%r15), %eax
	leal	1(%rax), %ecx
	imull	(%rbx), %ecx
	movl	%ecx, (%r14)
	leal	4(,%rax,4), %edi
	movl	(%r12), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	callq	_malloc
	movq	_V_spdcache_lock@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	cmpl	$0, (%r15)
	js	LBB0_4
## %bb.2:
	movl	$-1, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	movl	%ebx, %edi
	callq	_SPDCACHE_LOCK_INIT
	cmpl	(%r15), %ebx
	jl	LBB0_3
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"net.key.spdcache.maxentries"

	.comm	_V_key_spdcache_maxentries,4,2  ## @V_key_spdcache_maxentries
L_.str.1:                               ## @.str.1
	.asciz	"net.key.spdcache.threshold"

	.comm	_V_key_spdcache_threshold,4,2   ## @V_key_spdcache_threshold
	.comm	_SPDCACHE_MAX_ENTRIES_PER_HASH,4,2 ## @SPDCACHE_MAX_ENTRIES_PER_HASH
	.comm	_M_IPSEC_SPDCACHE,4,2           ## @M_IPSEC_SPDCACHE
	.comm	_V_spdcachehash_mask,4,2        ## @V_spdcachehash_mask
	.comm	_V_spdcachehashtbl,4,2          ## @V_spdcachehashtbl
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_V_spdcache_lock,4,2            ## @V_spdcache_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_spdcache_init                  ; -- Begin function spdcache_init
	.p2align	2
_spdcache_init:                         ; @spdcache_init
	.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
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
Lloh2:
	adrp	x20, _V_key_spdcache_maxentries@GOTPAGE
Lloh3:
	ldr	x20, [x20, _V_key_spdcache_maxentries@GOTPAGEOFF]
	mov	x1, x20
	bl	_TUNABLE_INT_FETCH
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
Lloh6:
	adrp	x1, _V_key_spdcache_threshold@GOTPAGE
Lloh7:
	ldr	x1, [x1, _V_key_spdcache_threshold@GOTPAGEOFF]
	bl	_TUNABLE_INT_FETCH
	ldr	w0, [x20]
	cbz	w0, LBB0_4
; %bb.1:
Lloh8:
	adrp	x21, _SPDCACHE_MAX_ENTRIES_PER_HASH@GOTPAGE
Lloh9:
	ldr	x21, [x21, _SPDCACHE_MAX_ENTRIES_PER_HASH@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_MAX
	str	w0, [x20]
	ldr	w8, [x21]
Lloh10:
	adrp	x22, _M_IPSEC_SPDCACHE@GOTPAGE
Lloh11:
	ldr	x22, [x22, _M_IPSEC_SPDCACHE@GOTPAGEOFF]
	ldr	w1, [x22]
	sdiv	w0, w0, w8
Lloh12:
	adrp	x19, _V_spdcachehash_mask@GOTPAGE
Lloh13:
	ldr	x19, [x19, _V_spdcachehash_mask@GOTPAGEOFF]
	mov	x2, x19
	bl	_hashinit
Lloh14:
	adrp	x8, _V_spdcachehashtbl@GOTPAGE
Lloh15:
	ldr	x8, [x8, _V_spdcachehashtbl@GOTPAGEOFF]
Lloh16:
	str	w0, [x8]
	ldr	w8, [x19]
	ldr	w9, [x21]
	madd	w9, w9, w8, w9
	str	w9, [x20]
	lsl	w8, w8, #2
	add	w0, w8, #4
Lloh17:
	adrp	x8, _M_WAITOK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _M_WAITOK@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _M_ZERO@GOTPAGE
Lloh21:
	ldr	x9, [x9, _M_ZERO@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w2, w9, w8
	bl	_malloc
Lloh23:
	adrp	x8, _V_spdcache_lock@GOTPAGE
Lloh24:
	ldr	x8, [x8, _V_spdcache_lock@GOTPAGEOFF]
Lloh25:
	str	w0, [x8]
	ldr	w8, [x19]
	tbnz	w8, #31, LBB0_4
; %bb.2:
	mov	w20, #-1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	w20, w20, #1
	mov	x0, x20
	bl	_SPDCACHE_LOCK_INIT
	ldr	w8, [x19]
	cmp	w20, w8
	b.lt	LBB0_3
LBB0_4:
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"net.key.spdcache.maxentries"

	.comm	_V_key_spdcache_maxentries,4,2  ; @V_key_spdcache_maxentries
l_.str.1:                               ; @.str.1
	.asciz	"net.key.spdcache.threshold"

	.comm	_V_key_spdcache_threshold,4,2   ; @V_key_spdcache_threshold
	.comm	_SPDCACHE_MAX_ENTRIES_PER_HASH,4,2 ; @SPDCACHE_MAX_ENTRIES_PER_HASH
	.comm	_M_IPSEC_SPDCACHE,4,2           ; @M_IPSEC_SPDCACHE
	.comm	_V_spdcachehash_mask,4,2        ; @V_spdcachehash_mask
	.comm	_V_spdcachehashtbl,4,2          ; @V_spdcachehashtbl
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_V_spdcache_lock,4,2            ; @V_spdcache_lock
.subsections_via_symbols
