	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcx_palette
_pcx_palette:                           ## @pcx_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %r12
	movq	%rdi, %r14
	callq	_bytestream2_get_bytes_left
	cltq
	imulq	$1431655766, %rax, %rsi         ## imm = 0x55555556
	movq	%rsi, %rax
	shrq	$63, %rax
	shrq	$32, %rsi
	addl	%eax, %esi
	movl	%r15d, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_FFMIN
	movl	%eax, %r15d
	testl	%eax, %eax
	jle	LBB0_5
## %bb.1:
	movl	%r15d, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_bytestream2_get_be24u
	orl	$-16777216, %eax                ## imm = 0xFF000000
	movl	%eax, (%r12)
	addq	$4, %r12
	decl	%ebx
	jne	LBB0_2
## %bb.3:
	cmpl	$255, %r15d
	jg	LBB0_4
LBB0_5:
	shll	$2, %r15d
	movl	$1024, %edx                     ## imm = 0x400
	subl	%r15d, %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memset                         ## TAILCALL
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_pcx_palette
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcx_palette
_pcx_palette:                           ; @pcx_palette
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	bl	_bytestream2_get_bytes_left
	mov	w8, #21846
	movk	w8, #21845, lsl #16
	smull	x8, w0, w8
	lsr	x9, x8, #63
	lsr	x8, x8, #32
	add	w1, w8, w9
	mov	x0, x21
	bl	_FFMIN
	mov	x21, x0
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x22, x21
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_bytestream2_get_be24u
	orr	w8, w0, #0xff000000
	str	w8, [x19], #4
	subs	w22, w22, #1
	b.ne	LBB0_2
; %bb.3:
	cmp	w21, #255
	b.gt	LBB0_5
LBB0_4:
	mov	w8, #1024
	sub	w2, w8, w21, lsl #2
	mov	x0, x19
	mov	w1, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_memset
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_pcx_palette
.subsections_via_symbols
