	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vga_port_handler
_vga_port_handler:                      ## @vga_port_handler
	.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
	movq	%r9, %r15
	movl	%ecx, %r13d
	movl	%edx, %ebx
	movq	%rdi, %r12
	movq	16(%rbp), %r14
	cmpl	$2, %r8d
	je	LBB0_8
## %bb.1:
	cmpl	$1, %r8d
	jne	LBB0_14
## %bb.2:
	movl	(%r15), %eax
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.3:
	andl	$-256, %eax
	movl	%eax, (%r15)
	leaq	-44(%rbp), %r8
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	movl	$1, %ecx
	movq	%r14, %r9
	callq	_vga_port_in_handler
	testl	%eax, %eax
	jne	LBB0_15
## %bb.4:
	movzbl	-44(%rbp), %eax
	jmp	LBB0_5
LBB0_8:
	movl	(%r15), %eax
	testl	%ebx, %ebx
	je	LBB0_13
## %bb.9:
	andl	$-65536, %eax                   ## imm = 0xFFFF0000
	movl	%eax, (%r15)
	leaq	-44(%rbp), %r8
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	movl	$1, %ecx
	movq	%r14, %r9
	callq	_vga_port_in_handler
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	movzbl	-44(%rbp), %eax
	orl	%eax, (%r15)
LBB0_11:
	incl	%r13d
	leaq	-44(%rbp), %r8
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	movl	$1, %ecx
	movq	%r14, %r9
	callq	_vga_port_in_handler
	testl	%eax, %eax
	jne	LBB0_15
## %bb.12:
	movl	-44(%rbp), %eax
	shll	$8, %eax
	movzwl	%ax, %eax
LBB0_5:
	orl	%eax, (%r15)
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_14:
	xorl	%edi, %edi
	callq	_assert
	movl	$-1, %eax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movzbl	%al, %r8d
	jmp	LBB0_7
LBB0_13:
	movzbl	%al, %r8d
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	%r13d, %edx
	movl	$1, %ecx
	movq	%r14, %r9
	callq	_vga_port_out_handler
	movzbl	1(%r15), %r8d
	incl	%r13d
LBB0_7:
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	%r13d, %edx
	movl	$1, %ecx
	movq	%r14, %r9
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vga_port_out_handler           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_vga_port_handler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vga_port_handler
_vga_port_handler:                      ; @vga_port_handler
	.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
	mov	x20, x6
	mov	x19, x5
	mov	x22, x3
	mov	x23, x2
	mov	x21, x0
	cmp	w4, #2
	b.eq	LBB0_5
; %bb.1:
	cmp	w4, #1
	b.ne	LBB0_10
; %bb.2:
	ldr	w8, [x19]
	cbz	w23, LBB0_12
; %bb.3:
	and	w8, w8, #0xffffff00
	str	w8, [x19]
	add	x4, sp, #12
	mov	x0, x21
	mov	x1, x23
	mov	x2, x22
	mov	w3, #1
	mov	x5, x20
	bl	_vga_port_in_handler
	cbnz	w0, LBB0_11
; %bb.4:
	ldrb	w8, [sp, #12]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	b	LBB0_11
LBB0_5:
	ldr	w8, [x19]
	cbz	w23, LBB0_13
; %bb.6:
	and	w8, w8, #0xffff0000
	str	w8, [x19]
	add	x4, sp, #12
	mov	x0, x21
	mov	x1, x23
	mov	x2, x22
	mov	w3, #1
	mov	x5, x20
	bl	_vga_port_in_handler
	cbnz	w0, LBB0_8
; %bb.7:
	ldrb	w8, [sp, #12]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_8:
	add	w2, w22, #1
	add	x4, sp, #12
	mov	x0, x21
	mov	x1, x23
	mov	w3, #1
	mov	x5, x20
	bl	_vga_port_in_handler
	cbnz	w0, LBB0_11
; %bb.9:
	ldr	w8, [sp, #12]
	ubfiz	w8, w8, #8, #8
	ldr	w9, [x19]
	orr	w8, w8, w9
	str	w8, [x19]
	b	LBB0_11
LBB0_10:
	mov	w0, #0
	bl	_assert
	mov	w0, #-1
LBB0_11:
	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
LBB0_12:
	and	w4, w8, #0xff
	mov	x0, x21
	mov	w1, #0
	mov	x2, x22
	b	LBB0_14
LBB0_13:
	and	w4, w8, #0xff
	mov	x0, x21
	mov	w1, #0
	mov	x2, x22
	mov	w3, #1
	mov	x5, x20
	bl	_vga_port_out_handler
	ldrb	w4, [x19, #1]
	add	w2, w22, #1
	mov	x0, x21
	mov	w1, #0
LBB0_14:
	mov	w3, #1
	mov	x5, x20
	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
	b	_vga_port_out_handler
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_vga_port_handler
.subsections_via_symbols
