	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_key_sp2msg                     ## -- Begin function key_sp2msg
	.p2align	4, 0x90
_key_sp2msg:                            ## @key_sp2msg
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	xorl	%edi, %edi
	testq	%r12, %r12
	setne	%dil
	leaq	L_.str(%rip), %rsi
	callq	_IPSEC_ASSERT
	movq	(%r14), %rsi
	cmpq	$31, %rsi
	ja	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_18
LBB0_2:
	movq	%r15, %rdi
	callq	_bzero
	movq	_SADB_X_EXT_POLICY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r15)
	movq	(%r12), %rax
	movq	%rax, (%r15)
	movl	32(%r12), %ecx
	movl	%ecx, 24(%r15)
	movl	28(%r12), %ecx
	movl	%ecx, 20(%r15)
	movl	24(%r12), %ecx
	movl	%ecx, 16(%r15)
	movl	8(%r12), %edx
	cmpl	$128, %edx
	jne	LBB0_3
## %bb.4:
	movq	_IPSEC_POLICYSCOPE_PCB@GOTPCREL(%rip), %rcx
	cmpl	$129, %edx
	je	LBB0_6
	jmp	LBB0_7
LBB0_3:
	movq	_IPSEC_POLICYSCOPE_GLOBAL@GOTPCREL(%rip), %rcx
	cmpl	$129, %edx
	jne	LBB0_7
LBB0_6:
	movq	_IPSEC_POLICYSCOPE_IFNET@GOTPCREL(%rip), %rcx
LBB0_7:
	movl	(%rcx), %ecx
	movl	%ecx, 12(%r15)
	movq	_IPSEC_POLICY_IPSEC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.8:
	cmpl	$0, 12(%r12)
	jle	LBB0_15
## %bb.9:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	leaq	32(%r15), %r14
	movl	$32, %ebx
	xorl	%r13d, %r13d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	leaq	8(%r15), %rdi
	movq	%rax, (%r14)
	movl	24(%r15), %eax
	movl	%eax, 20(%r14)
	movl	20(%r15), %eax
	movl	%eax, 16(%r14)
	movl	32(%r15), %eax
	movl	%eax, 12(%r14)
	movl	16(%r15), %eax
	movl	%eax, 8(%r14)
	addq	$24, %r14
	movq	8(%r15), %rdx
	movq	%r14, %rsi
	callq	_bcopy
	addq	8(%r15), %r14
	movq	(%r15), %rdx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_bcopy
	addq	(%r15), %r14
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	incq	%r13
	movslq	12(%r12), %rax
	cmpq	%rax, %r13
	jge	LBB0_14
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rax
	movq	(%rax,%r13,8), %r15
	movq	(%r15), %rax
	movq	8(%r15), %rcx
	leaq	(%rcx,%rax), %rdi
	addq	$24, %rdi
	callq	_PFKEY_ALIGN8
	addq	%rax, %rbx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpq	(%rcx), %rbx
	jbe	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	_ENOBUFS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_13
LBB0_15:
	movl	$32, %ebx
	movl	$32, %edi
	callq	_PFKEY_UNIT64
	movl	%eax, 8(%r15)
LBB0_16:
	xorl	%eax, %eax
	movq	%rbx, %rcx
LBB0_17:
	movq	%rcx, (%r14)
LBB0_18:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	%rbx, %rdi
	callq	_PFKEY_UNIT64
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 8(%rcx)
	movl	$32, %ecx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_17
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"null policy"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SADB_X_EXT_POLICY,4,2          ## @SADB_X_EXT_POLICY
	.comm	_IPSEC_POLICYSCOPE_IFNET,4,2    ## @IPSEC_POLICYSCOPE_IFNET
	.comm	_IPSEC_POLICYSCOPE_PCB,4,2      ## @IPSEC_POLICYSCOPE_PCB
	.comm	_IPSEC_POLICYSCOPE_GLOBAL,4,2   ## @IPSEC_POLICYSCOPE_GLOBAL
	.comm	_IPSEC_POLICY_IPSEC,8,3         ## @IPSEC_POLICY_IPSEC
	.comm	_ENOBUFS,4,2                    ## @ENOBUFS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_key_sp2msg                     ; -- Begin function key_sp2msg
	.p2align	2
_key_sp2msg:                            ; @key_sp2msg
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x2
	mov	x20, x1
	mov	x21, x0
	cmp	x0, #0
	cset	w0, ne
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_IPSEC_ASSERT
	ldr	x1, [x19]
	cmp	x1, #31
	b.hi	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w22, [x8]
	b	LBB0_14
