	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function flash_csum
_flash_csum:                            ## @flash_csum
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	(%rdi), %eax
	cmpl	$8, %eax
	movl	$8, %edx
	cmovbl	%eax, %edx
	testl	%edx, %edx
	je	LBB0_1
## %bb.2:
	movl	%edx, %r9d
	decl	%r9d
	je	LBB0_16
## %bb.3:
	addl	$-2, %edx
	cmpl	$7, %edx
	jae	LBB0_5
## %bb.4:
	movq	%rdi, %r8
	jmp	LBB0_14
LBB0_1:
	movl	$-1, %eax
	jmp	LBB0_17
LBB0_5:
	incq	%rdx
	movq	%rdx, %r8
	andq	$-8, %r8
	movd	%eax, %xmm0
	leaq	-8(%r8), %rcx
	movq	%rcx, %rax
	shrq	$3, %rax
	incq	%rax
	movl	%eax, %r10d
	andl	$3, %r10d
	cmpq	$24, %rcx
	jae	LBB0_7
## %bb.6:
	pxor	%xmm1, %xmm1
	xorl	%ecx, %ecx
	jmp	LBB0_9
LBB0_7:
	andq	$-4, %rax
	pxor	%xmm1, %xmm1
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	4(%rdi,%rcx,4), %xmm2
	paddd	%xmm0, %xmm2
	movdqu	20(%rdi,%rcx,4), %xmm0
	paddd	%xmm1, %xmm0
	movdqu	36(%rdi,%rcx,4), %xmm1
	movdqu	52(%rdi,%rcx,4), %xmm3
	movdqu	68(%rdi,%rcx,4), %xmm4
	paddd	%xmm1, %xmm4
	paddd	%xmm2, %xmm4
	movdqu	84(%rdi,%rcx,4), %xmm2
	paddd	%xmm3, %xmm2
	paddd	%xmm0, %xmm2
	movdqu	100(%rdi,%rcx,4), %xmm0
	paddd	%xmm4, %xmm0
	movdqu	116(%rdi,%rcx,4), %xmm1
	paddd	%xmm2, %xmm1
	addq	$32, %rcx
	addq	$-4, %rax
	jne	LBB0_8
LBB0_9:
	testq	%r10, %r10
	je	LBB0_12
## %bb.10:
	leaq	(%rdi,%rcx,4), %rax
	addq	$20, %rax
	shlq	$5, %r10
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%rax,%rcx), %xmm2
	paddd	%xmm2, %xmm0
	movdqu	(%rax,%rcx), %xmm2
	paddd	%xmm2, %xmm1
	addq	$32, %rcx
	cmpq	%rcx, %r10
	jne	LBB0_11
LBB0_12:
	paddd	%xmm1, %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddd	%xmm0, %xmm1
	pshufd	$85, %xmm1, %xmm0               ## xmm0 = xmm1[1,1,1,1]
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpq	%r8, %rdx
	je	LBB0_16
## %bb.13:
	subl	%r8d, %r9d
	leaq	(%rdi,%r8,4), %r8
LBB0_14:
	movl	%r9d, %edx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	addl	4(%r8,%rcx,4), %eax
	incq	%rcx
	cmpl	%ecx, %edx
	jne	LBB0_15
LBB0_16:
	notl	%eax
LBB0_17:
	addl	4(%rdi), %eax
	testl	%esi, %esi
	je	LBB0_19
## %bb.18:
	movl	%eax, 4(%rdi)
LBB0_19:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_flash_csum
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function flash_csum
_flash_csum:                            ; @flash_csum
	.cfi_startproc
; %bb.0:
	ldr	w9, [x0]
	mov	w8, #8
	cmp	w9, #8
	csel	w10, w9, w8, lo
	cbz	w10, LBB0_4
; %bb.1:
	subs	w8, w10, #1
	b.eq	LBB0_10
; %bb.2:
	sub	w10, w10, #2
	cmp	w10, #15
	b.hs	LBB0_5
; %bb.3:
	mov	x10, x0
	b	LBB0_8
LBB0_4:
	mov	w8, #-1
	b	LBB0_11
LBB0_5:
	add	x11, x10, #1
	and	x12, x11, #0x1fffffff0
	sub	w8, w8, w12
	add	x10, x0, x12, lsl #2
	movi.2d	v0, #0000000000000000
	movi.2d	v1, #0000000000000000
	mov.s	v1[0], w9
	add	x9, x0, #36
	mov	x13, x12
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x9, #-32]
	ldp	q6, q7, [x9], #64
	add.4s	v1, v4, v1
	add.4s	v0, v5, v0
	add.4s	v2, v6, v2
	add.4s	v3, v7, v3
	subs	x13, x13, #16
	b.ne	LBB0_6
; %bb.7:
	add.4s	v0, v0, v1
	add.4s	v0, v2, v0
	add.4s	v0, v3, v0
	addv.4s	s0, v0
	fmov	w9, s0
	cmp	x11, x12
	b.eq	LBB0_10
LBB0_8:
	add	x10, x10, #4
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10], #4
	add	w9, w11, w9
	subs	w8, w8, #1
	b.ne	LBB0_9
LBB0_10:
	mvn	w8, w9
LBB0_11:
	ldr	w9, [x0, #4]
	add	w8, w9, w8
	cbz	w1, LBB0_13
; %bb.12:
	str	w8, [x0, #4]
LBB0_13:
	mov	x0, x8
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_flash_csum
.subsections_via_symbols
