	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function write_bitstream
LCPI0_0:
	.quad	0x4020000000000000              ## double 8
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_write_bitstream:                       ## @write_bitstream
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r13d
	movl	%r8d, %r14d
	movq	%rcx, %r12
	movq	%rdi, %r15
	movl	%r9d, %ecx
	callq	_mark_all_blocks
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_encode_all_blocks
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_2
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_write_header
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_6
## %bb.3:
	movl	%ebx, %eax
	leaq	(%r12,%rax,4), %rsi
	subl	%ebx, %r14d
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_write_all_blocks
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	addl	%eax, %ebx
	cvtsi2sd	%ebx, %xmm0
	mulsd	LCPI0_0(%rip), %xmm0
	addsd	(%r15), %xmm0
	movsd	%xmm0, (%r15)
	jmp	LBB0_6
LBB0_4:
	movl	%eax, %ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_write_bitstream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_bitstream
_write_bitstream:                       ; @write_bitstream
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x23, x5
	mov	x21, x4
	mov	x22, x3
	mov	x19, x0
	mov	x3, x5
	bl	_mark_all_blocks
	mov	x20, x0
	cbnz	w0, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x23
	bl	_encode_all_blocks
	mov	x20, x0
	cbz	w0, LBB0_3
LBB0_2:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_write_header
	mov	x20, x0
	tbnz	w0, #31, LBB0_2
; %bb.4:
	add	x1, x22, w20, uxtw #2
	sub	w2, w21, w20
	mov	x0, x19
	bl	_write_all_blocks
	tbnz	w0, #31, LBB0_6
; %bb.5:
	add	w20, w0, w20
	scvtf	d0, w20
	ldr	d1, [x19]
	fmov	d2, #8.00000000
	fmadd	d0, d0, d2, d1
	str	d0, [x19]
	b	LBB0_2
LBB0_6:
	mov	x20, x0
	b	LBB0_2
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_write_bitstream
.subsections_via_symbols
