	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function plat_video_flip
LCPI0_0:
	.long	16252928                        ## 0xf80000
	.long	16252928                        ## 0xf80000
	.long	16252928                        ## 0xf80000
	.long	16252928                        ## 0xf80000
LCPI0_1:
	.long	64512                           ## 0xfc00
	.long	64512                           ## 0xfc00
	.long	64512                           ## 0xfc00
	.long	64512                           ## 0xfc00
LCPI0_2:
	.long	248                             ## 0xf8
	.long	248                             ## 0xf8
	.long	248                             ## 0xf8
	.long	248                             ## 0xf8
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_plat_video_flip
	.p2align	4, 0x90
_plat_video_flip:                       ## @plat_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_ximage@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_18
## %bb.1:
	movq	_g_screen_width@GOTPCREL(%rip), %rcx
	movq	_g_screen_height@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	imull	(%rcx), %esi
	movq	(%rax), %rax
	movq	_current_bpp@GOTPCREL(%rip), %rcx
	cmpl	$8, (%rcx)
	jne	LBB0_10
## %bb.2:
	testl	%esi, %esi
	jle	LBB0_17
## %bb.3:
	movq	_g_screen_ptr@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_current_pal@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%esi, %edi
	leaq	-1(%rdi), %rbx
	movl	%edi, %r8d
	andl	$3, %r8d
	cmpq	$3, %rbx
	jae	LBB0_5
## %bb.4:
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_10:
	testl	%esi, %esi
	jle	LBB0_17
## %bb.11:
	movq	_g_screen_ptr@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%esi, %r8d
	cmpl	$8, %esi
	jae	LBB0_13
## %bb.12:
	xorl	%esi, %esi
	jmp	LBB0_16
LBB0_5:
	andl	$-4, %edi
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	(%rcx,%rbx), %esi
	movl	(%rdx,%rsi,4), %esi
	movl	%esi, (%rax,%rbx,4)
	movzbl	1(%rcx,%rbx), %esi
	movl	(%rdx,%rsi,4), %esi
	movl	%esi, 4(%rax,%rbx,4)
	movzbl	2(%rcx,%rbx), %esi
	movl	(%rdx,%rsi,4), %esi
	movl	%esi, 8(%rax,%rbx,4)
	movzbl	3(%rcx,%rbx), %esi
	movl	(%rdx,%rsi,4), %esi
	movl	%esi, 12(%rax,%rbx,4)
	addq	$4, %rbx
	cmpq	%rbx, %rdi
	jne	LBB0_6
LBB0_7:
	testq	%r8, %r8
	je	LBB0_17
## %bb.8:
	leaq	(%rax,%rbx,4), %rax
	addq	%rbx, %rcx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	(%rcx,%rdi), %esi
	movl	(%rdx,%rsi,4), %esi
	movl	%esi, (%rax,%rdi,4)
	incq	%rdi
	cmpq	%rdi, %r8
	jne	LBB0_9
	jmp	LBB0_17
LBB0_13:
	movl	%r8d, %esi
	andl	$-8, %esi
	xorl	%edi, %edi
	movdqa	LCPI0_0(%rip), %xmm8            ## xmm8 = [16252928,16252928,16252928,16252928]
	movdqa	LCPI0_1(%rip), %xmm1            ## xmm1 = [64512,64512,64512,64512]
	movdqa	LCPI0_2(%rip), %xmm2            ## xmm2 = [248,248,248,248]
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	pmovzxwd	(%rcx,%rdi,2), %xmm3            ## xmm3 = mem[0],zero,mem[1],zero,mem[2],zero,mem[3],zero
	pmovzxwd	8(%rcx,%rdi,2), %xmm6           ## xmm6 = mem[0],zero,mem[1],zero,mem[2],zero,mem[3],zero
	movdqa	%xmm3, %xmm5
	pslld	$8, %xmm5
	movdqa	%xmm6, %xmm0
	pslld	$8, %xmm0
	pand	%xmm8, %xmm5
	pand	%xmm8, %xmm0
	movdqa	%xmm3, %xmm7
	pslld	$5, %xmm7
	movdqa	%xmm6, %xmm4
	pslld	$5, %xmm4
	pand	%xmm1, %xmm7
	por	%xmm5, %xmm7
	pand	%xmm1, %xmm4
	por	%xmm0, %xmm4
	pslld	$3, %xmm3
	pslld	$3, %xmm6
	pand	%xmm2, %xmm3
	por	%xmm7, %xmm3
	pand	%xmm2, %xmm6
	por	%xmm4, %xmm6
	movdqu	%xmm3, (%rax,%rdi,4)
	movdqu	%xmm6, 16(%rax,%rdi,4)
	addq	$8, %rdi
	cmpq	%rdi, %rsi
	jne	LBB0_14
