	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_decode_udp_ip_header           ## -- Begin function decode_udp_ip_header
	.p2align	4, 0x90
_decode_udp_ip_header:                  ## @decode_udp_ip_header
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r14d
	movq	%rcx, %r13
	movq	%rdx, %r15
	movslq	%esi, %rax
	leaq	(%rdi,%rax), %r12
	movzbl	(%rdi,%rax), %ebx
	shll	$2, %ebx
	andl	$60, %ebx
	incl	_decode_udp_ip_header.ip_packets_seen(%rip)
	movq	%r12, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_checksum
	movl	%eax, %edi
	callq	_wrapsum
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movl	_decode_udp_ip_header.ip_packets_bad_checksum(%rip), %esi
	incl	%esi
	movl	%esi, _decode_udp_ip_header.ip_packets_bad_checksum(%rip)
	movl	_decode_udp_ip_header.ip_packets_seen(%rip), %ecx
	movl	$-1, %ebx
	cmpl	$5, %ecx
	jl	LBB0_21
## %bb.2:
	testl	%esi, %esi
	je	LBB0_21
## %bb.3:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	cmpl	$1, %eax
	jg	LBB0_21
## %bb.4:
	leaq	L_.str(%rip), %rdi
	movl	%ecx, %edx
	callq	_note
	movl	$0, _decode_udp_ip_header.ip_packets_bad_checksum(%rip)
	movl	$0, _decode_udp_ip_header.ip_packets_seen(%rip)
	jmp	LBB0_21
LBB0_5:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movl	4(%r12), %edi
	callq	_ntohs
	cmpl	%r14d, %eax
	je	LBB0_7
## %bb.6:
	movl	4(%r12), %edi
	callq	_ntohs
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_debug
LBB0_7:
	leaq	(%r12,%rbx), %r13
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	leaq	4(%r15), %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_memcpy
	xorl	%eax, %eax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	testq	%r15, %r15
	je	LBB0_8
LBB0_14:
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	(%r13), %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	8(%r13), %edi
	movl	$0, (%r13)
	movq	_IPPROTO_UDP@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	callq	_ntohs
	addl	%eax, %r14d
	movq	%r12, %rdi
	movl	$8, %esi
	movl	%r14d, %edx
	callq	_checksum
	movq	%r15, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	callq	_checksum
	movq	%r13, %rdi
	movl	$12, %esi
	movl	%eax, %edx
	callq	_checksum
	movl	%eax, %edi
	callq	_wrapsum
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	_decode_udp_ip_header.udp_packets_seen(%rip), %edx
	leal	1(%rdx), %ecx
	movl	%ecx, _decode_udp_ip_header.udp_packets_seen(%rip)
	testl	%esi, %esi
	je	LBB0_20
## %bb.15:
	cmpl	%eax, %esi
	je	LBB0_20
## %bb.16:
	movl	_decode_udp_ip_header.udp_packets_bad_checksum(%rip), %esi
	incl	%esi
	movl	%esi, _decode_udp_ip_header.udp_packets_bad_checksum(%rip)
	movl	$-1, %ebx
	cmpl	$4, %edx
	jl	LBB0_21
## %bb.17:
	testl	%esi, %esi
	je	LBB0_21
## %bb.18:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	cmpl	$1, %eax
	jg	LBB0_21
## %bb.19:
	leaq	L_.str.4(%rip), %rdi
	movl	%ecx, %edx
	callq	_note
	movl	$0, _decode_udp_ip_header.udp_packets_bad_checksum(%rip)
	movl	$0, _decode_udp_ip_header.udp_packets_seen(%rip)
	jmp	LBB0_21
LBB0_20:
	addq	$4, %r13
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movl	$4, %edx
	callq	_memcpy
	addb	$12, %bl
	movzbl	%bl, %ebx
LBB0_21:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	leaq	12(%r13), %r15
	movl	8(%r13), %edi
	callq	_ntohs
	addl	$-12, %eax
	movl	_decode_udp_ip_header.udp_packets_length_checked(%rip), %edi
	leal	1(%rdi), %ecx
	movl	%ecx, _decode_udp_ip_header.udp_packets_length_checked(%rip)
	movslq	%eax, %rdx
	addq	%r13, %rdx
	addq	$12, %rdx
	movslq	%r14d, %rsi
	addq	%r12, %rsi
	cmpq	%rsi, %rdx
	jbe	LBB0_12
## %bb.9:
	movl	_decode_udp_ip_header.udp_packets_length_overflow(%rip), %esi
	incl	%esi
	movl	%esi, _decode_udp_ip_header.udp_packets_length_overflow(%rip)
	movl	$-1, %ebx
	cmpl	$4, %edi
	jl	LBB0_21
## %bb.10:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	cmpl	$1, %eax
	jg	LBB0_21
