	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psp_video_flip                 ## -- Begin function psp_video_flip
	.p2align	4, 0x90
_psp_video_flip:                        ## @psp_video_flip
	.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
	movl	%edi, %ebx
	testl	%edi, %edi
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_sceDisplayWaitVblankStart
LBB0_2:
	movq	_psp_screen@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_PSP_DISPLAY_PIXEL_FORMAT_565@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testl	%ebx, %ebx
	jne	LBB0_3
## %bb.4:
	movq	_PSP_DISPLAY_SETBUF_NEXTFRAME@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_PSP_DISPLAY_SETBUF_IMMEDIATE@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %ecx
	movl	$512, %esi                      ## imm = 0x200
	callq	_sceDisplaySetFrameBuf
	movq	_current_screen@GOTPCREL(%rip), %rax
	xorl	$1, (%rax)
	jne	LBB0_6
## %bb.7:
	movq	_VRAM_FB1@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	_VRAM_FB0@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %eax
	movl	%eax, (%r14)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_psp_screen,4,2                 ## @psp_screen
	.comm	_PSP_DISPLAY_PIXEL_FORMAT_565,4,2 ## @PSP_DISPLAY_PIXEL_FORMAT_565
	.comm	_PSP_DISPLAY_SETBUF_IMMEDIATE,4,2 ## @PSP_DISPLAY_SETBUF_IMMEDIATE
	.comm	_PSP_DISPLAY_SETBUF_NEXTFRAME,4,2 ## @PSP_DISPLAY_SETBUF_NEXTFRAME
	.comm	_current_screen,4,2             ## @current_screen
	.comm	_VRAM_FB0,4,2                   ## @VRAM_FB0
	.comm	_VRAM_FB1,4,2                   ## @VRAM_FB1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psp_video_flip                 ; -- Begin function psp_video_flip
	.p2align	2
_psp_video_flip:                        ; @psp_video_flip
	.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
	cbz	w0, LBB0_2
; %bb.1:
	bl	_sceDisplayWaitVblankStart
LBB0_2:
Lloh0:
	adrp	x20, _psp_screen@GOTPAGE
Lloh1:
	ldr	x20, [x20, _psp_screen@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh2:
	adrp	x8, _PSP_DISPLAY_PIXEL_FORMAT_565@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PSP_DISPLAY_PIXEL_FORMAT_565@GOTPAGEOFF]
Lloh4:
	adrp	x9, _PSP_DISPLAY_SETBUF_IMMEDIATE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _PSP_DISPLAY_SETBUF_IMMEDIATE@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
Lloh7:
	adrp	x8, _PSP_DISPLAY_SETBUF_NEXTFRAME@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PSP_DISPLAY_SETBUF_NEXTFRAME@GOTPAGEOFF]
	cmp	w19, #0
	csel	x8, x8, x9, eq
	ldr	w3, [x8]
	mov	w1, #512
	bl	_sceDisplaySetFrameBuf
Lloh9:
	adrp	x8, _current_screen@GOTPAGE
Lloh10:
	ldr	x8, [x8, _current_screen@GOTPAGEOFF]
	ldr	w9, [x8]
	eor	w9, w9, #0x1
	str	w9, [x8]
Lloh11:
	adrp	x8, _VRAM_FB0@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VRAM_FB0@GOTPAGEOFF]
Lloh13:
	adrp	x10, _VRAM_FB1@GOTPAGE
Lloh14:
	ldr	x10, [x10, _VRAM_FB1@GOTPAGEOFF]
	cmp	w9, #0
	csel	x8, x10, x8, eq
	ldr	w8, [x8]
	str	w8, [x20]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_psp_screen,4,2                 ; @psp_screen
	.comm	_PSP_DISPLAY_PIXEL_FORMAT_565,4,2 ; @PSP_DISPLAY_PIXEL_FORMAT_565
	.comm	_PSP_DISPLAY_SETBUF_IMMEDIATE,4,2 ; @PSP_DISPLAY_SETBUF_IMMEDIATE
	.comm	_PSP_DISPLAY_SETBUF_NEXTFRAME,4,2 ; @PSP_DISPLAY_SETBUF_NEXTFRAME
	.comm	_current_screen,4,2             ; @current_screen
	.comm	_VRAM_FB0,4,2                   ; @VRAM_FB0
	.comm	_VRAM_FB1,4,2                   ; @VRAM_FB1
.subsections_via_symbols