## %bb.15:
	cmpq	%r8, %rsi
	je	LBB0_17
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movzwl	(%rcx,%rsi,2), %edx
	movl	%edx, %ebx
	shll	$8, %ebx
	andl	$16252928, %ebx                 ## imm = 0xF80000
	movl	%edx, %edi
	shll	$5, %edi
	andl	$64512, %edi                    ## imm = 0xFC00
	orl	%ebx, %edi
	andl	$31, %edx
	leal	(%rdi,%rdx,8), %edx
	movl	%edx, (%rax,%rsi,4)
	incq	%rsi
	cmpq	%rsi, %r8
	jne	LBB0_16
LBB0_17:
	xorl	%eax, %eax
	callq	_xlib_update
	movq	_scr_changed@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_18
## %bb.19:
	xorl	%eax, %eax
	callq	_realloc_screen
	movq	_xlib_display@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_DefaultVisual
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ximage_realloc
	xorl	%edi, %edi
	xorl	%esi, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_plat_video_toggle_renderer     ## TAILCALL
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ximage,8,3                     ## @ximage
	.comm	_g_screen_width,4,2             ## @g_screen_width
	.comm	_g_screen_height,4,2            ## @g_screen_height
	.comm	_current_bpp,4,2                ## @current_bpp
	.comm	_g_screen_ptr,8,3               ## @g_screen_ptr
	.comm	_current_pal,8,3                ## @current_pal
	.comm	_scr_changed,8,3                ## @scr_changed
	.comm	_xlib_display,4,2               ## @xlib_display
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_plat_video_flip                ; -- Begin function plat_video_flip
	.p2align	2
_plat_video_flip:                       ; @plat_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
Lloh0:
	adrp	x8, _ximage@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ximage@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x8]
	cbz	x9, LBB0_15
; %bb.1:
Lloh3:
	adrp	x8, _g_screen_width@GOTPAGE
