	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cs_calc_buf_sum                ## -- Begin function cs_calc_buf_sum
	.p2align	4, 0x90
_cs_calc_buf_sum:                       ## @cs_calc_buf_sum
	.cfi_startproc
## %bb.0:
	movl	$4294967295, %eax               ## imm = 0xFFFFFFFF
	testl	%esi, %esi
	je	LBB0_8
## %bb.1:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_crctab@GOTPCREL(%rip), %r8
	movq	(%r8), %r9
	cmpl	$1, %esi
	jne	LBB0_9
## %bb.2:
	xorl	%ecx, %ecx
	jmp	LBB0_3
LBB0_9:
	movl	%esi, %r10d
	andl	$-2, %r10d
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %r11
	shlq	$8, %r11
	shrl	$24, %ecx
	movzbl	(%rdi), %edx
	xorq	%rcx, %rdx
	xorq	(%r9,%rdx,8), %r11
	movq	%r11, %rcx
	shlq	$8, %rcx
	shrl	$24, %r11d
	movzbl	1(%rdi), %edx
	addq	$2, %rdi
	xorq	%r11, %rdx
	xorq	(%r9,%rdx,8), %rcx
	addl	$-2, %r10d
	jne	LBB0_10
LBB0_3:
	testb	$1, %sil
	je	LBB0_5
## %bb.4:
	movq	%rcx, %rdx
	shlq	$8, %rdx
	shrl	$24, %ecx
	movzbl	(%rdi), %edi
	xorq	%rcx, %rdi
	xorq	(%r9,%rdi,8), %rdx
	movq	%rdx, %rcx
LBB0_5:
	movslq	%esi, %rsi
	movq	(%r8), %r8
	movq	%rsi, %rdi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %rdx
	shlq	$8, %rdx
	shrl	$24, %ecx
	xorl	%esi, %ecx
	movzbl	%cl, %r9d
	movq	%rdx, %rcx
	xorq	(%r8,%r9,8), %rcx
	shrq	$8, %rdi
	cmpq	$255, %rsi
	movq	%rdi, %rsi
	ja	LBB0_6
## %bb.7:
	movl	%ecx, %ecx
	xorq	%rcx, %rax
	popq	%rbp
LBB0_8:
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_crctab,8,3                     ## @crctab
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cs_calc_buf_sum                ; -- Begin function cs_calc_buf_sum
	.p2align	2
_cs_calc_buf_sum:                       ; @cs_calc_buf_sum
	.cfi_startproc
; %bb.0:
                                        ; kill: def $w1 killed $w1 def $x1
	cbz	w1, LBB0_6
; %bb.1:
	mov	x8, #0
	sxtw	x9, w1
Lloh0:
	adrp	x10, _crctab@GOTPAGE
Lloh1:
	ldr	x10, [x10, _crctab@GOTPAGEOFF]
	ldr	x11, [x10]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w12, [x0], #1
	ubfx	x13, x8, #24, #8
	eor	x12, x13, x12
	ldr	x12, [x11, x12, lsl #3]
	eor	x8, x12, x8, lsl #8
	subs	w1, w1, #1
	b.ne	LBB0_2
; %bb.3:
	ldr	x10, [x10]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	eor	w11, w9, w8, lsr #24
	and	x11, x11, #0xff
	ldr	x11, [x10, x11, lsl #3]
	eor	x8, x11, x8, lsl #8
	lsr	x11, x9, #8
	cmp	x9, #255
	mov	x9, x11
	b.hi	LBB0_4
; %bb.5:
	mvn	w0, w8
	ret
LBB0_6:
	mov	w0, #-1
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_crctab,8,3                     ; @crctab
.subsections_via_symbols
