	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function find_font
_find_font:                             ## @find_font
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	shll	$6, %r15d
	movq	_fonts@GOTPCREL(%rip), %r12
	movq	(%r12), %rbx
	testq	%rbx, %rbx
	je	LBB0_3
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r15d, (%rbx)
	je	LBB0_8
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%rbx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_1
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movl	$16, %edi
	callq	_vcos_malloc
	testq	%rax, %rax
	je	LBB0_14
## %bb.4:
	movq	%rax, %r14
	movl	%r15d, (%rax)
	movq	%rax, %rbx
	addq	$4, %rbx
	movq	%rbx, %rdi
	callq	_vgft_font_init
	movq	_VCOS_SUCCESS@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	jne	LBB0_13
## %bb.5:
	movq	_default_font@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	4(%rax), %esi
	movq	%rbx, %rdi
	callq	_vgft_font_load_mem
	cmpq	(%r13), %rax
	jne	LBB0_10
## %bb.6:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_vgft_font_convert_glyphs
	cmpq	(%r13), %rax
	jne	LBB0_11
## %bb.7:
	movq	(%r12), %rax
	movq	%rax, 8(%r14)
	movq	%r14, (%r12)
	jmp	LBB0_15
LBB0_8:
	addq	$4, %rbx
	jmp	LBB0_15
LBB0_10:
	leaq	L_.str.1(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_GX_LOG
	jmp	LBB0_12
LBB0_11:
	movq	_fname@GOTPCREL(%rip), %rax
	movslq	(%rax), %rsi
	leaq	L_.str.2(%rip), %rdi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_GX_LOG
LBB0_12:
	movq	%rbx, %rdi
	callq	_vgft_font_term
LBB0_13:
	movq	%r14, %rdi
	callq	_vcos_free
LBB0_14:
	xorl	%ebx, %ebx
LBB0_15:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_fonts,8,3                      ## @fonts
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"font"

	.comm	_VCOS_SUCCESS,8,3               ## @VCOS_SUCCESS
	.comm	_default_font,8,2               ## @default_font
L_.str.1:                               ## @.str.1
	.asciz	"Could not load font from memory: %d"

L_.str.2:                               ## @.str.2
	.asciz	"Could not convert font '%s' at size %d"

	.comm	_fname,4,2                      ## @fname
	.no_dead_strip	_find_font
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function find_font
_find_font:                             ; @find_font
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	lsl	w21, w1, #6
Lloh0:
	adrp	x22, _fonts@GOTPAGE
Lloh1:
	ldr	x22, [x22, _fonts@GOTPAGEOFF]
	ldr	x8, [x22]
	cbz	x8, LBB0_3
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x8]
	cmp	w9, w21
	b.eq	LBB0_8
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x8, #8]
	cbnz	x8, LBB0_1
LBB0_3:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #16
	bl	_vcos_malloc
	cbz	x0, LBB0_13
; %bb.4:
	mov	x20, x0
	mov	x19, x0
	str	w21, [x19], #4
	mov	x0, x19
	bl	_vgft_font_init
Lloh4:
	adrp	x23, _VCOS_SUCCESS@GOTPAGE
Lloh5:
	ldr	x23, [x23, _VCOS_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.5:
Lloh6:
	adrp	x8, _default_font@GOTPAGE
Lloh7:
	ldr	x8, [x8, _default_font@GOTPAGEOFF]
	ldp	w2, w1, [x8]
	mov	x0, x19
	bl	_vgft_font_load_mem
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.6:
	mov	x0, x19
	mov	x1, x21
	mov	w2, #0
	mov	w3, #0
	bl	_vgft_font_convert_glyphs
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.7:
	ldr	x8, [x22]
	str	x8, [x20, #8]
	str	x20, [x22]
	b	LBB0_14
LBB0_8:
	add	x19, x8, #4
	b	LBB0_14
LBB0_9:
	mov	x1, x0
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh10:
	adrp	x8, _fname@GOTPAGE
Lloh11:
	ldr	x8, [x8, _fname@GOTPAGEOFF]
Lloh12:
	ldrsw	x1, [x8]
	str	x21, [sp]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_11:
	bl	_GX_LOG
	mov	x0, x19
	bl	_vgft_font_term
LBB0_12:
	mov	x0, x20
	bl	_vcos_free
LBB0_13:
	mov	x19, #0
LBB0_14:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_fonts,8,3                      ; @fonts
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"font"

	.comm	_VCOS_SUCCESS,8,3               ; @VCOS_SUCCESS
	.comm	_default_font,8,2               ; @default_font
l_.str.1:                               ; @.str.1
	.asciz	"Could not load font from memory: %d"

l_.str.2:                               ; @.str.2
	.asciz	"Could not convert font '%s' at size %d"

	.comm	_fname,4,2                      ; @fname
	.no_dead_strip	_find_font
.subsections_via_symbols
