	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lha_calcsum
_lha_calcsum:                           ## @lha_calcsum
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	testq	%rcx, %rcx
	je	LBB0_10
## %bb.1:
	movslq	%edx, %r8
	leaq	(%rsi,%r8), %r10
	cmpq	$8, %rcx
	jae	LBB0_3
LBB0_2:
	movq	%r10, %rax
	movq	%rcx, %rsi
	jmp	LBB0_8
LBB0_3:
	cmpq	$32, %rcx
	jae	LBB0_11
## %bb.4:
	xorl	%edx, %edx
	jmp	LBB0_5
LBB0_11:
	movq	%rcx, %rdx
	andq	$-32, %rdx
	movzbl	%dil, %eax
	movd	%eax, %xmm0
	leaq	-32(%rdx), %rax
	movq	%rax, %r11
	shrq	$5, %r11
	incq	%r11
	movl	%r11d, %r9d
	andl	$3, %r9d
	cmpq	$96, %rax
	jae	LBB0_13
## %bb.12:
	pxor	%xmm1, %xmm1
	xorl	%edi, %edi
	jmp	LBB0_15
LBB0_13:
	andq	$-4, %r11
	leaq	(%r8,%rsi), %rax
	addq	$112, %rax
	pxor	%xmm1, %xmm1
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-112(%rax,%rdi), %xmm2
	paddb	%xmm0, %xmm2
	movdqu	-96(%rax,%rdi), %xmm0
	paddb	%xmm1, %xmm0
	movdqu	-80(%rax,%rdi), %xmm1
	movdqu	-64(%rax,%rdi), %xmm3
	movdqu	-48(%rax,%rdi), %xmm4
	paddb	%xmm1, %xmm4
	paddb	%xmm2, %xmm4
	movdqu	-32(%rax,%rdi), %xmm2
	paddb	%xmm3, %xmm2
	paddb	%xmm0, %xmm2
	movdqu	-16(%rax,%rdi), %xmm0
	paddb	%xmm4, %xmm0
	movdqu	(%rax,%rdi), %xmm1
	paddb	%xmm2, %xmm1
	subq	$-128, %rdi
	addq	$-4, %r11
	jne	LBB0_14
LBB0_15:
	testq	%r9, %r9
	je	LBB0_18
## %bb.16:
	addq	%r8, %rdi
	leaq	(%rsi,%rdi), %rax
	addq	$16, %rax
	shlq	$5, %r9
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%rax,%rsi), %xmm2
	paddb	%xmm2, %xmm0
	movdqu	(%rax,%rsi), %xmm2
	paddb	%xmm2, %xmm1
	addq	$32, %rsi
	cmpq	%rsi, %r9
	jne	LBB0_17
LBB0_18:
	paddb	%xmm1, %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddb	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	psadbw	%xmm1, %xmm0
	movd	%xmm0, %edi
	cmpq	%rcx, %rdx
	je	LBB0_10
## %bb.19:
	testb	$24, %cl
	je	LBB0_20
LBB0_5:
	movq	%rcx, %r8
	andq	$-8, %r8
	leaq	(%r10,%r8), %rax
	movl	%ecx, %esi
	andl	$7, %esi
	movzbl	%dil, %edi
	movd	%edi, %xmm0
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r10,%rdx), %xmm1              ## xmm1 = mem[0],zero
	paddb	%xmm1, %xmm0
	addq	$8, %rdx
	cmpq	%rdx, %r8
	jne	LBB0_6
## %bb.7:
	pxor	%xmm1, %xmm1
	psadbw	%xmm1, %xmm0
	movd	%xmm0, %edi
	cmpq	%rcx, %r8
	je	LBB0_10
LBB0_8:
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	addb	(%rax,%rcx), %dil
	incq	%rcx
	cmpq	%rcx, %rsi
	jne	LBB0_9
LBB0_10:
	movzbl	%dil, %eax
	popq	%rbp
	retq
LBB0_20:
	andl	$31, %ecx
	addq	%rdx, %r10
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_lha_calcsum
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lha_calcsum
_lha_calcsum:                           ; @lha_calcsum
	.cfi_startproc
; %bb.0:
                                        ; kill: def $w2 killed $w2 def $x2
	cbz	x3, LBB0_14
; %bb.1:
	sxtw	x9, w2
	add	x8, x1, x9
	cmp	x3, #8
	b.hs	LBB0_3
; %bb.2:
	mov	x11, x3
	b	LBB0_13
LBB0_3:
	cmp	x3, #64
	b.hs	LBB0_5
; %bb.4:
	mov	x10, #0
	b	LBB0_9
LBB0_5:
	and	x10, x3, #0xffffffffffffffc0
	movi.2d	v0, #0000000000000000
	mov.b	v0[0], w0
	movi.2d	v1, #0000000000000000
	add	x11, x9, x1
	add	x11, x11, #32
	mov	x12, x10
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x11, #-32]
	ldp	q6, q7, [x11], #64
	add.16b	v0, v4, v0
	add.16b	v1, v5, v1
	add.16b	v2, v6, v2
	add.16b	v3, v7, v3
	subs	x12, x12, #64
	b.ne	LBB0_6
; %bb.7:
	add.16b	v0, v1, v0
	add.16b	v0, v2, v0
	add.16b	v0, v3, v0
	addv.16b	b0, v0
	fmov	w0, s0
	cmp	x10, x3
	b.eq	LBB0_14
; %bb.8:
	tst	x3, #0x38
	b.eq	LBB0_12
LBB0_9:
	and	x12, x3, #0xfffffffffffffff8
	add	x8, x8, x12
	and	x11, x3, #0x7
	movi	d0, #0000000000000000
	mov.b	v0[0], w0
	add	x9, x10, x9
	add	x9, x1, x9
	sub	x10, x10, x12
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	d1, [x9], #8
	add.8b	v0, v1, v0
	adds	x10, x10, #8
	b.ne	LBB0_10
; %bb.11:
	addv.8b	b0, v0
	fmov	w0, s0
	cmp	x12, x3
	b.ne	LBB0_13
	b	LBB0_14
LBB0_12:
	and	x11, x3, #0x3f
	add	x8, x8, x10
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldrb	w9, [x8], #1
	add	w0, w9, w0
	subs	x11, x11, #1
	b.ne	LBB0_13
LBB0_14:
	and	w0, w0, #0xff
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_lha_calcsum
.subsections_via_symbols
