	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pfkey_compile_policy
_pfkey_compile_policy:                  ## @pfkey_compile_policy
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movl	%ecx, %r12d
	movq	%rdx, %r13
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_sock_net
	cmpl	$129, (%r15)
	jne	LBB0_4
## %bb.1:
	movq	_IP_IPSEC_POLICY@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	jne	LBB0_2
## %bb.5:
	movq	%r13, %rbx
	movq	_EINVAL@GOTPCREL(%rip), %rdx
	xorl	%r13d, %r13d
	xorl	%ecx, %ecx
	subl	(%rdx), %ecx
	movl	%ecx, (%r14)
	cmpl	$24, %r12d
	jb	LBB0_25
## %bb.6:
	movl	(%rbx), %ecx
	shll	$3, %ecx
	cmpl	%r12d, %ecx
	jg	LBB0_21
## %bb.7:
	movq	%rbx, %rsi
	movq	8(%rbx), %rcx
	movq	_IPSEC_POLICY_BYPASS@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jle	LBB0_8
LBB0_21:
	xorl	%r13d, %r13d
	jmp	LBB0_25
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%r13d, %r13d
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, (%r14)
LBB0_25:
	movq	%r13, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	16(%rsi), %ecx
	xorl	%r13d, %r13d
	testl	%ecx, %ecx
	je	LBB0_25
## %bb.9:
	movq	_IPSEC_DIR_OUTBOUND@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jg	LBB0_25
## %bb.10:
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_xfrm_policy_alloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	movq	%rax, %r13
	movq	8(%rbx), %rax
	movq	_IPSEC_POLICY_DISCARD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.14:
	movq	_XFRM_POLICY_BLOCK@GOTPCREL(%rip), %rcx
	jmp	LBB0_15
LBB0_11:
	movq	_ENOBUFS@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_13:
	movq	_XFRM_POLICY_ALLOW@GOTPCREL(%rip), %rcx
LBB0_15:
	movq	_EINVAL@GOTPCREL(%rip), %rdx
	movl	(%rcx), %ecx
	movl	%ecx, 56(%r13)
	movq	_XFRM_INF@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 48(%r13)
	movq	%rcx, 40(%r13)
	movq	%rcx, 32(%r13)
	movq	%rcx, 24(%r13)
	movl	(%r15), %ecx
	movl	%ecx, (%r13)
	movq	$0, 16(%r13)
	movq	_IPSEC_POLICY_IPSEC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_17
## %bb.16:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_parse_ipsecrequests
	movq	_EINVAL@GOTPCREL(%rip), %rdx
	movl	%eax, (%r14)
	testl	%eax, %eax
	js	LBB0_20
LBB0_17:
	movslq	%r12d, %rax
	movslq	(%rbx), %r15
	leaq	4(,%r15,8), %rcx
	cmpq	%rax, %rcx
	jbe	LBB0_18
LBB0_24:
	movl	16(%rbx), %eax
	decl	%eax
	movl	%eax, (%r14)
	jmp	LBB0_25
LBB0_18:
	shlq	$3, %r15
	movl	(%rbx,%r15), %eax
	addl	%r15d, %eax
	cmpl	%r12d, %eax
	jle	LBB0_22
## %bb.19:
	xorl	%eax, %eax
	subl	(%rdx), %eax
	movl	%eax, (%r14)
	jmp	LBB0_20
LBB0_22:
	addq	%rbx, %r15
	movq	%r15, %rdi
	callq	_verify_sec_ctx_len
	movl	%eax, (%r14)
	testl	%eax, %eax
	jne	LBB0_20
## %bb.23:
	movq	%r15, %rdi
	callq	_pfkey_sadb2xfrm_user_sec_ctx
	movq	%rbx, %r15
	movq	%rax, %rbx
	movq	%r13, %rdi
	addq	$8, %rdi
	movq	%rax, %rsi
	callq	_security_xfrm_policy_alloc
	movl	%eax, (%r14)
	movq	%rbx, %rdi
	movq	%r15, %rbx
	callq	_kfree
	cmpl	$0, (%r14)
	je	LBB0_24
LBB0_20:
	movl	$1, 4(%r13)
	movq	%r13, %rdi
	callq	_xfrm_policy_destroy
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_IP_IPSEC_POLICY,4,2            ## @IP_IPSEC_POLICY
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IPSEC_POLICY_BYPASS,8,3        ## @IPSEC_POLICY_BYPASS
	.comm	_IPSEC_DIR_OUTBOUND,4,2         ## @IPSEC_DIR_OUTBOUND
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_ENOBUFS,4,2                    ## @ENOBUFS
	.comm	_IPSEC_POLICY_DISCARD,8,3       ## @IPSEC_POLICY_DISCARD
	.comm	_XFRM_POLICY_BLOCK,4,2          ## @XFRM_POLICY_BLOCK
	.comm	_XFRM_POLICY_ALLOW,4,2          ## @XFRM_POLICY_ALLOW
	.comm	_XFRM_INF,8,3                   ## @XFRM_INF
	.comm	_IPSEC_POLICY_IPSEC,8,3         ## @IPSEC_POLICY_IPSEC
	.comm	_IPV6_IPSEC_POLICY,4,2          ## @IPV6_IPSEC_POLICY
	.no_dead_strip	_pfkey_compile_policy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pfkey_compile_policy
_pfkey_compile_policy:                  ; @pfkey_compile_policy
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x4
	mov	x22, x3
	mov	x21, x2
	mov	x20, x1
	mov	x23, x0
	bl	_sock_net
	ldr	w8, [x23]
	cmp	w8, #129
	b.ne	LBB0_6
; %bb.1:
Lloh0:
	adrp	x8, _IP_IPSEC_POLICY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IP_IPSEC_POLICY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_7
