	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function dos_change_mode
LCPI0_0:
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3
LCPI0_1:
	.long	56                              ## 0x38
	.long	56                              ## 0x38
	.long	56                              ## 0x38
	.long	56                              ## 0x38
LCPI0_2:
	.long	48                              ## 0x30
	.long	48                              ## 0x30
	.long	48                              ## 0x30
	.long	48                              ## 0x30
LCPI0_3:
	.long	4                               ## 0x4
	.long	4                               ## 0x4
	.long	4                               ## 0x4
	.long	4                               ## 0x4
LCPI0_4:
	.long	8                               ## 0x8
	.long	8                               ## 0x8
	.long	8                               ## 0x8
	.long	8                               ## 0x8
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_dos_change_mode
	.p2align	4, 0x90
_dos_change_mode:                       ## @dos_change_mode
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_option@GOTPCREL(%rip), %r15
	movl	(%r15), %r14d
	movl	4(%r15), %ebx
	cmpq	$0, 16(%r15)
	setne	%cl
	shll	%cl, %ebx
	movl	12(%r15), %edi
	movl	%r14d, %esi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_set_gfx_mode
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	movq	_bitmap@GOTPCREL(%rip), %rax
	cmpl	$8, (%rax)
	jne	LBB0_7
## %bb.2:
	cmpq	$0, 8(%rax)
	je	LBB0_6
## %bb.3:
	movq	_gen_pal@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [0,1,2,3]
	xorl	%eax, %eax
	movdqa	LCPI0_1(%rip), %xmm1            ## xmm1 = [56,56,56,56]
	movdqa	LCPI0_2(%rip), %xmm2            ## xmm2 = [48,48,48,48]
	movdqa	LCPI0_3(%rip), %xmm8            ## xmm8 = [4,4,4,4]
	movdqa	LCPI0_4(%rip), %xmm9            ## xmm9 = [8,8,8,8]
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movdqa	%xmm0, %xmm5
	psrld	$2, %xmm5
	pand	%xmm1, %xmm5
	movdqa	%xmm0, %xmm6
	paddd	%xmm0, %xmm6
	pand	%xmm1, %xmm6
	movdqa	%xmm0, %xmm7
	pslld	$4, %xmm7
	pand	%xmm2, %xmm7
	pshufd	$80, %xmm6, %xmm3               ## xmm3 = xmm6[0,0,1,1]
	pshufd	$68, %xmm5, %xmm4               ## xmm4 = xmm5[0,1,0,1]
	pblendw	$12, %xmm3, %xmm4               ## xmm4 = xmm4[0,1],xmm3[2,3],xmm4[4,5,6,7]
	pshufd	$68, %xmm7, %xmm3               ## xmm3 = xmm7[0,1,0,1]
	pblendw	$207, %xmm4, %xmm3              ## xmm3 = xmm4[0,1,2,3],xmm3[4,5],xmm4[6,7]
	pshufd	$165, %xmm6, %xmm4              ## xmm4 = xmm6[1,1,2,2]
	pblendw	$48, %xmm5, %xmm4               ## xmm4 = xmm4[0,1,2,3],xmm5[4,5],xmm4[6,7]
	pblendw	$12, %xmm7, %xmm4               ## xmm4 = xmm4[0,1],xmm7[2,3],xmm4[4,5,6,7]
	shufps	$255, %xmm6, %xmm5              ## xmm5 = xmm5[3,3],xmm6[3,3]
	pshufd	$238, %xmm7, %xmm6              ## xmm6 = xmm7[2,3,2,3]
	pblendw	$60, %xmm5, %xmm6               ## xmm6 = xmm6[0,1],xmm5[2,3,4,5],xmm6[6,7]
	movdqu	%xmm6, 32(%rdi,%rax)
	movdqu	%xmm4, 16(%rdi,%rax)
	movdqu	%xmm3, (%rdi,%rax)
	movdqa	%xmm0, %xmm3
	paddd	%xmm8, %xmm3
	movdqa	%xmm3, %xmm4
	psrld	$2, %xmm4
	pand	%xmm1, %xmm4
	movdqa	%xmm3, %xmm5
	paddd	%xmm3, %xmm5
	pand	%xmm1, %xmm5
	pslld	$4, %xmm3
	pand	%xmm2, %xmm3
	pshufd	$80, %xmm5, %xmm6               ## xmm6 = xmm5[0,0,1,1]
	pshufd	$68, %xmm4, %xmm7               ## xmm7 = xmm4[0,1,0,1]
	pblendw	$12, %xmm6, %xmm7               ## xmm7 = xmm7[0,1],xmm6[2,3],xmm7[4,5,6,7]
	pshufd	$68, %xmm3, %xmm6               ## xmm6 = xmm3[0,1,0,1]
	pblendw	$207, %xmm7, %xmm6              ## xmm6 = xmm7[0,1,2,3],xmm6[4,5],xmm7[6,7]
	pshufd	$165, %xmm5, %xmm7              ## xmm7 = xmm5[1,1,2,2]
	pblendw	$48, %xmm4, %xmm7               ## xmm7 = xmm7[0,1,2,3],xmm4[4,5],xmm7[6,7]
	pblendw	$12, %xmm3, %xmm7               ## xmm7 = xmm7[0,1],xmm3[2,3],xmm7[4,5,6,7]
	shufps	$255, %xmm5, %xmm4              ## xmm4 = xmm4[3,3],xmm5[3,3]
	pshufd	$238, %xmm3, %xmm3              ## xmm3 = xmm3[2,3,2,3]
	pblendw	$60, %xmm4, %xmm3               ## xmm3 = xmm3[0,1],xmm4[2,3,4,5],xmm3[6,7]
	movdqu	%xmm3, 80(%rdi,%rax)
	movdqu	%xmm7, 64(%rdi,%rax)
	movdqu	%xmm6, 48(%rdi,%rax)
	paddd	%xmm9, %xmm0
	addq	$96, %rax
	cmpq	$3072, %rax                     ## imm = 0xC00
	jne	LBB0_4
