	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_codebooks
_write_codebooks:                       ## @write_codebooks
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$0, (%rsi)
	je	LBB0_7
## %bb.1:
	movq	%rsi, %r12
	movq	%rdi, %r14
	leaq	16(%rdi), %r15
	movq	_RoQ_QUAD_CODEBOOK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_bytestream_put_le16
	movl	(%r12), %eax
	movl	4(%r12), %ecx
	leal	(%rax,%rax,2), %eax
	addl	%eax, %eax
	leal	(%rax,%rcx,4), %esi
	movq	%r15, %rdi
	callq	_bytestream_put_le32
	movl	4(%r12), %esi
	movq	%r15, %rdi
	callq	_bytestream_put_byte
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_bytestream_put_byte
	cmpl	$0, (%r12)
	jle	LBB0_4
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rax
	movq	8(%r12), %rcx
	movq	(%rcx,%rbx,8), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movl	8(%rax,%rcx,4), %esi
	movq	%r15, %rdi
	movl	$4, %edx
	callq	_bytestream_put_buffer
	movq	8(%r14), %rax
	movq	8(%r12), %rcx
	movq	(%rcx,%rbx,8), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movl	(%rax,%rcx,4), %esi
	movq	%r15, %rdi
	callq	_bytestream_put_byte
	movq	8(%r14), %rax
	movq	8(%r12), %rcx
	movq	(%rcx,%rbx,8), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movl	4(%rax,%rcx,4), %esi
	movq	%r15, %rdi
	callq	_bytestream_put_byte
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_3
LBB0_4:
	cmpl	$0, 4(%r12)
	jle	LBB0_7
## %bb.5:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movq	16(%r12), %rcx
	movq	24(%r12), %rdx
	movq	(%rdx,%rbx,8), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	(%rax), %rax
	movl	(%rcx,%rax,4), %esi
	movq	%r15, %rdi
	callq	_bytestream_put_byte
	movq	(%r14), %rax
	movq	16(%r12), %rcx
	movq	24(%r12), %rdx
	movq	(%rdx,%rbx,8), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	8(%rax), %rax
	movl	(%rcx,%rax,4), %esi
	movq	%r15, %rdi
	callq	_bytestream_put_byte
	movq	(%r14), %rax
	movq	16(%r12), %rcx
	movq	24(%r12), %rdx
	movq	(%rdx,%rbx,8), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	16(%rax), %rax
	movl	(%rcx,%rax,4), %esi
	movq	%r15, %rdi
	callq	_bytestream_put_byte
	movq	(%r14), %rax
	movq	16(%r12), %rcx
	movq	24(%r12), %rdx
	movq	(%rdx,%rbx,8), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	24(%rax), %rax
	movl	(%rcx,%rax,4), %esi
	movq	%r15, %rdi
	callq	_bytestream_put_byte
	incq	%rbx
	movslq	4(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_6
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RoQ_QUAD_CODEBOOK,4,2          ## @RoQ_QUAD_CODEBOOK
	.no_dead_strip	_write_codebooks
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_codebooks
_write_codebooks:                       ; @write_codebooks
	.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
	ldr	w8, [x1]
	cbz	w8, LBB0_7
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	add	x21, x0, #16
Lloh0:
	adrp	x8, _RoQ_QUAD_CODEBOOK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RoQ_QUAD_CODEBOOK@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_bytestream_put_le16
	mov	w8, #6
	ldp	w9, w10, [x19]
	mul	w8, w9, w8
	add	w1, w8, w10, lsl #2
	mov	x0, x21
	bl	_bytestream_put_le32
	ldr	w1, [x19, #4]
	mov	x0, x21
	bl	_bytestream_put_byte
	ldr	w1, [x19]
	mov	x0, x21
	bl	_bytestream_put_byte
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x22, #0
	mov	w23, #12
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	ldr	x9, [x19, #8]
	lsl	x24, x22, #3
	ldr	x9, [x9, x24]
	madd	x8, x9, x23, x8
	ldr	w1, [x8, #8]
	mov	x0, x21
	mov	w2, #4
	bl	_bytestream_put_buffer
	ldr	x8, [x20, #8]
	ldr	x9, [x19, #8]
	ldr	x9, [x9, x24]
	mul	x9, x9, x23
	ldr	w1, [x8, x9]
	mov	x0, x21
	bl	_bytestream_put_byte
	ldr	x8, [x20, #8]
	ldr	x9, [x19, #8]
	ldr	x9, [x9, x24]
	madd	x8, x9, x23, x8
	ldr	w1, [x8, #4]
	mov	x0, x21
	bl	_bytestream_put_byte
	add	x22, x22, #1
	ldrsw	x8, [x19]
	cmp	x22, x8
	b.lt	LBB0_3
LBB0_4:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.5:
	mov	x22, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x8, x9, [x19, #16]
	lsl	x23, x22, #3
	ldr	x9, [x9, x23]
	ldr	x10, [x20]
	ldr	x9, [x10, x9, lsl #3]
	ldr	x9, [x9]
	ldr	w1, [x8, x9, lsl #2]
	mov	x0, x21
	bl	_bytestream_put_byte
	ldp	x8, x9, [x19, #16]
	ldr	x9, [x9, x23]
	ldr	x10, [x20]
	ldr	x9, [x10, x9, lsl #3]
	ldr	x9, [x9, #8]
	ldr	w1, [x8, x9, lsl #2]
	mov	x0, x21
	bl	_bytestream_put_byte
	ldp	x8, x9, [x19, #16]
	ldr	x9, [x9, x23]
	ldr	x10, [x20]
	ldr	x9, [x10, x9, lsl #3]
	ldr	x9, [x9, #16]
	ldr	w1, [x8, x9, lsl #2]
	mov	x0, x21
	bl	_bytestream_put_byte
	ldp	x8, x9, [x19, #16]
	ldr	x9, [x9, x23]
	ldr	x10, [x20]
	ldr	x9, [x10, x9, lsl #3]
	ldr	x9, [x9, #24]
	ldr	w1, [x8, x9, lsl #2]
	mov	x0, x21
	bl	_bytestream_put_byte
	add	x22, x22, #1
	ldrsw	x8, [x19, #4]
	cmp	x22, x8
	b.lt	LBB0_6
LBB0_7:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_RoQ_QUAD_CODEBOOK,4,2          ; @RoQ_QUAD_CODEBOOK
	.no_dead_strip	_write_codebooks
.subsections_via_symbols
