	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chksum
_chksum:                                ## @chksum
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	xorl	%ebx, %ebx
	cmpl	$2, %esi
	jl	LBB0_13
## %bb.1:
	movl	%esi, %eax
	subl	$3, %eax
	cmovbl	%ebx, %eax
	incl	%eax
	cmpl	$6, %eax
	jae	LBB0_3
## %bb.2:
	movq	%rdi, %rax
	jmp	LBB0_11
LBB0_3:
	shrl	%eax
	incl	%eax
	movl	%eax, %r8d
	andl	$-4, %r8d
	leaq	-4(%r8), %rdx
	movq	%rdx, %rcx
	shrq	$2, %rcx
	incq	%rcx
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.5:
	movq	%rcx, %rdx
	andq	$-2, %rdx
	pxor	%xmm0, %xmm0
	xorl	%ebx, %ebx
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	pmovsxdq	(%rdi,%rbx,4), %xmm2
	paddq	%xmm0, %xmm2
	pmovsxdq	8(%rdi,%rbx,4), %xmm3
	paddq	%xmm1, %xmm3
	pmovsxdq	16(%rdi,%rbx,4), %xmm0
	pmovsxdq	24(%rdi,%rbx,4), %xmm1
	paddq	%xmm2, %xmm0
	paddq	%xmm3, %xmm1
	addq	$8, %rbx
	addq	$-2, %rdx
	jne	LBB0_6
	jmp	LBB0_7
LBB0_4:
	pxor	%xmm0, %xmm0
	xorl	%ebx, %ebx
	pxor	%xmm1, %xmm1
LBB0_7:
	leal	(%r8,%r8), %edx
	testb	$1, %cl
	je	LBB0_9
## %bb.8:
	pmovsxdq	(%rdi,%rbx,4), %xmm2
	paddq	%xmm2, %xmm0
	pmovsxdq	8(%rdi,%rbx,4), %xmm2
	paddq	%xmm2, %xmm1
LBB0_9:
	paddq	%xmm1, %xmm0
	subl	%edx, %esi
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rbx
	cmpq	%rax, %r8
	je	LBB0_13
## %bb.10:
	leaq	(%rdi,%r8,4), %rax
LBB0_11:
	movl	%esi, %ecx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movslq	(%rax), %rdx
	addq	$4, %rax
	addq	%rdx, %rbx
	leal	-2(%rcx), %esi
	cmpl	$3, %ecx
	movl	%esi, %ecx
	ja	LBB0_12
LBB0_13:
	cmpl	$1, %esi
	jne	LBB0_15
## %bb.14:
	movl	(%rdi), %edi
	shll	$8, %edi
	callq	_htons
	addq	%rax, %rbx
LBB0_15:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_chksum
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function chksum
_chksum:                                ; @chksum
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	cmp	w1, #2
	b.lt	LBB0_3
; %bb.1:
	subs	w8, w1, #3
	csel	w8, wzr, w8, lo
	add	w8, w8, #1
	cmp	w8, #14
	b.hs	LBB0_4
; %bb.2:
	mov	x19, #0
	mov	x8, x0
	b	LBB0_7
LBB0_3:
	mov	x19, #0
	b	LBB0_9
LBB0_4:
	lsr	w8, w8, #1
	add	w9, w8, #1
	and	x10, x9, #0xfffffff8
	add	x8, x0, x10, lsl #2
	sub	w1, w1, w10, lsl #1
	add	x11, x0, #16
	movi.2d	v0, #0000000000000000
	mov	x12, x10
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	d4, d5, [x11, #-16]
	ldp	d6, d7, [x11], #32
	saddw.2d	v0, v0, v4
	saddw.2d	v1, v1, v5
	saddw.2d	v2, v2, v6
	saddw.2d	v3, v3, v7
	subs	x12, x12, #8
	b.ne	LBB0_5
; %bb.6:
	add.2d	v0, v1, v0
	add.2d	v0, v2, v0
	add.2d	v0, v3, v0
	addp.2d	d0, v0
	fmov	x19, d0
	cmp	x10, x9
	b.eq	LBB0_9
LBB0_7:
	mov	x9, x1
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x10, [x8], #4
	add	x19, x19, x10
	sub	w1, w9, #2
	cmp	w9, #3
	mov	x9, x1
	b.hi	LBB0_8
LBB0_9:
	cmp	w1, #1
	b.ne	LBB0_11
; %bb.10:
	ldr	w8, [x0]
	lsl	w0, w8, #8
	bl	_htons
	add	x19, x0, x19
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_chksum
.subsections_via_symbols
