	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fpga_gfx_frame
_fpga_gfx_frame:                        ## @fpga_gfx_frame
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	testq	%rsi, %rsi
	je	LBB0_33
## %bb.1:
	testl	%edx, %edx
	je	LBB0_33
## %bb.2:
	testl	%ecx, %ecx
	je	LBB0_33
## %bb.3:
	movq	%rsi, %r12
	movq	_fpga_video_bits@GOTPCREL(%rip), %r8
	movq	_fpga_video_width@GOTPCREL(%rip), %rsi
	movl	(%rsi), %ebx
	movq	_fpga_video_height@GOTPCREL(%rip), %rdi
	movl	(%rdi), %eax
	movq	_fpga_video_pitch@GOTPCREL(%rip), %r10
	cmpl	%edx, %ebx
	jne	LBB0_6
## %bb.4:
	cmpl	%ecx, %eax
	jne	LBB0_6
## %bb.5:
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r14d
	cmpl	%r9d, (%r10)
	je	LBB0_10
LBB0_6:
	cmpl	$5, %edx
	jb	LBB0_7
## %bb.8:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %r14d
	cmpl	$5, %ecx
	jb	LBB0_10
## %bb.9:
	movl	%edx, (%rsi)
	movl	%ecx, (%rdi)
	movl	%r9d, (%r10)
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r14d
	jmp	LBB0_10
LBB0_7:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %r14d
LBB0_10:
	movl	(%r8), %r15d
	movq	_fpga_menu_frame@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	24(%rbp), %rsi
	movq	(%rsi), %rsi
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	testq	%rsi, %rsi
	je	LBB0_13
## %bb.12:
	movq	_fpga_menu_width@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	movq	_fpga_menu_height@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	_fpga_menu_bits@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	movb	$1, %bl
	movq	%rax, %r12
	jmp	LBB0_14
LBB0_13:
	testq	%rsi, %rsi
	sete	%bl
	testq	%rax, %rax
	setne	%al
	orb	%bl, %al
	xorl	$4, %edx
	xorl	$4, %ecx
	cmpl	$5, %r14d
	setb	%bl
	orl	%edx, %ecx
	setne	%cl
	orb	%bl, %cl
	cmpl	$5, -44(%rbp)                   ## 4-byte Folded Reload
	setb	%bl
	orb	%cl, %bl
	andb	%al, %bl
LBB0_14:
	leaq	-60(%rbp), %rdi
	callq	_video_context_driver_get_video_size
	testb	%bl, %bl
	je	LBB0_31
## %bb.15:
	cmpl	$16, %r15d
	jne	LBB0_31
## %bb.16:
	movq	_FB_HEIGHT@GOTPCREL(%rip), %r8
	movl	(%r8), %ebx
	cmpq	(%r13), %r12
	je	LBB0_21
## %bb.17:
	testl	%ebx, %ebx
	je	LBB0_31
## %bb.18:
	movq	_FB_WIDTH@GOTPCREL(%rip), %r9
	movl	(%r9), %ecx
	xorl	%r10d, %r10d
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_19 Depth=1
	xorl	%ecx, %ecx
LBB0_30:                                ##   in Loop: Header=BB0_19 Depth=1
	incl	%r10d
	cmpl	%ebx, %r10d
	jae	LBB0_31
LBB0_19:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_29 Depth 2
	testl	%ecx, %ecx
	je	LBB0_20
## %bb.28:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	%r10d, %r11d
	imull	-44(%rbp), %r11d                ## 4-byte Folded Reload
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r15
	xorl	%esi, %esi
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_29:                                ##   Parent Loop BB0_19 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %edi
	movl	%r11d, %eax
	xorl	%edx, %edx
	divl	%ebx
                                        ## kill: def $eax killed $eax def $rax
	imull	%r14d, %eax
	addl	%edi, %eax
	movzwl	(%r12,%rax,2), %eax
	movl	%eax, %edx
	shll	$8, %edx
	andl	$16252928, %edx                 ## imm = 0xF80000
	movl	%eax, %edi
	shll	$11, %edi
	movzwl	%di, %edi
	orl	%edx, %edi
	shrl	$3, %eax
	andl	$252, %eax
	orl	%edi, %eax
	imull	%r10d, %ecx
	addl	%r13d, %ecx
	movl	%eax, (%r15,%rcx,4)
	incl	%r13d
	movl	(%r9), %ecx
	movl	(%r8), %ebx
	addl	%r14d, %esi
	cmpl	%ecx, %r13d
	jb	LBB0_29
	jmp	LBB0_30
LBB0_21:
	testl	%ebx, %ebx
	je	LBB0_31
## %bb.22:
	movq	_FB_WIDTH@GOTPCREL(%rip), %r9
	movl	(%r9), %ecx
	xorl	%r10d, %r10d
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_23 Depth=1
	xorl	%ecx, %ecx
LBB0_27:                                ##   in Loop: Header=BB0_23 Depth=1
	incl	%r10d
	cmpl	%ebx, %r10d
	jae	LBB0_31
