	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function omapfb_backup_state
_omapfb_backup_state:                   ## @omapfb_backup_state
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	xorl	%edi, %edi
	cmpq	$0, (%rbx)
	sete	%dil
	callq	_retro_assert
	movl	$1, %edi
	movl	$4, %esi
	callq	_calloc
	movq	%rax, (%rbx)
	movl	$-1, %r14d
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movl	8(%rbx), %edi
	movq	_OMAPFB_QUERY_PLANE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	addq	$20, %rax
	movq	%rax, %rdx
	callq	_ioctl
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_ERR
	jmp	LBB0_11
LBB0_3:
	movl	8(%rbx), %edi
	movq	_OMAPFB_QUERY_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%rbx), %rdx
	callq	_ioctl
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	callq	_RARCH_ERR
	jmp	LBB0_11
LBB0_5:
	movl	8(%rbx), %edi
	movq	_FBIOGET_VSCREENINFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%rbx), %rdx
	addq	$16, %rdx
	callq	_ioctl
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
	callq	_RARCH_ERR
	jmp	LBB0_11
LBB0_7:
	movq	(%rbx), %rax
	movl	(%rax), %edi
	callq	_malloc
	movq	(%rbx), %rcx
	movq	%rax, 8(%rcx)
	movq	_PROT_WRITE@GOTPCREL(%rip), %rax
	movq	_PROT_READ@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rax), %edx
	movl	(%rcx), %esi
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	8(%rbx), %r8d
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	callq	_mmap
	movq	%rax, %r15
	movq	(%rbx), %rax
	movq	8(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.8:
	movq	_MAP_FAILED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r15
	je	LBB0_9
## %bb.10:
	movl	(%rax), %edx
	movq	%r15, %rsi
	callq	_memcpy
	movq	(%rbx), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_munmap
	xorl	%r14d, %r14d
	jmp	LBB0_11
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
	callq	_RARCH_ERR
	movq	(%rbx), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_munmap
LBB0_11:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OMAPFB_QUERY_PLANE,4,2         ## @OMAPFB_QUERY_PLANE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[video_omap]: backup layer (plane) failed\n"

	.comm	_OMAPFB_QUERY_MEM,4,2           ## @OMAPFB_QUERY_MEM
L_.str.1:                               ## @.str.1
	.asciz	"[video_omap]: backup layer (mem) failed\n"

	.comm	_FBIOGET_VSCREENINFO,4,2        ## @FBIOGET_VSCREENINFO
L_.str.2:                               ## @.str.2
	.asciz	"[video_omap]: backup layer (screeninfo) failed\n"

	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
L_.str.3:                               ## @.str.3
	.asciz	"[video_omap]: backup layer (mem backup) failed\n"

	.no_dead_strip	_omapfb_backup_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function omapfb_backup_state
_omapfb_backup_state:                   ; @omapfb_backup_state
	.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, x0
	ldr	x8, [x0]
	cmp	x8, #0
	cset	w0, eq
	bl	_retro_assert
	mov	w0, #1
	mov	w1, #4
	bl	_calloc
	str	x0, [x19]
	cbz	x0, LBB0_8
; %bb.1:
	ldr	w8, [x19, #8]
Lloh0:
	adrp	x9, _OMAPFB_QUERY_PLANE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _OMAPFB_QUERY_PLANE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	add	x2, x0, #20
	mov	x0, x8
	bl	_ioctl
	cbz	x0, LBB0_3
; %bb.2:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_3:
	ldr	w0, [x19, #8]
Lloh5:
	adrp	x8, _OMAPFB_QUERY_MEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _OMAPFB_QUERY_MEM@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	ldr	x2, [x19]
	bl	_ioctl
	cbz	x0, LBB0_5
; %bb.4:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_5:
	ldr	w0, [x19, #8]
Lloh10:
	adrp	x8, _FBIOGET_VSCREENINFO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _FBIOGET_VSCREENINFO@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	ldr	x8, [x19]
	add	x2, x8, #16
	bl	_ioctl
	cbz	x0, LBB0_10
; %bb.6:
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_7:
	bl	_RARCH_ERR
LBB0_8:
	mov	w0, #-1
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_10:
	ldr	x8, [x19]
	ldr	w0, [x8]
	bl	_malloc
	ldr	x8, [x19]
	str	x0, [x8, #8]
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _PROT_WRITE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PROT_WRITE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _PROT_READ@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PROT_READ@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh21:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
Lloh23:
	ldr	w3, [x8]
	ldr	w4, [x19, #8]
	mov	x0, #0
	mov	w5, #0
	bl	_mmap
	mov	x20, x0
	ldr	x8, [x19]
	ldr	x0, [x8, #8]
	cbz	x0, LBB0_13
; %bb.11:
Lloh24:
	adrp	x9, _MAP_FAILED@GOTPAGE
Lloh25:
	ldr	x9, [x9, _MAP_FAILED@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x20, x9
	b.eq	LBB0_13
; %bb.12:
	ldr	w2, [x8]
	mov	x1, x20
	bl	_memcpy
	ldr	x8, [x19]
	ldr	w1, [x8]
	mov	x0, x20
	bl	_munmap
	mov	w0, #0
	b	LBB0_9
LBB0_13:
Lloh27:
	adrp	x0, l_.str.3@PAGE
Lloh28:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_RARCH_ERR
	ldr	x8, [x19]
	ldr	w1, [x8]
	mov	x0, x20
	bl	_munmap
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_OMAPFB_QUERY_PLANE,4,2         ; @OMAPFB_QUERY_PLANE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[video_omap]: backup layer (plane) failed\n"

	.comm	_OMAPFB_QUERY_MEM,4,2           ; @OMAPFB_QUERY_MEM
l_.str.1:                               ; @.str.1
	.asciz	"[video_omap]: backup layer (mem) failed\n"

	.comm	_FBIOGET_VSCREENINFO,4,2        ; @FBIOGET_VSCREENINFO
l_.str.2:                               ; @.str.2
	.asciz	"[video_omap]: backup layer (screeninfo) failed\n"

	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
l_.str.3:                               ; @.str.3
	.asciz	"[video_omap]: backup layer (mem backup) failed\n"

	.no_dead_strip	_omapfb_backup_state
.subsections_via_symbols
