	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cirrus_mode_set
_cirrus_mode_set:                       ## @cirrus_mode_set
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rsi), %eax
	movl	4(%rsi), %ecx
	leal	7(%rax), %ebx
	testl	%eax, %eax
	cmovnsl	%eax, %ebx
	sarl	$3, %ebx
	movq	%rbx, %r8
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	leal	7(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$3, %eax
	movl	%eax, %ecx
	movl	8(%rsi), %eax
	leal	7(%rax), %r14d
	testl	%eax, %eax
	cmovnsl	%eax, %r14d
	sarl	$3, %r14d
	movl	12(%rsi), %eax
	leal	7(%rax), %r15d
	testl	%eax, %eax
	cmovnsl	%eax, %r15d
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	sarl	$3, %r15d
	movl	16(%rsi), %ebx
	movl	20(%rsi), %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leal	-1(%rax), %r12d
	addl	$-2, %ebx
	leal	-5(%r8), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	decl	%r15d
	incl	%r14d
	incl	%ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	_VGA_CRTC_V_SYNC_END@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rdi, %r13
	movl	$32, %edx
	callq	_wreg_crt
	movq	_VGA_CRTC_H_TOTAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_wreg_crt
	movq	_VGA_CRTC_H_DISP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%r15d, %edx
	movq	%r13, %r15
	callq	_wreg_crt
	movq	_VGA_CRTC_H_SYNC_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%r14d, %edx
	callq	_wreg_crt
	movq	_VGA_CRTC_H_SYNC_END@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_wreg_crt
	movq	_VGA_CRTC_V_TOTAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%bl, %edx
	movq	%r13, %rdi
	callq	_wreg_crt
	movq	_VGA_CRTC_V_DISP_END@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%r12b, %edx
	movq	%r13, %rdi
	callq	_wreg_crt
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movl	%r13d, %edx
	shrl	$4, %edx
	andl	$32, %edx
	orl	$64, %edx
	movq	_VGA_CRTC_MAX_SCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_wreg_crt
	movl	%ebx, %r14d
	andl	$256, %r14d                     ## imm = 0x100
	movl	%r12d, %eax
	shrl	$7, %eax
	andl	$2, %eax
	movq	%r13, %rcx
	shrl	$5, %ecx
	andl	$8, %ecx
	movq	%rcx, %rdx
	andl	$512, %ebx                      ## imm = 0x200
	movl	%ebx, %ecx
	shrl	$4, %ecx
	orl	%edx, %ecx
	shrl	$3, %r12d
	andl	$64, %r12d
	cmpl	$1, %r14d
	sbbl	$0, %ecx
	addl	$17, %ecx
	orl	%eax, %r12d
	orl	%ecx, %r12d
	movq	_VGA_CRTC_OVERFLOW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	callq	_wreg_crt
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	shrl	$2, %eax
	andl	$48, %eax
	orl	%r14d, %ebx
	shrl	$2, %ebx
	orl	%eax, %ebx
	movq	_CL_CRT1A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_wreg_crt
	movq	_VGA_CRTC_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$3, %edx
	callq	_wreg_crt
	movq	%r15, %rdi
	movl	$7, %esi
	callq	_rreg_seq
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_cirrus_cpp
	movl	%eax, (%r15)
	decl	%eax
	andl	$536870911, %eax                ## imm = 0x1FFFFFFF
	movl	$-1, %r14d
	cmpl	$3, %eax
	ja	LBB0_2
## %bb.1:
	andl	$224, %ebx
	movl	%eax, %eax
	leaq	L_switch.table.cirrus_mode_set(%rip), %rcx
	leaq	L_switch.table.cirrus_mode_set.1(%rip), %rdx
	movl	(%rdx,%rax,4), %r14d
	orl	(%rcx,%rax,4), %ebx
	movq	%r15, %rdi
	movl	$7, %esi
	movl	%ebx, %edx
	callq	_wreg_seq
	movq	%r12, %rdi
	callq	_cirrus_pitch
                                        ## kill: def $eax killed $eax def $rax
	leal	7(%rax), %edx
	testl	%eax, %eax
	cmovnsl	%eax, %edx
	movl	%eax, 4(%r15)
	sarl	$3, %edx
	movq	_VGA_CRTC_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_wreg_crt
	movl	4(%r15), %eax
	movl	%eax, %ecx
	shrl	$7, %ecx
	andl	$16, %ecx
	shrl	$6, %eax
	andl	$64, %eax
	leal	(%rax,%rcx), %edx
	addl	$34, %edx
	movq	%r15, %rdi
	movl	$27, %esi
	callq	_wreg_crt
	movq	_VGA_GFX_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$64, %edx
	callq	_wreg_gfx
	movq	_VGA_GFX_MISC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_wreg_gfx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_wreg_hdr
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_cirrus_set_start_address
	movl	$32, %edi
	movl	$960, %esi                      ## imm = 0x3C0
	callq	_outb
LBB0_2:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VGA_CRTC_V_SYNC_END,4,2        ## @VGA_CRTC_V_SYNC_END
	.comm	_VGA_CRTC_H_TOTAL,4,2           ## @VGA_CRTC_H_TOTAL
	.comm	_VGA_CRTC_H_DISP,4,2            ## @VGA_CRTC_H_DISP
	.comm	_VGA_CRTC_H_SYNC_START,4,2      ## @VGA_CRTC_H_SYNC_START
	.comm	_VGA_CRTC_H_SYNC_END,4,2        ## @VGA_CRTC_H_SYNC_END
	.comm	_VGA_CRTC_V_TOTAL,4,2           ## @VGA_CRTC_V_TOTAL
	.comm	_VGA_CRTC_V_DISP_END,4,2        ## @VGA_CRTC_V_DISP_END
	.comm	_VGA_CRTC_MAX_SCAN,4,2          ## @VGA_CRTC_MAX_SCAN
	.comm	_VGA_CRTC_OVERFLOW,4,2          ## @VGA_CRTC_OVERFLOW
	.comm	_CL_CRT1A,4,2                   ## @CL_CRT1A
	.comm	_VGA_CRTC_MODE,4,2              ## @VGA_CRTC_MODE
	.comm	_VGA_CRTC_OFFSET,4,2            ## @VGA_CRTC_OFFSET
	.comm	_VGA_GFX_MODE,4,2               ## @VGA_GFX_MODE
	.comm	_VGA_GFX_MISC,4,2               ## @VGA_GFX_MISC
	.no_dead_strip	_cirrus_mode_set
	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ## @switch.table.cirrus_mode_set
L_switch.table.cirrus_mode_set:
	.long	17                              ## 0x11
	.long	23                              ## 0x17
	.long	21                              ## 0x15
	.long	25                              ## 0x19

	.p2align	2                               ## @switch.table.cirrus_mode_set.1
L_switch.table.cirrus_mode_set.1:
	.long	0                               ## 0x0
	.long	193                             ## 0xc1
	.long	197                             ## 0xc5
	.long	197                             ## 0xc5

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cirrus_mode_set
_cirrus_mode_set:                       ; @cirrus_mode_set
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x2
	mov	x19, x0
	ldp	w8, w9, [x1]
	add	w10, w8, #7
	cmp	w8, #0
	csel	w8, w10, w8, lt
	asr	w25, w8, #3
	add	w8, w9, #7
	cmp	w9, #0
	csel	w8, w8, w9, lt
	asr	w8, w8, #3
	ldp	w9, w10, [x1, #8]
	add	w11, w9, #7
	cmp	w9, #0
	csel	w9, w11, w9, lt
	asr	w9, w9, #3
	add	w11, w10, #7
	cmp	w10, #0
	csel	w10, w11, w10, lt
	asr	w10, w10, #3
	ldp	w11, w27, [x1, #16]
	sub	w26, w27, #1
	sub	w28, w11, #2
	sub	w21, w25, #5
	sub	w22, w10, #1
	add	w23, w9, #1
	add	w24, w8, #1
Lloh0:
	adrp	x8, _VGA_CRTC_V_SYNC_END@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VGA_CRTC_V_SYNC_END@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #32
	bl	_wreg_crt
Lloh3:
	adrp	x8, _VGA_CRTC_H_TOTAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VGA_CRTC_H_TOTAL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_wreg_crt
Lloh6:
	adrp	x8, _VGA_CRTC_H_DISP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VGA_CRTC_H_DISP@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_wreg_crt
Lloh9:
	adrp	x8, _VGA_CRTC_H_SYNC_START@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VGA_CRTC_H_SYNC_START@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x23
	bl	_wreg_crt
Lloh12:
	adrp	x8, _VGA_CRTC_H_SYNC_END@GOTPAGE
Lloh13:
	ldr	x8, [x8, _VGA_CRTC_H_SYNC_END@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x24
	bl	_wreg_crt
Lloh15:
	adrp	x8, _VGA_CRTC_V_TOTAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VGA_CRTC_V_TOTAL@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	and	w2, w28, #0xff
	mov	x0, x19
	bl	_wreg_crt
Lloh18:
	adrp	x8, _VGA_CRTC_V_DISP_END@GOTPAGE
Lloh19:
	ldr	x8, [x8, _VGA_CRTC_V_DISP_END@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	and	w2, w26, #0xff
	mov	x0, x19
	bl	_wreg_crt
	tst	w27, #0x200
	mov	w8, #96
	mov	w9, #64
	csel	w2, w9, w8, eq
Lloh21:
	adrp	x8, _VGA_CRTC_MAX_SCAN@GOTPAGE
Lloh22:
	ldr	x8, [x8, _VGA_CRTC_MAX_SCAN@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wreg_crt
	ands	w21, w28, #0x100
	mov	w8, #16
	cinc	w8, w8, ne
	lsr	w9, w26, #7
	and	w9, w9, #0x2
	lsr	w10, w27, #5
	and	w10, w10, #0x8
	and	w22, w28, #0x200
	lsr	w11, w26, #3
	and	w11, w11, #0x40
	orr	w10, w10, w22, lsr #4
	orr	w8, w10, w8
	orr	w8, w8, w9
	orr	w2, w8, w11
Lloh24:
	adrp	x8, _VGA_CRTC_OVERFLOW@GOTPAGE
Lloh25:
	ldr	x8, [x8, _VGA_CRTC_OVERFLOW@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wreg_crt
	lsr	w8, w25, #2
	and	w8, w8, #0x30
	orr	w9, w21, w22
	orr	w2, w8, w9, lsr #2
Lloh27:
	adrp	x8, _CL_CRT1A@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CL_CRT1A@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wreg_crt
Lloh30:
	adrp	x8, _VGA_CRTC_MODE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _VGA_CRTC_MODE@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #3
	bl	_wreg_crt
	mov	x0, x19
	mov	w1, #7
	bl	_rreg_seq
	mov	x21, x0
	mov	x0, x20
	bl	_cirrus_cpp
	str	w0, [x19]
	sub	w8, w0, #1
	and	w8, w8, #0x1fffffff
	cmp	w8, #3
	b.hi	LBB0_2
; %bb.1:
	lsl	x8, x8, #2
Lloh33:
	adrp	x9, l_switch.table.cirrus_mode_set@PAGE
Lloh34:
	add	x9, x9, l_switch.table.cirrus_mode_set@PAGEOFF
	ldr	w9, [x9, x8]
	and	w10, w21, #0xe0
Lloh35:
	adrp	x11, l_switch.table.cirrus_mode_set.1@PAGE
Lloh36:
	add	x11, x11, l_switch.table.cirrus_mode_set.1@PAGEOFF
	ldr	w21, [x11, x8]
	orr	w2, w10, w9
	mov	x0, x19
	mov	w1, #7
	bl	_wreg_seq
	mov	x0, x20
	bl	_cirrus_pitch
	str	w0, [x19, #4]
	add	w8, w0, #7
	cmp	w0, #0
	csel	w8, w8, w0, lt
	asr	w2, w8, #3
Lloh37:
	adrp	x8, _VGA_CRTC_OFFSET@GOTPAGE
Lloh38:
	ldr	x8, [x8, _VGA_CRTC_OFFSET@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wreg_crt
	ldr	w8, [x19, #4]
	lsr	w9, w8, #7
	and	w9, w9, #0x10
	lsr	w8, w8, #6
	and	w8, w8, #0x40
	orr	w8, w8, w9
	mov	w9, #34
	orr	w2, w8, w9
	mov	x0, x19
	mov	w1, #27
	bl	_wreg_crt
Lloh40:
	adrp	x8, _VGA_GFX_MODE@GOTPAGE
Lloh41:
	ldr	x8, [x8, _VGA_GFX_MODE@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #64
	bl	_wreg_gfx
Lloh43:
	adrp	x8, _VGA_GFX_MISC@GOTPAGE
Lloh44:
	ldr	x8, [x8, _VGA_GFX_MISC@GOTPAGEOFF]
Lloh45:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_wreg_gfx
	mov	x0, x19
	mov	x1, x21
	bl	_wreg_hdr
	mov	x0, x19
	mov	w1, #0
	bl	_cirrus_set_start_address
	mov	w0, #32
	mov	w1, #960
	bl	_outb
	mov	w0, #0
	b	LBB0_3
LBB0_2:
	mov	w0, #-1
LBB0_3:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_VGA_CRTC_V_SYNC_END,4,2        ; @VGA_CRTC_V_SYNC_END
	.comm	_VGA_CRTC_H_TOTAL,4,2           ; @VGA_CRTC_H_TOTAL
	.comm	_VGA_CRTC_H_DISP,4,2            ; @VGA_CRTC_H_DISP
	.comm	_VGA_CRTC_H_SYNC_START,4,2      ; @VGA_CRTC_H_SYNC_START
	.comm	_VGA_CRTC_H_SYNC_END,4,2        ; @VGA_CRTC_H_SYNC_END
	.comm	_VGA_CRTC_V_TOTAL,4,2           ; @VGA_CRTC_V_TOTAL
	.comm	_VGA_CRTC_V_DISP_END,4,2        ; @VGA_CRTC_V_DISP_END
	.comm	_VGA_CRTC_MAX_SCAN,4,2          ; @VGA_CRTC_MAX_SCAN
	.comm	_VGA_CRTC_OVERFLOW,4,2          ; @VGA_CRTC_OVERFLOW
	.comm	_CL_CRT1A,4,2                   ; @CL_CRT1A
	.comm	_VGA_CRTC_MODE,4,2              ; @VGA_CRTC_MODE
	.comm	_VGA_CRTC_OFFSET,4,2            ; @VGA_CRTC_OFFSET
	.comm	_VGA_GFX_MODE,4,2               ; @VGA_GFX_MODE
	.comm	_VGA_GFX_MISC,4,2               ; @VGA_GFX_MISC
	.no_dead_strip	_cirrus_mode_set
	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ; @switch.table.cirrus_mode_set
l_switch.table.cirrus_mode_set:
	.long	17                              ; 0x11
	.long	23                              ; 0x17
	.long	21                              ; 0x15
	.long	25                              ; 0x19

	.p2align	2                               ; @switch.table.cirrus_mode_set.1
l_switch.table.cirrus_mode_set.1:
	.long	0                               ; 0x0
	.long	193                             ; 0xc1
	.long	197                             ; 0xc5
	.long	197                             ; 0xc5

.subsections_via_symbols
