	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipsec_chkreplay                ## -- Begin function ipsec_chkreplay
	.p2align	4, 0x90
_ipsec_chkreplay:                       ## @ipsec_chkreplay
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movl	%edi, %r14d
	xorl	%edi, %edi
	testq	%rsi, %rsi
	setne	%dil
	leaq	L_.str(%rip), %rsi
	callq	_IPSEC_ASSERT
	xorl	%edi, %edi
	cmpq	$0, (%rbx)
	setne	%dil
	leaq	L_.str.1(%rip), %rsi
	callq	_IPSEC_ASSERT
	movq	(%rbx), %rbx
	movl	(%rbx), %ecx
	movl	$1, %eax
	testl	%ecx, %ecx
	je	LBB0_7
## %bb.1:
	testl	%r14d, %r14d
	je	LBB0_2
## %bb.3:
	cmpq	$0, 8(%rbx)
	je	LBB0_7
## %bb.4:
	movl	16(%rbx), %edx
	subl	%r14d, %edx
	jl	LBB0_7
## %bb.5:
	shll	$3, %ecx
	movl	$0, %eax
	cmpl	%ecx, %edx
	jge	LBB0_7
## %bb.6:
	movq	_IPSEC_BITMAP_LOC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	andl	%r14d, %r15d
	movq	_IPSEC_REDUNDANT_BIT_SHIFTS@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r14d
	movl	32(%rbx), %edi
	callq	_IPSEC_BITMAP_INDEX_MASK
	andl	%r14d, %eax
	movq	24(%rbx), %rcx
	cltq
	movl	(%rcx,%rax,4), %ecx
	xorl	%eax, %eax
	btl	%r15d, %ecx
	setae	%al
	jmp	LBB0_7
LBB0_2:
	xorl	%eax, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Null SA"

L_.str.1:                               ## @.str.1
	.asciz	"Null replay state"

	.comm	_IPSEC_BITMAP_LOC_MASK,4,2      ## @IPSEC_BITMAP_LOC_MASK
	.comm	_IPSEC_REDUNDANT_BIT_SHIFTS,4,2 ## @IPSEC_REDUNDANT_BIT_SHIFTS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipsec_chkreplay                ; -- Begin function ipsec_chkreplay
	.p2align	2
_ipsec_chkreplay:                       ; @ipsec_chkreplay
	.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, x1
	mov	x19, x0
	cmp	x1, #0
	cset	w0, ne
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_IPSEC_ASSERT
	ldr	x8, [x20]
	cmp	x8, #0
	cset	w0, ne
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_IPSEC_ASSERT
	ldr	x20, [x20]
	ldr	w8, [x20]
	cbz	w8, LBB0_4
; %bb.1:
	cbz	w19, LBB0_7
; %bb.2:
	ldr	x9, [x20, #8]
	cbz	x9, LBB0_4
; %bb.3:
	ldr	w9, [x20, #16]
	subs	w9, w9, w19
	b.ge	LBB0_5
LBB0_4:
	mov	w0, #1
	b	LBB0_8
LBB0_5:
	lsl	w8, w8, #3
	cmp	w9, w8
	b.ge	LBB0_7
; %bb.6:
Lloh4:
	adrp	x8, _IPSEC_BITMAP_LOC_MASK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IPSEC_BITMAP_LOC_MASK@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	and	w21, w8, w19
Lloh7:
	adrp	x8, _IPSEC_REDUNDANT_BIT_SHIFTS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IPSEC_REDUNDANT_BIT_SHIFTS@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	asr	w19, w19, w8
	ldr	w0, [x20, #32]
	bl	_IPSEC_BITMAP_INDEX_MASK
	and	w8, w0, w19
	ldr	x9, [x20, #24]
	ldr	w8, [x9, w8, sxtw #2]
	mvn	w8, w8
	lsr	w8, w8, w21
	and	w0, w8, #0x1
	b	LBB0_8
LBB0_7:
	mov	w0, #0
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 AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Null SA"

l_.str.1:                               ; @.str.1
	.asciz	"Null replay state"

	.comm	_IPSEC_BITMAP_LOC_MASK,4,2      ; @IPSEC_BITMAP_LOC_MASK
	.comm	_IPSEC_REDUNDANT_BIT_SHIFTS,4,2 ; @IPSEC_REDUNDANT_BIT_SHIFTS
.subsections_via_symbols
