	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function patch_gamut_packet_checksum
_patch_gamut_packet_checksum:           ## @patch_gamut_packet_checksum
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	cmpq	$0, 8(%rdi)
	je	LBB0_14
## %bb.1:
	movq	(%rdi), %rax
	movq	8(%rax), %rcx
	incq	%rcx
	cmpq	$4, %rcx
	jae	LBB0_4
## %bb.2:
	xorl	%edx, %edx
	xorl	%esi, %esi
	jmp	LBB0_3
LBB0_4:
	movq	%rcx, %rdx
	andq	$-4, %rdx
	leaq	-4(%rdx), %rdi
	movq	%rdi, %rsi
	shrq	$2, %rsi
	incq	%rsi
	movl	%esi, %r8d
	andl	$3, %r8d
	cmpq	$12, %rdi
	jae	LBB0_6
## %bb.5:
	pxor	%xmm0, %xmm0
	xorl	%edi, %edi
	pxor	%xmm1, %xmm1
	jmp	LBB0_8
LBB0_6:
	andq	$-4, %rsi
	pxor	%xmm0, %xmm0
	xorl	%edi, %edi
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	24(%rax,%rdi,8), %xmm2
	paddq	%xmm0, %xmm2
	movdqu	40(%rax,%rdi,8), %xmm0
	paddq	%xmm1, %xmm0
	movdqu	56(%rax,%rdi,8), %xmm1
	movdqu	72(%rax,%rdi,8), %xmm3
	movdqu	88(%rax,%rdi,8), %xmm4
	paddq	%xmm1, %xmm4
	paddq	%xmm2, %xmm4
	movdqu	104(%rax,%rdi,8), %xmm2
	paddq	%xmm3, %xmm2
	paddq	%xmm0, %xmm2
	movdqu	120(%rax,%rdi,8), %xmm0
	paddq	%xmm4, %xmm0
	movdqu	136(%rax,%rdi,8), %xmm1
	paddq	%xmm2, %xmm1
	addq	$16, %rdi
	addq	$-4, %rsi
	jne	LBB0_7
LBB0_8:
	testq	%r8, %r8
	je	LBB0_11
## %bb.9:
	leaq	(%rax,%rdi,8), %rsi
	addq	$40, %rsi
	shlq	$5, %r8
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%rsi,%rdi), %xmm2
	paddq	%xmm2, %xmm0
	movdqu	(%rsi,%rdi), %xmm2
	paddq	%xmm2, %xmm1
	addq	$32, %rdi
	cmpq	%rdi, %r8
	jne	LBB0_10
LBB0_11:
	paddq	%xmm1, %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rsi
	jmp	LBB0_12
LBB0_3:
	addq	24(%rax,%rdx,8), %rsi
	incq	%rdx
LBB0_12:
	cmpq	%rdx, %rcx
	jne	LBB0_3
## %bb.13:
	movl	$256, %ecx                      ## imm = 0x100
	subq	%rsi, %rcx
	movq	%rcx, 16(%rax)
LBB0_14:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_patch_gamut_packet_checksum
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function patch_gamut_packet_checksum
_patch_gamut_packet_checksum:           ; @patch_gamut_packet_checksum
	.cfi_startproc
; %bb.0:
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_9
; %bb.1:
	ldr	x8, [x0]
	ldr	x9, [x8, #8]
	add	x11, x9, #1
	cmp	x11, #8
	b.hs	LBB0_3
; %bb.2:
	mov	x10, #0
	mov	x12, #0
	b	LBB0_6
LBB0_3:
	and	x10, x11, #0xfffffffffffffff8
	add	x12, x8, #72
	movi.2d	v0, #0000000000000000
	mov	x13, x10
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x12, #-48]
	ldp	q6, q7, [x12, #-16]
	add.2d	v0, v4, v0
	add.2d	v1, v5, v1
	add.2d	v2, v6, v2
	add.2d	v3, v7, v3
	add	x12, x12, #64
	subs	x13, x13, #8
	b.ne	LBB0_4
; %bb.5:
	add.2d	v0, v1, v0
	add.2d	v0, v2, v0
	add.2d	v0, v3, v0
	addp.2d	d0, v0
	fmov	x12, d0
	cmp	x11, x10
	b.eq	LBB0_8
LBB0_6:
	sub	x9, x9, x10
	add	x9, x9, #1
	add	x10, x8, x10, lsl #3
	add	x10, x10, #24
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10], #8
	add	x12, x11, x12
	subs	x9, x9, #1
	b.ne	LBB0_7
LBB0_8:
	mov	w9, #256
	sub	x9, x9, x12
	str	x9, [x8, #16]
LBB0_9:
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_patch_gamut_packet_checksum
.subsections_via_symbols