; %bb.2:
Lloh3:
	adrp	x24, _EINVAL@GOTPAGE
Lloh4:
	ldr	x24, [x24, _EINVAL@GOTPAGEOFF]
	ldr	w8, [x24]
	neg	w8, w8
	str	w8, [x19]
	cmp	w22, #24
	b.lo	LBB0_5
; %bb.3:
	ldr	w8, [x21]
	cmp	w22, w8, lsl #3
	b.lt	LBB0_5
; %bb.4:
	ldr	x8, [x21, #8]
Lloh5:
	adrp	x9, _IPSEC_POLICY_BYPASS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IPSEC_POLICY_BYPASS@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_11
LBB0_5:
	mov	x20, #0
	b	LBB0_10
LBB0_6:
	mov	x20, #0
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
	mov	x20, #0
Lloh10:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w8, w8
LBB0_9:
	str	w8, [x19]
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_11:
	mov	x20, #0
	ldr	w8, [x21, #16]
	cbz	w8, LBB0_10
; %bb.12:
Lloh12:
	adrp	x9, _IPSEC_DIR_OUTBOUND@GOTPAGE
Lloh13:
	ldr	x9, [x9, _IPSEC_DIR_OUTBOUND@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w9
	b.gt	LBB0_10
; %bb.13:
Lloh15:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_xfrm_policy_alloc
	mov	x20, x0
	cbz	x0, LBB0_18
; %bb.14:
Lloh18:
	adrp	x8, _IPSEC_POLICY_DISCARD@GOTPAGE
Lloh19:
	ldr	x8, [x8, _IPSEC_POLICY_DISCARD@GOTPAGEOFF]
	ldr	x9, [x21, #8]
Lloh20:
	ldr	x8, [x8]
Lloh21:
	adrp	x10, _XFRM_POLICY_BLOCK@GOTPAGE
Lloh22:
	ldr	x10, [x10, _XFRM_POLICY_BLOCK@GOTPAGEOFF]
Lloh23:
	adrp	x11, _XFRM_POLICY_ALLOW@GOTPAGE
Lloh24:
	ldr	x11, [x11, _XFRM_POLICY_ALLOW@GOTPAGEOFF]
	cmp	x9, x8
	csel	x8, x10, x11, eq
	ldr	w8, [x8]
	str	w8, [x20, #56]
Lloh25:
	adrp	x8, _XFRM_INF@GOTPAGE
Lloh26:
	ldr	x8, [x8, _XFRM_INF@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	stp	x8, x8, [x20, #40]
	str	x8, [x20, #32]
	ldr	w10, [x23]
	str	w10, [x20]
	stp	xzr, x8, [x20, #16]
Lloh28:
	adrp	x8, _IPSEC_POLICY_IPSEC@GOTPAGE
Lloh29:
	ldr	x8, [x8, _IPSEC_POLICY_IPSEC@GOTPAGEOFF]
Lloh30:
	ldr	x8, [x8]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.15:
	mov	x0, x20
	mov	x1, x21
	bl	_parse_ipsecrequests
	str	w0, [x19]
	tbnz	w0, #31, LBB0_23
LBB0_16:
	sxtw	x9, w22
	ldrsw	x8, [x21]
	mov	w10, #4
	bfi	x10, x8, #3, #61
	cmp	x10, x9
	b.ls	LBB0_19
LBB0_17:
	ldr	w8, [x21, #16]
	sub	w8, w8, #1
	b	LBB0_9
LBB0_18:
Lloh31:
	adrp	x8, _ENOBUFS@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOBUFS@GOTPAGEOFF]
	b	LBB0_8
LBB0_19:
	lsl	x8, x8, #3
	add	x23, x21, x8
	ldr	w9, [x23]
	add	w8, w9, w8
	cmp	w8, w22
	b.le	LBB0_21
; %bb.20:
	ldr	w8, [x24]
	neg	w8, w8
	str	w8, [x19]
	b	LBB0_23
LBB0_21:
	mov	x0, x23
	bl	_verify_sec_ctx_len
	str	w0, [x19]
	cbnz	w0, LBB0_23
; %bb.22:
	mov	x0, x23
	bl	_pfkey_sadb2xfrm_user_sec_ctx
	mov	x22, x0
	add	x0, x20, #8
	mov	x1, x22
	bl	_security_xfrm_policy_alloc
	str	w0, [x19]
	mov	x0, x22
	bl	_kfree
	ldr	w8, [x19]
	cbz	w8, LBB0_17
LBB0_23:
	mov	w8, #1
	str	w8, [x20, #4]
	mov	x0, x20
	bl	_xfrm_policy_destroy
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_IP_IPSEC_POLICY,4,2            ; @IP_IPSEC_POLICY
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IPSEC_POLICY_BYPASS,8,3        ; @IPSEC_POLICY_BYPASS
	.comm	_IPSEC_DIR_OUTBOUND,4,2         ; @IPSEC_DIR_OUTBOUND
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_ENOBUFS,4,2                    ; @ENOBUFS
	.comm	_IPSEC_POLICY_DISCARD,8,3       ; @IPSEC_POLICY_DISCARD
	.comm	_XFRM_POLICY_BLOCK,4,2          ; @XFRM_POLICY_BLOCK
	.comm	_XFRM_POLICY_ALLOW,4,2          ; @XFRM_POLICY_ALLOW
	.comm	_XFRM_INF,8,3                   ; @XFRM_INF
	.comm	_IPSEC_POLICY_IPSEC,8,3         ; @IPSEC_POLICY_IPSEC
	.comm	_IPV6_IPSEC_POLICY,4,2          ; @IPV6_IPSEC_POLICY
	.no_dead_strip	_pfkey_compile_policy
.subsections_via_symbols
