	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function encode_ext_header
_encode_ext_header:                     ## @encode_ext_header
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	40(%rdi), %rax
	movl	8(%rax), %edx
	movl	12(%rax), %esi
	leaq	-20(%rbp), %r14
	movq	%r14, %rdi
	callq	_init_put_bits
	movq	40(%rbx), %rcx
	movl	(%rcx), %eax
	cltd
	idivl	4(%rcx)
	movq	%r14, %rdi
	movl	$5, %esi
	movl	%eax, %edx
	callq	_put_bits
	movl	24(%rbx), %eax
	leal	1023(%rax), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$10, %edi
	movl	$2047, %esi                     ## imm = 0x7FF
	callq	_FFMIN
	movq	%r14, %rdi
	movl	$11, %esi
	movl	%eax, %edx
	callq	_put_bits
	movl	$1, (%rbx)
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %edx
	callq	_put_bits
	movl	28(%rbx), %edx
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_put_bits
	movl	$1, 4(%rbx)
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %edx
	callq	_put_bits
	movl	$1, 8(%rbx)
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %edx
	callq	_put_bits
	movl	$0, 12(%rbx)
	movq	%r14, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_put_bits
	movl	$1, 16(%rbx)
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %edx
	callq	_put_bits
	movq	%r14, %rdi
	movl	$3, %esi
	movl	$1, %edx
	callq	_put_bits
	movq	%r14, %rdi
	callq	_flush_put_bits
	movl	36(%rbx), %eax
	movl	%eax, 32(%rbx)
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_encode_ext_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encode_ext_header
_encode_ext_header:                     ; @encode_ext_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0, #40]
	ldp	w2, w1, [x8, #8]
	add	x0, sp, #12
	bl	_init_put_bits
	ldr	x8, [x19, #40]
	ldp	w9, w8, [x8]
	sdiv	w2, w9, w8
	add	x0, sp, #12
	mov	w1, #5
	bl	_put_bits
	ldr	w8, [x19, #24]
	add	w9, w8, #1023
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w0, w8, #10
	mov	w1, #2047
	bl	_FFMIN
	mov	x2, x0
	add	x0, sp, #12
	mov	w1, #11
	bl	_put_bits
	mov	w20, #1
	str	w20, [x19]
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #1
	bl	_put_bits
	ldr	w2, [x19, #28]
	add	x0, sp, #12
	mov	w1, #1
	bl	_put_bits
	str	w20, [x19, #4]
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #1
	bl	_put_bits
	str	w20, [x19, #8]
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #1
	bl	_put_bits
	str	wzr, [x19, #12]
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #0
	bl	_put_bits
	str	w20, [x19, #16]
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #1
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #3
	mov	w2, #1
	bl	_put_bits
	add	x0, sp, #12
	bl	_flush_put_bits
	ldr	w8, [x19, #36]
	str	w8, [x19, #32]
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_encode_ext_header
.subsections_via_symbols
