	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_png
_read_png:                              ## @read_png
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	$0, -64(%rbp)
	movq	_PNG_LIBPNG_VER_STRING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_error_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_warning_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rsi
	callq	_png_create_read_struct
	movq	%rax, -88(%rbp)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movl	8(%r14), %edi
	callq	_setjmp
	movl	%eax, -48(%rbp)
	cmpl	$0, -48(%rbp)
	jne	LBB0_16
## %bb.3:
	movq	_read_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_png_set_read_fn
	movq	%rbx, %rdi
	callq	_png_create_info_struct
	movq	%rax, %r15
	movq	%rax, -64(%rbp)
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_png_error
LBB0_5:
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.6:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_fprintf
LBB0_7:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_png_read_info
	movq	%rbx, %rdi
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, %rsi
	callq	_png_get_image_height
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_png_set_interlace_handling
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_png_start_read_image
	testl	%r13d, %r13d
	jle	LBB0_13
## %bb.8:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
                                        ## kill: def $eax killed $eax def $rax
	incl	%eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	xorl	%r14d, %r14d
	movl	%r14d, %r15d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	%r15d, %eax
	incl	%eax
	movl	%eax, %r15d
	cmpl	%r13d, %eax
	je	LBB0_13
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jle	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%eax, %r12d
	movl	%r14d, %edx
	movq	%rbx, %rdi
	movq	%rdx, %rsi
	callq	_png_read_row
	decl	%r12d
	movl	%r12d, %eax
	cmpl	$1, %r12d
	ja	LBB0_11
	jmp	LBB0_12
LBB0_1:
	movq	_LIBPNG_ERROR_CODE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	callq	_log_error
	movq	_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 12(%r14)
	movl	(%rbx), %eax
	jmp	LBB0_17
LBB0_13:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	cmpq	$0, (%rax)
	je	LBB0_15
## %bb.14:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_fprintf
LBB0_15:
	movq	%rbx, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_png_read_end
LBB0_16:
	xorl	%eax, %eax
	movl	%eax, %edx
	leaq	-88(%rbp), %rdi
	leaq	-64(%rbp), %rsi
	callq	_png_destroy_read_struct
	movl	-48(%rbp), %eax
LBB0_17:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PNG_LIBPNG_VER_STRING,4,2      ## @PNG_LIBPNG_VER_STRING
	.comm	_error_handler,4,2              ## @error_handler
	.comm	_warning_handler,4,2            ## @warning_handler
	.comm	_LIBPNG_ERROR_CODE,4,2          ## @LIBPNG_ERROR_CODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"OOM allocating png_struct"

	.comm	_INTERNAL_ERROR,4,2             ## @INTERNAL_ERROR
	.comm	_read_callback,4,2              ## @read_callback
L_.str.1:                               ## @.str.1
	.asciz	"OOM allocating info structure"

	.comm	_stderr,4,2                     ## @stderr
L_.str.2:                               ## @.str.2
	.asciz	" INFO\n"

L_.str.3:                               ## @.str.3
	.asciz	" END\n"

	.no_dead_strip	_read_png
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_png
_read_png:                              ; @read_png
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	str	xzr, [sp, #16]
Lloh0:
	adrp	x8, _PNG_LIBPNG_VER_STRING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PNG_LIBPNG_VER_STRING@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _error_handler@GOTPAGE
Lloh4:
	ldr	x8, [x8, _error_handler@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _warning_handler@GOTPAGE
Lloh7:
	ldr	x8, [x8, _warning_handler@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	x1, x19
	bl	_png_create_read_struct
	str	x0, [sp, #24]
	cbz	x0, LBB0_12
; %bb.1:
	mov	x20, x0
	ldr	w0, [x19, #8]
	bl	_setjmp
	str	w0, [sp, #12]
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_16
; %bb.2:
Lloh9:
	adrp	x8, _read_callback@GOTPAGE
Lloh10:
	ldr	x8, [x8, _read_callback@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_png_set_read_fn
	mov	x0, x20
	bl	_png_create_info_struct
	mov	x21, x0
	str	x0, [sp, #16]
	cbnz	x0, LBB0_4
; %bb.3:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_png_error
LBB0_4:
	ldr	x8, [x19]
	ldr	x8, [x8]
Lloh14:
	adrp	x24, _stderr@GOTPAGE
Lloh15:
	ldr	x24, [x24, _stderr@GOTPAGEOFF]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	w0, [x24]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fprintf
LBB0_6:
	mov	x0, x20
	mov	x1, x21
	bl	_png_read_info
	mov	x0, x20
	mov	x1, x21
	bl	_png_get_image_height
	mov	x22, x0
	mov	x0, x20
	bl	_png_set_interlace_handling
	mov	x23, x0
	mov	x0, x20
	bl	_png_start_read_image
	cmp	w23, #1
	b.lt	LBB0_13
; %bb.7:
	mov	w0, #0
	add	w25, w22, #1
	mov	w26, #0
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	w8, w26, #1
	mov	x26, x8
	cmp	w8, w23
	b.eq	LBB0_13
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	cmp	w22, #1
	b.lt	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x8, x25
LBB0_11:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x27, x8
	mov	x1, #0
	mov	x0, x20
	mov	x2, #0
	bl	_png_read_row
	sub	w9, w27, #1
	mov	x8, x9
	cmp	w9, #1
	b.hi	LBB0_11
	b	LBB0_8
LBB0_12:
Lloh18:
	adrp	x20, _LIBPNG_ERROR_CODE@GOTPAGE
Lloh19:
	ldr	x20, [x20, _LIBPNG_ERROR_CODE@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh20:
	adrp	x2, l_.str@PAGE
Lloh21:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_log_error
Lloh22:
	adrp	x8, _INTERNAL_ERROR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _INTERNAL_ERROR@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	ldr	w9, [x19, #12]
	orr	w8, w9, w8
	str	w8, [x19, #12]
	ldr	w0, [x20]
	b	LBB0_17
LBB0_13:
	ldr	x8, [x19]
	ldr	x8, [x8]
	cbz	x8, LBB0_15
; %bb.14:
	ldr	w0, [x24]
Lloh25:
	adrp	x1, l_.str.3@PAGE
Lloh26:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fprintf
LBB0_15:
	mov	x0, x20
	mov	x1, x21
	bl	_png_read_end
LBB0_16:
	mov	x2, #0
	add	x0, sp, #24
	add	x1, sp, #16
	bl	_png_destroy_read_struct
	ldr	w0, [sp, #12]
LBB0_17:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_PNG_LIBPNG_VER_STRING,4,2      ; @PNG_LIBPNG_VER_STRING
	.comm	_error_handler,4,2              ; @error_handler
	.comm	_warning_handler,4,2            ; @warning_handler
	.comm	_LIBPNG_ERROR_CODE,4,2          ; @LIBPNG_ERROR_CODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"OOM allocating png_struct"

	.comm	_INTERNAL_ERROR,4,2             ; @INTERNAL_ERROR
	.comm	_read_callback,4,2              ; @read_callback
l_.str.1:                               ; @.str.1
	.asciz	"OOM allocating info structure"

	.comm	_stderr,4,2                     ; @stderr
l_.str.2:                               ; @.str.2
	.asciz	" INFO\n"

l_.str.3:                               ; @.str.3
	.asciz	" END\n"

	.no_dead_strip	_read_png
.subsections_via_symbols
