	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function parse_ipsecrequest
_parse_ipsecrequest:                    ## @parse_ipsecrequest
	.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	%rsi, %r14
	movq	%rdi, %rbx
	callq	_xp_net
	movq	%rax, %r15
	movslq	(%rbx), %rax
	movq	_XFRM_MAX_DEPTH@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	jle	LBB0_1
## %bb.3:
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.5:
	movq	8(%rbx), %r12
	movl	24(%r14), %ecx
	leaq	(%rax,%rax,4), %r13
	movl	%ecx, 28(%r12,%r13,8)
	callq	_pfkey_mode_to_xfrm
	testl	%eax, %eax
	js	LBB0_4
## %bb.6:
	movl	%eax, (%r12,%r13,8)
	movq	8(%r14), %rcx
	movq	_IPSEC_LEVEL_USE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_8
## %bb.7:
	movl	$1, 4(%r12,%r13,8)
	jmp	LBB0_12
LBB0_1:
	movq	_ELOOP@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_8:
	movq	_IPSEC_LEVEL_UNIQUE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_12
## %bb.9:
	movq	16(%r14), %rcx
	movq	%rcx, 8(%r12,%r13,8)
	movq	_IPSEC_MANUAL_REQID_MAX@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	cmpq	(%rdx), %rcx
	cmovleq	%rcx, %rsi
	movq	%rsi, 8(%r12,%r13,8)
	testq	%rsi, %rsi
	jne	LBB0_12
## %bb.10:
	leaq	(%r12,%r13,8), %rax
	addq	$8, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_gen_reqid
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_18
## %bb.11:
	leaq	(%r12,%r13,8), %rax
	movl	(%rax), %eax
LBB0_12:
	movq	_XFRM_MODE_TUNNEL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_15
## %bb.13:
	addq	$32, %r14
	leaq	(%r12,%r13,8), %rsi
	addq	$32, %rsi
	movq	%r14, %rdi
	callq	_pfkey_sockaddr_extract
	testl	%eax, %eax
	je	LBB0_4
## %bb.14:
	movl	%eax, %r15d
	movl	%eax, %edi
	callq	_pfkey_sockaddr_len
	cltq
	leaq	(%r14,%rax,4), %rdi
	leaq	(%r12,%r13,8), %rsi
	addq	$24, %rsi
	callq	_pfkey_sockaddr_extract
	cmpl	%r15d, %eax
	je	LBB0_16
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movl	4(%rbx), %r15d
LBB0_16:
	movl	%r15d, 16(%r12,%r13,8)
	movl	$1, 20(%r12,%r13,8)
	incl	(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_18:
	movq	_ENOBUFS@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_XFRM_MAX_DEPTH,8,3             ## @XFRM_MAX_DEPTH
	.comm	_ELOOP,4,2                      ## @ELOOP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IPSEC_LEVEL_USE,8,3            ## @IPSEC_LEVEL_USE
	.comm	_IPSEC_LEVEL_UNIQUE,8,3         ## @IPSEC_LEVEL_UNIQUE
	.comm	_IPSEC_MANUAL_REQID_MAX,8,3     ## @IPSEC_MANUAL_REQID_MAX
	.comm	_ENOBUFS,4,2                    ## @ENOBUFS
	.comm	_XFRM_MODE_TUNNEL,4,2           ## @XFRM_MODE_TUNNEL
	.no_dead_strip	_parse_ipsecrequest
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function parse_ipsecrequest
_parse_ipsecrequest:                    ; @parse_ipsecrequest
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_xp_net
	ldrsw	x22, [x19]
Lloh0:
	adrp	x8, _XFRM_MAX_DEPTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XFRM_MAX_DEPTH@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x22
	b.le	LBB0_5
; %bb.1:
	mov	x21, x0
	ldr	x0, [x20]
	cbz	x0, LBB0_13
; %bb.2:
	ldr	x23, [x19, #8]
	ldr	w8, [x20, #24]
	mov	w9, #40
	madd	x9, x22, x9, x23
	str	w8, [x9, #28]
	bl	_pfkey_mode_to_xfrm
	tbnz	w0, #31, LBB0_13
; %bb.3:
	mov	w8, #40
	madd	x24, x22, x8, x23
	str	w0, [x24]
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _IPSEC_LEVEL_USE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IPSEC_LEVEL_USE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	mov	w8, #40
	madd	x8, x22, x8, x23
	mov	w9, #1
	str	w9, [x8, #4]
	b	LBB0_10
LBB0_5:
Lloh6:
	adrp	x8, _ELOOP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ELOOP@GOTPAGEOFF]
	b	LBB0_14
LBB0_6:
Lloh8:
	adrp	x9, _IPSEC_LEVEL_UNIQUE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IPSEC_LEVEL_UNIQUE@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.7:
	ldr	x8, [x20, #16]
	mov	w9, #40
	madd	x25, x22, x9, x23
	str	x8, [x25, #8]!
Lloh11:
	adrp	x9, _IPSEC_MANUAL_REQID_MAX@GOTPAGE
Lloh12:
	ldr	x9, [x9, _IPSEC_MANUAL_REQID_MAX@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	csel	x8, xzr, x8, gt
	str	x8, [x25]
	cbnz	x8, LBB0_10
; %bb.8:
	mov	x0, x21
	bl	_gen_reqid
	str	x0, [x25]
	cbz	x0, LBB0_18
; %bb.9:
	ldr	w0, [x24]
LBB0_10:
Lloh14:
	adrp	x8, _XFRM_MODE_TUNNEL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _XFRM_MODE_TUNNEL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_16
; %bb.11:
	add	x21, x20, #32
	mov	w8, #40
	madd	x8, x22, x8, x23
	add	x1, x8, #32
	mov	x0, x21
	bl	_pfkey_sockaddr_extract
	cbz	w0, LBB0_13
; %bb.12:
	mov	x20, x0
	bl	_pfkey_sockaddr_len
	add	x0, x21, w0, sxtw #2
	mov	w8, #40
	madd	x8, x22, x8, x23
	add	x1, x8, #24
	bl	_pfkey_sockaddr_extract
	cmp	w0, w20
	b.eq	LBB0_17
LBB0_13:
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_16:
	ldr	w20, [x19, #4]
LBB0_17:
	mov	w0, #0
	mov	w8, #40
	madd	x8, x22, x8, x23
	mov	w9, #1
	stp	w20, w9, [x8, #16]
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
	b	LBB0_15
LBB0_18:
Lloh19:
	adrp	x8, _ENOBUFS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOBUFS@GOTPAGEOFF]
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_XFRM_MAX_DEPTH,8,3             ; @XFRM_MAX_DEPTH
	.comm	_ELOOP,4,2                      ; @ELOOP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IPSEC_LEVEL_USE,8,3            ; @IPSEC_LEVEL_USE
	.comm	_IPSEC_LEVEL_UNIQUE,8,3         ; @IPSEC_LEVEL_UNIQUE
	.comm	_IPSEC_MANUAL_REQID_MAX,8,3     ; @IPSEC_MANUAL_REQID_MAX
	.comm	_ENOBUFS,4,2                    ; @ENOBUFS
	.comm	_XFRM_MODE_TUNNEL,4,2           ; @XFRM_MODE_TUNNEL
	.no_dead_strip	_parse_ipsecrequest
.subsections_via_symbols
