	.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	$40, %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	_PNG_LIBPNG_VER_STRING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%ebx, %ebx
	movl	%ebx, %esi
	movl	%ebx, %edx
	movl	%ebx, %ecx
	callq	_png_create_read_struct
	movq	%rax, -72(%rbp)
	movq	$0, -56(%rbp)
	testq	%rax, %rax
	je	LBB0_19
## %bb.1:
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_png_jmpbuf
	movl	%eax, %edi
	callq	_setjmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	xorl	%ebx, %ebx
	movl	%ebx, %edx
	leaq	-72(%rbp), %rdi
	leaq	-56(%rbp), %rsi
	callq	_png_destroy_read_struct
	jmp	LBB0_19
LBB0_3:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_png_init_io
	movq	%r15, %rdi
	callq	_png_create_info_struct
	movq	%rax, -56(%rbp)
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_png_error
LBB0_5:
	movq	_PNG_HANDLE_CHUNK_ALWAYS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ecx, %ecx
	movl	%ecx, %edx
	movq	%r15, %rdi
	callq	_png_set_keep_unknown_chunks
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_png_read_info
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_png_get_rowbytes
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_malloc
	movq	%rax, %r14
	movl	%ebx, %edi
	callq	_malloc
	movq	%rax, %r12
	testq	%r14, %r14
	je	LBB0_7
## %bb.6:
	testq	%r12, %r12
	jne	LBB0_8
LBB0_7:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_png_error
LBB0_8:
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_png_get_image_height
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%r13, %rsi
	callq	_png_get_interlace_type
	movq	_PNG_INTERLACE_ADAM7@GOTPCREL(%rip), %rcx
	movl	$1, %r13d
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movq	_PNG_INTERLACE_ADAM7_PASSES@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_10:
	movq	%r14, %rbx
	movq	%r15, %rdi
	callq	_png_start_read_image
	testl	%r13d, %r13d
	jle	LBB0_18
## %bb.11:
	movl	%r13d, %edx
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%r14d, %r14d
	movl	%r13d, -64(%rbp)                ## 4-byte Spill
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_12 Depth=1
	incl	%r13d
	movl	%r13d, %r14d
	movl	-64(%rbp), %edx                 ## 4-byte Reload
	cmpl	%edx, %r13d
	je	LBB0_18
LBB0_12:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_16 Depth 2
	movl	%r14d, %r13d
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	_PNG_INTERLACE_ADAM7_PASSES@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edx
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%r13d, %esi
	callq	_PNG_PASS_ROWS
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	testl	%eax, %eax
	jle	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=1
	incl	%eax
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_12 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%eax, %r14d
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_png_read_row
	decl	%r14d
	movl	%r14d, %eax
	cmpl	$1, %r14d
	ja	LBB0_16
	jmp	LBB0_17
LBB0_18:
	movq	%r15, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	callq	_png_read_end
	xorl	%eax, %eax
	movl	%eax, %edx
	leaq	-72(%rbp), %rdi
	leaq	-56(%rbp), %rsi
	callq	_png_destroy_read_struct
	movq	%rbx, %rdi
	callq	_free
	movq	%r12, %rdi
	callq	_free
	movl	$1, %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$40, %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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"OOM allocating info structure"

	.comm	_PNG_HANDLE_CHUNK_ALWAYS,4,2    ## @PNG_HANDLE_CHUNK_ALWAYS
L_.str.1:                               ## @.str.1
	.asciz	"OOM allocating row buffers"

	.comm	_PNG_INTERLACE_ADAM7,8,3        ## @PNG_INTERLACE_ADAM7
	.comm	_PNG_INTERLACE_ADAM7_PASSES,4,2 ## @PNG_INTERLACE_ADAM7_PASSES
	.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, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x0
Lloh0:
	adrp	x8, _PNG_LIBPNG_VER_STRING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PNG_LIBPNG_VER_STRING@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	w19, #0
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	bl	_png_create_read_struct
	mov	x8, #0
	stp	xzr, x0, [sp]
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	bl	_png_jmpbuf
	bl	_setjmp
	cbz	x0, LBB0_4
