	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vita2d_swap_buffers            ## -- Begin function vita2d_swap_buffers
	.p2align	4, 0x90
_vita2d_swap_buffers:                   ## @vita2d_swap_buffers
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_displaySurface@GOTPCREL(%rip), %rax
	movq	_backBufferIndex@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	leaq	(,%rcx,4), %rdi
	addq	(%rax), %rdi
	movq	_displayBufferSync@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movl	(%rax,%rcx,4), %esi
	callq	_sceGxmPadHeartbeat
	movq	_displayBufferData@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r14), %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, -24(%rbp)
	movq	(%rbx), %rax
	movq	_frontBufferIndex@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	movl	(%rax,%rdx,4), %edi
	movl	(%rax,%rcx,4), %esi
	leaq	-24(%rbp), %rdx
	callq	_sceGxmDisplayQueueAddEntry
	movq	(%r14), %rax
	movq	%rax, (%rbx)
	incq	%rax
	movq	_DISPLAY_BUFFER_COUNT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_1
## %bb.2:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_3
LBB0_1:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
LBB0_3:
	movq	%rdx, (%r14)
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_displaySurface,8,3             ## @displaySurface
	.comm	_backBufferIndex,8,3            ## @backBufferIndex
	.comm	_displayBufferSync,8,3          ## @displayBufferSync
	.comm	_displayBufferData,8,3          ## @displayBufferData
	.comm	_frontBufferIndex,8,3           ## @frontBufferIndex
	.comm	_DISPLAY_BUFFER_COUNT,8,3       ## @DISPLAY_BUFFER_COUNT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vita2d_swap_buffers            ; -- Begin function vita2d_swap_buffers
	.p2align	2
_vita2d_swap_buffers:                   ; @vita2d_swap_buffers
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x8, _displaySurface@GOTPAGE
Lloh1:
	ldr	x8, [x8, _displaySurface@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x19, _backBufferIndex@GOTPAGE
Lloh4:
	ldr	x19, [x19, _backBufferIndex@GOTPAGEOFF]
	ldr	x9, [x19]
	lsl	x9, x9, #2
	add	x0, x8, x9
Lloh5:
	adrp	x20, _displayBufferSync@GOTPAGE
Lloh6:
	ldr	x20, [x20, _displayBufferSync@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	w1, [x8, x9]
	bl	_sceGxmPadHeartbeat
Lloh7:
	adrp	x8, _displayBufferData@GOTPAGE
Lloh8:
	ldr	x8, [x8, _displayBufferData@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	x9, [x19]
	lsl	x9, x9, #2
	ldr	w8, [x8, x9]
	str	w8, [sp, #8]
Lloh10:
	adrp	x21, _frontBufferIndex@GOTPAGE
Lloh11:
	ldr	x21, [x21, _frontBufferIndex@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x10, [x21]
	ldr	w0, [x8, x10, lsl #2]
	ldr	w1, [x8, x9]
	add	x2, sp, #8
	bl	_sceGxmDisplayQueueAddEntry
	ldr	x8, [x19]
	str	x8, [x21]
	add	x8, x8, #1
Lloh12:
	adrp	x9, _DISPLAY_BUFFER_COUNT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _DISPLAY_BUFFER_COUNT@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	udiv	x10, x8, x9
	msub	x8, x10, x9, x8
	str	x8, [x19]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_displaySurface,8,3             ; @displaySurface
	.comm	_backBufferIndex,8,3            ; @backBufferIndex
	.comm	_displayBufferSync,8,3          ; @displayBufferSync
	.comm	_displayBufferData,8,3          ; @displayBufferData
	.comm	_frontBufferIndex,8,3           ; @frontBufferIndex
	.comm	_DISPLAY_BUFFER_COUNT,8,3       ; @DISPLAY_BUFFER_COUNT
.subsections_via_symbols