## %bb.11:
	leaq	L_.str.2(%rip), %rdi
	movl	%ecx, %edx
	callq	_note
	movl	$0, _decode_udp_ip_header.udp_packets_length_checked(%rip)
	movl	$0, _decode_udp_ip_header.udp_packets_length_overflow(%rip)
	jmp	LBB0_21
LBB0_12:
	je	LBB0_14
## %bb.13:
	movl	%eax, %r14d
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_debug
	movl	%r14d, %eax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_decode_udp_ip_header.ip_packets_seen,4,2 ## @decode_udp_ip_header.ip_packets_seen
.zerofill __DATA,__bss,_decode_udp_ip_header.ip_packets_bad_checksum,4,2 ## @decode_udp_ip_header.ip_packets_bad_checksum
.zerofill __DATA,__bss,_decode_udp_ip_header.udp_packets_seen,4,2 ## @decode_udp_ip_header.udp_packets_seen
.zerofill __DATA,__bss,_decode_udp_ip_header.udp_packets_bad_checksum,4,2 ## @decode_udp_ip_header.udp_packets_bad_checksum
.zerofill __DATA,__bss,_decode_udp_ip_header.udp_packets_length_checked,4,2 ## @decode_udp_ip_header.udp_packets_length_checked
.zerofill __DATA,__bss,_decode_udp_ip_header.udp_packets_length_overflow,4,2 ## @decode_udp_ip_header.udp_packets_length_overflow
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d bad IP checksums seen in %d packets"

L_.str.1:                               ## @.str.1
	.asciz	"ip length %d disagrees with bytes received %d."

L_.str.2:                               ## @.str.2
	.asciz	"%d udp packets in %d too long - dropped"

L_.str.3:                               ## @.str.3
	.asciz	"accepting packet with data after udp payload."

	.comm	_IPPROTO_UDP,4,2                ## @IPPROTO_UDP
L_.str.4:                               ## @.str.4
	.asciz	"%d bad udp checksums in %d packets"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_decode_udp_ip_header           ; -- Begin function decode_udp_ip_header
	.p2align	2
_decode_udp_ip_header:                  ; @decode_udp_ip_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x24, x4
	mov	x21, x3
	mov	x19, x2
	add	x23, x0, w1, sxtw
	ldrb	w8, [x23]
	lsl	w8, w8, #2
	and	x20, x8, #0x3c
	adrp	x22, _decode_udp_ip_header.ip_packets_seen@PAGE
	ldr	w8, [x22, _decode_udp_ip_header.ip_packets_seen@PAGEOFF]
	add	w8, w8, #1
	str	w8, [x22, _decode_udp_ip_header.ip_packets_seen@PAGEOFF]
	mov	x0, x23
	mov	x1, x20
	mov	w2, #0
	bl	_checksum
	bl	_wrapsum
	cbz	x0, LBB0_6
; %bb.1:
	adrp	x19, _decode_udp_ip_header.ip_packets_bad_checksum@PAGE
	ldr	w8, [x19, _decode_udp_ip_header.ip_packets_bad_checksum@PAGEOFF]
	add	w1, w8, #1
	str	w1, [x19, _decode_udp_ip_header.ip_packets_bad_checksum@PAGEOFF]
	ldr	w2, [x22, _decode_udp_ip_header.ip_packets_seen@PAGEOFF]
	cmp	w2, #5
	ccmp	w1, #0, #4, ge
	b.eq	LBB0_4
; %bb.2:
	sdiv	w8, w2, w1
	cmp	w8, #1
	b.gt	LBB0_4
; %bb.3:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_note
	str	wzr, [x19, _decode_udp_ip_header.ip_packets_bad_checksum@PAGEOFF]
	str	wzr, [x22, _decode_udp_ip_header.ip_packets_seen@PAGEOFF]
LBB0_4:
	mov	w0, #-1