; %bb.2:
	mov	x2, #0
	add	x0, sp, #8
	mov	x1, sp
	bl	_png_destroy_read_struct
	mov	w0, #0
	b	LBB0_17
LBB0_3:
	mov	x0, x19
	b	LBB0_17
LBB0_4:
	mov	x0, x19
	mov	x1, x20
	bl	_png_init_io
	mov	x0, x19
	bl	_png_create_info_struct
	mov	x20, x0
	str	x0, [sp]
	cbnz	x0, LBB0_6
; %bb.5:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_png_error
LBB0_6:
Lloh5:
	adrp	x8, _PNG_HANDLE_CHUNK_ALWAYS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PNG_HANDLE_CHUNK_ALWAYS@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x2, #0
	mov	w3, #0
	mov	x0, x19
	bl	_png_set_keep_unknown_chunks
	mov	x0, x19
	mov	x1, x20
	bl	_png_read_info
	mov	x0, x19
	mov	x1, x20
	bl	_png_get_rowbytes
	mov	x21, x0
	bl	_malloc
	mov	x22, x0
	mov	x0, x21
	bl	_malloc
	mov	x21, x0
	cmp	x22, #0
	ccmp	x0, #0, #4, ne
	b.ne	LBB0_8
; %bb.7:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_png_error
LBB0_8:
	mov	x0, x19
	mov	x1, x20
	bl	_png_get_image_height
	mov	x23, x0
	mov	x0, x19
	mov	x1, x20
	bl	_png_get_interlace_type
Lloh10:
	adrp	x8, _PNG_INTERLACE_ADAM7@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PNG_INTERLACE_ADAM7@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
Lloh13:
	adrp	x25, _PNG_INTERLACE_ADAM7_PASSES@GOTPAGE
Lloh14:
	ldr	x25, [x25, _PNG_INTERLACE_ADAM7_PASSES@GOTPAGEOFF]
	ldr	w9, [x25]
	cmp	x0, x8
	csinc	w26, w9, wzr, eq
	mov	x0, x19
	bl	_png_start_read_image
	cmp	w26, #1
	b.lt	LBB0_16
; %bb.9:
	mov	w24, #0
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	w8, w24, #1
	mov	x24, x8
	cmp	w8, w26
	b.eq	LBB0_16
LBB0_11:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
	ldr	w9, [x25]
	mov	x8, x23
	cmp	w26, w9
	b.ne	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x23
	mov	x1, x24
	bl	_PNG_PASS_ROWS
	mov	x8, x0
LBB0_13:                                ;   in Loop: Header=BB0_11 Depth=1
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=1
	add	w8, w8, #1
LBB0_15:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x27, x8
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_png_read_row
	sub	w9, w27, #1
	mov	x8, x9
	cmp	w9, #1
	b.hi	LBB0_15
	b	LBB0_10
LBB0_16:
	mov	x0, x19
	mov	x1, x20
	bl	_png_read_end
	mov	x2, #0
	add	x0, sp, #8
	mov	x1, sp
	bl	_png_destroy_read_struct
	mov	x0, x22
	bl	_free
	mov	x0, x21
	bl	_free
	mov	w0, #1
LBB0_17:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_PNG_LIBPNG_VER_STRING,4,2      ; @PNG_LIBPNG_VER_STRING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"OOM allocating info structure"

	.comm	_PNG_HANDLE_CHUNK_ALWAYS,4,2    ; @PNG_HANDLE_CHUNK_ALWAYS
l_.str.1:                               ; @.str.1
	.asciz	"OOM allocating row buffers"

	.comm	_PNG_INTERLACE_ADAM7,8,3        ; @PNG_INTERLACE_ADAM7
	.comm	_PNG_INTERLACE_ADAM7_PASSES,4,2 ; @PNG_INTERLACE_ADAM7_PASSES
	.no_dead_strip	_read_png
.subsections_via_symbols
