	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rbmp_save_image                ## -- Begin function rbmp_save_image
	.p2align	4, 0x90
_rbmp_save_image:                       ## @rbmp_save_image
	.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	%r9d, %ebx
	movl	%r8d, %r13d
	movl	%ecx, %r12d
	movl	%edx, %r15d
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	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
	callq	_filestream_open
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	movq	_RBMP_SOURCE_TYPE_ARGB8888@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	cmpl	%ebx, (%rax)
	sete	%cl
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
	callq	_write_header_bmp
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r15d, %edx
	movl	%r12d, %ecx
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	callq	_dump_content
LBB0_4:
	movq	%r14, %rdi
	callq	_filestream_close
	jmp	LBB0_5
LBB0_1:
	xorl	%r13d, %r13d
LBB0_5:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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
	.comm	_RBMP_SOURCE_TYPE_ARGB8888,4,2  ## @RBMP_SOURCE_TYPE_ARGB8888
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rbmp_save_image                ; -- Begin function rbmp_save_image
	.p2align	2
_rbmp_save_image:                       ; @rbmp_save_image
	.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, x5
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
Lloh0:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_filestream_open
	cbz	x0, LBB0_4
; %bb.1:
	mov	x24, x0
Lloh6:
	adrp	x8, _RBMP_SOURCE_TYPE_ARGB8888@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RBMP_SOURCE_TYPE_ARGB8888@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w19
	cset	w3, eq
	mov	x1, x22
	mov	x2, x21
	bl	_write_header_bmp
	mov	x25, x0
	cbz	w0, LBB0_3
; %bb.2:
	mov	x0, x24
	mov	x1, x23
	mov	x2, x22
	mov	x3, x21
	mov	x4, x20
	mov	x5, x19
	bl	_dump_content
LBB0_3:
	mov	x0, x24
	bl	_filestream_close
	b	LBB0_5
LBB0_4:
	mov	w25, #0
LBB0_5:
	mov	x0, x25
	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	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.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
	.comm	_RBMP_SOURCE_TYPE_ARGB8888,4,2  ; @RBMP_SOURCE_TYPE_ARGB8888
.subsections_via_symbols
