	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vga_get_text_pixel
_vga_get_text_pixel:                    ## @vga_get_text_pixel
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r8d
	leal	15(%r8), %r10d
	testl	%edx, %edx
	movl	%edx, %r12d
	cmovsl	%r10d, %r12d
	movl	32(%rdi), %ebx
	movl	%r12d, %eax
	sarl	$4, %eax
	imull	(%rdi), %eax
	cltd
	idivl	%ebx
	movl	%eax, %ecx
	addl	48(%rdi), %ecx
	movl	%esi, %eax
	cltd
	idivl	%ebx
                                        ## kill: def $eax killed $eax def $rax
	addl	%ecx, %eax
	leal	(%rax,%rax), %ecx
	movq	8(%rdi), %r9
	movq	_KB@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r14d
	movslq	%ecx, %rsi
	movl	(%r9,%rsi,4), %r11d
	movl	%r14d, %esi
	shll	$6, %esi
	leal	(%rsi,%rax,2), %eax
	cltq
	movl	(%r9,%rax,4), %eax
	cmpq	$0, 64(%rdi)
	je	LBB0_5
## %bb.1:
	movl	52(%rdi), %esi
	addl	%esi, %esi
	cmpl	%esi, %ecx
	jne	LBB0_5
## %bb.2:
	testl	%r8d, %r8d
	movl	%r8d, %esi
	cmovsl	%r10d, %esi
	andl	$-16, %esi
	movl	%r8d, %ecx
	subl	%esi, %ecx
	movq	_CRTC_CS_CS@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	56(%rdi), %esi
	cmpl	%esi, %ecx
	jl	LBB0_5
## %bb.3:
	movq	_CRTC_CE_CE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	60(%rdi), %esi
	cmpl	%esi, %ecx
	jle	LBB0_4
LBB0_5:
	movl	$7, %ecx
	subl	%edx, %ecx
	movq	_SEQ_MM_EM@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testl	%esi, 36(%rdi)
	je	LBB0_8
## %bb.6:
	movl	40(%rdi), %esi
	movl	44(%rdi), %r15d
	cmpl	%r15d, %esi
	jne	LBB0_7
LBB0_8:
	andl	$-16, %r12d
	subl	%r12d, %r8d
	shll	$5, %r11d
	addl	%r8d, %r11d
	jmp	LBB0_9
LBB0_7:
	shll	$5, %r11d
	testl	%r8d, %r8d
	cmovnsl	%r8d, %r10d
	andl	$-16, %r10d
	subl	%r10d, %r8d
	addl	%r11d, %r8d
	testb	$8, %al
	cmovel	%r15d, %esi
	addl	%r8d, %esi
	andl	$-9, %eax
	movl	%esi, %r11d
LBB0_9:
	shll	$7, %r14d
	addl	%r11d, %r14d
	movl	$1, %esi
	movl	$1, %ebx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	cmpl	$8, %edx
	movslq	%r14d, %rcx
	cmovgel	%esi, %ebx
	movl	%eax, %edx
	sarl	$4, %edx
	andl	$15, %eax
	testl	%ebx, (%r9,%rcx,4)
	movslq	%edx, %rcx
	cmoveq	%rcx, %rax
LBB0_10:
	shlq	$2, %rax
	addq	24(%rdi), %rax
	movslq	(%rax), %rax
	movq	16(%rdi), %rcx
	movl	(%rcx,%rax,4), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	andl	$15, %eax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_KB,4,2                         ## @KB
	.comm	_CRTC_CS_CS,4,2                 ## @CRTC_CS_CS
	.comm	_CRTC_CE_CE,4,2                 ## @CRTC_CE_CE
	.comm	_SEQ_MM_EM,4,2                  ## @SEQ_MM_EM
	.no_dead_strip	_vga_get_text_pixel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vga_get_text_pixel
_vga_get_text_pixel:                    ; @vga_get_text_pixel
	.cfi_startproc
