	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_out
_write_out:                             ## @write_out
	.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
	movq	%rsi, %rbx
	testq	%rsi, %rsi
	je	LBB0_12
## %bb.1:
	movq	_xcsum@GOTPCREL(%rip), %r8
	movl	(%r8), %eax
	movq	_csum@GOTPCREL(%rip), %r9
	movl	(%r9), %ecx
	cmpq	$4, %rbx
	jae	LBB0_3
## %bb.2:
	xorl	%edx, %edx
	jmp	LBB0_10
LBB0_3:
	movq	%rbx, %rdx
	andq	$-4, %rdx
	movd	%ecx, %xmm0
	movd	%eax, %xmm1
	leaq	-4(%rdx), %rax
	movq	%rax, %rcx
	shrq	$2, %rcx
	incq	%rcx
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rcx, %rsi
	andq	$-2, %rsi
	pxor	%xmm2, %xmm2
	xorl	%eax, %eax
	pxor	%xmm3, %xmm3
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rdi,%rax,8), %xmm4
	movdqu	16(%rdi,%rax,8), %xmm5
	movdqu	32(%rdi,%rax,8), %xmm6
	movdqu	48(%rdi,%rax,8), %xmm7
	pshufd	$232, %xmm4, %xmm4              ## xmm4 = xmm4[0,2,2,3]
	pshufd	$232, %xmm5, %xmm5              ## xmm5 = xmm5[0,2,2,3]
	paddd	%xmm4, %xmm0
	paddd	%xmm5, %xmm2
	paddd	%xmm4, %xmm1
	paddd	%xmm5, %xmm3
	pshufd	$232, %xmm6, %xmm4              ## xmm4 = xmm6[0,2,2,3]
	pshufd	$232, %xmm7, %xmm5              ## xmm5 = xmm7[0,2,2,3]
	paddd	%xmm4, %xmm0
	paddd	%xmm5, %xmm2
	paddd	%xmm4, %xmm1
	paddd	%xmm5, %xmm3
	addq	$8, %rax
	addq	$-2, %rsi
	jne	LBB0_6
## %bb.7:
	testb	$1, %cl
	je	LBB0_9
LBB0_8:
	movdqu	(%rdi,%rax,8), %xmm4
	movdqu	16(%rdi,%rax,8), %xmm5
	pshufd	$232, %xmm4, %xmm4              ## xmm4 = xmm4[0,2,2,3]
	pshufd	$232, %xmm5, %xmm5              ## xmm5 = xmm5[0,2,2,3]
	paddd	%xmm4, %xmm0
	paddd	%xmm5, %xmm2
	paddd	%xmm4, %xmm1
	paddd	%xmm5, %xmm3
LBB0_9:
	paddd	%xmm2, %xmm0
	paddd	%xmm3, %xmm1
	pshufd	$85, %xmm1, %xmm2               ## xmm2 = xmm1[1,1,1,1]
	paddd	%xmm1, %xmm2
	movd	%xmm2, %eax
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %ecx
	cmpq	%rbx, %rdx
	je	LBB0_11
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdi,%rdx,8), %esi
	addl	%esi, %ecx
	addl	%esi, %eax
	incq	%rdx
	cmpq	%rdx, %rbx
	jne	LBB0_10
LBB0_11:
	movl	%ecx, (%r9)
	movl	%eax, (%r8)
LBB0_12:
	movq	_outfd@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %esi
	movq	%rbx, %rdx
	callq	_fwrite
	cmpq	%rbx, %rax
	jne	LBB0_13
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_4:
	pxor	%xmm2, %xmm2
	xorl	%eax, %eax
	pxor	%xmm3, %xmm3
	testb	$1, %cl
	jne	LBB0_8
	jmp	LBB0_9
LBB0_13:
	callq	_write_out.cold.1
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function write_out.cold.1
_write_out.cold.1:                      ## @write_out.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str(%rip), %rdi
	callq	_perror
	pushq	$1
	popq	%rdi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_csum,4,2                       ## @csum
	.comm	_xcsum,4,2                      ## @xcsum
	.comm	_outfd,4,2                      ## @outfd
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write"

	.no_dead_strip	_write_out
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_out
_write_out:                             ; @write_out
	.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
	mov	x19, x1
	cbz	x1, LBB0_9
; %bb.1:
Lloh0:
	adrp	x8, _xcsum@GOTPAGE
Lloh1:
	ldr	x8, [x8, _xcsum@GOTPAGEOFF]
	ldr	w11, [x8]
Lloh2:
	adrp	x9, _csum@GOTPAGE
Lloh3:
	ldr	x9, [x9, _csum@GOTPAGEOFF]
	ldr	w12, [x9]
	cmp	x19, #8
	b.hs	LBB0_3
; %bb.2:
	mov	x10, #0
	b	LBB0_6
LBB0_3:
	and	x10, x19, #0xfffffffffffffff8
	movi.2d	v0, #0000000000000000
	movi.2d	v1, #0000000000000000
	mov.s	v1[0], w12
	movi.2d	v2, #0000000000000000
	mov.s	v2[0], w11
	add	x11, x0, #32
	mov	x12, x10
	movi.2d	v3, #0000000000000000
	movi.2d	v4, #0000000000000000
	movi.2d	v5, #0000000000000000
	movi.2d	v6, #0000000000000000
	movi.2d	v7, #0000000000000000
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q16, q17, [x11, #-32]
	ldp	q18, q19, [x11], #64
	xtn.2s	v16, v16
	xtn.2s	v17, v17
	xtn.2s	v18, v18
	xtn.2s	v19, v19
	add.2s	v1, v1, v16
	add.2s	v0, v0, v17
	add.2s	v3, v3, v18
	add.2s	v4, v4, v19
	add.2s	v2, v2, v16
	add.2s	v5, v5, v17
	add.2s	v6, v6, v18
	add.2s	v7, v7, v19
	subs	x12, x12, #8
	b.ne	LBB0_4
; %bb.5:
	add.2s	v2, v5, v2
	add.2s	v2, v6, v2
	add.2s	v2, v7, v2
	addp.2s	v2, v2, v2
	fmov	w11, s2
	add.2s	v0, v0, v1
	add.2s	v0, v3, v0
	add.2s	v0, v4, v0
	addp.2s	v0, v0, v0
	fmov	w12, s0
	cmp	x10, x19
	b.eq	LBB0_8
LBB0_6:
	sub	x13, x19, x10
	add	x10, x0, x10, lsl #3
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w14, [x10], #8
	add	w12, w12, w14
	add	w11, w11, w14
	subs	x13, x13, #1
	b.ne	LBB0_7
LBB0_8:
	str	w12, [x9]
	str	w11, [x8]
LBB0_9:
Lloh4:
	adrp	x8, _outfd@GOTPAGE
Lloh5:
	ldr	x8, [x8, _outfd@GOTPAGEOFF]
Lloh6:
	ldr	w3, [x8]
	mov	w1, #1
	mov	x2, x19
	bl	_fwrite
	cmp	x0, x19
	b.ne	LBB0_11
; %bb.10:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_11:
	bl	_write_out.cold.1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function write_out.cold.1
_write_out.cold.1:                      ; @write_out.cold.1
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perror
	mov	w0, #1
	bl	_exit
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_csum,4,2                       ; @csum
	.comm	_xcsum,4,2                      ; @xcsum
	.comm	_outfd,4,2                      ; @outfd
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write"

	.no_dead_strip	_write_out
.subsections_via_symbols
