	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipsec_copy_pcbpolicy           ## -- Begin function ipsec_copy_pcbpolicy
	.p2align	4, 0x90
_ipsec_copy_pcbpolicy:                  ## @ipsec_copy_pcbpolicy
	.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
	xorl	%r14d, %r14d
	cmpq	$0, (%rdi)
	je	LBB0_12
## %bb.1:
	movq	%rsi, %r15
	movq	%rdi, %rbx
	xorl	%edi, %edi
	cmpq	$0, (%rsi)
	setne	%dil
	leaq	L_.str(%rip), %rsi
	callq	_IPSEC_ASSERT
	movq	(%r15), %rax
	movq	_INP_INBOUND_POLICY@GOTPCREL(%rip), %r13
	movq	_INP_OUTBOUND_POLICY@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	orl	(%r13), %ecx
	xorl	%edi, %edi
	andl	(%rax), %ecx
	sete	%dil
	leaq	L_.str.1(%rip), %rsi
	callq	_IPSEC_ASSERT
	movq	%r15, %rdi
	callq	_INP_WLOCK_ASSERT
	movq	%rbx, %rdi
	callq	_INP_LOCK_ASSERT
	movq	(%rbx), %rax
	movl	(%rax), %ecx
	testl	%ecx, (%r13)
	je	LBB0_7
## %bb.2:
	movq	16(%rax), %rdi
	callq	_ipsec_deepcopy_pcbpolicy
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r12
	movq	_IPSEC_DIR_INBOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_ipsec_setspidx_inpcb
	movq	(%r15), %rdi
	cmpq	$0, 16(%rdi)
	je	LBB0_6
## %bb.5:
	addq	$16, %rdi
	callq	_key_freesp
	movq	(%r15), %rdi
LBB0_6:
	movq	%r12, 16(%rdi)
	movl	(%r13), %eax
	orl	%eax, (%rdi)
	movq	(%rbx), %rax
	movl	(%rax), %ecx
	movq	_INP_OUTBOUND_POLICY@GOTPCREL(%rip), %r12
LBB0_7:
	testl	%ecx, (%r12)
	je	LBB0_12
## %bb.8:
	movq	8(%rax), %rdi
	callq	_ipsec_deepcopy_pcbpolicy
	testq	%rax, %rax
	je	LBB0_3
## %bb.9:
	movq	%rax, %rbx
	movq	_IPSEC_DIR_OUTBOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_ipsec_setspidx_inpcb
	movq	(%r15), %rdi
	cmpq	$0, 8(%rdi)
	je	LBB0_11
## %bb.10:
	addq	$8, %rdi
	callq	_key_freesp
	movq	(%r15), %rdi
LBB0_11:
	movq	%rbx, 8(%rdi)
	movl	(%r12), %eax
	orl	%eax, (%rdi)
	jmp	LBB0_12
LBB0_3:
	movq	_ENOBUFS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"new inp_sp is NULL"

	.comm	_INP_INBOUND_POLICY,4,2         ## @INP_INBOUND_POLICY
	.comm	_INP_OUTBOUND_POLICY,4,2        ## @INP_OUTBOUND_POLICY
L_.str.1:                               ## @.str.1
	.asciz	"new PCB already has configured policies"

	.comm	_ENOBUFS,4,2                    ## @ENOBUFS
	.comm	_IPSEC_DIR_INBOUND,4,2          ## @IPSEC_DIR_INBOUND
	.comm	_IPSEC_DIR_OUTBOUND,4,2         ## @IPSEC_DIR_OUTBOUND
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipsec_copy_pcbpolicy           ; -- Begin function ipsec_copy_pcbpolicy
	.p2align	2
_ipsec_copy_pcbpolicy:                  ; @ipsec_copy_pcbpolicy
	.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
	ldr	x8, [x0]
	cbz	x8, LBB0_11
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x1]
	cmp	x8, #0
	cset	w0, ne
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_IPSEC_ASSERT
	ldr	x8, [x19]
	ldr	w8, [x8]
Lloh2:
	adrp	x23, _INP_INBOUND_POLICY@GOTPAGE
Lloh3:
	ldr	x23, [x23, _INP_INBOUND_POLICY@GOTPAGEOFF]
	ldr	w9, [x23]
Lloh4:
	adrp	x22, _INP_OUTBOUND_POLICY@GOTPAGE
Lloh5:
	ldr	x22, [x22, _INP_OUTBOUND_POLICY@GOTPAGEOFF]
	ldr	w10, [x22]
	orr	w9, w10, w9
	tst	w9, w8
	cset	w0, eq
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_IPSEC_ASSERT
	mov	x0, x19
	bl	_INP_WLOCK_ASSERT
	mov	x0, x20
	bl	_INP_LOCK_ASSERT
	ldr	x8, [x20]
	ldr	w9, [x8]
	ldr	w10, [x23]
	tst	w10, w9
	b.eq	LBB0_6
; %bb.2:
	ldr	x0, [x8, #16]
	bl	_ipsec_deepcopy_pcbpolicy
	cbz	x0, LBB0_12
; %bb.3:
	mov	x21, x0
Lloh8:
	adrp	x8, _IPSEC_DIR_INBOUND@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IPSEC_DIR_INBOUND@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_ipsec_setspidx_inpcb
	ldr	x8, [x19]
	mov	x0, x8
	ldr	x9, [x0, #16]!
	cbz	x9, LBB0_5
; %bb.4:
	bl	_key_freesp
	ldr	x8, [x19]
LBB0_5:
	str	x21, [x8, #16]
	ldr	w9, [x23]
	ldr	w10, [x8]
	orr	w9, w10, w9
	str	w9, [x8]
	ldr	x8, [x20]
	ldr	w9, [x8]
LBB0_6:
	ldr	w10, [x22]
	tst	w10, w9
	b.eq	LBB0_11
; %bb.7:
	ldr	x0, [x8, #8]
	bl	_ipsec_deepcopy_pcbpolicy
	cbz	x0, LBB0_12
; %bb.8:
	mov	x20, x0
Lloh11:
	adrp	x8, _IPSEC_DIR_OUTBOUND@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IPSEC_DIR_OUTBOUND@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_ipsec_setspidx_inpcb
	ldr	x8, [x19]
	mov	x0, x8
	ldr	x9, [x0, #8]!
	cbz	x9, LBB0_10
; %bb.9:
	bl	_key_freesp
	ldr	x8, [x19]
LBB0_10:
	mov	w0, #0
	str	x20, [x8, #8]
	ldr	w9, [x22]
	ldr	w10, [x8]
	orr	w9, w10, w9
	str	w9, [x8]
	b	LBB0_13
LBB0_11:
	mov	w0, #0
	b	LBB0_13
LBB0_12:
Lloh14:
	adrp	x8, _ENOBUFS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOBUFS@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
LBB0_13:
	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
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"new inp_sp is NULL"

	.comm	_INP_INBOUND_POLICY,4,2         ; @INP_INBOUND_POLICY
	.comm	_INP_OUTBOUND_POLICY,4,2        ; @INP_OUTBOUND_POLICY
l_.str.1:                               ; @.str.1
	.asciz	"new PCB already has configured policies"

	.comm	_ENOBUFS,4,2                    ; @ENOBUFS
	.comm	_IPSEC_DIR_INBOUND,4,2          ; @IPSEC_DIR_INBOUND
	.comm	_IPSEC_DIR_OUTBOUND,4,2         ; @IPSEC_DIR_OUTBOUND
.subsections_via_symbols
