	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pf_begin_rules
_pf_begin_rules:                        ## @pf_begin_rules
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r15d
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_PF_RULES_WASSERT
	testl	%r15d, %r15d
	js	LBB0_2
## %bb.1:
	movq	_PF_RULESET_MAX@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jle	LBB0_2
## %bb.3:
	movq	%rbx, %rdi
	callq	_pf_find_or_create_ruleset
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	%rax, %r12
	movl	%r15d, %ebx
	movq	(%rax), %rax
	leaq	(%rbx,%rbx,2), %r15
	movl	20(%rax,%r15,8), %edi
	callq	_TAILQ_FIRST
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	shlq	$3, %rbx
	leaq	(%rbx,%rbx,2), %rbx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rcx
	movl	20(%rcx,%rbx), %edi
	movq	%rax, %rsi
	callq	_pf_unlink_rule
	movq	(%r12), %rax
	decl	16(%rax,%rbx)
	movl	20(%rax,%rbx), %edi
	callq	_TAILQ_FIRST
	testq	%rax, %rax
	jne	LBB0_6
LBB0_7:
	movq	(%r12), %rax
	movq	8(%rax,%r15,8), %rcx
	incq	%rcx
	movq	%rcx, 8(%rax,%r15,8)
	movq	%rcx, (%r14)
	movl	$1, (%rax,%r15,8)
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PF_RULESET_MAX,4,2             ## @PF_RULESET_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_pf_begin_rules
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pf_begin_rules
_pf_begin_rules:                        ; @pf_begin_rules
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_PF_RULES_WASSERT
	tbnz	w21, #31, LBB0_7
; %bb.1:
Lloh0:
	adrp	x8, _PF_RULESET_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PF_RULESET_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.le	LBB0_7
; %bb.2:
	mov	x0, x20
	bl	_pf_find_or_create_ruleset
	cbz	x0, LBB0_7
; %bb.3:
	mov	x20, x0
	mov	w22, w21
	ldr	x8, [x0]
	mov	w9, #24
	umaddl	x8, w21, w9, x8
	ldr	w0, [x8, #20]
	bl	_TAILQ_FIRST
	cbz	x0, LBB0_6
; %bb.4:
	mov	x1, x0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	add	x9, x22, x22, lsl #1
	lsl	x21, x9, #3
	add	x8, x8, x21
	ldr	w0, [x8, #20]
	bl	_pf_unlink_rule
	ldr	x8, [x20]
	add	x8, x8, x21
	ldp	w9, w0, [x8, #16]
	sub	w9, w9, #1
	str	w9, [x8, #16]
	bl	_TAILQ_FIRST
	mov	x1, x0
	cbnz	x0, LBB0_5
LBB0_6:
	mov	w0, #0
	ldr	x8, [x20]
	mov	w9, #24
	madd	x8, x22, x9, x8
	ldr	x9, [x8, #8]
	add	x9, x9, #1
	str	x9, [x8, #8]
	str	x9, [x19]
	mov	w9, #1
	str	w9, [x8]
	b	LBB0_8
LBB0_7:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PF_RULESET_MAX,4,2             ; @PF_RULESET_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_pf_begin_rules
.subsections_via_symbols
