	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hnm_update_palette
_hnm_update_palette:                    ## @hnm_update_palette
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	(%rdi), %r13
	testb	$-128, 28(%rsi)
	jne	LBB0_2
## %bb.1:
	xorl	%r14d, %r14d
	jmp	LBB0_3
LBB0_2:
	cmpl	$74, (%r13)
	sete	%r14b
LBB0_3:
	addq	$32, %rsi
	addq	$-8, %rbx
	leaq	-44(%rbp), %r15
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_bytestream2_init
	movq	%r15, %rdi
	callq	_bytestream2_tell
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	cmpq	%rbx, %rax
	jge	LBB0_11
## %bb.4:
	leaq	-44(%rbp), %r15
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%r15, %rdi
	callq	_bytestream2_tell
	cmpq	-56(%rbp), %rax                 ## 8-byte Folded Reload
	jge	LBB0_11
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	movq	%r15, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_bytestream2_get_byte
	movl	%eax, %r12d
	cmpl	$255, %ebx
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$255, %r12d
	je	LBB0_11
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	testl	%r12d, %r12d
	movl	$256, %eax                      ## imm = 0x100
	cmovel	%eax, %r12d
	testl	%r12d, %r12d
	jle	LBB0_5
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movslq	%ebx, %rbx
	shlq	$2, %rbx
	incl	%r12d
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rdi
	callq	_bytestream2_get_be24
                                        ## kill: def $eax killed $eax def $rax
	movq	8(%r13), %rcx
	leal	(,%rax,4), %edx
	testb	%r14b, %r14b
	cmovnel	%eax, %edx
	orl	$-16777216, %edx                ## imm = 0xFF000000
	movl	%edx, (%rcx,%rbx)
	addq	$4, %rbx
	decl	%r12d
	cmpl	$1, %r12d
	ja	LBB0_10
	jmp	LBB0_5
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_hnm_update_palette
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hnm_update_palette
_hnm_update_palette:                    ; @hnm_update_palette
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, [x0]
	ldrb	w8, [x1, #28]
	tbnz	w8, #7, LBB0_2
; %bb.1:
	mov	w22, #0
	b	LBB0_3
LBB0_2:
	ldr	w8, [x21]
	cmp	w8, #74
	cset	w22, eq
LBB0_3:
	add	x1, x1, #32
	sub	x19, x2, #8
	add	x0, sp, #12
	mov	x2, x19
	bl	_bytestream2_init
	add	x0, sp, #12
	bl	_bytestream2_tell
	cmp	x0, x19
	b.ge	LBB0_11
; %bb.4:
	mov	w23, #256
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x0, sp, #12
	bl	_bytestream2_tell
	cmp	x0, x19
	b.ge	LBB0_11
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	add	x0, sp, #12
	bl	_bytestream2_get_byte
	mov	x20, x0
	add	x0, sp, #12
	bl	_bytestream2_get_byte
	cmp	w20, #255
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w0, #255
	b.eq	LBB0_11
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	cmp	w0, #0
	csel	w8, w23, w0, eq
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	sbfiz	x20, x20, #2, #32
	add	w24, w8, #1
LBB0_10:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x0, sp, #12
	bl	_bytestream2_get_be24
	ldr	x8, [x21, #8]
	lsl	w9, w0, #2
	cmp	w22, #0
	csel	w9, w0, w9, ne
	orr	w9, w9, #0xff000000
	str	w9, [x8, x20]
	add	x20, x20, #4
	sub	w24, w24, #1
	cmp	w24, #1
	b.hi	LBB0_10
	b	LBB0_5
LBB0_11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_hnm_update_palette
.subsections_via_symbols
