	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function CreatePallet
_CreatePallet:                          ## @CreatePallet
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	$0, -28(%rbp)
	movq	$0, -40(%rbp)
	leaq	-40(%rbp), %rax
	leaq	-28(%rbp), %rcx
	movl	%esi, %edi
	movl	%edx, %esi
	movq	%rax, %rdx
	callq	_png_get_PLTE
	movq	_PNG_INFO_PLTE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movl	8(%rbx), %edi
	movl	-28(%rbp), %eax
	leal	(%rax,%rax,2), %esi
	callq	_HPDF_GetMem
	testq	%rax, %rax
	je	LBB0_11
## %bb.3:
	movq	%rax, %r14
	cmpl	$0, -28(%rbp)
	jle	LBB0_7
## %bb.4:
	xorl	%ecx, %ecx
	movq	-40(%rbp), %rax
	movq	%r14, %rdx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%rax), %esi
	movl	%esi, (%rdx)
	movl	4(%rax), %esi
	movl	%esi, 4(%rdx)
	movl	(%rax), %esi
	movl	%esi, 8(%rdx)
	incl	%ecx
	addq	$12, %rax
	addq	$12, %rdx
	cmpl	-28(%rbp), %ecx
	jl	LBB0_5
## %bb.6:
	movq	%rax, -40(%rbp)
LBB0_7:
	movl	8(%rbx), %edi
	callq	_HPDF_Array_New
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	%rax, %r15
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movq	%rax, %rdx
	callq	_HPDF_Dict_Add
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_HPDF_Array_AddName
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_HPDF_Array_AddName
	movl	-28(%rbp), %esi
	decl	%esi
	movq	%r15, %rdi
	callq	_HPDF_Array_AddNumber
	movl	8(%rbx), %edi
	movl	-28(%rbp), %eax
	leal	(%rax,%rax,2), %edx
	movq	%r14, %rsi
	callq	_HPDF_Binary_New
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_HPDF_Array_Add
LBB0_10:
	movl	8(%rbx), %edi
	movq	%r14, %rsi
	callq	_HPDF_FreeMem
LBB0_11:
	movq	(%rbx), %rax
	movl	(%rax), %eax
	jmp	LBB0_12
LBB0_1:
	movq	(%rbx), %rdi
	movq	_HPDF_LIBPNG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_HPDF_CANNOT_GET_PALLET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_HPDF_SetError
LBB0_12:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PNG_INFO_PLTE,8,3              ## @PNG_INFO_PLTE
	.comm	_HPDF_LIBPNG_ERROR,4,2          ## @HPDF_LIBPNG_ERROR
	.comm	_HPDF_CANNOT_GET_PALLET,4,2     ## @HPDF_CANNOT_GET_PALLET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ColorSpace"

L_.str.1:                               ## @.str.1
	.asciz	"Indexed"

L_.str.2:                               ## @.str.2
	.asciz	"DeviceRGB"

	.no_dead_strip	_CreatePallet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function CreatePallet
_CreatePallet:                          ; @CreatePallet
	.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
	mov	x8, x2
	mov	x19, x0
	str	wzr, [sp, #12]
	str	xzr, [sp]
	mov	x2, sp
	add	x3, sp, #12
	mov	x0, x1
	mov	x1, x8
	bl	_png_get_PLTE
Lloh0:
	adrp	x8, _PNG_INFO_PLTE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PNG_INFO_PLTE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.1:
	ldr	w0, [x19, #8]
	ldr	w8, [sp, #12]
	add	w1, w8, w8, lsl #1
	bl	_HPDF_GetMem
	cbz	x0, LBB0_10
; %bb.2:
	mov	x20, x0
	ldr	w8, [sp, #12]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.3:
	mov	w8, #0
	ldr	x9, [sp]
	mov	x10, x20
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9, #8]
	str	w11, [x10]
	ldr	w11, [x9, #4]
	str	w11, [x10, #4]
	ldr	w11, [x9], #12
	str	w11, [x10, #8]
	add	w8, w8, #1
	ldr	w11, [sp, #12]
	add	x10, x10, #12
	cmp	w8, w11
	b.lt	LBB0_4
; %bb.5:
	str	x9, [sp]
LBB0_6:
	ldr	w0, [x19, #8]
	bl	_HPDF_Array_New
	cbz	x0, LBB0_9
; %bb.7:
	mov	x21, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_HPDF_Dict_Add
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_HPDF_Array_AddName
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_HPDF_Array_AddName
	ldr	w8, [sp, #12]
	sub	w1, w8, #1
	mov	x0, x21
	bl	_HPDF_Array_AddNumber
	ldr	w0, [x19, #8]
	ldr	w8, [sp, #12]
	add	w2, w8, w8, lsl #1
	mov	x1, x20
	bl	_HPDF_Binary_New
	cbz	x0, LBB0_9
; %bb.8:
	mov	x1, x0
	mov	x0, x21
	bl	_HPDF_Array_Add
LBB0_9:
	ldr	w0, [x19, #8]
	mov	x1, x20
	bl	_HPDF_FreeMem
LBB0_10:
	ldr	x8, [x19]
	ldr	w0, [x8]
	b	LBB0_12
LBB0_11:
	ldr	x0, [x19]
Lloh9:
	adrp	x8, _HPDF_LIBPNG_ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HPDF_LIBPNG_ERROR@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _HPDF_CANNOT_GET_PALLET@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HPDF_CANNOT_GET_PALLET@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	bl	_HPDF_SetError
LBB0_12:
	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
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_PNG_INFO_PLTE,8,3              ; @PNG_INFO_PLTE
	.comm	_HPDF_LIBPNG_ERROR,4,2          ; @HPDF_LIBPNG_ERROR
	.comm	_HPDF_CANNOT_GET_PALLET,4,2     ; @HPDF_CANNOT_GET_PALLET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ColorSpace"

l_.str.1:                               ; @.str.1
	.asciz	"Indexed"

l_.str.2:                               ; @.str.2
	.asciz	"DeviceRGB"

	.no_dead_strip	_CreatePallet
.subsections_via_symbols
