	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_uip_chksum                     ## -- Begin function uip_chksum
	.p2align	4, 0x90
_uip_chksum:                            ## @uip_chksum
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	xorl	%ebx, %ebx
	cmpl	$2, %esi
	jl	LBB0_12
## %bb.1:
	xorl	%ebx, %ebx
	movl	%esi, %eax
	subl	$3, %eax
	cmovbl	%ebx, %eax
	incl	%eax
	cmpl	$14, %eax
	jb	LBB0_10
## %bb.2:
	shrl	%eax
	incl	%eax
	movl	%eax, %r8d
	andl	$-8, %r8d
	leaq	-8(%r8), %rbx
	movq	%rbx, %rdx
	shrq	$3, %rdx
	incq	%rdx
	movl	%edx, %ecx
	andl	$3, %ecx
	cmpq	$24, %rbx
	jae	LBB0_4
## %bb.3:
	pxor	%xmm0, %xmm0
	xorl	%ebx, %ebx
	pxor	%xmm1, %xmm1
	jmp	LBB0_6
LBB0_4:
	andq	$-4, %rdx
	pxor	%xmm0, %xmm0
	xorl	%ebx, %ebx
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rdi,%rbx,4), %xmm2
	paddd	%xmm0, %xmm2
	movdqu	16(%rdi,%rbx,4), %xmm0
	paddd	%xmm1, %xmm0
	movdqu	32(%rdi,%rbx,4), %xmm1
	movdqu	48(%rdi,%rbx,4), %xmm3
	movdqu	64(%rdi,%rbx,4), %xmm4
	paddd	%xmm1, %xmm4
	paddd	%xmm2, %xmm4
	movdqu	80(%rdi,%rbx,4), %xmm2
	paddd	%xmm3, %xmm2
	paddd	%xmm0, %xmm2
	movdqu	96(%rdi,%rbx,4), %xmm0
	paddd	%xmm4, %xmm0
	movdqu	112(%rdi,%rbx,4), %xmm1
	paddd	%xmm2, %xmm1
	addq	$32, %rbx
	addq	$-4, %rdx
	jne	LBB0_5
LBB0_6:
	leal	(%r8,%r8), %r9d
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.7:
	leaq	(%rdi,%rbx,4), %rbx
	addq	$16, %rbx
	shlq	$5, %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%rbx,%rdx), %xmm2
	paddd	%xmm2, %xmm0
	movdqu	(%rbx,%rdx), %xmm2
	paddd	%xmm2, %xmm1
	addq	$32, %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_8
LBB0_9:
	paddd	%xmm1, %xmm0
	subl	%r9d, %esi
	leaq	(%rdi,%r8,4), %rdi
	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, %ebx
	cmpq	%rax, %r8
	je	LBB0_12
LBB0_10:
	movl	%esi, %eax
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	addl	(%rdi), %ebx
	addq	$4, %rdi
	leal	-2(%rax), %esi
	cmpl	$3, %eax
	movl	%esi, %eax
	ja	LBB0_11
LBB0_12:
	cmpl	$1, %esi
	jne	LBB0_14
## %bb.13:
	movl	(%rdi), %eax
	shll	$8, %eax
	movzwl	%ax, %edi
	callq	_htons
	addl	%eax, %ebx
LBB0_14:
	cmpl	$65536, %ebx                    ## imm = 0x10000
	jb	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %eax
	sarl	$16, %eax
	movzwl	%bx, %ebx
	addl	%eax, %ebx
	cmpl	$65535, %ebx                    ## imm = 0xFFFF
	ja	LBB0_15
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_uip_chksum                     ; -- Begin function uip_chksum
	.p2align	2
_uip_chksum:                            ; @uip_chksum
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	cmp	w1, #2
	b.lt	LBB0_3
; %bb.1:
	subs	w8, w1, #3
	csel	w8, wzr, w8, lo
	add	w8, w8, #1
	cmp	w8, #30
	b.hs	LBB0_4
; %bb.2:
	mov	w19, #0
	mov	x8, x0
	b	LBB0_7
LBB0_3:
	mov	w19, #0
	mov	x8, x0
	b	LBB0_9
LBB0_4:
	lsr	w8, w8, #1
	add	w9, w8, #1
	and	x10, x9, #0xfffffff0
	sub	w1, w1, w10, lsl #1
	add	x8, x0, x10, lsl #2
	add	x11, x0, #32
	movi.2d	v0, #0000000000000000
	mov	x12, x10
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x11, #-32]
	ldp	q6, q7, [x11], #64
	add.4s	v0, v4, v0
	add.4s	v1, v5, v1
	add.4s	v2, v6, v2
	add.4s	v3, v7, v3
	subs	x12, x12, #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	w19, s0
	cmp	x10, x9
	b.eq	LBB0_9
LBB0_7:
	mov	x9, x1
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x8], #4
	add	w19, w10, w19
	sub	w1, w9, #2
	cmp	w9, #3
	mov	x9, x1
	b.hi	LBB0_8
LBB0_9:
	cmp	w1, #1
	b.ne	LBB0_11
; %bb.10:
	ldr	w8, [x8]
	ubfiz	w0, w8, #8, #8
	bl	_htons
	add	w19, w19, w0
LBB0_11:
	cmp	w19, #16, lsl #12               ; =65536
	b.lo	LBB0_13
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	asr	w8, w19, #16
	add	w19, w8, w19, uxth
	lsr	w8, w19, #16
	cbnz	w8, LBB0_12
LBB0_13:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
