	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bwrite_coordinates_list
_bwrite_coordinates_list:               ## @bwrite_coordinates_list
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	(%rsi), %rax
	movq	_tot_items@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setb	%dil
	callq	_assert
	movq	%r14, %rdi
	callq	_bwrite_get_bits_written
	movq	_coordinate_bits@GOTPCREL(%rip), %rcx
	subl	%eax, (%rcx)
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_bwrite_gamma_code
	movq	_item_positions@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	(%r13), %rcx
	movl	(%rax,%rcx,4), %r12d
	testl	%r15d, %r15d
	setg	%al
	cmpl	%r15d, %r12d
	setge	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	callq	_assert
	movq	(%rbx), %rax
	movq	(%r13), %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	8(%r14), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	12(%r14), %ebx
	movq	_le_golomb@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_bwrite_get_bits_written
	movq	%rax, (%rsp)
	leaq	-72(%rbp), %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %edx
	movl	%ebx, %ecx
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	callq	_list_encoder_init
	testl	%r15d, %r15d
	jle	LBB0_4
## %bb.1:
	movl	8(%r13), %eax
	testl	%eax, %eax
	setg	%cl
	cmpl	%r12d, %eax
	setle	%al
	andb	%cl, %al
	movzbl	%al, %edi
	callq	_assert
	movl	$1, %edi
	callq	_assert
	movl	8(%r13), %esi
	decl	%esi
	leaq	-72(%rbp), %rdi
	callq	*-64(%rbp)
	cmpl	$1, %r15d
	je	LBB0_4
## %bb.2:
	movl	%r15d, %ebx
	addq	$24, %r13
	decq	%rbx
	leaq	-72(%rbp), %r15
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %eax
	testl	%eax, %eax
	setg	%cl
	cmpl	%r12d, %eax
	setle	%al
	andb	%cl, %al
	movzbl	%al, %edi
	callq	_assert
	movl	-16(%r13), %eax
	xorl	%edi, %edi
	cmpl	(%r13), %eax
	setl	%dil
	callq	_assert
	movl	(%r13), %esi
	decl	%esi
	movq	%r15, %rdi
	callq	*-64(%rbp)
	addq	$16, %r13
	decq	%rbx
	jne	LBB0_3
LBB0_4:
	movl	-68(%rbp), %eax
	movl	%eax, 4(%r14)
	movl	-72(%rbp), %eax
	movl	%eax, (%r14)
	movq	%r14, %rdi
	callq	_bwrite_get_bits_written
	movq	_coordinate_bits@GOTPCREL(%rip), %rcx
	addl	%eax, (%rcx)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_tot_items,8,3                  ## @tot_items
	.comm	_coordinate_bits,4,2            ## @coordinate_bits
	.comm	_item_positions,8,3             ## @item_positions
	.comm	_le_golomb,4,2                  ## @le_golomb
	.no_dead_strip	_bwrite_coordinates_list
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bwrite_coordinates_list
_bwrite_coordinates_list:               ; @bwrite_coordinates_list
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _tot_items@GOTPAGE
Lloh1:
	ldr	x9, [x9, _tot_items@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, lo
	bl	_assert
	mov	x0, x19
	bl	_bwrite_get_bits_written
Lloh3:
	adrp	x26, _coordinate_bits@GOTPAGE
Lloh4:
	ldr	x26, [x26, _coordinate_bits@GOTPAGEOFF]
	ldr	w8, [x26]
	sub	w8, w8, w0
	str	w8, [x26]
	mov	x0, x19
	mov	x1, x21
	bl	_bwrite_gamma_code
Lloh5:
	adrp	x22, _item_positions@GOTPAGE
Lloh6:
	ldr	x22, [x22, _item_positions@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x9, [x20]
	ldr	w27, [x8, x9, lsl #2]
	cmp	w21, #0
	ccmp	w27, w21, #8, gt
	cset	w0, ge
	bl	_assert
	ldr	x8, [x22]
	ldr	x9, [x20]
	ldr	w22, [x8, x9, lsl #2]
	ldp	w24, w23, [x19, #8]
Lloh7:
	adrp	x8, _le_golomb@GOTPAGE
Lloh8:
	ldr	x8, [x8, _le_golomb@GOTPAGEOFF]
Lloh9:
	ldr	w25, [x8]
	mov	x0, x19
	bl	_bwrite_get_bits_written
	mov	x6, x0
	mov	x0, sp
	mov	x1, x22
	mov	x2, x21
	mov	x3, x23
	mov	x4, x24
	mov	x5, x25
	bl	_list_encoder_init
	cmp	w21, #1
	b.lt	LBB0_4
; %bb.1:
	ldr	w8, [x20, #8]
	cmp	w8, #0
	ccmp	w8, w27, #0, gt
	cset	w0, le
	bl	_assert
	mov	w0, #1
	bl	_assert
	ldr	x8, [sp, #8]
	ldr	w9, [x20, #8]
	sub	w1, w9, #1
	mov	x0, sp
	blr	x8
	cmp	w21, #1
	b.eq	LBB0_4
; %bb.2:
	mov	w8, w21
	add	x20, x20, #24
	sub	x21, x8, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	cmp	w8, #0
	ccmp	w8, w27, #0, gt
	cset	w0, le
	bl	_assert
	ldur	w8, [x20, #-16]
	ldr	w9, [x20]
	cmp	w8, w9
	cset	w0, lt
	bl	_assert
	ldr	x8, [sp, #8]
	ldr	w9, [x20], #16
	sub	w1, w9, #1
	mov	x0, sp
	blr	x8
	subs	x21, x21, #1
	b.ne	LBB0_3
LBB0_4:
	ldr	d0, [sp]
	str	d0, [x19]
	mov	x0, x19
	bl	_bwrite_get_bits_written
	ldr	w8, [x26]
	add	w8, w8, w0
	str	w8, [x26]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_tot_items,8,3                  ; @tot_items
	.comm	_coordinate_bits,4,2            ; @coordinate_bits
	.comm	_item_positions,8,3             ; @item_positions
	.comm	_le_golomb,4,2                  ; @le_golomb
	.no_dead_strip	_bwrite_coordinates_list
.subsections_via_symbols