## %bb.5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_set_palette                    ## TAILCALL
LBB0_7:
	movq	_screen@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_clear                          ## TAILCALL
LBB0_6:
	movq	_screen@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$255, %esi
	callq	_clear_to_color
	movq	_gen_pal@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movabsq	$1095216660735, %rax            ## imm = 0xFF000000FF
	movq	%rax, 3048(%rdi)
	movl	$255, 3056(%rdi)
	callq	_set_palette
	movl	$986, %edi                      ## imm = 0x3DA
	callq	_inp
	movl	$960, %edi                      ## imm = 0x3C0
	movl	$49, %esi
	callq	_outp
	movl	$960, %edi                      ## imm = 0x3C0
	movl	$255, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_outp                           ## TAILCALL
LBB0_8:
	movq	_GFX_TEXT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_set_gfx_mode
	movl	8(%r15), %ecx
	movq	_allegro_error@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_printf
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_option,24,3                    ## @option
	.comm	_GFX_TEXT,4,2                   ## @GFX_TEXT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error setting graphics mode (%dx%d %dbpp).\nAllegro says: `%s'\n"

	.comm	_allegro_error,8,3              ## @allegro_error
	.comm	_bitmap,16,3                    ## @bitmap
	.comm	_gen_pal,8,3                    ## @gen_pal
	.comm	_screen,4,2                     ## @screen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function dos_change_mode
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	3                               ; 0x3
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_dos_change_mode
	.p2align	2
