	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipsec_set_tunnel
_ipsec_set_tunnel:                      ## @ipsec_set_tunnel
	.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
	movl	%ecx, %r12d
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_IPSEC_SPCOUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movq	_SA_XLOCKED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ipsec_ioctl_sx@GOTPCREL(%rip), %rdi
	callq	_sx_assert
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	movq	%r13, %rcx
	movl	%r12d, %r8d
	callq	_ipsec_newpolicies
	testq	%rax, %rax
	je	LBB0_1
## %bb.16:
	movq	_IFF_DRV_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movq	8(%r14), %rcx
	andl	%eax, (%rcx)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_1:
	movq	_IPSEC_SPCOUNT@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_key_register_ifnet
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	cmpl	$0, (%r12)
	jle	LBB0_5
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_key_freesp
	incq	%rbx
	movslq	(%r12), %rax
	addq	$8, %r15
	cmpq	%rax, %rbx
	jl	LBB0_4
LBB0_5:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %eax
LBB0_18:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_20
## %bb.19:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	cmpq	$0, (%r14)
	je	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	callq	_ipsec_delete_tunnel
LBB0_8:
	movl	(%r12), %edx
	testl	%edx, %edx
	movq	%rbx, %rdi
	jle	LBB0_15
## %bb.9:
	leaq	-1(%rdx), %rcx
	movl	%edx, %eax
	andl	$3, %eax
	cmpq	$3, %rcx
	jae	LBB0_11
## %bb.10:
	xorl	%ecx, %ecx
	jmp	LBB0_13
LBB0_11:
	andl	$-4, %edx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15,%rcx,8), %rsi
	movq	16(%r14), %rbx
	movq	%rsi, (%rbx,%rcx,8)
	movq	8(%r15,%rcx,8), %rsi
	movq	16(%r14), %rbx
	movq	%rsi, 8(%rbx,%rcx,8)
	movq	16(%r15,%rcx,8), %rsi
	movq	16(%r14), %rbx
	movq	%rsi, 16(%rbx,%rcx,8)
	movq	24(%r15,%rcx,8), %rsi
	movq	16(%r14), %rbx
	movq	%rsi, 24(%rbx,%rcx,8)
	addq	$4, %rcx
	cmpq	%rcx, %rdx
	jne	LBB0_12
LBB0_13:
	testq	%rax, %rax
	je	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15,%rcx,8), %rdx
	movq	16(%r14), %rsi
	movq	%rdx, (%rsi,%rcx,8)
	incq	%rcx
	decq	%rax
	jne	LBB0_14
LBB0_15:
	movq	(%rdi), %rax
	movq	%rax, (%r14)
	callq	_ipsec_srchash
	movq	_srchash@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	_CK_LIST_INSERT_HEAD
	movq	%r14, %rdi
	callq	_ipsec_set_running
	xorl	%eax, %eax
	jmp	LBB0_18
LBB0_20:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_IPSEC_SPCOUNT,4,2              ## @IPSEC_SPCOUNT
	.comm	_ipsec_ioctl_sx,4,2             ## @ipsec_ioctl_sx
	.comm	_SA_XLOCKED,4,2                 ## @SA_XLOCKED
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_srchash,4,2                    ## @srchash
	.comm	_IFF_DRV_RUNNING,4,2            ## @IFF_DRV_RUNNING
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_ipsec_set_tunnel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipsec_set_tunnel
_ipsec_set_tunnel:                      ; @ipsec_set_tunnel
	.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
	sub	sp, sp, #16
	mov	x22, x3
	mov	x23, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x24, _IPSEC_SPCOUNT@GOTPAGE
Lloh4:
	ldr	x24, [x24, _IPSEC_SPCOUNT@GOTPAGEOFF]
	ldr	w8, [x24]
	lsl	x8, x8, #3
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x20, x9, x8
	mov	sp, x20
Lloh7:
	adrp	x8, _SA_XLOCKED@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SA_XLOCKED@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x0, _ipsec_ioctl_sx@GOTPAGE
Lloh11:
	ldr	x0, [x0, _ipsec_ioctl_sx@GOTPAGEOFF]
	bl	_sx_assert
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	mov	x3, x23
	mov	x4, x22
	bl	_ipsec_newpolicies
	cbz	x0, LBB0_2
; %bb.1:
Lloh12:
	adrp	x8, _IFF_DRV_RUNNING@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IFF_DRV_RUNNING@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldr	x9, [x19, #8]
	ldr	w10, [x9]
	bic	w8, w10, w8
	str	w8, [x9]
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_7
LBB0_2:
	ldr	w1, [x24]
	mov	x0, x20
	bl	_key_register_ifnet
	cbz	x0, LBB0_10
; %bb.3:
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.4:
	mov	x19, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_key_freesp
	add	x19, x19, #1
	ldrsw	x8, [x24]
	add	x20, x20, #8
	cmp	x19, x8
	b.lt	LBB0_5
LBB0_6:
Lloh17:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_7:
	ldr	w0, [x8]
LBB0_8:
	ldur	x8, [x29, #-56]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.9:
	sub	sp, x29, #48
	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_10:
	ldr	x8, [x19]
	cbz	x8, LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_ipsec_delete_tunnel
LBB0_12:
	ldr	w9, [x24]
	cmp	w9, #1
	b.lt	LBB0_15
; %bb.13:
	mov	x8, #0
	lsl	x9, x9, #3
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x20, x8]
	ldr	x11, [x19, #16]
	str	x10, [x11, x8]
	add	x8, x8, #8
	cmp	x9, x8
	b.ne	LBB0_14
LBB0_15:
	ldr	x8, [x21]
	str	x8, [x19]
	mov	x0, x21
	bl	_ipsec_srchash
Lloh22:
	adrp	x8, _srchash@GOTPAGE
Lloh23:
	ldr	x8, [x8, _srchash@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	mov	x1, x19
	bl	_CK_LIST_INSERT_HEAD
	mov	x0, x19
	bl	_ipsec_set_running
	mov	w0, #0
	b	LBB0_8
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_IPSEC_SPCOUNT,4,2              ; @IPSEC_SPCOUNT
	.comm	_ipsec_ioctl_sx,4,2             ; @ipsec_ioctl_sx
	.comm	_SA_XLOCKED,4,2                 ; @SA_XLOCKED
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_srchash,4,2                    ; @srchash
	.comm	_IFF_DRV_RUNNING,4,2            ; @IFF_DRV_RUNNING
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_ipsec_set_tunnel
.subsections_via_symbols
