	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_Image_LoadPngImage        ## -- Begin function HPDF_Image_LoadPngImage
	.p2align	4, 0x90
_HPDF_Image_LoadPngImage:               ## @HPDF_Image_LoadPngImage
	.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
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_HPDF_PNG_BYTES_TO_CHECK@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	movq	%rbx, %rax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movl	%ebx, -60(%rbp)
	leaq	L_.str(%rip), %rdi
	callq	_HPDF_PTRACE
	movl	(%r15), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_HPDF_MemSet
	leaq	-60(%rbp), %rdx
	movl	%r12d, %edi
	movq	%r14, %rsi
	callq	_HPDF_Stream_Read
	movq	%rax, %rbx
	movq	_HPDF_OK@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_2
## %bb.1:
	movl	(%r15), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_png_sig_cmp
	testq	%rax, %rax
	je	LBB0_5
LBB0_2:
	movl	(%r13), %edi
	movq	_HPDF_INVALID_PNG_IMAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	callq	_HPDF_SetError
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_10
## %bb.4:
	movq	%rbx, %rax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%r13, %rdi
	movl	-56(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %esi
	callq	_HPDF_DictStream_New
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:
	movq	%rax, %r13
	movq	_HPDF_OSUBCLASS_XOBJECT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r13)
	leaq	L_.str.1(%rip), %rsi
	leaq	L_.str.2(%rip), %rdx
	movq	%r13, %rdi
	callq	_HPDF_Dict_AddName
	movq	%rax, %r14
	addq	%rbx, %r14
	leaq	L_.str.3(%rip), %rsi
	leaq	L_.str.4(%rip), %rdx
	movq	%r13, %rdi
	callq	_HPDF_Dict_AddName
	addq	%r14, %rax
	movq	_HPDF_OK@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	jne	LBB0_9
## %bb.7:
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_LoadPngData
	xorl	%ebx, %ebx
	cmpq	(%r14), %rax
	cmoveq	%r13, %rbx
	jmp	LBB0_3
LBB0_9:
	xorl	%ebx, %ebx
	jmp	LBB0_3
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_HPDF_PNG_BYTES_TO_CHECK,4,2    ## @HPDF_PNG_BYTES_TO_CHECK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" HPDF_Image_LoadPngImage\n"

	.comm	_HPDF_OK,8,3                    ## @HPDF_OK
	.comm	_HPDF_INVALID_PNG_IMAGE,4,2     ## @HPDF_INVALID_PNG_IMAGE
	.comm	_HPDF_OSUBCLASS_XOBJECT,4,2     ## @HPDF_OSUBCLASS_XOBJECT
L_.str.1:                               ## @.str.1
	.asciz	"Type"

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

L_.str.3:                               ## @.str.3
	.asciz	"Subtype"

L_.str.4:                               ## @.str.4
	.asciz	"Image"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_Image_LoadPngImage        ; -- Begin function HPDF_Image_LoadPngImage
	.p2align	2
_HPDF_Image_LoadPngImage:               ; @HPDF_Image_LoadPngImage
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #16
	mov	x19, x3
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x26, _HPDF_PNG_BYTES_TO_CHECK@GOTPAGE
Lloh4:
	ldr	x26, [x26, _HPDF_PNG_BYTES_TO_CHECK@GOTPAGEOFF]
	ldr	w12, [x26]
	lsl	x8, x12, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x24, x9, x8
	mov	sp, x24
	stur	w12, [x29, #-76]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_HPDF_PTRACE
	ldr	w2, [x26]
	mov	x0, x24
	mov	w1, #0
	bl	_HPDF_MemSet
	sub	x2, x29, #76
	mov	x0, x20
	mov	x1, x24
	bl	_HPDF_Stream_Read
Lloh9:
	adrp	x25, _HPDF_OK@GOTPAGE
Lloh10:
	ldr	x25, [x25, _HPDF_OK@GOTPAGEOFF]
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_2
; %bb.1:
	mov	x23, x0
	ldr	w2, [x26]
	mov	x0, x24
	mov	w1, #0
	bl	_png_sig_cmp
	cbz	x0, LBB0_6
LBB0_2:
	ldr	w0, [x22]
Lloh11:
	adrp	x8, _HPDF_INVALID_PNG_IMAGE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HPDF_INVALID_PNG_IMAGE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_HPDF_SetError
LBB0_3:
	mov	x0, #0
LBB0_4:
	ldur	x8, [x29, #-72]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.5:
	sub	sp, x29, #64
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x0, x22
	mov	x1, x21
	bl	_HPDF_DictStream_New
	cbz	x0, LBB0_4
; %bb.7:
	mov	x22, x0
Lloh17:
	adrp	x8, _HPDF_OSUBCLASS_XOBJECT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _HPDF_OSUBCLASS_XOBJECT@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	ldr	w9, [x0]
	orr	w8, w9, w8
	str	w8, [x0]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
Lloh22:
	adrp	x2, l_.str.2@PAGE
Lloh23:
	add	x2, x2, l_.str.2@PAGEOFF
	bl	_HPDF_Dict_AddName
	add	x23, x0, x23
Lloh24:
	adrp	x1, l_.str.3@PAGE
Lloh25:
	add	x1, x1, l_.str.3@PAGEOFF
Lloh26:
	adrp	x2, l_.str.4@PAGE
Lloh27:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x22
	bl	_HPDF_Dict_AddName
	ldr	x8, [x25]
	add	x9, x23, x0
	cmp	x9, x8
	b.ne	LBB0_3
; %bb.8:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	bl	_LoadPngData
	ldr	x8, [x25]
	cmp	x0, x8
	csel	x0, x22, xzr, eq
	b	LBB0_4
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_HPDF_PNG_BYTES_TO_CHECK,4,2    ; @HPDF_PNG_BYTES_TO_CHECK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" HPDF_Image_LoadPngImage\n"

	.comm	_HPDF_OK,8,3                    ; @HPDF_OK
	.comm	_HPDF_INVALID_PNG_IMAGE,4,2     ; @HPDF_INVALID_PNG_IMAGE
	.comm	_HPDF_OSUBCLASS_XOBJECT,4,2     ; @HPDF_OSUBCLASS_XOBJECT
l_.str.1:                               ; @.str.1
	.asciz	"Type"

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

l_.str.3:                               ; @.str.3
	.asciz	"Subtype"

l_.str.4:                               ; @.str.4
	.asciz	"Image"

.subsections_via_symbols