_dos_change_mode:                       ; @dos_change_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x21, _option@GOTPAGE
Lloh1:
	ldr	x21, [x21, _option@GOTPAGEOFF]
	ldp	w19, w8, [x21]
	ldr	x9, [x21, #16]
	cmp	x9, #0
	cset	w9, ne
	lsl	w20, w8, w9
	ldr	w0, [x21, #12]
	mov	x1, x19
	mov	x2, x20
	mov	w3, #0
	mov	w4, #0
	bl	_set_gfx_mode
	cbnz	w0, LBB0_8
; %bb.1:
Lloh2:
	adrp	x8, _bitmap@GOTPAGE
Lloh3:
	ldr	x8, [x8, _bitmap@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #8
	b.ne	LBB0_6
; %bb.2:
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_7
; %bb.3:
	mov	x8, #0
Lloh4:
	adrp	x9, lCPI0_0@PAGE
Lloh5:
	ldr	q0, [x9, lCPI0_0@PAGEOFF]
Lloh6:
	adrp	x9, _gen_pal@GOTPAGE
Lloh7:
	ldr	x9, [x9, _gen_pal@GOTPAGEOFF]
Lloh8:
	ldr	x0, [x9]
	movi.4s	v1, #4
	movi.4s	v2, #8
	movi.4s	v3, #12
	movi.4s	v4, #56
	movi.4s	v5, #48
	movi.4s	v6, #16
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add.4s	v7, v0, v1
	add.4s	v16, v0, v2
	add.4s	v17, v0, v3
	ushr.4s	v18, v0, #2
	ushr.4s	v19, v7, #2
	ushr.4s	v20, v16, #2
	ushr.4s	v21, v17, #2
	and.16b	v22, v18, v4
	shl.4s	v18, v0, #1
	and.16b	v23, v18, v4
	shl.4s	v18, v0, #4
	and.16b	v24, v18, v5
	and.16b	v25, v19, v4
	shl.4s	v18, v7, #1
	and.16b	v26, v18, v4
	shl.4s	v7, v7, #4
	and.16b	v27, v7, v5
	and.16b	v18, v20, v4
	shl.4s	v7, v16, #1
	and.16b	v19, v7, v4
	shl.4s	v7, v16, #4
	add	x9, x0, x8
	add	x10, x9, #96
	add	x11, x9, #144
	and.16b	v20, v7, v5
	and.16b	v28, v21, v4
	shl.4s	v7, v17, #1
	and.16b	v29, v7, v4
	shl.4s	v7, v17, #4
	and.16b	v30, v7, v5
	st3.4s	{ v22, v23, v24 }, [x9], #48
	st3.4s	{ v25, v26, v27 }, [x9]
	st3.4s	{ v18, v19, v20 }, [x10]
	st3.4s	{ v28, v29, v30 }, [x11]
	add	x8, x8, #192
	add.4s	v0, v0, v6
	cmp	x8, #3072
	b.ne	LBB0_4
; %bb.5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_set_palette
LBB0_6:
Lloh9:
	adrp	x8, _screen@GOTPAGE
Lloh10:
	ldr	x8, [x8, _screen@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_clear
LBB0_7:
Lloh12:
	adrp	x8, _screen@GOTPAGE
Lloh13:
	ldr	x8, [x8, _screen@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	mov	w19, #255
	mov	w1, #255
	bl	_clear_to_color
Lloh15:
	adrp	x8, _gen_pal@GOTPAGE
Lloh16:
	ldr	x8, [x8, _gen_pal@GOTPAGEOFF]
Lloh17:
	ldr	x0, [x8]
	movi	d0, #0x0000ff000000ff
	str	d0, [x0, #3048]
	str	w19, [x0, #3056]
	bl	_set_palette
	mov	w0, #986
	bl	_inp
	mov	w0, #960
	mov	w1, #49
	bl	_outp
	mov	w0, #960
	mov	w1, #255
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_outp
LBB0_8:
Lloh18:
	adrp	x8, _GFX_TEXT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _GFX_TEXT@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_set_gfx_mode
	ldr	w3, [x21, #8]
Lloh21:
	adrp	x8, _allegro_error@GOTPAGE
Lloh22:
	ldr	x8, [x8, _allegro_error@GOTPAGEOFF]
Lloh23:
	ldr	x4, [x8]
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	mov	x2, x20
	bl	_printf
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdrp	Lloh4, Lloh6
	.loh AdrpLdr	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_option,24,3                    ; @option
	.comm	_GFX_TEXT,4,2                   ; @GFX_TEXT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error setting graphics mode (%dx%d %dbpp).\nAllegro says: `%s'\n"

	.comm	_allegro_error,8,3              ; @allegro_error
	.comm	_bitmap,16,3                    ; @bitmap
	.comm	_gen_pal,8,3                    ; @gen_pal
	.comm	_screen,4,2                     ; @screen
.subsections_via_symbols
