	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rpng_save_image_bgr24_string   ## -- Begin function rpng_save_image_bgr24_string
	.p2align	4, 0x90
_rpng_save_image_bgr24_string:          ## @rpng_save_image_bgr24_string
	.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
	movq	%r8, %r14
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r13d
	movl	%esi, %r12d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_DEFLATE_PADDING@GOTPCREL(%rip), %rax
	movl	%esi, %ecx
	imull	%edx, %ecx
	imull	(%rax), %ecx
	leal	(%rcx,%rcx,2), %ebx
	movq	_PNG_ROUGH_HEADER@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	leal	(,%rbx,4), %edi
	callq	_malloc
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_GOTO_END_ERROR
LBB0_2:
	movq	_RETRO_VFS_FILE_ACCESS_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%ebx, %ecx
	callq	_intfstream_open_writable_memory
	movq	%rax, %rbx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	movl	%r12d, %edx
	movl	%r13d, %ecx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	$3, %r9d
	callq	_rpng_save_image_stream
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_intfstream_get_ptr
	movl	%eax, (%r14)
	movq	%rbx, %rdi
	callq	_intfstream_rewind
	movl	(%r14), %edi
	shll	$2, %edi
	callq	_malloc
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_GOTO_END_ERROR
LBB0_4:
	movl	(%r14), %edx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_intfstream_read
	testq	%r15, %r15
	je	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	callq	_free
LBB0_6:
	testq	%rbx, %rbx
	je	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_free
LBB0_8:
	xorl	%eax, %eax
	testl	%r12d, %r12d
	cmovneq	%r13, %rax
	jne	LBB0_11
## %bb.9:
	testq	%r13, %r13
	je	LBB0_11
## %bb.10:
	movq	%r13, %rdi
	callq	_free
	xorl	%eax, %eax
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DEFLATE_PADDING,4,2            ## @DEFLATE_PADDING
	.comm	_PNG_ROUGH_HEADER,4,2           ## @PNG_ROUGH_HEADER
	.comm	_RETRO_VFS_FILE_ACCESS_WRITE,4,2 ## @RETRO_VFS_FILE_ACCESS_WRITE
	.comm	_RETRO_VFS_FILE_ACCESS_HINT_NONE,4,2 ## @RETRO_VFS_FILE_ACCESS_HINT_NONE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rpng_save_image_bgr24_string   ; -- Begin function rpng_save_image_bgr24_string
	.p2align	2
_rpng_save_image_bgr24_string:          ; @rpng_save_image_bgr24_string
	.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
	mov	x19, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x25, x0
	mul	w8, w1, w2
Lloh0:
	adrp	x9, _DEFLATE_PADDING@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DEFLATE_PADDING@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	mul	w8, w8, w9
	add	w8, w8, w8, lsl #1
Lloh3:
	adrp	x9, _PNG_ROUGH_HEADER@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PNG_ROUGH_HEADER@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	add	w21, w8, w9
	lsl	w0, w21, #2
	bl	_malloc
	mov	x20, x0
	cbnz	x0, LBB0_2
; %bb.1:
	bl	_GOTO_END_ERROR
LBB0_2:
Lloh6:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_WRITE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_WRITE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x3, x21
	bl	_intfstream_open_writable_memory
	mov	x21, x0
	mov	x0, x25
	mov	x1, x21
	mov	x2, x24
	mov	x3, x23
	mov	x4, x22
	mov	w5, #3
	bl	_rpng_save_image_stream
	mov	x22, x0
	mov	x0, x21
	bl	_intfstream_get_ptr
	str	w0, [x19]
	mov	x0, x21
	bl	_intfstream_rewind
	ldr	w8, [x19]
	lsl	w0, w8, #2
	bl	_malloc
	mov	x23, x0
	cbnz	x0, LBB0_4
; %bb.3:
	bl	_GOTO_END_ERROR
LBB0_4:
	ldr	w2, [x19]
	mov	x0, x21
	mov	x1, x23
	bl	_intfstream_read
	cbz	x20, LBB0_6
; %bb.5:
	mov	x0, x20
	bl	_free
LBB0_6:
	cbz	x21, LBB0_8
; %bb.7:
	mov	x0, x21
	bl	_free
LBB0_8:
	cmp	w22, #0
	csel	x0, x23, xzr, ne
	ccmp	x23, #0, #4, eq
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x23
	bl	_free
	mov	x0, #0
LBB0_10:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_DEFLATE_PADDING,4,2            ; @DEFLATE_PADDING
	.comm	_PNG_ROUGH_HEADER,4,2           ; @PNG_ROUGH_HEADER
	.comm	_RETRO_VFS_FILE_ACCESS_WRITE,4,2 ; @RETRO_VFS_FILE_ACCESS_WRITE
	.comm	_RETRO_VFS_FILE_ACCESS_HINT_NONE,4,2 ; @RETRO_VFS_FILE_ACCESS_HINT_NONE
.subsections_via_symbols
