	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function checksum_fw
_checksum_fw:                           ## @checksum_fw
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
                                        ## kill: def $esi killed $esi def $rsi
	xorl	%ecx, %ecx
	movl	$0, %edx
	cmpl	$2, %esi
	jl	LBB0_7
## %bb.1:
	leal	-1(%rsi), %r9d
	cmpq	$3, %r9
	movl	$2, %r8d
	cmovaeq	%r9, %r8
	decq	%r8
	cmpq	$14, %r8
	jae	LBB0_3
## %bb.2:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	LBB0_6
LBB0_3:
	shrq	%r8
	incq	%r8
	movabsq	$9223372036854775800, %rax      ## imm = 0x7FFFFFFFFFFFFFF8
	andq	%r8, %rax
	leaq	(%rax,%rax), %rcx
	pxor	%xmm0, %xmm0
	xorl	%edx, %edx
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movups	(%rdi,%rdx,8), %xmm2
	movups	16(%rdi,%rdx,8), %xmm3
	movups	32(%rdi,%rdx,8), %xmm4
	movups	48(%rdi,%rdx,8), %xmm5
	movaps	%xmm2, %xmm6
	shufps	$136, %xmm3, %xmm6              ## xmm6 = xmm6[0,2],xmm3[0,2]
	movaps	%xmm4, %xmm7
	shufps	$136, %xmm5, %xmm7              ## xmm7 = xmm7[0,2],xmm5[0,2]
	shufps	$221, %xmm3, %xmm2              ## xmm2 = xmm2[1,3],xmm3[1,3]
	shufps	$221, %xmm5, %xmm4              ## xmm4 = xmm4[1,3],xmm5[1,3]
	pslld	$8, %xmm2
	por	%xmm6, %xmm2
	paddd	%xmm2, %xmm0
	pslld	$8, %xmm4
	por	%xmm7, %xmm4
	paddd	%xmm4, %xmm1
	addq	$8, %rdx
	cmpq	%rdx, %rax
	jne	LBB0_4
## %bb.5:
	paddd	%xmm0, %xmm1
	pshufd	$238, %xmm1, %xmm0              ## xmm0 = xmm1[2,3,2,3]
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	cmpq	%rax, %r8
	je	LBB0_7
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%rdi,%rcx,4), %eax
	shll	$8, %eax
	orl	(%rdi,%rcx,4), %eax
	addl	%eax, %edx
	addq	$2, %rcx
	cmpq	%r9, %rcx
	jb	LBB0_6
LBB0_7:
	cmpl	%esi, %ecx
	jge	LBB0_9
## %bb.8:
	movl	%ecx, %eax
	addl	(%rdi,%rax,4), %edx
LBB0_9:
	movl	%edx, %eax
	sarl	$16, %eax
	movl	%edx, %ecx
	addl	%eax, %ecx
	addl	%edx, %eax
	addl	$65535, %eax                    ## imm = 0xFFFF
	shrl	$16, %eax
	addl	%ecx, %eax
	addl	$65535, %eax                    ## imm = 0xFFFF
	notl	%eax
	movzwl	%ax, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_checksum_fw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function checksum_fw
_checksum_fw:                           ; @checksum_fw
	.cfi_startproc
; %bb.0:
	cmp	w1, #2
	b.lt	LBB0_3
; %bb.1:
	sub	w8, w1, #1
	mov	w9, #2
	cmp	x8, #2
	csel	x9, x8, x9, hi
	sub	x9, x9, #1
	cmp	x9, #30
	b.hs	LBB0_4
; %bb.2:
	mov	x9, #0
	mov	w12, #0
	b	LBB0_7
LBB0_3:
	mov	w8, #0
	mov	w12, #0
	cmp	w8, w1
	b.lt	LBB0_9
	b	LBB0_10
LBB0_4:
	lsr	x9, x9, #1
	add	x10, x9, #1
	and	x11, x10, #0x7ffffffffffffff0
	lsl	x9, x11, #1
	add	x12, x0, #64
	movi.2d	v0, #0000000000000000
	mov	x13, x11
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sub	x14, x12, #64
	ld2.4s	{ v4, v5 }, [x14]
	sub	x14, x12, #32
	ld2.4s	{ v6, v7 }, [x14]
	mov	x14, x12
	ld2.4s	{ v16, v17 }, [x14], #32
	ld2.4s	{ v18, v19 }, [x14]
	shl.4s	v20, v5, #8
	shl.4s	v21, v7, #8
	shl.4s	v22, v17, #8
	shl.4s	v23, v19, #8
	orr.16b	v4, v20, v4
	orr.16b	v5, v21, v6
	orr.16b	v6, v22, v16
	orr.16b	v7, v23, v18
	add.4s	v0, v4, v0
	add.4s	v1, v5, v1
	add.4s	v2, v6, v2
	add.4s	v3, v7, v3
	add	x12, x12, #128
	subs	x13, x13, #16
	b.ne	LBB0_5
; %bb.6:
	add.4s	v0, v1, v0
	add.4s	v0, v2, v0
	add.4s	v0, v3, v0
	addv.4s	s0, v0
	fmov	w12, s0
	cmp	x10, x11
	b.eq	LBB0_8
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	x10, x0, x9, lsl #2
	ldp	w10, w11, [x10]
	orr	w10, w10, w11, lsl #8
	add	w12, w10, w12
	add	x9, x9, #2
	cmp	x9, x8
	b.lo	LBB0_7
LBB0_8:
	and	w8, w1, #0xfffffffe
	cmp	w8, w1
	b.ge	LBB0_10
LBB0_9:
	ldr	w8, [x0, w8, uxtw #2]
	add	w12, w8, w12
LBB0_10:
	add	w8, w12, w12, asr #16
	mov	w9, #65535
	add	w8, w8, w9
	add	w8, w8, w8, lsr #16
	mvn	w8, w8
	and	w0, w8, #0xffff
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_checksum_fw
.subsections_via_symbols