LBB0_2:
	mov	x0, x20
	bl	_bzero
Lloh5:
	adrp	x8, _SADB_X_EXT_POLICY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SADB_X_EXT_POLICY@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	x9, [x21]
	str	x9, [x20]
	ldr	w10, [x21, #32]
	stp	w10, w8, [x20, #24]
	ldr	d0, [x21, #24]
	str	d0, [x20, #16]
	ldr	w8, [x21, #8]
Lloh8:
	adrp	x10, _IPSEC_POLICYSCOPE_IFNET@GOTPAGE
Lloh9:
	ldr	x10, [x10, _IPSEC_POLICYSCOPE_IFNET@GOTPAGEOFF]
Lloh10:
	adrp	x11, _IPSEC_POLICYSCOPE_PCB@GOTPAGE
Lloh11:
	ldr	x11, [x11, _IPSEC_POLICYSCOPE_PCB@GOTPAGEOFF]
Lloh12:
	adrp	x12, _IPSEC_POLICYSCOPE_GLOBAL@GOTPAGE
Lloh13:
	ldr	x12, [x12, _IPSEC_POLICYSCOPE_GLOBAL@GOTPAGEOFF]
	cmp	w8, #128
	csel	x11, x11, x12, eq
	cmp	w8, #129
	csel	x8, x10, x11, eq
	ldr	w8, [x8]
	str	w8, [x20, #12]
Lloh14:
	adrp	x8, _IPSEC_POLICY_IPSEC@GOTPAGE
Lloh15:
	ldr	x8, [x8, _IPSEC_POLICY_IPSEC@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.3:
	ldr	w8, [x21, #12]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.4:
	mov	x27, #0
	mov	w22, #0
	add	x26, x20, #32
	mov	w23, #32
Lloh17:
	adrp	x28, _ENOBUFS@GOTPAGE
Lloh18:
	ldr	x28, [x28, _ENOBUFS@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	str	x0, [x26]
	ldur	d0, [x24, #20]
	str	d0, [x26, #16]
	ldr	w8, [x24, #32]
	ldr	w9, [x24, #16]
	stp	w9, w8, [x26, #8]
	add	x26, x26, #24
	ldr	x2, [x24, #8]
	mov	x0, x25
	mov	x1, x26
	bl	_bcopy
	ldp	x2, x8, [x24]
	add	x25, x8, x26
	mov	x0, x24
	mov	x1, x25
	bl	_bcopy
	ldr	x8, [x24]
	add	x26, x8, x25
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x27, x27, #1
	ldrsw	x8, [x21, #12]
	cmp	x27, x8
	b.ge	LBB0_11
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #16]
	ldr	x24, [x8, x27, lsl #3]
	mov	x25, x24
	ldr	x8, [x25, #8]!
	ldr	x9, [x24]
	add	x8, x8, x9
	add	x0, x8, #24
	bl	_PFKEY_ALIGN8
	ldr	x8, [x19]
	add	x23, x0, x23
	cmp	x23, x8
	b.ls	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w22, [x28]
	b	LBB0_6
LBB0_9:
	mov	w23, #32
	mov	w0, #32
	bl	_PFKEY_UNIT64
	str	w0, [x20, #8]
LBB0_10:
	mov	w22, #0
	b	LBB0_13
LBB0_11:
	mov	x0, x23
	bl	_PFKEY_UNIT64
	str	w0, [x20, #8]
	cbz	w22, LBB0_10
; %bb.12:
	mov	w23, #32
LBB0_13:
	str	x23, [x19]
LBB0_14:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"null policy"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SADB_X_EXT_POLICY,4,2          ; @SADB_X_EXT_POLICY
	.comm	_IPSEC_POLICYSCOPE_IFNET,4,2    ; @IPSEC_POLICYSCOPE_IFNET
	.comm	_IPSEC_POLICYSCOPE_PCB,4,2      ; @IPSEC_POLICYSCOPE_PCB
	.comm	_IPSEC_POLICYSCOPE_GLOBAL,4,2   ; @IPSEC_POLICYSCOPE_GLOBAL
	.comm	_IPSEC_POLICY_IPSEC,8,3         ; @IPSEC_POLICY_IPSEC
	.comm	_ENOBUFS,4,2                    ; @ENOBUFS
.subsections_via_symbols
