	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ahci_checksum
_ahci_checksum:                         ## @ahci_checksum
	.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
	leal	-1(%rsi), %r8d
	movl	$256, %ecx                      ## imm = 0x100
	cmpl	$2, %esi
	jl	LBB0_13
## %bb.1:
	movl	%r8d, %ecx
	cmpl	$4, %r8d
	jae	LBB0_3
## %bb.2:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_3:
	movl	%ecx, %edx
	andl	$-4, %edx
	leaq	-4(%rdx), %rax
	movq	%rax, %rsi
	shrq	$2, %rsi
	incq	%rsi
	movl	%esi, %r9d
	andl	$3, %r9d
	cmpq	$12, %rax
	jae	LBB0_5
## %bb.4:
	pxor	%xmm0, %xmm0
	xorl	%eax, %eax
	pxor	%xmm1, %xmm1
	jmp	LBB0_7
LBB0_5:
	andq	$-4, %rsi
	pxor	%xmm0, %xmm0
	xorl	%eax, %eax
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rdi,%rax,8), %xmm2
	paddq	%xmm0, %xmm2
	movdqu	16(%rdi,%rax,8), %xmm0
	paddq	%xmm1, %xmm0
	movdqu	32(%rdi,%rax,8), %xmm1
	movdqu	48(%rdi,%rax,8), %xmm3
	movdqu	64(%rdi,%rax,8), %xmm4
	paddq	%xmm1, %xmm4
	paddq	%xmm2, %xmm4
	movdqu	80(%rdi,%rax,8), %xmm2
	paddq	%xmm3, %xmm2
	paddq	%xmm0, %xmm2
	movdqu	96(%rdi,%rax,8), %xmm0
	paddq	%xmm4, %xmm0
	movdqu	112(%rdi,%rax,8), %xmm1
	paddq	%xmm2, %xmm1
	addq	$16, %rax
	addq	$-4, %rsi
	jne	LBB0_6
LBB0_7:
	testq	%r9, %r9
	je	LBB0_10
## %bb.8:
	leaq	(%rdi,%rax,8), %rax
	addq	$16, %rax
	shlq	$5, %r9
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%rax,%rsi), %xmm2
	paddq	%xmm2, %xmm0
	movdqu	(%rax,%rsi), %xmm2
	paddq	%xmm2, %xmm1
	addq	$32, %rsi
	cmpq	%rsi, %r9
	jne	LBB0_9
LBB0_10:
	paddq	%xmm1, %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rax
	cmpq	%rcx, %rdx
	je	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	addq	(%rdi,%rdx,8), %rax
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	LBB0_11
LBB0_12:
	movl	$256, %ecx                      ## imm = 0x100
	subq	%rax, %rcx
LBB0_13:
	movslq	%r8d, %rax
	movq	%rcx, (%rdi,%rax,8)
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_ahci_checksum
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ahci_checksum
_ahci_checksum:                         ; @ahci_checksum
	.cfi_startproc
; %bb.0:
	sub	w8, w1, #1
	cmp	w1, #2
	b.lt	LBB0_3
; %bb.1:
	cmp	w8, #8
	b.hs	LBB0_4
; %bb.2:
	mov	x9, #0
	mov	x10, #0
	b	LBB0_7
LBB0_3:
	mov	w9, #256
	str	x9, [x0, w8, sxtw #3]
	ret
LBB0_4:
	and	x9, x8, #0xfffffff8
	add	x10, x0, #32
	movi.2d	v0, #0000000000000000
	mov	x11, x9
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x10, #-32]
	ldp	q6, q7, [x10], #64
	add.2d	v0, v4, v0
	add.2d	v1, v5, v1
	add.2d	v2, v6, v2
	add.2d	v3, v7, v3
	subs	x11, x11, #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	x10, d0
	cmp	x9, x8
	b.eq	LBB0_9
LBB0_7:
	add	x11, x0, x9, lsl #3
	sub	x9, x8, x9
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x11], #8
	add	x10, x12, x10
	subs	x9, x9, #1
	b.ne	LBB0_8
LBB0_9:
	mov	w9, #256
	sub	x9, x9, x10
	str	x9, [x0, w8, sxtw #3]
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_ahci_checksum
.subsections_via_symbols