LBB0_5:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_6:
	add	x22, x23, x20
	ldr	w0, [x23, #4]
	bl	_ntohs
	cmp	w0, w24
	b.eq	LBB0_8
; %bb.7:
	ldr	w0, [x23, #4]
	bl	_ntohs
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x0, x24, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_debug
LBB0_8:
	add	x0, x19, #4
	mov	x1, x23
	mov	w2, #4
	bl	_memcpy
	cbz	x21, LBB0_16
; %bb.9:
	mov	w25, #0
LBB0_10:
	ldr	w24, [x22]
	str	wzr, [x22]
Lloh4:
	adrp	x8, _IPPROTO_UDP@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IPPROTO_UDP@GOTPAGEOFF]
Lloh6:
	ldr	w26, [x8]
	ldr	w0, [x22, #8]
	bl	_ntohs
	add	w2, w0, w26
	mov	x0, x23
	mov	w1, #8
	bl	_checksum
	mov	x2, x0
	mov	x0, x21
	mov	x1, x25
	bl	_checksum
	mov	x2, x0
	mov	x0, x22
	mov	w1, #12
	bl	_checksum
	bl	_wrapsum
	adrp	x21, _decode_udp_ip_header.udp_packets_seen@PAGE
	ldr	w8, [x21, _decode_udp_ip_header.udp_packets_seen@PAGEOFF]
	add	w2, w8, #1
	str	w2, [x21, _decode_udp_ip_header.udp_packets_seen@PAGEOFF]
	cmp	w24, #0
	ccmp	w24, w0, #4, ne
	b.ne	LBB0_12
; %bb.11:
	add	x1, x22, #4
	mov	x0, x19
	mov	w2, #4
	bl	_memcpy
	add	w0, w20, #12
	b	LBB0_5
LBB0_12:
	adrp	x19, _decode_udp_ip_header.udp_packets_bad_checksum@PAGE
	ldr	w9, [x19, _decode_udp_ip_header.udp_packets_bad_checksum@PAGEOFF]
	add	w1, w9, #1
	str	w1, [x19, _decode_udp_ip_header.udp_packets_bad_checksum@PAGEOFF]
	mov	w0, #-1
	cmp	w8, #4
	b.lt	LBB0_5
; %bb.13:
	cbz	w1, LBB0_5
; %bb.14:
	sdiv	w8, w2, w1
	cmp	w8, #1
	b.gt	LBB0_4
; %bb.15:
Lloh7:
	adrp	x0, l_.str.4@PAGE
Lloh8:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_note
	str	wzr, [x19, _decode_udp_ip_header.udp_packets_bad_checksum@PAGEOFF]
	str	wzr, [x21, _decode_udp_ip_header.udp_packets_seen@PAGEOFF]
	b	LBB0_4
LBB0_16:
	add	x21, x22, #12
	ldr	w0, [x22, #8]
	bl	_ntohs
	sub	w25, w0, #12
	adrp	x26, _decode_udp_ip_header.udp_packets_length_checked@PAGE
	ldr	w8, [x26, _decode_udp_ip_header.udp_packets_length_checked@PAGEOFF]
	add	w2, w8, #1
	str	w2, [x26, _decode_udp_ip_header.udp_packets_length_checked@PAGEOFF]
	add	x9, x21, w25, sxtw
	add	x10, x23, w24, sxtw
	cmp	x9, x10
	b.ls	LBB0_20
; %bb.17:
	adrp	x19, _decode_udp_ip_header.udp_packets_length_overflow@PAGE
	ldr	w9, [x19, _decode_udp_ip_header.udp_packets_length_overflow@PAGEOFF]
	add	w1, w9, #1
	str	w1, [x19, _decode_udp_ip_header.udp_packets_length_overflow@PAGEOFF]
	cmp	w8, #4
	b.lt	LBB0_4
; %bb.18:
	sdiv	w8, w2, w1
	cmp	w8, #1
	b.gt	LBB0_4
; %bb.19:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_note
	str	wzr, [x26, _decode_udp_ip_header.udp_packets_length_checked@PAGEOFF]
	str	wzr, [x19, _decode_udp_ip_header.udp_packets_length_overflow@PAGEOFF]
	b	LBB0_4
LBB0_20:
	b.eq	LBB0_10
; %bb.21:
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_debug
	b	LBB0_10
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_decode_udp_ip_header.ip_packets_seen,4,2 ; @decode_udp_ip_header.ip_packets_seen
.zerofill __DATA,__bss,_decode_udp_ip_header.ip_packets_bad_checksum,4,2 ; @decode_udp_ip_header.ip_packets_bad_checksum
.zerofill __DATA,__bss,_decode_udp_ip_header.udp_packets_seen,4,2 ; @decode_udp_ip_header.udp_packets_seen
.zerofill __DATA,__bss,_decode_udp_ip_header.udp_packets_bad_checksum,4,2 ; @decode_udp_ip_header.udp_packets_bad_checksum
.zerofill __DATA,__bss,_decode_udp_ip_header.udp_packets_length_checked,4,2 ; @decode_udp_ip_header.udp_packets_length_checked
.zerofill __DATA,__bss,_decode_udp_ip_header.udp_packets_length_overflow,4,2 ; @decode_udp_ip_header.udp_packets_length_overflow
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d bad IP checksums seen in %d packets"

l_.str.1:                               ; @.str.1
	.asciz	"ip length %d disagrees with bytes received %d."

l_.str.2:                               ; @.str.2
	.asciz	"%d udp packets in %d too long - dropped"

l_.str.3:                               ; @.str.3
	.asciz	"accepting packet with data after udp payload."

	.comm	_IPPROTO_UDP,4,2                ; @IPPROTO_UDP
l_.str.4:                               ; @.str.4
	.asciz	"%d bad udp checksums in %d packets"

.subsections_via_symbols