LBB0_23:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_26 Depth 2
	testl	%ecx, %ecx
	je	LBB0_24
## %bb.25:                              ##   in Loop: Header=BB0_23 Depth=1
	movl	%r10d, %r11d
	imull	-44(%rbp), %r11d                ## 4-byte Folded Reload
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r15
	xorl	%esi, %esi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_26:                                ##   Parent Loop BB0_23 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r13d
	movl	%r11d, %eax
	xorl	%edx, %edx
	divl	%ebx
                                        ## kill: def $eax killed $eax def $rax
	imull	%r14d, %eax
	addl	%r13d, %eax
	movzwl	(%r12,%rax,2), %eax
	movl	%eax, %edx
	shll	$8, %edx
	shrl	$4, %eax
	orl	%edx, %eax
	andl	$15790320, %eax                 ## imm = 0xF0F0F0
	imull	%r10d, %ecx
	addl	%edi, %ecx
	movl	%eax, (%r15,%rcx,4)
	incl	%edi
	movl	(%r9), %ecx
	movl	(%r8), %ebx
	addl	%r14d, %esi
	cmpl	%ecx, %edi
	jb	LBB0_26
	jmp	LBB0_27
LBB0_31:
	movq	16(%rbp), %rdx
	testq	%rdx, %rdx
	je	LBB0_33
## %bb.32:
	movq	24(%rbp), %rdi
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	callq	_font_driver_render_msg
LBB0_33:
	movl	$1, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_fpga_video_bits,4,2            ## @fpga_video_bits
	.comm	_fpga_video_width,4,2           ## @fpga_video_width
	.comm	_fpga_video_height,4,2          ## @fpga_video_height
	.comm	_fpga_video_pitch,4,2           ## @fpga_video_pitch
	.comm	_fpga_menu_frame,8,3            ## @fpga_menu_frame
	.comm	_fpga_menu_width,4,2            ## @fpga_menu_width
	.comm	_fpga_menu_height,4,2           ## @fpga_menu_height
	.comm	_fpga_menu_pitch,4,2            ## @fpga_menu_pitch
	.comm	_fpga_menu_bits,4,2             ## @fpga_menu_bits
	.comm	_FB_HEIGHT,4,2                  ## @FB_HEIGHT
	.comm	_FB_WIDTH,4,2                   ## @FB_WIDTH
	.no_dead_strip	_fpga_gfx_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fpga_gfx_frame
_fpga_gfx_frame:                        ; @fpga_gfx_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cbz	x1, LBB0_27
; %bb.1:
	cbz	w2, LBB0_27
; %bb.2:
	cbz	w3, LBB0_27
; %bb.3:
	mov	x20, x7
	mov	x19, x6
	mov	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x9, _fpga_video_width@GOTPAGE
Lloh1:
	ldr	x9, [x9, _fpga_video_width@GOTPAGEOFF]
	ldr	w11, [x9]
Lloh2:
	adrp	x10, _fpga_video_height@GOTPAGE
Lloh3:
	ldr	x10, [x10, _fpga_video_height@GOTPAGEOFF]
	ldr	w12, [x10]
Lloh4:
	adrp	x8, _fpga_video_pitch@GOTPAGE
Lloh5:
	ldr	x8, [x8, _fpga_video_pitch@GOTPAGEOFF]
	ldr	w13, [x8]
	cmp	w11, w2
	ccmp	w12, w3, #0, eq
	ccmp	w13, w5, #0, eq
	mov	x23, x3
	mov	x24, x2
	b.eq	LBB0_7
; %bb.4:
	mov	x23, x12
	mov	x24, x11
	cmp	w2, #5
	b.lo	LBB0_7
; %bb.5:
	cmp	w3, #5
	b.lo	LBB0_7
; %bb.6:
	str	w2, [x9]
	str	w3, [x10]
	mov	x23, x3
	mov	x24, x2
	str	w5, [x8]
LBB0_7:
Lloh6:
	adrp	x25, _fpga_menu_frame@GOTPAGE
Lloh7:
	ldr	x25, [x25, _fpga_menu_frame@GOTPAGEOFF]
	ldr	x8, [x25]
	ldr	x9, [x20]
	cmp	x8, #0
	ccmp	x9, #0, #4, ne
	b.ne	LBB0_9
; %bb.8:
Lloh8:
	adrp	x10, _fpga_video_bits@GOTPAGE
Lloh9:
	ldr	x10, [x10, _fpga_video_bits@GOTPAGEOFF]
Lloh10:
	ldr	w26, [x10]
	cmp	x8, #0
	ccmp	x9, #0, #4, eq
	cset	w8, eq
	cmp	w2, #4
	ccmp	w3, #4, #0, eq
	ccmp	w24, #5, #0, eq
	ccmp	w23, #5, #0, hs
	cset	w9, lo
	and	w27, w8, w9
	b	LBB0_10
LBB0_9:
Lloh11:
	adrp	x9, _fpga_menu_width@GOTPAGE