Lloh4:
	ldr	x8, [x8, _g_screen_width@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x10, _g_screen_height@GOTPAGE
Lloh7:
	ldr	x10, [x10, _g_screen_height@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	mul	w8, w10, w8
	ldr	x9, [x9]
Lloh9:
	adrp	x10, _current_bpp@GOTPAGE
Lloh10:
	ldr	x10, [x10, _current_bpp@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	cmp	w10, #8
	b.ne	LBB0_5
; %bb.2:
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.3:
Lloh12:
	adrp	x10, _g_screen_ptr@GOTPAGE
Lloh13:
	ldr	x10, [x10, _g_screen_ptr@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x10]
Lloh15:
	adrp	x11, _current_pal@GOTPAGE
Lloh16:
	ldr	x11, [x11, _current_pal@GOTPAGEOFF]
Lloh17:
	ldr	x11, [x11]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w12, [x10], #1
	ldr	w12, [x11, x12, lsl #2]
	str	w12, [x9], #4
	subs	x8, x8, #1
	b.ne	LBB0_4
	b	LBB0_13
LBB0_5:
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.6:
Lloh18:
	adrp	x10, _g_screen_ptr@GOTPAGE
Lloh19:
	ldr	x10, [x10, _g_screen_ptr@GOTPAGEOFF]
Lloh20:
	ldr	x10, [x10]
	cmp	w8, #16
	b.hs	LBB0_8
; %bb.7:
	mov	x11, #0
	b	LBB0_11
LBB0_8:
	and	x11, x8, #0xfffffff0
	add	x12, x9, #32
	add	x13, x10, #16
	movi.4s	v0, #248, lsl #16
	movi.4s	v1, #252, lsl #8
	movi.4s	v2, #248
	mov	x14, x11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldp	d3, d4, [x13, #-16]
	ushll.4s	v5, v3, #8
	ushll.4s	v6, v4, #8
	ldp	d7, d16, [x13], #32
	ushll.4s	v17, v7, #8
	ushll.4s	v18, v16, #8
	and.16b	v5, v5, v0
	and.16b	v6, v6, v0
	and.16b	v17, v17, v0
	and.16b	v18, v18, v0
	ushll.4s	v19, v3, #5
	ushll.4s	v20, v4, #5
	ushll.4s	v21, v7, #5
	ushll.4s	v22, v16, #5
	and.16b	v19, v19, v1
	and.16b	v20, v20, v1
	and.16b	v21, v21, v1
	and.16b	v22, v22, v1
	orr.16b	v5, v5, v19
	orr.16b	v6, v6, v20
	orr.16b	v17, v17, v21
	orr.16b	v18, v18, v22
	ushll.4s	v3, v3, #3
	ushll.4s	v4, v4, #3
	ushll.4s	v7, v7, #3
	ushll.4s	v16, v16, #3
	and.16b	v3, v3, v2
	and.16b	v4, v4, v2
	and.16b	v7, v7, v2
	and.16b	v16, v16, v2
	orr.16b	v3, v5, v3
	orr.16b	v4, v6, v4
	orr.16b	v5, v17, v7
	stp	q3, q4, [x12, #-32]
	orr.16b	v3, v18, v16
	stp	q5, q3, [x12], #64
	subs	x14, x14, #16
	b.ne	LBB0_9
; %bb.10:
	cmp	x11, x8
	b.eq	LBB0_13
LBB0_11:
	add	x9, x9, x11, lsl #2
	sub	x8, x8, x11
	add	x10, x10, x11, lsl #1
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldrh	w11, [x10], #2
	lsr	w12, w11, #11
	lsl	w13, w11, #5
	and	w13, w13, #0xfc00
	bfi	w13, w12, #19, #5
	bfi	w13, w11, #3, #5
	str	w13, [x9], #4
	subs	x8, x8, #1
	b.ne	LBB0_12
LBB0_13:
	bl	_xlib_update
Lloh21:
	adrp	x8, _scr_changed@GOTPAGE
Lloh22:
	ldr	x8, [x8, _scr_changed@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cbz	x8, LBB0_15
; %bb.14:
	bl	_realloc_screen
Lloh24:
	adrp	x8, _xlib_display@GOTPAGE
Lloh25:
	ldr	x8, [x8, _xlib_display@GOTPAGEOFF]
Lloh26:
	ldr	w19, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_DefaultVisual
	mov	x1, x0
	mov	x0, x19
	bl	_ximage_realloc
	mov	w0, #0
	mov	w1, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_plat_video_toggle_renderer
LBB0_15:
	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 AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_ximage,8,3                     ; @ximage
	.comm	_g_screen_width,4,2             ; @g_screen_width
	.comm	_g_screen_height,4,2            ; @g_screen_height
	.comm	_current_bpp,4,2                ; @current_bpp
	.comm	_g_screen_ptr,8,3               ; @g_screen_ptr
	.comm	_current_pal,8,3                ; @current_pal
	.comm	_scr_changed,8,3                ; @scr_changed
	.comm	_xlib_display,4,2               ; @xlib_display
.subsections_via_symbols
