	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_header
_write_header:                          ## @write_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$-1, %eax
	cmpl	$5, %edx
	jl	LBB0_4
## %bb.1:
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	leaq	-36(%rbp), %r12
	movq	%r12, %rdi
	callq	_init_put_bits
	movl	(%rbx), %edx
	sarl	$4, %edx
	decl	%edx
	movq	%r12, %rdi
	movl	$4, %esi
	callq	_put_bits
	movl	4(%rbx), %edx
	movq	%r12, %rdi
	movl	$12, %esi
	callq	_put_bits
	movl	8(%rbx), %edx
	sarl	$4, %edx
	decl	%edx
	movq	%r12, %rdi
	movl	$4, %esi
	callq	_put_bits
	movl	12(%rbx), %edx
	movq	%r12, %rdi
	movl	$12, %esi
	callq	_put_bits
	movq	%r12, %rdi
	callq	_flush_put_bits
	movl	16(%rbx), %eax
	movl	%eax, 16(%r14)
	movq	_HAS_PALLET_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%rbx)
	je	LBB0_2
## %bb.3:
	addq	$20, %r14
	addl	$-5, %r15d
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_write_palette
                                        ## kill: def $eax killed $eax def $rax
	leal	5(%rax), %ecx
	testl	%eax, %eax
	movl	$-1, %eax
	cmovnsl	%ecx, %eax
	jmp	LBB0_4
LBB0_2:
	movl	$5, %eax
LBB0_4:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HAS_PALLET_INFO,4,2            ## @HAS_PALLET_INFO
	.no_dead_strip	_write_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_header
_write_header:                          ; @write_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	subs	w19, w2, #5
	b.ge	LBB0_2
; %bb.1:
	mov	w0, #-1
	b	LBB0_5
LBB0_2:
	mov	x21, x1
	mov	x20, x0
	add	x0, sp, #12
	bl	_init_put_bits
	ldr	w8, [x20]
	asr	w8, w8, #4
	sub	w2, w8, #1
	add	x0, sp, #12
	mov	w1, #4
	bl	_put_bits
	ldr	w2, [x20, #4]
	add	x0, sp, #12
	mov	w1, #12
	bl	_put_bits
	ldr	w8, [x20, #8]
	asr	w8, w8, #4
	sub	w2, w8, #1
	add	x0, sp, #12
	mov	w1, #4
	bl	_put_bits
	ldr	w2, [x20, #12]
	add	x0, sp, #12
	mov	w1, #12
	bl	_put_bits
	add	x0, sp, #12
	bl	_flush_put_bits
	ldr	w8, [x20, #16]
	str	w8, [x21, #16]
	ldr	w8, [x20, #16]
Lloh0:
	adrp	x9, _HAS_PALLET_INFO@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HAS_PALLET_INFO@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	add	x1, x21, #20
	mov	x0, x20
	mov	x2, x19
	bl	_write_palette
	add	w8, w0, #5
	cmp	w0, #0
	csinv	w0, w8, wzr, ge
	b	LBB0_5
LBB0_4:
	mov	w0, #5
LBB0_5:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_HAS_PALLET_INFO,4,2            ; @HAS_PALLET_INFO
	.no_dead_strip	_write_header
.subsections_via_symbols