Lloh12:
	ldr	x9, [x9, _fpga_menu_width@GOTPAGEOFF]
Lloh13:
	ldr	w24, [x9]
Lloh14:
	adrp	x9, _fpga_menu_height@GOTPAGE
Lloh15:
	ldr	x9, [x9, _fpga_menu_height@GOTPAGEOFF]
Lloh16:
	ldr	w23, [x9]
Lloh17:
	adrp	x9, _fpga_menu_bits@GOTPAGE
Lloh18:
	ldr	x9, [x9, _fpga_menu_bits@GOTPAGEOFF]
Lloh19:
	ldr	w26, [x9]
	mov	w27, #1
	mov	x22, x8
LBB0_10:
	add	x0, sp, #12
	bl	_video_context_driver_get_video_size
	cbz	w27, LBB0_25
; %bb.11:
	cmp	w26, #16
	b.ne	LBB0_25
; %bb.12:
	ldr	x10, [x25]
Lloh20:
	adrp	x8, _FB_HEIGHT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _FB_HEIGHT@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	x22, x10
	b.eq	LBB0_19
; %bb.13:
	cbz	w9, LBB0_25
; %bb.14:
	mov	w10, #0
Lloh22:
	adrp	x11, _FB_WIDTH@GOTPAGE
Lloh23:
	ldr	x11, [x11, _FB_WIDTH@GOTPAGEOFF]
	ldr	w12, [x11]
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	add	w10, w10, #1
	cmp	w10, w9
	b.hs	LBB0_25
LBB0_16:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
	cbz	w12, LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	w13, #0
	mov	w14, #0
	mul	w15, w10, w23
	ldr	x16, [x21]
LBB0_18:                                ;   Parent Loop BB0_16 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	udiv	w17, w13, w12
	udiv	w9, w15, w9
	madd	w9, w9, w24, w17
	ldrh	w9, [x22, w9, uxtw #1]
	lsl	w17, w9, #8
	and	w17, w17, #0xf80000
	bfi	w17, w9, #11, #5
	lsr	w9, w9, #3
	and	w9, w9, #0xfc
	orr	w9, w17, w9
	madd	w12, w10, w12, w14
	str	w9, [x16, w12, uxtw #2]
	add	w14, w14, #1
	ldr	w12, [x11]
	ldr	w9, [x8]
	add	w13, w13, w24
	cmp	w14, w12
	b.lo	LBB0_18
	b	LBB0_15
LBB0_19:
	cbz	w9, LBB0_25
; %bb.20:
	mov	w10, #0
Lloh24:
	adrp	x11, _FB_WIDTH@GOTPAGE
Lloh25:
	ldr	x11, [x11, _FB_WIDTH@GOTPAGEOFF]
	ldr	w12, [x11]
	b	LBB0_22
LBB0_21:                                ;   in Loop: Header=BB0_22 Depth=1
	add	w10, w10, #1
	cmp	w10, w9
	b.hs	LBB0_25
LBB0_22:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_24 Depth 2
	cbz	w12, LBB0_21
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	mov	w13, #0
	mov	w14, #0
	mul	w15, w10, w23
	ldr	x16, [x21]
LBB0_24:                                ;   Parent Loop BB0_22 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	udiv	w17, w13, w12
	udiv	w9, w15, w9
	madd	w9, w9, w24, w17
	ldrh	w9, [x22, w9, uxtw #1]
	lsl	w17, w9, #8
	orr	w9, w17, w9, lsr #4
	and	w9, w9, #0xf0f0f0f0
	madd	w12, w10, w12, w14
	str	w9, [x16, w12, uxtw #2]
	add	w14, w14, #1
	ldr	w12, [x11]
	ldr	w9, [x8]
	add	w13, w13, w24
	cmp	w14, w12
	b.lo	LBB0_24
	b	LBB0_21
LBB0_25:
	cbz	x19, LBB0_27
; %bb.26:
	mov	x0, x20
	mov	x1, #0
	mov	x2, x19
	mov	x3, #0
	bl	_font_driver_render_msg
LBB0_27:
	mov	w0, #1
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_fpga_video_bits,4,2            ; @fpga_video_bits
	.comm	_fpga_video_width,4,2           ; @fpga_video_width
	.comm	_fpga_video_height,4,2          ; @fpga_video_height
	.comm	_fpga_video_pitch,4,2           ; @fpga_video_pitch
	.comm	_fpga_menu_frame,8,3            ; @fpga_menu_frame
	.comm	_fpga_menu_width,4,2            ; @fpga_menu_width
	.comm	_fpga_menu_height,4,2           ; @fpga_menu_height
	.comm	_fpga_menu_pitch,4,2            ; @fpga_menu_pitch
	.comm	_fpga_menu_bits,4,2             ; @fpga_menu_bits
	.comm	_FB_HEIGHT,4,2                  ; @FB_HEIGHT
	.comm	_FB_WIDTH,4,2                   ; @FB_WIDTH
	.no_dead_strip	_fpga_gfx_frame
.subsections_via_symbols
