	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdl2_gfx_read_viewport
_sdl2_gfx_read_viewport:                ## @sdl2_gfx_read_viewport
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	testl	%edx, %edx
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_video_driver_cached_frame
LBB0_2:
	movl	(%rbx), %edi
	callq	_SDL_GetWindowSurface
	movq	_SDL_PIXELFORMAT_BGR24@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	xorl	%ebx, %ebx
	movq	%rax, %rdi
	xorl	%edx, %edx
	callq	_SDL_ConvertSurfaceFormat
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	4(%rax), %edx
	movl	8(%rax), %esi
	imull	(%rax), %edx
	movq	%r14, %rdi
	callq	_memcpy
	movl	$1, %ebx
	jmp	LBB0_5
LBB0_3:
	xorl	%eax, %eax
	callq	_SDL_GetError
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_RARCH_WARN
LBB0_5:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDL_PIXELFORMAT_BGR24,4,2      ## @SDL_PIXELFORMAT_BGR24
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to convert viewport data to BGR24: %s"

	.no_dead_strip	_sdl2_gfx_read_viewport
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdl2_gfx_read_viewport
_sdl2_gfx_read_viewport:                ; @sdl2_gfx_read_viewport
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
	cbnz	w2, LBB0_2
; %bb.1:
	bl	_video_driver_cached_frame
LBB0_2:
	ldr	w0, [x20]
	bl	_SDL_GetWindowSurface
Lloh0:
	adrp	x8, _SDL_PIXELFORMAT_BGR24@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SDL_PIXELFORMAT_BGR24@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_SDL_ConvertSurfaceFormat
	cbz	x0, LBB0_4
; %bb.3:
	ldp	w9, w1, [x0, #4]
	ldr	w8, [x0]
	mul	w2, w9, w8
	mov	x0, x19
	bl	_memcpy
	mov	w0, #1
	b	LBB0_5
LBB0_4:
	bl	_SDL_GetError
	mov	x1, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_WARN
	mov	w0, #0
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_SDL_PIXELFORMAT_BGR24,4,2      ; @SDL_PIXELFORMAT_BGR24
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to convert viewport data to BGR24: %s"

	.no_dead_strip	_sdl2_gfx_read_viewport
.subsections_via_symbols
