	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vga_upload_palette
_vga_upload_palette:                    ## @vga_upload_palette
	.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
	xorl	%r14d, %r14d
	movl	$968, %edi                      ## imm = 0x3C8
	xorl	%esi, %esi
	callq	_outp
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	testl	%r13d, %r13d
	setne	%al
	testb	$7, %r13b
	sete	%cl
	andb	%al, %cl
	movzbl	%bl, %eax
	cmovnel	%r14d, %eax
	addb	%cl, %r12b
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movzbl	%al, %ebx
	leal	(%rbx,%rbx,8), %eax
	movzbl	%al, %esi
	movl	$969, %edi                      ## imm = 0x3C9
	callq	_outp
	movzbl	%r12b, %eax
	leal	(%rax,%rax,8), %eax
	movzbl	%al, %esi
	movl	$969, %edi                      ## imm = 0x3C9
	callq	_outp
	movzbl	%r15b, %eax
	leal	(%rax,%rax,4), %ecx
	leal	(%rax,%rcx,4), %eax
	movzbl	%al, %esi
	movl	$969, %edi                      ## imm = 0x3C9
	callq	_outp
	incb	%bl
	incl	%r13d
	cmpl	$256, %r13d                     ## imm = 0x100
	je	LBB0_6
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	testl	%r13d, %r13d
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%r13d, %eax
	andl	$63, %eax
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	incb	%r15b
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	jmp	LBB0_5
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_vga_upload_palette
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vga_upload_palette
_vga_upload_palette:                    ; @vga_upload_palette
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	w0, #968
	mov	w1, #0
	bl	_outp
	mov	w19, #0
	mov	w21, #0
	mov	w8, #0
	mov	w20, #0
	mov	w22, #21
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w20, #0
	cset	w9, ne
	tst	w20, #0x7
	cset	w10, eq
	ands	w9, w9, w10
	csel	w23, wzr, w8, ne
	add	w21, w21, w9
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w8, w23, w23, lsl #3
	and	w1, w8, #0xff
	mov	w0, #969
	bl	_outp
	add	w8, w21, w21, lsl #3
	and	w1, w8, #0xff
	mov	w0, #969
	bl	_outp
	mul	w8, w19, w22
	and	w1, w8, #0xff
	mov	w0, #969
	bl	_outp
	add	w8, w23, #1
	add	w20, w20, #1
	cmp	w20, #256
	b.eq	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cbz	w20, LBB0_1
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	and	w9, w20, #0x3f
	cbnz	w9, LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w23, #0
	mov	w21, #0
	add	w19, w19, #1
	b	LBB0_2
LBB0_6:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_vga_upload_palette
.subsections_via_symbols
