	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_file
_read_file:                             ## @read_file
	.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	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %rbx
	leaq	32(%rdi), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	_PNG_IMAGE_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 60(%rbx)
	movq	88(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_10
## %bb.1:
	movl	80(%rbx), %edx
	movq	%r15, %rdi
	callq	_png_image_begin_read_from_memory
	testl	%eax, %eax
	je	LBB0_11
## %bb.2:
	movl	8(%rbx), %eax
	movq	_sRGB_16BIT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	_PNG_IMAGE_FLAG_16BIT_sRGB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 56(%rbx)
LBB0_4:
	movq	(%r15), %r13
	movq	_VERBOSE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_14
## %bb.5:
	movq	(%rbx), %rsi
	movq	40(%rbx), %rcx
	movq	48(%rbx), %rdx
	movq	_format_names@GOTPCREL(%rip), %rax
	movq	(%rax), %r10
	movq	_FORMAT_MASK@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rax
	movq	%rax, %rdi
	andq	%r13, %rdi
	movq	(%r10,%rdi,8), %r8
	movq	_FORMAT_NO_CHANGE@GOTPCREL(%rip), %rdi
	leaq	L_.str.4(%rip), %r9
	testq	%r12, (%rdi)
	jne	LBB0_8
## %bb.6:
	cmpq	%r12, %r13
	je	LBB0_8
## %bb.7:
	andq	%r12, %rax
	movq	(%r10,%rax,8), %r9
LBB0_8:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	testq	%r14, %r14
	je	LBB0_12
## %bb.9:
	movl	(%r14), %esi
	movl	4(%r14), %edx
	movl	8(%r14), %ecx
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_13
LBB0_10:
	movq	(%rbx), %rdx
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_23
LBB0_11:
	movq	(%rbx), %rdx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_23
LBB0_12:
	movl	$10, %edi
	callq	_putchar
LBB0_13:
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_fflush
LBB0_14:
	movq	_FORMAT_NO_CHANGE@GOTPCREL(%rip), %rax
	testq	%r12, (%rax)
	je	LBB0_20
## %bb.15:
	movq	_PNG_FORMAT_FLAG_COLORMAP@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%r12, %rax
	je	LBB0_19
## %bb.16:
	andq	%r13, %rax
	je	LBB0_19
## %bb.17:
	movq	_BASE_FORMATS@GOTPCREL(%rip), %rax
	xorq	%r13, %r12
	andq	(%rax), %r12
	xorq	%r13, %r12
	jmp	LBB0_20
LBB0_19:
	movq	%r13, %r12
LBB0_20:
	movq	%r12, 32(%rbx)
	movups	(%r15), %xmm0
	movups	16(%r15), %xmm1
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	callq	_PNG_IMAGE_ROW_STRIDE
	addq	64(%rbx), %rax
	movq	%rax, 16(%rbx)
	movq	%rbx, %rdi
	callq	_allocbuffer
	movq	24(%rbx), %rdx
	addq	$16, %rdx
	movl	12(%rbx), %r8d
	movl	16(%rbx), %ecx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_png_image_finish_read
	movl	%eax, %r14d
	movq	(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_checkbuffer
	testl	%r14d, %r14d
	je	LBB0_22
## %bb.21:
	movq	%rbx, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_checkopaque                    ## TAILCALL
LBB0_22:
	movq	(%rbx), %rsi
	leaq	L_.str.7(%rip), %rdx
LBB0_23:
	leaq	L_.str.1(%rip), %rcx
	movq	%rbx, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_logerror                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PNG_IMAGE_VERSION,4,2          ## @PNG_IMAGE_VERSION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"memory init: "

L_.str.1:                               ## @.str.1
	.space	1

L_.str.2:                               ## @.str.2
	.asciz	"unsupported file/stdio init: "

	.comm	_sRGB_16BIT,4,2                 ## @sRGB_16BIT
	.comm	_PNG_IMAGE_FLAG_16BIT_sRGB,4,2  ## @PNG_IMAGE_FLAG_16BIT_sRGB
	.comm	_VERBOSE,4,2                    ## @VERBOSE
L_.str.3:                               ## @.str.3
	.asciz	"%s %lu x %lu %s -> %s"

	.comm	_format_names,8,3               ## @format_names
	.comm	_FORMAT_MASK,8,3                ## @FORMAT_MASK
	.comm	_FORMAT_NO_CHANGE,8,3           ## @FORMAT_NO_CHANGE
L_.str.4:                               ## @.str.4
	.asciz	"no change"

L_.str.5:                               ## @.str.5
	.asciz	" background(%d,%d,%d)\n"

	.comm	_stdout,4,2                     ## @stdout
	.comm	_PNG_FORMAT_FLAG_COLORMAP,8,3   ## @PNG_FORMAT_FLAG_COLORMAP
	.comm	_BASE_FORMATS,8,3               ## @BASE_FORMATS
L_.str.7:                               ## @.str.7
	.asciz	": image read failed"

	.no_dead_strip	_read_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_file
_read_file:                             ; @read_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	add	x21, x0, #32
	mov	x0, x21
	mov	w1, #0
	mov	w2, #32
	bl	_memset
Lloh0:
	adrp	x8, _PNG_IMAGE_VERSION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PNG_IMAGE_VERSION@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #60]
	ldr	x1, [x19, #88]
	cbz	x1, LBB0_10
; %bb.1:
	ldr	w2, [x19, #80]
	mov	x0, x21
	bl	_png_image_begin_read_from_memory
	cbz	w0, LBB0_11
; %bb.2:
	ldr	w8, [x19, #8]
Lloh3:
	adrp	x9, _sRGB_16BIT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _sRGB_16BIT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh6:
	adrp	x9, _PNG_IMAGE_FLAG_16BIT_sRGB@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PNG_IMAGE_FLAG_16BIT_sRGB@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	ldr	w10, [x19, #56]
	orr	w9, w10, w9
	str	w9, [x19, #56]
LBB0_4:
	ldr	x23, [x21]
Lloh9:
	adrp	x9, _VERBOSE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _VERBOSE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x24, _FORMAT_NO_CHANGE@GOTPAGE
Lloh13:
	ldr	x24, [x24, _FORMAT_NO_CHANGE@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.5:
	ldr	x8, [x19]
Lloh14:
	adrp	x11, _format_names@GOTPAGE
Lloh15:
	ldr	x11, [x11, _format_names@GOTPAGEOFF]
	ldp	x10, x9, [x19, #40]
Lloh16:
	ldr	x12, [x11]
Lloh17:
	adrp	x11, _FORMAT_MASK@GOTPAGE
Lloh18:
	ldr	x11, [x11, _FORMAT_MASK@GOTPAGEOFF]
Lloh19:
	ldr	x14, [x11]
	and	x11, x14, x23
	ldr	x11, [x12, x11, lsl #3]
	ldr	x15, [x24]
Lloh20:
	adrp	x13, l_.str.4@PAGE
Lloh21:
	add	x13, x13, l_.str.4@PAGEOFF
	tst	x15, x22
	b.ne	LBB0_8
; %bb.6:
	cmp	x23, x22
	b.eq	LBB0_8
; %bb.7:
	and	x13, x14, x22
	ldr	x13, [x12, x13, lsl #3]
LBB0_8:
	stp	x11, x13, [sp, #24]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh22:
	adrp	x0, l_.str.3@PAGE
Lloh23:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printf
	cbz	x20, LBB0_13
; %bb.9:
	ldp	w8, w9, [x20]
	ldr	w10, [x20, #8]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh24:
	adrp	x0, l_.str.5@PAGE
Lloh25:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_printf
	b	LBB0_14
LBB0_10:
	ldr	x2, [x19]
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_12
LBB0_11:
	ldr	x2, [x19]
Lloh28:
	adrp	x1, l_.str@PAGE
Lloh29:
	add	x1, x1, l_.str@PAGEOFF
LBB0_12:
Lloh30:
	adrp	x3, l_.str.1@PAGE
Lloh31:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x19
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_logerror
LBB0_13:
	mov	w0, #10
	bl	_putchar
LBB0_14:
Lloh32:
	adrp	x8, _stdout@GOTPAGE
Lloh33:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	bl	_fflush
LBB0_15:
	ldr	x8, [x24]
	tst	x8, x22
	b.eq	LBB0_18
; %bb.16:
Lloh35:
	adrp	x8, _PNG_FORMAT_FLAG_COLORMAP@GOTPAGE
Lloh36:
	ldr	x8, [x8, _PNG_FORMAT_FLAG_COLORMAP@GOTPAGEOFF]
Lloh37:
	ldr	x8, [x8]
	and	x9, x8, x22
	and	x8, x8, x23
	cmp	x9, #0
	ccmp	x8, #0, #4, ne
	b.eq	LBB0_19
; %bb.17:
Lloh38:
	adrp	x8, _BASE_FORMATS@GOTPAGE
Lloh39:
	ldr	x8, [x8, _BASE_FORMATS@GOTPAGEOFF]
Lloh40:
	ldr	x8, [x8]
	bic	x9, x23, x8
	and	x8, x8, x22
	orr	x23, x9, x8
	b	LBB0_19
LBB0_18:
	mov	x23, x22
LBB0_19:
	str	x23, [x19, #32]
	ldp	q0, q1, [x21]
	stp	q0, q1, [sp, #48]
	add	x0, sp, #48
	bl	_PNG_IMAGE_ROW_STRIDE
	ldr	x8, [x19, #64]
	add	x8, x8, x0
	str	x8, [x19, #16]
	mov	x0, x19
	bl	_allocbuffer
	ldr	x8, [x19, #24]
	add	x2, x8, #16
	ldp	w4, w3, [x19, #12]
	mov	x0, x21
	mov	x1, x20
	bl	_png_image_finish_read
	mov	x20, x0
	ldr	x1, [x19]
	mov	x0, x19
	bl	_checkbuffer
	cbz	w20, LBB0_21
; %bb.20:
	mov	x0, x19
	bl	_checkopaque
	b	LBB0_22
LBB0_21:
	ldr	x1, [x19]
Lloh41:
	adrp	x2, l_.str.7@PAGE
Lloh42:
	add	x2, x2, l_.str.7@PAGEOFF
Lloh43:
	adrp	x3, l_.str.1@PAGE
Lloh44:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_logerror
LBB0_22:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_PNG_IMAGE_VERSION,4,2          ; @PNG_IMAGE_VERSION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"memory init: "

l_.str.1:                               ; @.str.1
	.space	1

l_.str.2:                               ; @.str.2
	.asciz	"unsupported file/stdio init: "

	.comm	_sRGB_16BIT,4,2                 ; @sRGB_16BIT
	.comm	_PNG_IMAGE_FLAG_16BIT_sRGB,4,2  ; @PNG_IMAGE_FLAG_16BIT_sRGB
	.comm	_VERBOSE,4,2                    ; @VERBOSE
l_.str.3:                               ; @.str.3
	.asciz	"%s %lu x %lu %s -> %s"

	.comm	_format_names,8,3               ; @format_names
	.comm	_FORMAT_MASK,8,3                ; @FORMAT_MASK
	.comm	_FORMAT_NO_CHANGE,8,3           ; @FORMAT_NO_CHANGE
l_.str.4:                               ; @.str.4
	.asciz	"no change"

l_.str.5:                               ; @.str.5
	.asciz	" background(%d,%d,%d)\n"

	.comm	_stdout,4,2                     ; @stdout
	.comm	_PNG_FORMAT_FLAG_COLORMAP,8,3   ; @PNG_FORMAT_FLAG_COLORMAP
	.comm	_BASE_FORMATS,8,3               ; @BASE_FORMATS
l_.str.7:                               ; @.str.7
	.asciz	": image read failed"

	.no_dead_strip	_read_file
.subsections_via_symbols