; %bb.0:
	ldr	w13, [x0, #32]
	ldr	w8, [x0, #48]
	add	w9, w2, #15
	cmp	w2, #0
	csel	w9, w9, w2, lt
	asr	w11, w9, #4
	ldr	w9, [x0]
	mul	w9, w9, w11
	sdiv	w9, w9, w13
	sdiv	w14, w1, w13
	add	w8, w9, w8
	add	w8, w8, w14
	lsl	w15, w8, #1
	ldr	x9, [x0, #8]
Lloh0:
	adrp	x8, _KB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KB@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x8]
	ldr	w12, [x9, w15, sxtw #2]
	add	w8, w15, w10, lsl #6
	ldr	w8, [x9, w8, sxtw #2]
	ldr	x16, [x0, #64]
	cbz	x16, LBB0_4
; %bb.1:
	ldr	w16, [x0, #52]
	cmp	w15, w16, lsl #1
	b.ne	LBB0_4
; %bb.2:
	negs	w15, w2
	and	w15, w15, #0xf
	and	w16, w2, #0xf
	csneg	w15, w16, w15, mi
	ldr	w16, [x0, #56]
Lloh3:
	adrp	x17, _CRTC_CS_CS@GOTPAGE
Lloh4:
	ldr	x17, [x17, _CRTC_CS_CS@GOTPAGEOFF]
Lloh5:
	ldr	w17, [x17]
	and	w16, w17, w16
	cmp	w15, w16
	b.lt	LBB0_4
; %bb.3:
	ldr	w16, [x0, #60]
Lloh6:
	adrp	x17, _CRTC_CE_CE@GOTPAGE
Lloh7:
	ldr	x17, [x17, _CRTC_CE_CE@GOTPAGEOFF]
Lloh8:
	ldr	w17, [x17]
	and	w16, w17, w16
	cmp	w15, w16
	b.le	LBB0_10
LBB0_4:
	msub	w13, w14, w13, w1
	mov	w14, #7
	sub	w14, w14, w13
	ldr	w15, [x0, #36]
Lloh9:
	adrp	x16, _SEQ_MM_EM@GOTPAGE
Lloh10:
	ldr	x16, [x16, _SEQ_MM_EM@GOTPAGEOFF]
Lloh11:
	ldr	w16, [x16]
	tst	w16, w15
	b.eq	LBB0_6
; %bb.5:
	ldp	w15, w16, [x0, #40]
	cmp	w15, w16
	b.ne	LBB0_7
LBB0_6:
	sub	w11, w2, w11, lsl #4
	add	w11, w11, w12, lsl #5
	b	LBB0_8
LBB0_7:
	negs	w11, w2
	and	w11, w11, #0xf
	and	w17, w2, #0xf
	csneg	w11, w17, w11, mi
	add	w11, w11, w12, lsl #5
	tst	w8, #0x8
	csel	w12, w16, w15, eq
	add	w11, w11, w12
	and	w8, w8, #0xfffffff7
LBB0_8:
	add	w10, w11, w10, lsl #7
	ldr	w9, [x9, w10, sxtw #2]
	mov	w10, #1
	lsl	w10, w10, w14
	cmp	w13, #7
	csinc	w10, w10, wzr, le
	ldr	x11, [x0, #24]
	mov	x12, x8
	sbfx	x12, x12, #4, #28
	and	w8, w8, #0xf
	tst	w9, w10
	csel	x8, x12, x8, eq
	add	x8, x11, x8, lsl #2
LBB0_9:
	ldrsw	x8, [x8]
	ldr	x9, [x0, #16]
	ldr	w0, [x9, x8, lsl #2]
	ret
LBB0_10:
	ldr	x9, [x0, #24]
	and	x8, x8, #0xf
	add	x8, x9, x8, lsl #2
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_KB,4,2                         ; @KB
	.comm	_CRTC_CS_CS,4,2                 ; @CRTC_CS_CS
	.comm	_CRTC_CE_CE,4,2                 ; @CRTC_CE_CE
	.comm	_SEQ_MM_EM,4,2                  ; @SEQ_MM_EM
	.no_dead_strip	_vga_get_text_pixel
.subsections_via_symbols
